fb2b4d8a8a
chore: fix api test conventions chore: rubocop -A spec/ chore: more rubocop -A fix failing test rubocop fixes removes helper methods that are in my opinion dead code more rubocop fixes rubocop -a --auto-gen-config
28 lines
771 B
Ruby
28 lines
771 B
Ruby
module FoodsoftPrinter
|
|
class Engine < ::Rails::Engine
|
|
def navigation(primary, context)
|
|
return unless FoodsoftPrinter.enabled?
|
|
|
|
return if primary[:orders].nil?
|
|
|
|
sub_nav = primary[:orders].sub_navigation
|
|
sub_nav.items <<
|
|
SimpleNavigation::Item.new(primary, :printer_jobs, I18n.t('navigation.orders.printer_jobs'),
|
|
context.printer_jobs_path)
|
|
end
|
|
|
|
def default_foodsoft_config(cfg)
|
|
cfg[:use_printer] = false
|
|
end
|
|
|
|
initializer 'foodsoft_printer.order_printer_jobs' do |_app|
|
|
if Rails.configuration.cache_classes
|
|
OrderPrinterJobs.install
|
|
else
|
|
ActiveSupport::Reloader.to_prepare do
|
|
OrderPrinterJobs.install
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|