4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
# File 'app/models/spree/tracker.rb', line 4
def self.current(store = nil)
return if !store
if store.is_a?(Spree::Store)
Spree::Tracker.where(active: true, store_id: store).first
else
ActiveSupport::Deprecation.warn " Calling Spree::Tracker.current with a string is DEPRECATED. Instead\n pass it an instance of Spree::Store.\n EOS\n Spree::Tracker.where(active: true).joins(:store).where(\n \"spree_stores.code = ? OR spree_stores.url LIKE ?\",\n store, \"%\#{store}%\"\n ).first\n end\nend\n".squish, caller
|