Module: Tenon::TenonContent::ClassMethods
- Defined in:
- lib/tenon/tenon_content.rb
Instance Method Summary collapse
Instance Method Details
#tenon_content(content_field) ⇒ Object
8 9 10 11 12 13 14 15 16 |
# File 'lib/tenon/tenon_content.rb', line 8 def tenon_content(content_field) assoc = "#{content_field}_tenon_content_rows".to_sym has_many assoc, -> { where(item_method: content_field) }, class_name: 'Tenon::TenonContent::Row', as: :item, dependent: :destroy accepts_nested_attributes_for assoc, allow_destroy: true end |