Permalink
Browse files

Rails 3: .scoped => Rails 3/4: .where(nil)

  • Loading branch information...
1 parent b23bda0 commit e69009845c18d6524f02c6f13f5af3ae2d75681c @bnauta bnauta committed Nov 14, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/authlogic/authenticates_many/base.rb
@@ -42,7 +42,7 @@ def authenticates_many(name, options = {})
options[:relationship_name] ||= options[:session_class].klass_name.underscore.pluralize
class_eval <<-"end_eval", __FILE__, __LINE__
def #{name}
- find_options = #{options[:find_options].inspect} || #{options[:relationship_name]}.scoped
+ find_options = #{options[:find_options].inspect} || #{options[:relationship_name]}.where(nil)
@#{name} ||= Authlogic::AuthenticatesMany::Association.new(#{options[:session_class]}, find_options, #{options[:scope_cookies] ? "self.class.model_name.underscore + '_' + self.send(self.class.primary_key).to_s" : "nil"})
end
end_eval

0 comments on commit e690098

Please sign in to comment.