Module: Cms::Behaviors::Versioning::ClassMethods

Defined in:
lib/cms/behaviors/versioning.rb

Instance Method Summary collapse

Instance Method Details

#version_classObject



50
51
52
# File 'lib/cms/behaviors/versioning.rb', line 50

def version_class
  const_get "Version"
end

#version_class_nameObject



54
55
56
# File 'lib/cms/behaviors/versioning.rb', line 54

def version_class_name
  "#{name}::Version"
end

#version_foreign_keyObject



58
59
60
# File 'lib/cms/behaviors/versioning.rb', line 58

def version_foreign_key
  @version_foreign_key
end

#version_table_nameObject



62
63
64
# File 'lib/cms/behaviors/versioning.rb', line 62

def version_table_name        
  @version_table_name
end

#versioned_columnsObject



66
67
68
69
# File 'lib/cms/behaviors/versioning.rb', line 66

def versioned_columns
  @versioned_columns ||= (version_class.new.attributes.keys - 
    (%w[id lock_version position version_comment created_at updated_at created_by_id updated_by_id type] + [version_foreign_key]))
end