class GdatastoreMapper::Associations::HasMany

Attributes

belonging[RW]
owner[RW]

Public Class Methods

new(owner, belonging) click to toggle source
# File lib/gdatastore_mapper/associations/has_many.rb, line 7
def initialize(owner, belonging)
  @owner = owner
  @belonging = belonging
end

Public Instance Methods

belonging_id() click to toggle source
# File lib/gdatastore_mapper/associations/has_many.rb, line 22
def belonging_id
  @belonging.to_s + '_id'
end
belonging_klass() click to toggle source
# File lib/gdatastore_mapper/associations/has_many.rb, line 12
def belonging_klass
  @belonging.to_s.classify.constantize
end
owner_attributes() click to toggle source
# File lib/gdatastore_mapper/associations/has_many.rb, line 16
def owner_attributes
  {
    (@owner.class.to_s.underscore + '_id') => @owner.id
  }
end