Module: ComfortableMexicanSofa::HasRevisions::ClassMethods
- Defined in:
- lib/comfortable_mexican_sofa/extensions/has_revisions.rb
Instance Method Summary collapse
Instance Method Details
#cms_has_revisions_for(*fields) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/comfortable_mexican_sofa/extensions/has_revisions.rb', line 11 def cms_has_revisions_for(*fields) include ComfortableMexicanSofa::HasRevisions::InstanceMethods attr_accessor :revision_data has_many :revisions, as: :record, dependent: :destroy, class_name: "Comfy::Cms::Revision" before_save :prepare_revision after_save :create_revision define_method(:revision_fields) do fields.collect(&:to_s) end end |