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/SymbolProc

This commit is contained in:
Jared Beck 2016-03-05 17:00:08 -05:00
parent c28e818e72
commit 5672fd7d31
3 changed files with 3 additions and 12 deletions

View file

@ -356,12 +356,3 @@ Style/StringLiterals:
# SupportedStyles: single_quotes, double_quotes
Style/StringLiteralsInInterpolation:
Enabled: false
# Offense count: 3
# Cop supports --auto-correct.
# Configuration parameters: IgnoredMethods.
# IgnoredMethods: respond_to
Style/SymbolProc:
Exclude:
- 'lib/paper_trail/reifier.rb'
- 'test/unit/version_test.rb'

View file

@ -106,7 +106,7 @@ module PaperTrail
if (version = versions.delete(record.id)).nil?
record
elsif version.event == 'create'
options[:mark_for_destruction] ? record.tap { |r| r.mark_for_destruction } : nil
options[:mark_for_destruction] ? record.tap(&:mark_for_destruction) : nil
else
version.reify(options.merge(has_many: false, has_one: false))
end

View file

@ -82,7 +82,7 @@ module PaperTrail
context "given a Version" do
should "grab the timestamp from the version and use that as the value" do
expected = @animal.versions.to_a.tap { |assoc| assoc.shift }
expected = @animal.versions.to_a.tap(&:shift)
actual = Version.subsequent(@animal.versions.first)
assert_equal expected, actual
end
@ -109,7 +109,7 @@ module PaperTrail
context "given a Version" do
should "grab the timestamp from the version and use that as the value" do
expected = @animal.versions.to_a.tap { |assoc| assoc.pop }.reverse
expected = @animal.versions.to_a.tap(&:pop).reverse
actual = Version.preceding(@animal.versions.last)
assert_equal expected, actual
end