Module: Trek::Fragmentable
- Extended by:
- ActiveSupport::Concern
- Included in:
- Page
- Defined in:
- app/models/concerns/trek/fragmentable.rb
Instance Method Summary collapse
Instance Method Details
#fragments ⇒ Object
5 6 7 |
# File 'app/models/concerns/trek/fragmentable.rb', line 5 def fragments @fragments ||= fragments_for_key&.map { |pf| Fragment.find_by(pf) } end |
#fragments_attributes=(attributes) ⇒ Object
9 10 11 12 13 |
# File 'app/models/concerns/trek/fragmentable.rb', line 9 def fragments_attributes=(attributes) attributes.each do |_i, fragment_attrs| Fragment.find(fragment_attrs["id"]).update(fragment_attrs.except("id")) end end |