1
0
Fork 0
mirror of https://github.com/paper-trail-gem/paper_trail.git synced 2022-11-09 11:33:19 -05:00

Fix Style/Proc

This commit is contained in:
Jared Beck 2016-03-05 17:20:12 -05:00
parent 750d14635f
commit 5485d1dfcc
3 changed files with 6 additions and 13 deletions

View file

@ -220,13 +220,6 @@ Style/PredicateName:
Exclude:
- 'lib/paper_trail/has_paper_trail.rb'
# Offense count: 6
# Cop supports --auto-correct.
Style/Proc:
Exclude:
- 'test/dummy/app/models/article.rb'
- 'test/dummy/app/models/translation.rb'
# Offense count: 3
# Cop supports --auto-correct.
Style/RescueModifier:

View file

@ -2,18 +2,18 @@ class Article < ActiveRecord::Base
has_paper_trail(
ignore: [
:title, {
abstract: Proc.new { |obj|
abstract: proc { |obj|
["ignore abstract", "Other abstract"].include? obj.abstract
}
}
],
only: [:content, { abstract: Proc.new { |obj| obj.abstract.present? } }],
only: [:content, { abstract: proc { |obj| obj.abstract.present? } }],
skip: [:file_upload],
meta: {
answer: 42,
action: :action_data_provider_method,
question: Proc.new { "31 + 11 = #{31 + 11}" },
article_id: Proc.new { |article| article.id },
question: proc { "31 + 11 = #{31 + 11}" },
article_id: proc { |article| article.id },
title: :title
}
)

View file

@ -1,4 +1,4 @@
class Translation < ActiveRecord::Base
has_paper_trail if: Proc.new { |t| t.language_code == "US" },
unless: Proc.new { |t| t.type == "DRAFT" }
has_paper_trail if: proc { |t| t.language_code == "US" },
unless: proc { |t| t.type == "DRAFT" }
end