Skip to content

Commit

Permalink
Merge pull request #3 from spark-solutions/fix-rails-version-check
Browse files Browse the repository at this point in the history
use Gem::Version object to compare rails version instead of string
  • Loading branch information
damianlegawiec authored Aug 19, 2019
2 parents 22efcac + 1fd1c6b commit 31063ff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 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,7 @@ 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
if Rails.version < "6.0.0.beta1"
if Gem.loaded_specs["rails"].version < Gem::Version.new("6.0.0.beta1")
set_attribute_was('#{tag_type}_list', #{tag_type}_list)
else
duplicated_mutations_from_database.change_to_attribute('#{tag_type}_list')
Expand Down

0 comments on commit 31063ff

Please sign in to comment.