@projects ||=
begin
Project.find(:all,
- :conditions => ['id in (select prop.resource_id from properties prop where prop.resource_id is not null and prop.prop_key=? and prop.text_value=?)', "sonar.profile.#{language}", name])
+ :conditions => ['id in (select prop.resource_id from properties prop where prop.resource_id is not null and prop.prop_key=? and prop.text_value like ?)', "sonar.profile.#{language}", name])
end
end
validates_presence_of :prop_key
named_scope :with_key, lambda { |value| {:conditions => {:prop_key, value}} }
- named_scope :with_value, lambda { |value| {:conditions => {:text_value, value}} }
+ named_scope :with_value, lambda { |value| {:conditions => ['text_value like ?', value] } }
named_scope :with_resource, lambda { |value| {:conditions => {:resource_id => value}} }
named_scope :with_user, lambda { |value| {:conditions => {:user_id => value}} }
named_scope :with_resources, :conditions => 'resource_id is not null'