Sha256: acc01babb4771bfedbc7b87b6b8fb2e48eac9e4f9dc226660cce8a1101e92fe1

Contents?: true

Size: 399 Bytes

Versions: 15

Compression:

Stored size: 399 Bytes

Contents

module StorageRoom
  
  class AssociationField < Field
    key :collection_url
    
    def add_to_entry_class(klass) # :nodoc:
      super
      
     # collection
    end
    
    # The target collection of the association field
    def collection
      @collection ||= Collection.load(self.collection_url)
    end
    
    def collection_loaded?
      @collection ? true : false
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
storage_room-0.3.24 lib/storage_room/embeddeds/fields/association_field.rb
storage_room-0.3.23 lib/storage_room/embeddeds/fields/association_field.rb
storage_room-0.3.22 lib/storage_room/embeddeds/fields/association_field.rb
storage_room-0.3.21 lib/storage_room/embeddeds/fields/association_field.rb
storage_room-0.3.20 lib/storage_room/embeddeds/fields/association_field.rb
storage_room-0.3.19 lib/storage_room/embeddeds/fields/association_field.rb
storage_room-0.3.18 lib/storage_room/embeddeds/fields/association_field.rb
storage_room-0.3.17 lib/storage_room/embeddeds/fields/association_field.rb
storage_room-0.3.16 lib/storage_room/embeddeds/fields/association_field.rb
storage_room-0.3.15 lib/storage_room/embeddeds/fields/association_field.rb
storage_room-0.3.14 lib/storage_room/embeddeds/fields/association_field.rb
storage_room-0.3.13 lib/storage_room/embeddeds/fields/association_field.rb
storage_room-0.3.12 lib/storage_room/embeddeds/fields/association_field.rb
storage_room-0.3.11 lib/storage_room/embeddeds/fields/association_field.rb
storage_room-0.3.10 lib/storage_room/embeddeds/fields/association_field.rb