From 2cea6ed4330a793b0e79d732694891c87f94564e Mon Sep 17 00:00:00 2001 From: Arkadiy Zabazhanov Date: Tue, 26 Jan 2021 22:07:19 +0300 Subject: [PATCH 1/4] Use actual Ruby versions on CI --- .gitignore | 2 ++ .travis.yml | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 388fa25..89483f3 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,5 @@ nbproject test/debug.log test/db/database.yml Gemfile.lock +.ruby-version +.ruby-gemset diff --git a/.travis.yml b/.travis.yml index 709e95a..e52c268 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,5 +6,7 @@ before_script: script: "bundle exec rake" rvm: - 2.2 - - 2.1 - - 2.0.0 + - 2.5 + - 2.6 + - 2.7 + - 3.0 From 9528f6cdba3cd0c3818ed7813d22066967942f89 Mon Sep 17 00:00:00 2001 From: Arkadiy Zabazhanov Date: Tue, 26 Jan 2021 22:17:00 +0300 Subject: [PATCH 2/4] Add appraisals --- .travis.yml | 5 +- Appraisals | 7 ++ gemfiles/rails_5.2.gemfile | 7 ++ gemfiles/rails_5.2.gemfile.lock | 141 ++++++++++++++++++++++++++++ gemfiles/rails_6.0.gemfile | 7 ++ gemfiles/rails_6.0.gemfile.lock | 157 +++++++++++++++++++++++++++++++ gemfiles/rails_6.1.gemfile | 7 ++ gemfiles/rails_6.1.gemfile.lock | 160 ++++++++++++++++++++++++++++++++ globalize-accessors.gemspec | 1 + 9 files changed, 491 insertions(+), 1 deletion(-) create mode 100644 Appraisals create mode 100644 gemfiles/rails_5.2.gemfile create mode 100644 gemfiles/rails_5.2.gemfile.lock create mode 100644 gemfiles/rails_6.0.gemfile create mode 100644 gemfiles/rails_6.0.gemfile.lock create mode 100644 gemfiles/rails_6.1.gemfile create mode 100644 gemfiles/rails_6.1.gemfile.lock diff --git a/.travis.yml b/.travis.yml index e52c268..a94774b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,8 +4,11 @@ cache: bundler before_script: - "cp test/db/database.yml.travis test/db/database.yml" script: "bundle exec rake" +gemfile: + - gemfiles/rails_5.2.gemfile + - gemfiles/rails_6.0.gemfile + - gemfiles/rails_6.1.gemfile rvm: - - 2.2 - 2.5 - 2.6 - 2.7 diff --git a/Appraisals b/Appraisals new file mode 100644 index 0000000..ad96dd1 --- /dev/null +++ b/Appraisals @@ -0,0 +1,7 @@ +appraise "rails_5.2" do + gem "rails", "~> 5.2.0" +end + +appraise "rails_6.1" do + gem "rails", "~> 6.1.0" +end diff --git a/gemfiles/rails_5.2.gemfile b/gemfiles/rails_5.2.gemfile new file mode 100644 index 0000000..5a706dc --- /dev/null +++ b/gemfiles/rails_5.2.gemfile @@ -0,0 +1,7 @@ +# This file was generated by Appraisal + +source "https://rubygems.org" + +gem "rails", "~> 5.2.0" + +gemspec path: "../" diff --git a/gemfiles/rails_5.2.gemfile.lock b/gemfiles/rails_5.2.gemfile.lock new file mode 100644 index 0000000..3d5cd39 --- /dev/null +++ b/gemfiles/rails_5.2.gemfile.lock @@ -0,0 +1,141 @@ +PATH + remote: .. + specs: + globalize-accessors (0.3.0) + globalize (>= 5.0.0) + +GEM + remote: https://rubygems.org/ + specs: + actioncable (5.2.4.4) + actionpack (= 5.2.4.4) + nio4r (~> 2.0) + websocket-driver (>= 0.6.1) + actionmailer (5.2.4.4) + actionpack (= 5.2.4.4) + actionview (= 5.2.4.4) + activejob (= 5.2.4.4) + mail (~> 2.5, >= 2.5.4) + rails-dom-testing (~> 2.0) + actionpack (5.2.4.4) + actionview (= 5.2.4.4) + activesupport (= 5.2.4.4) + rack (~> 2.0, >= 2.0.8) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.0.2) + actionview (5.2.4.4) + activesupport (= 5.2.4.4) + builder (~> 3.1) + erubi (~> 1.4) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.0.3) + activejob (5.2.4.4) + activesupport (= 5.2.4.4) + globalid (>= 0.3.6) + activemodel (5.2.4.4) + activesupport (= 5.2.4.4) + activerecord (5.2.4.4) + activemodel (= 5.2.4.4) + activesupport (= 5.2.4.4) + arel (>= 9.0) + activestorage (5.2.4.4) + actionpack (= 5.2.4.4) + activerecord (= 5.2.4.4) + marcel (~> 0.3.1) + activesupport (5.2.4.4) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 0.7, < 2) + minitest (~> 5.1) + tzinfo (~> 1.1) + appraisal (2.3.0) + bundler + rake + thor (>= 0.14.0) + arel (9.0.0) + builder (3.2.4) + concurrent-ruby (1.1.8) + crass (1.0.6) + erubi (1.10.0) + globalid (0.4.2) + activesupport (>= 4.2.0) + globalize (6.0.0) + activemodel (>= 4.2, < 7.0) + activerecord (>= 4.2, < 7.0) + request_store (~> 1.0) + i18n (1.8.7) + concurrent-ruby (~> 1.0) + loofah (2.9.0) + crass (~> 1.0.2) + nokogiri (>= 1.5.9) + mail (2.7.1) + mini_mime (>= 0.1.1) + marcel (0.3.3) + mimemagic (~> 0.3.2) + method_source (1.0.0) + mimemagic (0.3.5) + mini_mime (1.0.2) + minitest (5.14.3) + nio4r (2.5.4) + nokogiri (1.11.1-x86_64-darwin) + racc (~> 1.4) + racc (1.5.2) + rack (2.2.3) + rack-test (1.1.0) + rack (>= 1.0, < 3) + rails (5.2.4.4) + actioncable (= 5.2.4.4) + actionmailer (= 5.2.4.4) + actionpack (= 5.2.4.4) + actionview (= 5.2.4.4) + activejob (= 5.2.4.4) + activemodel (= 5.2.4.4) + activerecord (= 5.2.4.4) + activestorage (= 5.2.4.4) + activesupport (= 5.2.4.4) + bundler (>= 1.3.0) + railties (= 5.2.4.4) + sprockets-rails (>= 2.0.0) + rails-dom-testing (2.0.3) + activesupport (>= 4.2.0) + nokogiri (>= 1.6) + rails-html-sanitizer (1.3.0) + loofah (~> 2.3) + railties (5.2.4.4) + actionpack (= 5.2.4.4) + activesupport (= 5.2.4.4) + method_source + rake (>= 0.8.7) + thor (>= 0.19.0, < 2.0) + rake (13.0.3) + request_store (1.5.0) + rack (>= 1.4) + sprockets (4.0.2) + concurrent-ruby (~> 1.0) + rack (> 1, < 3) + sprockets-rails (3.2.2) + actionpack (>= 4.0) + activesupport (>= 4.0) + sprockets (>= 3.0.0) + sqlite3 (1.4.2) + thor (1.1.0) + thread_safe (0.3.6) + tzinfo (1.2.9) + thread_safe (~> 0.1) + websocket-driver (0.7.3) + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.5) + +PLATFORMS + ruby + +DEPENDENCIES + appraisal + globalize-accessors! + minitest (~> 5.1) + rails (~> 5.2.0) + rake + sqlite3 + +BUNDLED WITH + 2.1.4 diff --git a/gemfiles/rails_6.0.gemfile b/gemfiles/rails_6.0.gemfile new file mode 100644 index 0000000..15b9b27 --- /dev/null +++ b/gemfiles/rails_6.0.gemfile @@ -0,0 +1,7 @@ +# This file was generated by Appraisal + +source "https://rubygems.org" + +gem "rails", "~> 6.0.0" + +gemspec path: "../" diff --git a/gemfiles/rails_6.0.gemfile.lock b/gemfiles/rails_6.0.gemfile.lock new file mode 100644 index 0000000..ceffae6 --- /dev/null +++ b/gemfiles/rails_6.0.gemfile.lock @@ -0,0 +1,157 @@ +PATH + remote: .. + specs: + globalize-accessors (0.3.0) + globalize (>= 5.0.0) + +GEM + remote: https://rubygems.org/ + specs: + actioncable (6.0.3.4) + actionpack (= 6.0.3.4) + nio4r (~> 2.0) + websocket-driver (>= 0.6.1) + actionmailbox (6.0.3.4) + actionpack (= 6.0.3.4) + activejob (= 6.0.3.4) + activerecord (= 6.0.3.4) + activestorage (= 6.0.3.4) + activesupport (= 6.0.3.4) + mail (>= 2.7.1) + actionmailer (6.0.3.4) + actionpack (= 6.0.3.4) + actionview (= 6.0.3.4) + activejob (= 6.0.3.4) + mail (~> 2.5, >= 2.5.4) + rails-dom-testing (~> 2.0) + actionpack (6.0.3.4) + actionview (= 6.0.3.4) + activesupport (= 6.0.3.4) + rack (~> 2.0, >= 2.0.8) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.2.0) + actiontext (6.0.3.4) + actionpack (= 6.0.3.4) + activerecord (= 6.0.3.4) + activestorage (= 6.0.3.4) + activesupport (= 6.0.3.4) + nokogiri (>= 1.8.5) + actionview (6.0.3.4) + activesupport (= 6.0.3.4) + builder (~> 3.1) + erubi (~> 1.4) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.1, >= 1.2.0) + activejob (6.0.3.4) + activesupport (= 6.0.3.4) + globalid (>= 0.3.6) + activemodel (6.0.3.4) + activesupport (= 6.0.3.4) + activerecord (6.0.3.4) + activemodel (= 6.0.3.4) + activesupport (= 6.0.3.4) + activestorage (6.0.3.4) + actionpack (= 6.0.3.4) + activejob (= 6.0.3.4) + activerecord (= 6.0.3.4) + marcel (~> 0.3.1) + activesupport (6.0.3.4) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 0.7, < 2) + minitest (~> 5.1) + tzinfo (~> 1.1) + zeitwerk (~> 2.2, >= 2.2.2) + appraisal (2.3.0) + bundler + rake + thor (>= 0.14.0) + builder (3.2.4) + concurrent-ruby (1.1.8) + crass (1.0.6) + erubi (1.10.0) + globalid (0.4.2) + activesupport (>= 4.2.0) + globalize (6.0.0) + activemodel (>= 4.2, < 7.0) + activerecord (>= 4.2, < 7.0) + request_store (~> 1.0) + i18n (1.8.7) + concurrent-ruby (~> 1.0) + loofah (2.9.0) + crass (~> 1.0.2) + nokogiri (>= 1.5.9) + mail (2.7.1) + mini_mime (>= 0.1.1) + marcel (0.3.3) + mimemagic (~> 0.3.2) + method_source (1.0.0) + mimemagic (0.3.5) + mini_mime (1.0.2) + minitest (5.14.3) + nio4r (2.5.4) + nokogiri (1.11.1-x86_64-darwin) + racc (~> 1.4) + racc (1.5.2) + rack (2.2.3) + rack-test (1.1.0) + rack (>= 1.0, < 3) + rails (6.0.3.4) + actioncable (= 6.0.3.4) + actionmailbox (= 6.0.3.4) + actionmailer (= 6.0.3.4) + actionpack (= 6.0.3.4) + actiontext (= 6.0.3.4) + actionview (= 6.0.3.4) + activejob (= 6.0.3.4) + activemodel (= 6.0.3.4) + activerecord (= 6.0.3.4) + activestorage (= 6.0.3.4) + activesupport (= 6.0.3.4) + bundler (>= 1.3.0) + railties (= 6.0.3.4) + sprockets-rails (>= 2.0.0) + rails-dom-testing (2.0.3) + activesupport (>= 4.2.0) + nokogiri (>= 1.6) + rails-html-sanitizer (1.3.0) + loofah (~> 2.3) + railties (6.0.3.4) + actionpack (= 6.0.3.4) + activesupport (= 6.0.3.4) + method_source + rake (>= 0.8.7) + thor (>= 0.20.3, < 2.0) + rake (13.0.3) + request_store (1.5.0) + rack (>= 1.4) + sprockets (4.0.2) + concurrent-ruby (~> 1.0) + rack (> 1, < 3) + sprockets-rails (3.2.2) + actionpack (>= 4.0) + activesupport (>= 4.0) + sprockets (>= 3.0.0) + sqlite3 (1.4.2) + thor (1.1.0) + thread_safe (0.3.6) + tzinfo (1.2.9) + thread_safe (~> 0.1) + websocket-driver (0.7.3) + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.5) + zeitwerk (2.4.2) + +PLATFORMS + ruby + +DEPENDENCIES + appraisal + globalize-accessors! + minitest (~> 5.1) + rails (~> 6.0.0) + rake + sqlite3 + +BUNDLED WITH + 2.1.4 diff --git a/gemfiles/rails_6.1.gemfile b/gemfiles/rails_6.1.gemfile new file mode 100644 index 0000000..dd95a47 --- /dev/null +++ b/gemfiles/rails_6.1.gemfile @@ -0,0 +1,7 @@ +# This file was generated by Appraisal + +source "https://rubygems.org" + +gem "rails", "~> 6.1.0" + +gemspec path: "../" diff --git a/gemfiles/rails_6.1.gemfile.lock b/gemfiles/rails_6.1.gemfile.lock new file mode 100644 index 0000000..3c73477 --- /dev/null +++ b/gemfiles/rails_6.1.gemfile.lock @@ -0,0 +1,160 @@ +PATH + remote: .. + specs: + globalize-accessors (0.3.0) + globalize (>= 5.0.0) + +GEM + remote: https://rubygems.org/ + specs: + actioncable (6.1.1) + actionpack (= 6.1.1) + activesupport (= 6.1.1) + nio4r (~> 2.0) + websocket-driver (>= 0.6.1) + actionmailbox (6.1.1) + actionpack (= 6.1.1) + activejob (= 6.1.1) + activerecord (= 6.1.1) + activestorage (= 6.1.1) + activesupport (= 6.1.1) + mail (>= 2.7.1) + actionmailer (6.1.1) + actionpack (= 6.1.1) + actionview (= 6.1.1) + activejob (= 6.1.1) + activesupport (= 6.1.1) + mail (~> 2.5, >= 2.5.4) + rails-dom-testing (~> 2.0) + actionpack (6.1.1) + actionview (= 6.1.1) + activesupport (= 6.1.1) + rack (~> 2.0, >= 2.0.9) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.2.0) + actiontext (6.1.1) + actionpack (= 6.1.1) + activerecord (= 6.1.1) + activestorage (= 6.1.1) + activesupport (= 6.1.1) + nokogiri (>= 1.8.5) + actionview (6.1.1) + activesupport (= 6.1.1) + builder (~> 3.1) + erubi (~> 1.4) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.1, >= 1.2.0) + activejob (6.1.1) + activesupport (= 6.1.1) + globalid (>= 0.3.6) + activemodel (6.1.1) + activesupport (= 6.1.1) + activerecord (6.1.1) + activemodel (= 6.1.1) + activesupport (= 6.1.1) + activestorage (6.1.1) + actionpack (= 6.1.1) + activejob (= 6.1.1) + activerecord (= 6.1.1) + activesupport (= 6.1.1) + marcel (~> 0.3.1) + mimemagic (~> 0.3.2) + activesupport (6.1.1) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 1.6, < 2) + minitest (>= 5.1) + tzinfo (~> 2.0) + zeitwerk (~> 2.3) + appraisal (2.3.0) + bundler + rake + thor (>= 0.14.0) + builder (3.2.4) + concurrent-ruby (1.1.8) + crass (1.0.6) + erubi (1.10.0) + globalid (0.4.2) + activesupport (>= 4.2.0) + globalize (6.0.0) + activemodel (>= 4.2, < 7.0) + activerecord (>= 4.2, < 7.0) + request_store (~> 1.0) + i18n (1.8.7) + concurrent-ruby (~> 1.0) + loofah (2.9.0) + crass (~> 1.0.2) + nokogiri (>= 1.5.9) + mail (2.7.1) + mini_mime (>= 0.1.1) + marcel (0.3.3) + mimemagic (~> 0.3.2) + method_source (1.0.0) + mimemagic (0.3.5) + mini_mime (1.0.2) + minitest (5.14.3) + nio4r (2.5.4) + nokogiri (1.11.1-x86_64-darwin) + racc (~> 1.4) + racc (1.5.2) + rack (2.2.3) + rack-test (1.1.0) + rack (>= 1.0, < 3) + rails (6.1.1) + actioncable (= 6.1.1) + actionmailbox (= 6.1.1) + actionmailer (= 6.1.1) + actionpack (= 6.1.1) + actiontext (= 6.1.1) + actionview (= 6.1.1) + activejob (= 6.1.1) + activemodel (= 6.1.1) + activerecord (= 6.1.1) + activestorage (= 6.1.1) + activesupport (= 6.1.1) + bundler (>= 1.15.0) + railties (= 6.1.1) + sprockets-rails (>= 2.0.0) + rails-dom-testing (2.0.3) + activesupport (>= 4.2.0) + nokogiri (>= 1.6) + rails-html-sanitizer (1.3.0) + loofah (~> 2.3) + railties (6.1.1) + actionpack (= 6.1.1) + activesupport (= 6.1.1) + method_source + rake (>= 0.8.7) + thor (~> 1.0) + rake (13.0.3) + request_store (1.5.0) + rack (>= 1.4) + sprockets (4.0.2) + concurrent-ruby (~> 1.0) + rack (> 1, < 3) + sprockets-rails (3.2.2) + actionpack (>= 4.0) + activesupport (>= 4.0) + sprockets (>= 3.0.0) + sqlite3 (1.4.2) + thor (1.1.0) + tzinfo (2.0.4) + concurrent-ruby (~> 1.0) + websocket-driver (0.7.3) + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.5) + zeitwerk (2.4.2) + +PLATFORMS + ruby + +DEPENDENCIES + appraisal + globalize-accessors! + minitest (~> 5.1) + rails (~> 6.1.0) + rake + sqlite3 + +BUNDLED WITH + 2.1.4 diff --git a/globalize-accessors.gemspec b/globalize-accessors.gemspec index 87918ec..c5c977e 100644 --- a/globalize-accessors.gemspec +++ b/globalize-accessors.gemspec @@ -19,6 +19,7 @@ Gem::Specification.new do |s| s.add_development_dependency "sqlite3" s.add_development_dependency "rake" s.add_development_dependency "minitest", "~> 5.1" + s.add_development_dependency "appraisal" s.files = `git ls-files`.split("\n") s.executables = `git ls-files`.split("\n").map{|f| f =~ /^bin\/(.*)/ ? $1 : nil}.compact From a6463663980569da4b8dc3da7861d7e2dd677847 Mon Sep 17 00:00:00 2001 From: Arkadiy Zabazhanov Date: Tue, 26 Jan 2021 22:22:33 +0300 Subject: [PATCH 3/4] Limit matrix --- .travis.yml | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index a94774b..0dbe9ca 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,15 +1,18 @@ language: ruby sudo: false cache: bundler +before_install: + - "gem install bundler:2.1.4" before_script: - "cp test/db/database.yml.travis test/db/database.yml" script: "bundle exec rake" -gemfile: - - gemfiles/rails_5.2.gemfile - - gemfiles/rails_6.0.gemfile - - gemfiles/rails_6.1.gemfile -rvm: - - 2.5 - - 2.6 - - 2.7 - - 3.0 +jobs: + include: + - rvm: 2.5 + gemfile: gemfiles/rails_5.2.gemfile + - rvm: 2.6 + gemfile: gemfiles/rails_6.0.gemfile + - rvm: 2.7 + gemfile: gemfiles/rails_6.1.gemfile + - rvm: 3.0 + gemfile: gemfiles/rails_6.1.gemfile From 0d699185472d650f34e7e81cd4e7af9d726cbbd9 Mon Sep 17 00:00:00 2001 From: Arkadiy Zabazhanov Date: Wed, 27 Jan 2021 21:32:12 +0300 Subject: [PATCH 4/4] Make sure dirty tracking works in modern Rails --- Appraisals | 4 ++++ lib/globalize-accessors.rb | 19 ++++++++----------- test/globalize_accessors_test.rb | 2 +- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/Appraisals b/Appraisals index ad96dd1..ab4bcdf 100644 --- a/Appraisals +++ b/Appraisals @@ -2,6 +2,10 @@ appraise "rails_5.2" do gem "rails", "~> 5.2.0" end +appraise "rails_6.0" do + gem "rails", "~> 6.0.0" +end + appraise "rails_6.1" do gem "rails", "~> 6.1.0" end diff --git a/lib/globalize-accessors.rb b/lib/globalize-accessors.rb index ff45fb4..510954c 100644 --- a/lib/globalize-accessors.rb +++ b/lib/globalize-accessors.rb @@ -3,13 +3,14 @@ module Globalize::Accessors def globalize_accessors(options = {}) options.reverse_merge!(:locales => I18n.available_locales, :attributes => translated_attribute_names) - class_attribute :globalize_locales, :globalize_attribute_names, :instance_writer => false - - self.globalize_locales = options[:locales] - self.globalize_attribute_names = [] + class_attribute :globalize_locales, default: options[:locales], instance_writer: false + class_attribute :globalize_attribute_names, default: [], instance_writer: false each_attribute_and_locale(options) do |attr_name, locale| + localized_attr_name = localized_attr_name_for(attr_name, locale) + attribute localized_attr_name # needed for dirty tracking define_accessors(attr_name, locale) + self.globalize_attribute_names += [localized_attr_name.to_sym] end include InstanceMethods @@ -27,7 +28,7 @@ def define_accessors(attr_name, locale) end def define_getter(attr_name, locale) - define_method localized_attr_name_for(attr_name, locale) do + generated_attribute_methods.define_method localized_attr_name_for(attr_name, locale) do globalize.stash.contains?(locale, attr_name) ? globalize.send(:fetch_stash, locale, attr_name) : globalize.send(:fetch_attribute, locale, attr_name) end end @@ -35,15 +36,11 @@ def define_getter(attr_name, locale) def define_setter(attr_name, locale) localized_attr_name = localized_attr_name_for(attr_name, locale) - define_method :"#{localized_attr_name}=" do |value| - attribute_will_change!(localized_attr_name) if value != send(localized_attr_name) + generated_attribute_methods.define_method :"#{localized_attr_name}=" do |value| + write_attribute(localized_attr_name, value) # dirty tracking write_attribute(attr_name, value, :locale => locale) translation_for(locale)[attr_name] = value end - if respond_to?(:accessible_attributes) && accessible_attributes.include?(attr_name) - attr_accessible :"#{localized_attr_name}" - end - self.globalize_attribute_names << localized_attr_name.to_sym end def each_attribute_and_locale(options) diff --git a/test/globalize_accessors_test.rb b/test/globalize_accessors_test.rb index 3badc77..d1a60f1 100644 --- a/test/globalize_accessors_test.rb +++ b/test/globalize_accessors_test.rb @@ -192,7 +192,7 @@ def u.globalize_fallbacks(locale) u = Unit.create!(:name_en => "Name en") u.name_en = "New name en" assert u.changed.include?("name_en") - assert ["Name en", "New name en"], u.changes["name_en"] + assert_equal ["Name en", "New name en"], u.changes["name_en"] u.save! assert ! u.changed.include?("name_en") end