Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Appraisals
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ 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

appraise 'rails-7.2' do
Expand Down
4 changes: 2 additions & 2 deletions gemfiles/rails_7.1.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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: "../"
7 changes: 7 additions & 0 deletions spec/attribute_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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)
Expand Down