Skip to content

Loading…

Update active_record_adapter.rb #952

Open
wants to merge 1 commit into from

2 participants

@davidakachaos

As @dim suggested in #889
Please refer to that issue for more information. Note that I did't came up with this idea, @dim did :smile:

@davidakachaos davidakachaos Update active_record_adapter.rb
As @dim suggested in #889
Please refer to that issue for more information. Note that I did't came up with this idea, @dim did :smile:
8ccf5d9
@macfanatic

This is also mentioned in #859, and there is a fork mentioned there with a spec added as well!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 11, 2013
  1. @davidakachaos

    Update active_record_adapter.rb

    davidakachaos committed
    As @dim suggested in #889
    Please refer to that issue for more information. Note that I did't came up with this idea, @dim did :smile:
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/cancan/model_adapters/active_record_adapter.rb
View
4 lib/cancan/model_adapters/active_record_adapter.rb
@@ -73,8 +73,8 @@ def tableized_conditions(conditions, model_class = @model_class)
value.delete(k)
nested[k] = v
else
- name = model_class.reflect_on_association(name).table_name.to_sym
- result_hash[name] = value
+ assoc = model_class.reflect_on_association(name).table_name.to_sym
+ result_hash[assoc] = value
end
nested
end
Something went wrong with that request. Please try again.