diff options
Diffstat (limited to 'activerecord/test/fixtures')
-rw-r--r-- | activerecord/test/fixtures/comment.rb | 2 | ||||
-rwxr-xr-x | activerecord/test/fixtures/company.rb | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/activerecord/test/fixtures/comment.rb b/activerecord/test/fixtures/comment.rb index fd3a43ff5a..3eab263fa4 100644 --- a/activerecord/test/fixtures/comment.rb +++ b/activerecord/test/fixtures/comment.rb @@ -6,7 +6,7 @@ class Comment < ActiveRecord::Base end def self.search_by_type(q) - self.find(:all, :conditions => ['type = ?', q]) + self.find(:all, :conditions => ["#{QUOTED_TYPE} = ?", q]) end end diff --git a/activerecord/test/fixtures/company.rb b/activerecord/test/fixtures/company.rb index 4a0c96bdd3..6d33d4e1a8 100755 --- a/activerecord/test/fixtures/company.rb +++ b/activerecord/test/fixtures/company.rb @@ -7,7 +7,9 @@ end class Firm < Company - has_many :clients, :order => "id", :dependent => true, :counter_sql => "SELECT COUNT(*) FROM companies WHERE firm_id = 1 AND (type = 'Client' OR type = 'SpecialClient' OR type = 'VerySpecialClient' )" + has_many :clients, :order => "id", :dependent => true, :counter_sql => + "SELECT COUNT(*) FROM companies WHERE firm_id = 1 " + + "AND (#{QUOTED_TYPE} = 'Client' OR #{QUOTED_TYPE} = 'SpecialClient' OR #{QUOTED_TYPE} = 'VerySpecialClient' )" has_many :clients_sorted_desc, :class_name => "Client", :order => "id DESC" has_many :clients_of_firm, :foreign_key => "client_of", :class_name => "Client", :order => "id" has_many :dependent_clients_of_firm, :foreign_key => "client_of", :class_name => "Client", :order => "id", :dependent => true |