Module: Cms::Behaviors::Versioning::ClassMethods
- Defined in:
- lib/cms/behaviors/versioning.rb
Instance Method Summary collapse
- #non_versioned_columns ⇒ Object
- #version_class ⇒ Object
- #version_class_name ⇒ Object
-
#version_foreign_key ⇒ Object
Probably no longer needs to be a method anymore, since all classes use the same column name.
- #version_table_name ⇒ Object
- #versioned_columns ⇒ Object
Instance Method Details
#non_versioned_columns ⇒ Object
144 145 146 |
# File 'lib/cms/behaviors/versioning.rb', line 144 def non_versioned_columns (%w[ id lock_version position version_comment created_at updated_at created_by_id updated_by_id type original_record_id]) end |
#version_class ⇒ Object
123 124 125 |
# File 'lib/cms/behaviors/versioning.rb', line 123 def version_class const_get "Version" end |
#version_class_name ⇒ Object
127 128 129 |
# File 'lib/cms/behaviors/versioning.rb', line 127 def version_class_name "#{name}::Version" end |
#version_foreign_key ⇒ Object
Probably no longer needs to be a method anymore, since all classes use the same column name.
132 133 134 |
# File 'lib/cms/behaviors/versioning.rb', line 132 def version_foreign_key :original_record_id end |
#version_table_name ⇒ Object
136 137 138 |
# File 'lib/cms/behaviors/versioning.rb', line 136 def version_table_name @version_table_name end |
#versioned_columns ⇒ Object
140 141 142 |
# File 'lib/cms/behaviors/versioning.rb', line 140 def versioned_columns @versioned_columns ||= (version_class.new.attributes.keys - non_versioned_columns) end |