Class: ActiveRecord::Base
- Inherits:
-
Object
- Object
- ActiveRecord::Base
- Defined in:
- lib/verd/active_record_base.rb
Class Attribute Summary collapse
-
.model_validity ⇒ Object
Returns the value of attribute model_validity.
-
.source_location ⇒ Object
Returns the value of attribute source_location.
Class Method Summary collapse
Class Attribute Details
.model_validity ⇒ Object
Returns the value of attribute model_validity.
3 4 5 |
# File 'lib/verd/active_record_base.rb', line 3 def model_validity @model_validity end |
.source_location ⇒ Object
Returns the value of attribute source_location.
3 4 5 |
# File 'lib/verd/active_record_base.rb', line 3 def source_location @source_location end |
Class Method Details
.human_attribute_names ⇒ Object
12 13 14 |
# File 'lib/verd/active_record_base.rb', line 12 def human_attribute_names attribute_names.each_with_object({}){ |attr, h| h[attr] = human_attribute_name(attr) } end |
.source_dir ⇒ Object
5 6 7 8 9 10 |
# File 'lib/verd/active_record_base.rb', line 5 def source_dir return @source_dir if @source_dir path = name.split(/::/) path.pop @source_dir = "/#{path.map(&:underscore).join('/')}" end |
.verd_columns ⇒ Object
16 17 18 |
# File 'lib/verd/active_record_base.rb', line 16 def verd_columns columns.map{|c| "#{c.name} : #{c.sql_type}"} end |
.verd_indexes ⇒ Object
20 21 22 23 |
# File 'lib/verd/active_record_base.rb', line 20 def verd_indexes connection.indexes(table_name).sort_by(&:columns). map{|idx| {cols: idx.columns, uniq: idx.unique} } end |