Class: ActiveRecord::Base
- Inherits:
-
Object
- Object
- ActiveRecord::Base
- Defined in:
- lib/essay.rb
Class Method Summary collapse
- .association_features(assoc_name = nil) ⇒ Object
- .attribute_features(attr_name = nil) ⇒ Object
- .essay_for(attr_or_assoc) ⇒ Object
- .features ⇒ Object
Class Method Details
.association_features(assoc_name = nil) ⇒ Object
27 28 29 30 |
# File 'lib/essay.rb', line 27 def association_features(assoc_name = nil) @features_for_assocs ||= Essay::AssociationCollection.new(model_class: self) assoc_name ? @features_for_assocs[assoc_name] : @features_for_assocs end |
.attribute_features(attr_name = nil) ⇒ Object
22 23 24 25 |
# File 'lib/essay.rb', line 22 def attribute_features(attr_name = nil) @features_for_attrs ||= Essay::AttributeCollection.new(model_class: self) attr_name ? @features_for_attrs[attr_name] : @features_for_attrs end |
.essay_for(attr_or_assoc) ⇒ Object
32 33 34 |
# File 'lib/essay.rb', line 32 def essay_for(attr_or_assoc) raise NotImplmentedError end |
.features ⇒ Object
18 19 20 |
# File 'lib/essay.rb', line 18 def features @features_for_model ||= Essay::ModelFeatures.new(model_class: self) end |