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
141 142 143 |
# File 'lib/cms/behaviors/versioning.rb', line 141 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
120 121 122 |
# File 'lib/cms/behaviors/versioning.rb', line 120 def version_class const_get "Version" end |
#version_class_name ⇒ Object
124 125 126 |
# File 'lib/cms/behaviors/versioning.rb', line 124 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.
129 130 131 |
# File 'lib/cms/behaviors/versioning.rb', line 129 def version_foreign_key :original_record_id end |
#version_table_name ⇒ Object
133 134 135 |
# File 'lib/cms/behaviors/versioning.rb', line 133 def version_table_name @version_table_name end |
#versioned_columns ⇒ Object
137 138 139 |
# File 'lib/cms/behaviors/versioning.rb', line 137 def versioned_columns @versioned_columns ||= (version_class.new.attributes.keys - non_versioned_columns) end |