Skip to content
This repository has been archived by the owner on Dec 12, 2021. It is now read-only.

Commit

Permalink
fixing association conditions when MetaWhere is installed (thanks acm…
Browse files Browse the repository at this point in the history
…etech) - closes #261
  • Loading branch information
ryanb committed Mar 8, 2011
1 parent 79995e4 commit 52435e9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions Gemfile
Expand Up @@ -5,6 +5,7 @@ when nil, "active_record"
gem "sqlite3-ruby", :require => "sqlite3"
gem "activerecord", :require => "active_record"
gem "with_model"
gem "meta_where"
when "data_mapper"
gem "dm-core", "~> 1.0.2"
gem "dm-sqlite-adapter", "~> 1.0.2"
Expand Down
2 changes: 1 addition & 1 deletion lib/cancan/model_adapters/active_record_adapter.rb
Expand Up @@ -36,7 +36,7 @@ def tableized_conditions(conditions, model_class = @model_class)
conditions.inject({}) do |result_hash, (name, value)|
if value.kind_of? Hash
association_class = model_class.reflect_on_association(name).class_name.constantize
name = model_class.reflect_on_association(name).table_name
name = model_class.reflect_on_association(name).table_name.to_sym
value = tableized_conditions(value, association_class)
end
result_hash[name] = value
Expand Down

0 comments on commit 52435e9

Please sign in to comment.