Created
March 23, 2017 13:34
-
-
Save bofrede/1f353e23b58eb6df90601eaad532b450 to your computer and use it in GitHub Desktop.
Fixes for Solidus with Solidus Globalize
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spree/product' | |
require 'solidus_globalize/fallbacks' | |
module Spree | |
Product.class_eval do | |
# Fix for method not found find_by_slug | |
def self.find_by_slug(slug) | |
translation = Product::Translation.find_by_slug(slug) | |
find(translation.spree_product_id) | |
end | |
end | |
Taxon.class_eval do | |
# Fix for method not found find_by_permalink! | |
def self.find_by_permalink!(permalink) | |
translation = Spree::Taxon::Translation.find_by_permalink!(permalink) | |
find(translation.spree_taxon_id) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment