Skip to content

Commit

Permalink
When Rails version is 6.0.0, skip this.
Browse files Browse the repository at this point in the history
To fix mbleigh#955
When the Rails version is 6.0.0, it becomes true, so I want to skip set_attribute_was.
  • Loading branch information
sin authored Aug 19, 2019
1 parent fbf2b60 commit aa602f3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/acts_as_taggable_on/taggable/core.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@ def #{tag_type}_list=(new_tags)
parsed_new_list = ActsAsTaggableOn.default_parser.new(new_tags).parse
if self.class.preserve_tag_order? || parsed_new_list.sort != #{tag_type}_list.sort
set_attribute_was('#{tag_type}_list', #{tag_type}_list)
if Rails.version.to_f < 6.0
set_attribute_was('#{tag_type}_list', #{tag_type}_list)
else
d_mutations_from_database.change_to_attribute('#{tag_type}_list')
end
write_attribute("#{tag_type}_list", parsed_new_list)
end
Expand Down

2 comments on commit aa602f3

@tbuehl
Copy link

@tbuehl tbuehl commented on aa602f3 Aug 19, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It must be duplicated_mutations_from_database

NameError (undefined local variable or method `d_mutations_from_database' for

@sin-to-jin
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tbuehl It was.

Please sign in to comment.