Hi I migrate an app from Rails 2 to Rails 7.04.
I don't see how to rewrite :
self.accepted_roles.find_all_by_name(role_name).any? { |role| role.users }
users = self.accepted_roles.find_all_by_name(role_name).collect { |role| role.users }
users.flatten.uniq if users
I think self.roles.where("name="role_name).find_each
but .any?
and .collect
I don't find Rails 2 documentation. Help is welcome
I think that
.where()
is what you are looking for.