Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Ruby 3 #4072

Merged
merged 1 commit into from
May 25, 2021
Merged
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
5 changes: 2 additions & 3 deletions core/app/models/spree/return_item.rb
Original file line number Diff line number Diff line change
Expand Up @@ -254,10 +254,9 @@ def validate_no_other_completed_return_items
}).where.not(id: id).first

if other_return_item && (new_record? || COMPLETED_RECEPTION_STATUSES.include?(reception_status.to_sym))
errors.add(:inventory_unit, :other_completed_return_item_exists, {
errors.add(:inventory_unit, :other_completed_return_item_exists,
inventory_unit_id: inventory_unit_id,
return_item_id: other_return_item.id
})
return_item_id: other_return_item.id)
end
end

Expand Down
2 changes: 1 addition & 1 deletion core/lib/spree/core/validators/email.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class EmailValidator < ActiveModel::EachValidator

def validate_each(record, attribute, value)
unless EMAIL_REGEXP.match? value
record.errors.add(attribute, :invalid, { value: value }.merge!(options))
record.errors.add(attribute, :invalid, **{ value: value }.merge!(options))
end
end
end
Expand Down
8 changes: 7 additions & 1 deletion core/spec/models/spree/store_credit_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,13 @@

subject { store_credit.validate_authorization(store_credit_attrs[:amount], store_credit.currency) }

it { is_expected.to be_truthy }
if RUBY_VERSION >= "3"
pending "https://github.com/rails/rails/issues/42098" do
it { is_expected.to be_truthy }
end
else
it { is_expected.to be_truthy }
end
end
end

Expand Down