Skip to content
  • claudiob's avatar
    b26338e8
    Better tests for AV::RecordIdentifier · b26338e8
    claudiob authored
    This commit intends to clarify the scope of ActionView::RecordIdentifier
    methods `dom_id` and `dom_class`.
    
    Most of the current documentation comes from da257eb8 (7 years ago) when
    the decoupling of ActionView, ActiveRecord and ActiveModel was not a concern.
    
    Since then, steps have been taken to reach such decoupling.
    Therefore I think it's important to show that ActionView::RecordIdentifier
    **does not strictly depend on the ActiveRecord API**:
    any class `Post` implementing `post.to_key` and `post.model_name.param_key`
    will work.
    
    This commit adds a test to prove that ActionView::RecordIdentifier methods
    can also be used on objects that do not subclass ActiveRecord::Base.
    b26338e8
    Better tests for AV::RecordIdentifier
    claudiob authored
    This commit intends to clarify the scope of ActionView::RecordIdentifier
    methods `dom_id` and `dom_class`.
    
    Most of the current documentation comes from da257eb8 (7 years ago) when
    the decoupling of ActionView, ActiveRecord and ActiveModel was not a concern.
    
    Since then, steps have been taken to reach such decoupling.
    Therefore I think it's important to show that ActionView::RecordIdentifier
    **does not strictly depend on the ActiveRecord API**:
    any class `Post` implementing `post.to_key` and `post.model_name.param_key`
    will work.
    
    This commit adds a test to prove that ActionView::RecordIdentifier methods
    can also be used on objects that do not subclass ActiveRecord::Base.
Loading