0
私は自分のカスタム計算機を追加しています。これを正しく組み立てる方法は全く分かりません。Spreeで手作りのエクステンションを正しく読み込む方法
I'm sort of copying someone who had done the same thingですが、公式のインストールプロセスには適用されません。
マイファイルの構造が非常にシンプルになります。
/extensions/
calculators_extension.rb
app/
models/
calculators/
per_weight.rb
マイpreinitializer.rb負荷ようにそれら:
SPREE_EXTENSIONS_LOAD_ORDER = [:aged_revolt, :localization, :calculators, :theme_default]
calculators_extension.rb
def self.activate
Dir.glob(File.join(File.dirname(__FILE__), "../app/**/*_decorator*.rb")) do |c|
Rails.env.production? ? require(c) : load(c)
end
Calculator::PerWeight.register
end
この戻り、この:
/Users/macuser/Sites/age_of_revolt/aged_revolt/lib/aged_revolt.rb:14:in `activate': uninitialized constant Calculator::PerWeight (NameError)
私は何が欠けていますか?
Ha私はそれだけではなく、すべてのものの王子ルビーあなたに大きな賞賛を考え出した。ありがとう! – Trip