Merge branch 'design_team' of github.com:Rulingcom/orbit into design_team
This commit is contained in:
commit
3ef81c520e
|
@ -62,30 +62,23 @@ class OrbitBackendController< ApplicationController
|
|||
case key
|
||||
when 'status'
|
||||
a = Array.new
|
||||
objects.each do |bulletin|
|
||||
objects.each do |object|
|
||||
value.each do |v|
|
||||
case v
|
||||
when 'pending'
|
||||
a << bulletin if bulletin.is_checked.nil?
|
||||
when 'rejected'
|
||||
a << bulletin if bulletin.is_checked.eql?(false)
|
||||
else
|
||||
a << bulletin if bulletin[v]
|
||||
end
|
||||
a << object if object[v]
|
||||
end
|
||||
end
|
||||
objects = a.uniq
|
||||
when 'categories'
|
||||
a = Array.new
|
||||
objects.each do |bulletin|
|
||||
a << bulletin if value.include?(bulletin.bulletin_category.id.to_s)
|
||||
objects.each do |object|
|
||||
a << object if value.include?(object.send("#{object.class.to_s.underscore}_category").id.to_s)
|
||||
end
|
||||
objects = a.uniq
|
||||
when 'tags'
|
||||
a = Array.new
|
||||
objects.each do |bulletin|
|
||||
bulletin.tags.each do |tag|
|
||||
a << bulletin if value.include?(tag.id.to_s)
|
||||
objects.each do |object|
|
||||
object.tags.each do |tag|
|
||||
a << object if value.include?(tag.id.to_s)
|
||||
end
|
||||
end
|
||||
objects = a.uniq
|
||||
|
|
Loading…
Reference in New Issue