Class: StorageRoom::AssociationField
- Defined in:
- lib/storage_room/embeddeds/fields/association_field.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#add_to_entry_class(klass) ⇒ Object
:nodoc:.
-
#collection ⇒ Object
The target collection of the association field.
- #collection_loaded? ⇒ Boolean
Methods included from Accessors
#[], #as_json, #attributes, #attributes=, #eql?, #hash, #initialize, #inspect, #loaded?, #proxy?, #reset!, #response_data, #response_data=, #set_from_response_data, #to_hash
Instance Method Details
#add_to_entry_class(klass) ⇒ Object
:nodoc:
6 7 8 9 10 |
# File 'lib/storage_room/embeddeds/fields/association_field.rb', line 6 def add_to_entry_class(klass) # :nodoc: super # collection end |
#collection ⇒ Object
The target collection of the association field
13 14 15 |
# File 'lib/storage_room/embeddeds/fields/association_field.rb', line 13 def collection @collection ||= Collection.load(self.collection_url) end |
#collection_loaded? ⇒ Boolean
17 18 19 |
# File 'lib/storage_room/embeddeds/fields/association_field.rb', line 17 def collection_loaded? @collection ? true : false end |