Sha256: b5f970819828a6eb05d154ff07d9f5ddbb2ea7ae45bdf8c881d877773e37421a
Contents?: true
Size: 802 Bytes
Versions: 6
Compression:
Stored size: 802 Bytes
Contents
module AssociationWithOperator def find(*args) results = super if results.kind_of? Array results.each{|r| r.operator = proxy_owner.operator} else results.operator = proxy_owner.operator if results end results end def method_missing(method, *args) results = super if results.respond_to?(:operator=) results.operator= proxy_owner.operator elsif results.kind_of? Array results.each{|r| r.operator = proxy_owner.operator if r.respond_to?(:operator=)} end results end def construct_join_attributes(associate) join_attributes = super if @owner.operator || associate.operator join_attributes[:operator] ||= @owner.operator join_attributes[:operator] ||= associate.operator end join_attributes end end
Version data entries
6 entries across 6 versions & 1 rubygems