Sha256: 58f3288310c09e55db2f774eeba61dd57fe0964bc78c0d5ad772fa5c14cb4233
Contents?: true
Size: 711 Bytes
Versions: 13
Compression:
Stored size: 711 Bytes
Contents
module Superstore module Associations class Association attr_reader :owner, :reflection delegate :options, to: :reflection def initialize(owner, reflection) @owner = owner @reflection = reflection end def association_class association_class_name.constantize end def association_class_name reflection.polymorphic? ? owner.send(reflection.polymorphic_column) : reflection.class_name end def target=(target) @target = target loaded! end def target @target end def loaded? @loaded end def loaded! @loaded = true end end end end
Version data entries
13 entries across 13 versions & 1 rubygems