Sha256: 93e86663be5c3750ed745993896a653aaf2f5a4246cbe9e768aaaf9af3578082
Contents?: true
Size: 683 Bytes
Versions: 33
Compression:
Stored size: 683 Bytes
Contents
module ActiveRecord class AssociationRelation < Relation def initialize(klass, table, association) super(klass, table) @association = association end def proxy_association @association end def ==(other) other == to_a end def build(*args, &block) scoping { @association.build(*args, &block) } end alias new build def create(*args, &block) scoping { @association.create(*args, &block) } end def create!(*args, &block) scoping { @association.create!(*args, &block) } end private def exec_queries super.each { |r| @association.set_inverse_instance r } end end end
Version data entries
33 entries across 33 versions & 6 rubygems