Commit c48b131b86da8b26e10b0f631847ac5aa430b951

Authored by Nathan Broadbent
1 parent aae95783
Exists in master and in 1 other branch production

Added :notices index to Err

Showing 1 changed file with 2 additions and 1 deletions   Show diff stats
app/models/err.rb
@@ -15,6 +15,7 @@ class Err @@ -15,6 +15,7 @@ class Err
15 15
16 index :last_notice_at 16 index :last_notice_at
17 index :app_id 17 index :app_id
  18 + index :notices
18 19
19 belongs_to :app 20 belongs_to :app
20 has_many :notices 21 has_many :notices
@@ -26,7 +27,7 @@ class Err @@ -26,7 +27,7 @@ class Err
26 scope :unresolved, where(:resolved => false) 27 scope :unresolved, where(:resolved => false)
27 scope :ordered, order_by(:last_notice_at.desc) 28 scope :ordered, order_by(:last_notice_at.desc)
28 scope :for_apps, lambda {|apps| where(:app_id.in => apps.all.map(&:id))} 29 scope :for_apps, lambda {|apps| where(:app_id.in => apps.all.map(&:id))}
29 - 30 +
30 def self.in_env(env) 31 def self.in_env(env)
31 env.present? ? where(:environment => env) : scoped 32 env.present? ? where(:environment => env) : scoped
32 end 33 end