Screen blank array/hash values #35

Merged
merged 1 commit into from Apr 24, 2013

Projects

None yet

2 participants

@tfwright

Anything else I could do to help get this merged?

@rafaelfranca rafaelfranca and 1 other commented on an outdated diff Apr 13, 2013
lib/has_scope.rb
@@ -141,7 +154,7 @@ def call_scope_by_type(type, scope, target, value, options) #:nodoc:
if type == :boolean
block ? block.call(self, target) : target.send(scope)
elsif value && options.key?(:using)
- value = value.values_at(*options[:using])
+ value = value.values_at(*options[:using].map(&:to_s))
@rafaelfranca
rafaelfranca Apr 13, 2013

Why do we need this one?

@tfwright
tfwright Apr 13, 2013

This was working before because the rails initially instantiates params as a HashWithIndifferentAccess, but when you call hash methods on that, as on line 144 above, it returns a vanilla hash with all the keys as strings. Another option would be to explicitly turn it back into a HWIA there. What do you think?

@rafaelfranca
rafaelfranca Apr 24, 2013

We should return a HWIA

@rafaelfranca

It looks good. Could you squash your commits?

@tfwright

Ready to go.

@rafaelfranca rafaelfranca merged commit 88e7973 into plataformatec:master Apr 24, 2013
@tfwright

Thanks!

@rafaelfranca

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment