spree-multi-domain icon indicating copy to clipboard operation
spree-multi-domain copied to clipboard

current method in Tracker decorator have conflict with the method in Spree core

Open sanchojaf opened this issue 9 years ago • 1 comments

current method in Tracker decorator have conflict with the method in Spree core

ArgumentError - wrong number of arguments (0 for 1): /spree-multi-domain/app/models/spree/tracker_decorator.rb:4:in current' app/views/spree/shared/_google_analytics.html.erb:1:in_a7721bcc461d6fdcbf5840cd55249711' actionview (4.1.4) lib/action_view/template.rb:145:in `block in render'

sanchojaf avatar Sep 27 '14 21:09 sanchojaf

Correct. At least tracker_decorator should implement the current method like that:

def self.current(domain = nil)
    domain ||= Spree::Store.current.url
    Spree::Tracker.where(:active => true, :environment => Rails.env).joins(:store).where("spree_stores.url LIKE ?", "%#{domain}%").first
end

See pull request #110

schmijos avatar Nov 25 '14 14:11 schmijos