Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

#in_any_role seems to work

  • Loading branch information...
commit 2204c0b52e8c60e61f3dc29d9155826ae94549c2 1 parent b05779f
@stanislaw stanislaw authored
View
5 lib/roles_active_record/strategy/multi/many_roles.rb
@@ -18,10 +18,7 @@ def in_role(role_name)
def in_any_role(*role_names)
mr = Arel::Table.new :roles
- res = joins(:roles).where(mr[:name] => role_names.flatten.to_strings).to_sql
- puts "sql:" + res.to_sql
- puts "result:" + res.inspect
- res
+ joins(:many_roles).where(mr[:name].in(role_names.flatten.to_strings))
end
end
View
2  spec/spec_helper.rb
@@ -21,7 +21,7 @@ def self.config_root_dir
dbfile = File.open(path)
dbconfig = YAML::load(dbfile)
ActiveRecord::Base.establish_connection(dbconfig)
-ActiveRecord::Base.logger = Logger.new(STDERR)
+#ActiveRecord::Base.logger = Logger.new(STDERR)
# Attempts at trying to make database_cleaner accept another location for database.yml
# ------------------------------------------------------------------------------------
Please sign in to comment.
Something went wrong with that request. Please try again.