Sha256: ef244d4586e5211b47e5d8a84bc431b86e452f07d138debb94cc31f346624f58

Contents?: true

Size: 573 Bytes

Versions: 40

Compression:

Stored size: 573 Bytes

Contents

module ActiveRecord
  module Associations
    class AssociationProxy #:nodoc:

    def origin
      proxy_owner
    end

    def origin_attribute
      proxy_reflection.name
    end

      private


      def raise_on_type_mismatch(record)
        # Don't complain if the interface type of a polymorphic association doesn't exist
        klass = @reflection.klass rescue nil
        unless klass.nil? || record.is_a?(klass)
          raise ActiveRecord::AssociationTypeMismatch, "#{@reflection.klass} expected, got #{record.class}"
        end
      end

    end
  end
end

Version data entries

40 entries across 40 versions & 1 rubygems

Version Path
hobo-1.1.0 lib/active_record/association_proxy.rb
hobo-1.0.3 lib/active_record/association_proxy.rb
hobo-1.1.0.pre4 lib/active_record/association_proxy.rb
hobo-1.1.0.pre3 lib/active_record/association_proxy.rb
hobo-1.3.0.pre22 lib/hobo/extensions/active_record/association_proxy.rb
hobo-1.3.0.pre21 lib/hobo/extensions/active_record/association_proxy.rb
hobo-1.3.0.pre20 lib/hobo/extensions/active_record/association_proxy.rb
hobo-1.3.0.pre19 lib/hobo/extensions/active_record/association_proxy.rb
hobo-1.3.0.pre18 lib/hobo/extensions/active_record/association_proxy.rb
hobo-1.1.0.pre2 lib/active_record/association_proxy.rb
hobo-1.1.0.pre0 lib/active_record/association_proxy.rb
hobo-1.0.2 lib/active_record/association_proxy.rb
hobo-1.3.0.pre16 lib/hobo/extensions/active_record/association_proxy.rb
hobo-1.3.0.pre15 lib/hobo/extensions/active_record/association_proxy.rb
hobo-1.3.0.pre14 lib/hobo/extensions/active_record/association_proxy.rb
hobo-1.3.0.pre13 lib/hobo/extensions/active_record/association_proxy.rb
hobo-1.3.0.pre12 lib/hobo/extensions/active_record/association_proxy.rb
hobo-1.3.0.pre11 lib/hobo/extensions/active_record/association_proxy.rb
hobo-1.3.0.pre10 lib/hobo/extensions/active_record/association_proxy.rb
hobo-1.0.1 lib/active_record/association_proxy.rb