Sha256: 3d289e9ded6b3d505b829126a294e3a8b507d424a3c21324c837936afb9279ac

Contents?: true

Size: 495 Bytes

Versions: 3

Compression:

Stored size: 495 Bytes

Contents

module ActiveRecord
  module Associations
    class AssociationProxy #:nodoc:
      
      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

3 entries across 3 versions & 1 rubygems

Version Path
hobo-0.7.3 hobo_files/plugin/lib/active_record/association_proxy.rb
hobo-0.7.4 hobo_files/plugin/lib/active_record/association_proxy.rb
hobo-0.7.5 hobo_files/plugin/lib/active_record/association_proxy.rb