This commit makes the read column of delayed_job_failures default to false and not-null, eliminating the tristate logic that existed previously. It also updates the corresponding named_scope used to count the number of unread delayed job failures.
Reviewed-By: Nick Lewis <[email protected]> Signed-off-by: Josh Cooper <[email protected]> --- Local-branch: feature/master/7967-display-report-import-failures app/models/delayed_job_failure.rb | 2 +- .../20110620111500_create_delayed_job_failures.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/delayed_job_failure.rb b/app/models/delayed_job_failure.rb index c046d75..5daac30 100644 --- a/app/models/delayed_job_failure.rb +++ b/app/models/delayed_job_failure.rb @@ -1,5 +1,5 @@ class DelayedJobFailure < ActiveRecord::Base def self.per_page; 25 end - named_scope :unread, :conditions => { :read => nil } + named_scope :unread, :conditions => { :read => false } end diff --git a/db/migrate/20110620111500_create_delayed_job_failures.rb b/db/migrate/20110620111500_create_delayed_job_failures.rb index 23a9ac4..cc1d4e4 100644 --- a/db/migrate/20110620111500_create_delayed_job_failures.rb +++ b/db/migrate/20110620111500_create_delayed_job_failures.rb @@ -3,7 +3,7 @@ class CreateDelayedJobFailures < ActiveRecord::Migration create_table :delayed_job_failures do |t| t.string :summary, :limit => 255 t.text :details - t.boolean :read + t.boolean :read, :default => false, :null => false t.timestamps end end -- 1.7.4.4 -- You received this message because you are subscribed to the Google Groups "Puppet Developers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en.
