From: Tom Hughes Date: Tue, 28 Apr 2009 16:25:37 +0000 (+0000) Subject: Use the alias for the conditions as well... X-Git-Tag: live~7462 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/6d1c010213ca60b1ed85cf2648167982970b4aab?hp=074e5b0a11f67de7c35562edcc0374c2585594d5 Use the alias for the conditions as well... --- diff --git a/app/models/relation.rb b/app/models/relation.rb index f0b185ebc..37969ee76 100644 --- a/app/models/relation.rb +++ b/app/models/relation.rb @@ -151,7 +151,7 @@ class Relation < ActiveRecord::Base if ids.empty? return [] else - self.with_scope(:find => { :joins => "INNER JOIN current_relation_members AS crm ON crm.id = current_relations.id", :conditions => "current_relation_members.member_type = 'Node' AND current_relation_members.member_id IN (#{ids.join(',')})" }) do + self.with_scope(:find => { :joins => "INNER JOIN current_relation_members AS crm ON crm.id = current_relations.id", :conditions => "crm.member_type = 'Node' AND crm.member_id IN (#{ids.join(',')})" }) do return self.find(:all, options) end end @@ -161,7 +161,7 @@ class Relation < ActiveRecord::Base if ids.empty? return [] else - self.with_scope(:find => { :joins => "INNER JOIN current_relation_members AS crm ON crm.id = current_relations.id", :conditions => "current_relation_members.member_type = 'Way' AND current_relation_members.member_id IN (#{ids.join(',')})" }) do + self.with_scope(:find => { :joins => "INNER JOIN current_relation_members AS crm ON crm.id = current_relations.id", :conditions => "crm.member_type = 'Way' AND crm.member_id IN (#{ids.join(',')})" }) do return self.find(:all, options) end end @@ -171,7 +171,7 @@ class Relation < ActiveRecord::Base if ids.empty? return [] else - self.with_scope(:find => { :joins => "INNER JOIN current_relation_members AS crm ON crm.id = current_relations.id", :conditions => "current_relation_members.member_type = 'Relation' AND current_relation_members.member_id IN (#{ids.join(',')})" }) do + self.with_scope(:find => { :joins => "INNER JOIN current_relation_members AS crm ON crm.id = current_relations.id", :conditions => "crm.member_type = 'Relation' AND crm.member_id IN (#{ids.join(',')})" }) do return self.find(:all, options) end end