Sha256: c6fcf76db2f4b28dff66b63b50192e6b9c573298543b5fe56629061447855031
Contents?: true
Size: 981 Bytes
Versions: 9
Compression:
Stored size: 981 Bytes
Contents
module ActiveData module Model module Associations module PersistenceAdapters class ActiveRecord < Base class ReferencedProxy < ActiveData::Model::Associations::Collection::Proxy # You can't create data directly through ActiveRecord::Relation METHODS_EXCLUDED_FROM_DELEGATION = %w[build create create!].map(&:to_sym).freeze attr_reader :association delegate :scope, to: :@association def method_missing(method, *args, &block) delegate_to_scope?(method) ? scope.send(method, *args, &block) : super end def respond_to_missing?(method, include_private = false) delegate_to_scope?(method) || super end private def delegate_to_scope?(method) METHODS_EXCLUDED_FROM_DELEGATION.exclude?(method) && scope.respond_to?(method) end end end end end end end
Version data entries
9 entries across 9 versions & 1 rubygems