Skip to content

Commit

Permalink
Merge pull request #4072 from nebulab/waiting-for-dev/ruby3
Browse files Browse the repository at this point in the history
Support Ruby 3
  • Loading branch information
kennyadsl authored May 25, 2021
2 parents db980e6 + 5f35714 commit d6e84ec
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
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

0 comments on commit d6e84ec

Please sign in to comment.