Module: ActiveRecord::Collections::Collectable::Relation

Defined in:
lib/active_record/collections/collectable.rb

Instance Method Summary collapse

Instance Method Details

#collectionObject Also known as: to_collection



39
40
41
42
# File 'lib/active_record/collections/collectable.rb', line 39

def collection
  # do this with a hash so that we don't cause the relation query to execute
  kollektion.from_hash(values_hash)
end

#kollektionObject



29
30
31
# File 'lib/active_record/collections/collectable.rb', line 29

def kollektion
  klass.kollektion
end

#values_hashObject Also known as: to_values_hash, to_hash



33
34
35
# File 'lib/active_record/collections/collectable.rb', line 33

def values_hash
  ActiveRecord::Collections::Serializer.to_hash(values.merge({collectable: klass}))
end