Skip to content

Commit

Permalink
Update syntax to match Rubocop requirements.
Browse files Browse the repository at this point in the history
  • Loading branch information
pat committed Feb 23, 2018
1 parent 1965217 commit 52ee510
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/gutentag/active_record.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def add_callbacks
if legacy?
model.after_save :reset_tag_names
else
model.after_commit :reset_tag_names, on: [:create, :update]
model.after_commit :reset_tag_names, :on => %i[ create update ]
end
end

Expand Down
2 changes: 1 addition & 1 deletion lib/gutentag/active_record/modern_instance_methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def reset_tag_names
end

def tag_names
self.tag_names= tags.pluck(:name) if super.nil?
self.tag_names = tags.pluck(:name) if super.nil?

super
end
Expand Down
2 changes: 2 additions & 0 deletions spec/acceptance/dirty_state_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "spec_helper"

RSpec.describe "Dirty state of tag names" do
Expand Down

0 comments on commit 52ee510

Please sign in to comment.