Merge branch '345-update_to_rails4' of abf.rosalinux.ru:abf/rosa-build into 345-update_to_rails4

This commit is contained in:
Vokhmin Alexey V 2014-03-25 22:03:08 +04:00
commit 237df48f94
3 changed files with 3 additions and 3 deletions

View File

@ -15,7 +15,7 @@ module ActsLikeMember
) )
") ")
} }
scope :search_order, -> { order('CHAR_LENGTH(#{table_name}.uname) ASC') } scope :search_order, -> { order("CHAR_LENGTH(#{table_name}.uname) ASC") }
scope :without, ->(a) { where("#{table_name}.id NOT IN (?)", a) } scope :without, ->(a) { where("#{table_name}.id NOT IN (?)", a) }
scope :by_uname, ->(n) { where("#{table_name}.uname ILIKE ?", n) } scope :by_uname, ->(n) { where("#{table_name}.uname ILIKE ?", n) }
scope :search, ->(q) { by_uname("%#{q.to_s.strip}%") } scope :search, ->(q) { by_uname("%#{q.to_s.strip}%") }

View File

@ -82,7 +82,7 @@ class Project < ActiveRecord::Base
WHERE ptr.repository_id = ?)', repository_id) WHERE ptr.repository_id = ?)', repository_id)
} }
scope :by_owners, ->(group_owner_ids, user_owner_ids) { scope :by_owners, ->(group_owner_ids, user_owner_ids) {
where("projects.owner_id in (?) AND projects.owner_type = 'Group') OR where("(projects.owner_id in (?) AND projects.owner_type = 'Group') OR
(projects.owner_id in (?) AND projects.owner_type = 'User')", group_owner_ids, user_owner_ids) (projects.owner_id in (?) AND projects.owner_type = 'User')", group_owner_ids, user_owner_ids)
} }

View File

@ -1,4 +1,4 @@
json.product_build_lists @product_build_lists do |json, product_build_list| json.product_build_lists @product_build_lists do |product_build_list|
json.partial! 'product_build_list', product_build_list: product_build_list, json: json json.partial! 'product_build_list', product_build_list: product_build_list, json: json
end end