Skip to content

Commit

Permalink
Remove deprecated mails_from preference
Browse files Browse the repository at this point in the history
Please, use Spree::Store#mail_from_address now.

Ref solidusio#4712
  • Loading branch information
kennyadsl committed Apr 18, 2023
1 parent 74cd8ee commit ee2ed80
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 30 deletions.
14 changes: 0 additions & 14 deletions core/lib/spree/app_configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -207,20 +207,6 @@ def allow_promotions_any_match_policy=(value)
# entity expansion attacks.
preference :log_entry_allow_aliases, :boolean, default: true

# @!attribute [rw] mails_from
# @return [String] Email address used as +From:+ field in transactional emails.
# @deprecated Spree::Store#mail_from_address is used instead
preference :mails_from, :string, default: '[email protected]'
def mails_from=(value)
Spree::Deprecation.warn(<<~MSG) && preferences[:mail_from] = value
Solidus doesn't use `Spree::Config.mails_from` preference and it'll
removed on the next major release. Please, remove its definition in
`config/initializers/spree.rb`. Use the `Spree::Store#mail_from_address`
attribute for the default email address used as the 'From:' field in
transactional emails.
MSG
end

# @!attribute [rw] max_level_in_taxons_menu
# @return [Integer] maximum nesting level in taxons menu (default: +1+)
preference :max_level_in_taxons_menu, :integer, default: 1
Expand Down
16 changes: 0 additions & 16 deletions core/spec/lib/spree/app_configuration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -161,20 +161,4 @@ class DummyClass; end;
it 'has default Event adapter' do
expect(prefs.events.adapter).to eq Spree::Event::Adapters::ActiveSupportNotifications
end

context 'mails_from' do
it 'is deprecated' do
expect(Spree::Deprecation).to receive(:warn).with(/Solidus doesn't use `Spree::Config.mails_from`/)

prefs.mails_from=('[email protected]')
end

it "still sets the value so that consumers aren't broken" do
Spree::Deprecation.silence do
prefs.mails_from=('[email protected]')
end

expect(prefs.mails_from).to eq('[email protected]')
end
end
end

0 comments on commit ee2ed80

Please sign in to comment.