Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undefined method `translated_attribute_names' for #<Class:0x00007fb075953c60> #83

Open
poudelprakash opened this issue Feb 2, 2021 · 1 comment

Comments

@poudelprakash
Copy link

Getting folllowing error with latest version of thsis library,
Url:http://localhost:3000/admin/stores/1/translations

Showing /Users/prakash/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/bundler/gems/spree_globalize-5e2e8134c9f5/app/views/spree/admin/translations/_fields.html.erb where line #6 raised:

undefined method `translated_attribute_names' for

@channainfo
Copy link

channainfo commented Feb 5, 2021

@poudelprakash I had the same problem. I saw in this commit 253c308#diff-bfcf2ccfee02d99bd3b0b4932ca981983bf2a6edd40ebbead62e29c3b68649e2 the store_decorator was deleted. it raised error because Store model no longer has translated_attribute_names.

After putting this back

module Spree::StoreDecorator	
  def self.prepended(base)	
    base.translates :name, :meta_description, :meta_keywords, :seo_title, fallbacks_for_empty_translations: true	
  end	

  Spree::Store.include SpreeGlobalize::Translatable	
end	

::Spree::Store.prepend(Spree::StoreDecorator)

it works.

Store translation might be removed in favor of the default locale in the store model. For temporary fix you just need to add decorator to the store.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants