Commit 02430fc98ee9af4ea810475bbcb5cf55615445c6

Authored by Rodrigo Souto
1 parent 5b76a428

rails3: change named_scope call on spammable module

Showing 1 changed file with 3 additions and 3 deletions   Show diff stats
lib/spammable.rb
@@ -10,10 +10,10 @@ module Spammable @@ -10,10 +10,10 @@ module Spammable
10 10
11 module ClassMethods 11 module ClassMethods
12 def self.extended (base) 12 def self.extended (base)
13 - if base.respond_to?(:named_scope) 13 + if base.respond_to?(:scope)
14 base.class_eval do 14 base.class_eval do
15 - named_scope :without_spam, :conditions => ['spam IS NULL OR spam = ?', false]  
16 - named_scope :spam, :conditions => ['spam = ?', true] 15 + scope :without_spam, :conditions => ['spam IS NULL OR spam = ?', false]
  16 + scope :spam, :conditions => ['spam = ?', true]
17 end 17 end
18 end 18 end
19 end 19 end