Module: Reviewed::Embeddable::ClassMethods
- Defined in:
- lib/reviewed/embeddable.rb
Instance Attribute Summary collapse
-
#_embedded_many ⇒ Object
Returns the value of attribute _embedded_many.
-
#_embedded_one ⇒ Object
Returns the value of attribute _embedded_one.
Instance Method Summary collapse
Instance Attribute Details
#_embedded_many ⇒ Object
Returns the value of attribute _embedded_many.
51 52 53 |
# File 'lib/reviewed/embeddable.rb', line 51 def end |
#_embedded_one ⇒ Object
Returns the value of attribute _embedded_one.
51 52 53 |
# File 'lib/reviewed/embeddable.rb', line 51 def end |
Instance Method Details
#has_attachments ⇒ Object
53 54 55 |
# File 'lib/reviewed/embeddable.rb', line 53 def include Attachable end |
#has_many(name, opts = {}) ⇒ Object
57 58 59 60 61 |
# File 'lib/reviewed/embeddable.rb', line 57 def has_many(name, opts={}) klass = Reviewed::Embeddable.(name.to_s, opts[:class_name]) association = opts[:as] || name << { association.to_s => klass } end |
#has_one(name, opts = {}) ⇒ Object
63 64 65 66 67 |
# File 'lib/reviewed/embeddable.rb', line 63 def has_one(name, opts={}) klass = Reviewed::Embeddable.(name.to_s, opts[:class_name]) association = opts[:as] || name << { association.to_s => klass } end |