Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Don't use Module#=== explicitly, Array === value returns false althou…

…gh value.class returns Array
  • Loading branch information...
commit 6042f4c7859f5dbaf2cc583e03abf7c035aa1b55 1 parent 20c7dba
@tomlion tomlion authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/ripple/associations.rb
View
6 lib/ripple/associations.rb
@@ -323,11 +323,11 @@ def verify_type!(value, owner)
def type_matches?(value)
case
when polymorphic?
- one? || Array === value
+ one? || value.is_a?(Array)
when many?
- Array === value && value.all? {|d| (embedded? && Hash === d) || d.kind_of?(klass) }
+ value.is_a?(Array) && value.all? {|d| (embedded? && d.is_a?(Hash)) || d.kind_of?(klass) }
when one?
- value.nil? || (embedded? && Hash === value) || value.kind_of?(klass)
+ value.nil? || (embedded? && value.is_a?(Hash)) || value.kind_of?(klass)
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.