- def self.find_for_nodes(ids, options = {})
- if ids.empty?
- return []
- else
- 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
- end
-
- def self.find_for_ways(ids, options = {})
- if ids.empty?
- return []
- else
- 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
- end
-
- def self.find_for_relations(ids, options = {})
- if ids.empty?
- return []
- else
- 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
- end
-