diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index d64948a..18f0488 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -180,17 +180,6 @@ Style/LeadingCommentSpace: - 'spec/models/notification_service/hoiio_service_spec.rb' - 'spec/models/notification_service/pushover_service_spec.rb' -# Offense count: 7 -# Cop supports --auto-correct. -Style/MultilineBlockLayout: - Exclude: - - 'lib/tasks/errbit/demo.rake' - - 'spec/fabricators/issue_tracker_fabricator.rb' - - 'spec/interactors/user_destroy_spec.rb' - - 'spec/models/app_spec.rb' - - 'spec/models/error_report_spec.rb' - - 'spec/views/apps/show.atom.builder_spec.rb' - # Offense count: 10 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles. diff --git a/app/models/notice.rb b/app/models/notice.rb index 9a74cfb..b4dd7a5 100644 --- a/app/models/notice.rb +++ b/app/models/notice.rb @@ -28,7 +28,7 @@ class Notice scope :ordered, -> { order_by(:created_at.asc) } scope :reverse_ordered, -> { order_by(:created_at.desc) } - scope :for_errs, -> (errs) { + scope :for_errs, lambda { |errs| where(:err_id.in => errs.all.map(&:id)) } diff --git a/lib/tasks/errbit/demo.rake b/lib/tasks/errbit/demo.rake index 47356de..142acc0 100644 --- a/lib/tasks/errbit/demo.rake +++ b/lib/tasks/errbit/demo.rake @@ -32,11 +32,12 @@ namespace :errbit do def random_backtrace backtrace = [] - 99.times {|t| backtrace << { - 'number' => t.hash % 1000, - 'file' => "/path/to/file.rb", - 'method' => RANDOM_METHODS.sample.to_s - }} + 99.times {|t| + backtrace << { + 'number' => t.hash % 1000, + 'file' => "/path/to/file.rb", + 'method' => RANDOM_METHODS.sample.to_s + }} backtrace end diff --git a/spec/fabricators/issue_tracker_fabricator.rb b/spec/fabricators/issue_tracker_fabricator.rb index 2b6ab82..e18a440 100644 --- a/spec/fabricators/issue_tracker_fabricator.rb +++ b/spec/fabricators/issue_tracker_fabricator.rb @@ -1,8 +1,9 @@ Fabricator :issue_tracker do type_tracker 'mock' - options {{ - :foo => 'one', - :bar => 'two' - }} + options { + { + :foo => 'one', + :bar => 'two' + }} app end diff --git a/spec/interactors/user_destroy_spec.rb b/spec/interactors/user_destroy_spec.rb index 4668a1c..f935d4d 100644 --- a/spec/interactors/user_destroy_spec.rb +++ b/spec/interactors/user_destroy_spec.rb @@ -1,9 +1,10 @@ describe UserDestroy do - let(:app) { Fabricate( - :app, - :watchers => [ - Fabricate.build(:user_watcher, :user => user) - ]) + let(:app) { + Fabricate( + :app, + :watchers => [ + Fabricate.build(:user_watcher, :user => user) + ]) } describe "#destroy" do diff --git a/spec/models/app_spec.rb b/spec/models/app_spec.rb index eca3710..1388880 100644 --- a/spec/models/app_spec.rb +++ b/spec/models/app_spec.rb @@ -164,11 +164,12 @@ describe App, type: 'model' do context '#find_or_create_err!' do let(:app) { Fabricate(:app) } - let(:conditions) { { - :error_class => 'Whoops', - :environment => 'production', - :fingerprint => 'some-finger-print' - } + let(:conditions) { + { + :error_class => 'Whoops', + :environment => 'production', + :fingerprint => 'some-finger-print' + } } it 'returns the correct err if one already exists' do @@ -192,10 +193,11 @@ describe App, type: 'model' do end context "without error_class" do - let(:conditions) { { - :environment => 'production', - :fingerprint => 'some-finger-print' - } + let(:conditions) { + { + :environment => 'production', + :fingerprint => 'some-finger-print' + } } it 'save the err' do expect(Err.where(conditions).first).to be_nil -- libgit2 0.21.2