diff --git a/spec/fixtures/developer.rb b/spec/fixtures/developer.rb index 7c3f22c6d..4c55bc9ed 100644 --- a/spec/fixtures/developer.rb +++ b/spec/fixtures/developer.rb @@ -7,7 +7,9 @@ def self.with_poor_ones(&block) end end - scope :poor, :conditions => ['salary <= ?', 80000], :order => 'salary' + scope :poor, lambda { + where(['salary <= ?', 80000]).order('salary') + } def self.per_page() 10 end end diff --git a/spec/fixtures/reply.rb b/spec/fixtures/reply.rb index 9d2722173..5f09fba35 100644 --- a/spec/fixtures/reply.rb +++ b/spec/fixtures/reply.rb @@ -1,9 +1,10 @@ class Reply < ActiveRecord::Base belongs_to :topic, :include => [:replies] - scope :recent, - :conditions => ['replies.created_at > ?', 15.minutes.ago], - :order => 'replies.created_at DESC' + scope :recent, lambda { + where(['replies.created_at > ?', 15.minutes.ago]). + order('replies.created_at DESC') + } validates_presence_of :content end diff --git a/spec/fixtures/topic.rb b/spec/fixtures/topic.rb index 4ea3ee2b7..ea5a39b24 100644 --- a/spec/fixtures/topic.rb +++ b/spec/fixtures/topic.rb @@ -2,6 +2,10 @@ class Topic < ActiveRecord::Base has_many :replies, :dependent => :destroy, :order => 'replies.created_at DESC' belongs_to :project - scope :mentions_activerecord, :conditions => ['topics.title LIKE ?', '%ActiveRecord%'] - scope :distinct, :select => "DISTINCT #{table_name}.*" + scope :mentions_activerecord, lambda { + where(['topics.title LIKE ?', '%ActiveRecord%']) + } + scope :distinct, lambda { + select("DISTINCT #{table_name}.*") + } end