Skip to content

Commit ad1211e

Browse files
DanielePalombokennyadsl
authored andcommitted
Remove deprecated method Spree::Store.by_url
solidusio#2041
1 parent ca52d53 commit ad1211e

File tree

2 files changed

+0
-28
lines changed

2 files changed

+0
-28
lines changed

core/app/models/spree/store.rb

-6
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,6 @@ class Store < Spree::Base
2525
before_save :ensure_default_exists_and_is_unique
2626
before_destroy :validate_not_default
2727

28-
scope :by_url, lambda { |url| where("url like ?", "%#{url}%") }
29-
30-
class << self
31-
deprecate by_url: "Spree::Store.by_url is DEPRECATED", deprecator: Spree::Deprecation
32-
end
33-
3428
def available_locales
3529
locales = super()
3630
if locales

core/spec/models/spree/store_spec.rb

-22
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,8 @@
33
require 'rails_helper'
44

55
RSpec.describe Spree::Store, type: :model do
6-
before do
7-
allow(Spree::Deprecation).to receive(:warn).
8-
with(/^by_url is deprecated and will be removed/, any_args)
9-
end
10-
116
it { is_expected.to respond_to(:cart_tax_country_iso) }
127

13-
describe ".by_url (deprecated)" do
14-
let!(:store) { create(:store, url: "website1.com\nwww.subdomain.com") }
15-
let!(:store_2) { create(:store, url: 'freethewhales.com') }
16-
17-
before do
18-
expect(Spree::Deprecation).to receive(:warn).
19-
with(/^by_url is deprecated and will be removed/, any_args)
20-
end
21-
22-
it "should find stores by url" do
23-
by_domain = Spree::Store.by_url('www.subdomain.com')
24-
25-
expect(by_domain).to include(store)
26-
expect(by_domain).not_to include(store_2)
27-
end
28-
end
29-
308
describe ".default" do
319
it "should ensure saved store becomes default if one doesn't exist yet" do
3210
expect(Spree::Store.where(default: true).count).to eq(0)

0 commit comments

Comments
 (0)