From 3d54a07a0bacd0ed3e63e485e22bb79d515c9953 Mon Sep 17 00:00:00 2001 From: Ben Langfeld Date: Fri, 6 Sep 2024 10:54:41 -0300 Subject: [PATCH 1/2] Test use of attribute aliases See https://github.com/rpush/rpush/pull/675 --- spec/attribute_spec.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/spec/attribute_spec.rb b/spec/attribute_spec.rb index bebc6c2..c783aa2 100644 --- a/spec/attribute_spec.rb +++ b/spec/attribute_spec.rb @@ -14,6 +14,8 @@ class MockModel attribute :array, :array attribute :hash, :hash attribute :string_or_hash, %i[string hash] + + alias_attribute :proportion, :percentage end end @@ -25,6 +27,11 @@ class MockModel expect(model.name).to eq('bar') end + it 'defines attribute aliases' do + model.percentage = 18.6 + expect(model.proportion).to eq(18.6) + end + it 'applies an default value' do expect(model.name).to eq('Janet') expect(model.age).to eq(60) From b1f8c799cf2afc9cf71b6847dfe1fc8de07844eb Mon Sep 17 00:00:00 2001 From: Ben Langfeld Date: Mon, 9 Sep 2024 09:21:53 -0300 Subject: [PATCH 2/2] Rails 7.1.4 is broken Pending release of https://github.com/rails/rails/commit/139cca982ceb2f80b016642c72bbd7ad8d088efe so that 7.1.5 will work. --- Appraisals | 4 ++-- gemfiles/rails_7.1.gemfile | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Appraisals b/Appraisals index 67edb04..39d12ac 100644 --- a/Appraisals +++ b/Appraisals @@ -21,6 +21,6 @@ appraise 'rails-7.0' do end appraise 'rails-7.1' do - gem 'activemodel', '~> 7.1.0' - gem 'activesupport', '~> 7.1.0' + gem 'activemodel', '~> 7.1.0', '!= 7.1.4' # https://github.com/rails/rails/issues/52820 + gem 'activesupport', '~> 7.1.0', '!= 7.1.4' # https://github.com/rails/rails/issues/52820 end diff --git a/gemfiles/rails_7.1.gemfile b/gemfiles/rails_7.1.gemfile index cf0b8c9..c812a3c 100644 --- a/gemfiles/rails_7.1.gemfile +++ b/gemfiles/rails_7.1.gemfile @@ -2,7 +2,7 @@ source "https://rubygems.org" -gem "activemodel", "~> 7.1.0" -gem "activesupport", "~> 7.1.0" +gem "activemodel", "~> 7.1.0", "!= 7.1.4" +gem "activesupport", "~> 7.1.0", "!= 7.1.4" gemspec path: "../"