Skip to content

Commit

Permalink
replace lonely operators with booleans that default to STDOUT logger
Browse files Browse the repository at this point in the history
  • Loading branch information
andyweiss1982 committed Dec 5, 2016
1 parent ff28cdb commit 5ec7b00
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/paper_trail/record_trail.rb
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ def habtm_assoc_ids(habtm_assoc)
end

def log_version_errors(version, action)
version.logger&.warn(
(version.logger || Logger.new(STDOUT)).warn(
"Unable to create version for #{action} of #{@record.class.name}" +
"##{@record.id}: " + version.errors.full_messages.join(", ")
)
Expand Down
2 changes: 1 addition & 1 deletion lib/paper_trail/reifier.rb
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def reify_attributes(model, version, attrs)
elsif model.respond_to?("#{k}=")
model.send("#{k}=", v)
else
version.logger&.warn(
(version.logger || Logger.new(STDOUT)).warn(
"Attribute #{k} does not exist on #{version.item_type} (Version id: #{version.id})."
)
end
Expand Down

0 comments on commit 5ec7b00

Please sign in to comment.