chore: rubocop
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
This commit is contained in:
parent
f6fb804bbe
commit
fb2b4d8a8a
331 changed files with 4263 additions and 4507 deletions
|
|
@ -29,12 +29,14 @@ module Foodsoft
|
|||
|
||||
# Internationalization.
|
||||
config.i18n.load_path += Dir[Rails.root.join('config', 'locales', '*.yml')]
|
||||
config.i18n.available_locales = Pathname.glob(Rails.root.join('config', 'locales', '{??,???}{-*,}.yml')).map { |p| p.basename('.yml').to_s }
|
||||
config.i18n.available_locales = Pathname.glob(Rails.root.join('config', 'locales', '{??,???}{-*,}.yml')).map do |p|
|
||||
p.basename('.yml').to_s
|
||||
end
|
||||
config.i18n.default_locale = :en
|
||||
config.i18n.fallbacks = [:en]
|
||||
|
||||
# Configure the default encoding used in templates for Ruby 1.9.
|
||||
config.encoding = "utf-8"
|
||||
config.encoding = 'utf-8'
|
||||
|
||||
# Enable escaping HTML in JSON.
|
||||
config.active_support.escape_html_entities_in_json = true
|
||||
|
|
@ -44,7 +46,7 @@ module Foodsoft
|
|||
# like if you have constraints or database-specific column types
|
||||
# config.active_record.schema_format = :sql
|
||||
|
||||
# TODO Disable this. Uncommenting this line will currently cause rspec to fail.
|
||||
# TODO: Disable this. Uncommenting this line will currently cause rspec to fail.
|
||||
config.action_controller.permit_all_parameters = true
|
||||
|
||||
config.active_job.queue_adapter = :resque
|
||||
|
|
@ -82,5 +84,9 @@ module Foodsoft
|
|||
# Foodsoft version
|
||||
VERSION = Rails.root.join('VERSION').read.strip
|
||||
# Current revision, or +nil+
|
||||
REVISION = (Rails.root.join('REVISION').read.strip rescue nil)
|
||||
REVISION = begin
|
||||
Rails.root.join('REVISION').read.strip
|
||||
rescue StandardError
|
||||
nil
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
require "active_support/core_ext/integer/time"
|
||||
require 'active_support/core_ext/integer/time'
|
||||
|
||||
# Foodsoft production configuration.
|
||||
#
|
||||
|
|
@ -51,7 +51,7 @@ Rails.application.configure do
|
|||
# config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ]
|
||||
|
||||
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
||||
config.force_ssl = ENV["RAILS_FORCE_SSL"] != "false"
|
||||
config.force_ssl = ENV['RAILS_FORCE_SSL'] != 'false'
|
||||
|
||||
# Include generic and useful information about system operation, but avoid logging too much
|
||||
# information to avoid inadvertent exposure of personally identifiable information (PII).
|
||||
|
|
@ -97,9 +97,18 @@ Rails.application.configure do
|
|||
config.action_mailer.smtp_settings[:domain] = ENV['SMTP_DOMAIN'] if ENV['SMTP_DOMAIN'].present?
|
||||
config.action_mailer.smtp_settings[:user_name] = ENV['SMTP_USER_NAME'] if ENV['SMTP_USER_NAME'].present?
|
||||
config.action_mailer.smtp_settings[:password] = ENV['SMTP_PASSWORD'] if ENV['SMTP_PASSWORD'].present?
|
||||
config.action_mailer.smtp_settings[:authentication] = ENV['SMTP_AUTHENTICATION'] if ENV['SMTP_AUTHENTICATION'].present?
|
||||
config.action_mailer.smtp_settings[:enable_starttls_auto] = ENV['SMTP_ENABLE_STARTTLS_AUTO'] == 'true' if ENV['SMTP_ENABLE_STARTTLS_AUTO'].present?
|
||||
config.action_mailer.smtp_settings[:openssl_verify_mode] = ENV['SMTP_OPENSSL_VERIFY_MODE'] if ENV['SMTP_OPENSSL_VERIFY_MODE'].present?
|
||||
if ENV['SMTP_AUTHENTICATION'].present?
|
||||
config.action_mailer.smtp_settings[:authentication] =
|
||||
ENV['SMTP_AUTHENTICATION']
|
||||
end
|
||||
if ENV['SMTP_ENABLE_STARTTLS_AUTO'].present?
|
||||
config.action_mailer.smtp_settings[:enable_starttls_auto] =
|
||||
ENV['SMTP_ENABLE_STARTTLS_AUTO'] == 'true'
|
||||
end
|
||||
if ENV['SMTP_OPENSSL_VERIFY_MODE'].present?
|
||||
config.action_mailer.smtp_settings[:openssl_verify_mode] =
|
||||
ENV['SMTP_OPENSSL_VERIFY_MODE']
|
||||
end
|
||||
else
|
||||
# Use sendmail as default to avoid ssl cert problems
|
||||
config.action_mailer.delivery_method = :sendmail
|
||||
|
|
@ -112,7 +121,7 @@ Rails.application.configure do
|
|||
# require 'syslog/logger'
|
||||
# config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
|
||||
|
||||
if ENV["RAILS_LOG_TO_STDOUT"].present?
|
||||
if ENV['RAILS_LOG_TO_STDOUT'].present?
|
||||
logger = ActiveSupport::Logger.new(STDOUT)
|
||||
logger.formatter = config.log_formatter
|
||||
config.logger = ActiveSupport::TaggedLogging.new(logger)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
require "active_support/core_ext/integer/time"
|
||||
require 'active_support/core_ext/integer/time'
|
||||
|
||||
# The test environment is used exclusively to run your application's
|
||||
# test suite. You never need to work with it otherwise. Remember that
|
||||
|
|
@ -14,12 +14,12 @@ Rails.application.configure do
|
|||
# Eager loading loads your whole application. When running a single test locally,
|
||||
# this probably isn't necessary. It's a good idea to do in a continuous integration
|
||||
# system, or in some way before deploying your code.
|
||||
config.eager_load = ENV["CI"].present?
|
||||
config.eager_load = ENV['CI'].present?
|
||||
|
||||
# Configure public file server for tests with Cache-Control for performance.
|
||||
config.public_file_server.enabled = true
|
||||
config.public_file_server.headers = {
|
||||
"Cache-Control" => "public, max-age=#{1.hour.to_i}"
|
||||
'Cache-Control' => "public, max-age=#{1.hour.to_i}"
|
||||
}
|
||||
|
||||
# Show full error reports and disable caching.
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
# have it shown in all other languages too
|
||||
I18n.available_locales.each do |locale|
|
||||
unless locale == I18n.default_locale
|
||||
I18n.backend.store_translations(locale, number: { currency: { format: { unit: nil } } })
|
||||
I18n.backend.store_translations(locale,
|
||||
number: { currency: { format: { unit: nil } } })
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ Doorkeeper.configure do
|
|||
# http://tools.ietf.org/html/rfc6819#section-4.4.2
|
||||
# http://tools.ietf.org/html/rfc6819#section-4.4.3
|
||||
#
|
||||
grant_flows %w(authorization_code implicit password)
|
||||
grant_flows %w[authorization_code implicit password]
|
||||
|
||||
# Under some circumstances you might want to have applications auto-approved,
|
||||
# so that the user skips the authorization step.
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ ExceptionNotification.configure do |config|
|
|||
|
||||
# Adds a condition to decide when an exception must be ignored or not.
|
||||
# The ignore_if method can be invoked multiple times to add extra conditions.
|
||||
config.ignore_if do |exception, options|
|
||||
config.ignore_if do |_exception, _options|
|
||||
Rails.env.development? || Rails.env.test?
|
||||
end
|
||||
|
||||
|
|
@ -23,9 +23,9 @@ ExceptionNotification.configure do |config|
|
|||
# Email notifier sends notifications by email.
|
||||
if notification = FoodsoftConfig[:notification]
|
||||
config.add_notifier :email, {
|
||||
:email_prefix => notification[:email_prefix],
|
||||
:sender_address => notification[:sender_address],
|
||||
:exception_recipients => notification[:error_recipients],
|
||||
email_prefix: notification[:email_prefix],
|
||||
sender_address: notification[:sender_address],
|
||||
exception_recipients: notification[:error_recipients]
|
||||
}
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
class String
|
||||
# remove comma from decimal inputs
|
||||
def self.delocalized_decimal(string)
|
||||
if !string.blank? and string.is_a?(String)
|
||||
if string.present? and string.is_a?(String)
|
||||
BigDecimal(string.sub(',', '.'))
|
||||
else
|
||||
string
|
||||
|
|
@ -13,6 +13,6 @@ end
|
|||
class Array
|
||||
def cumulative_sum
|
||||
csum = 0
|
||||
self.map { |val| csum += val }
|
||||
map { |val| csum += val }
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -3,6 +3,6 @@
|
|||
# Configure parameters to be filtered from the log file. Use this to limit dissemination of
|
||||
# sensitive information. See the ActiveSupport::ParameterFilter documentation for supported
|
||||
# notations and behaviors.
|
||||
Rails.application.config.filter_parameters += [
|
||||
:passw, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn
|
||||
Rails.application.config.filter_parameters += %i[
|
||||
passw secret token _key crypt salt certificate otp ssn
|
||||
]
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
# Increase key space for post request.
|
||||
# Warning, this is dangerous. See http://stackoverflow.com/questions/12243694/getting-error-exceeded-available-parameter-key-space
|
||||
Rack::Utils.key_space_limit = 262144
|
||||
Rack::Utils.key_space_limit = 262_144
|
||||
|
|
|
|||
|
|
@ -2,28 +2,28 @@
|
|||
|
||||
if defined? RubyUnits
|
||||
RubyUnits::Unit.redefine!('liter') do |unit|
|
||||
unit.aliases += %w{ltr}
|
||||
unit.aliases += %w[ltr]
|
||||
end
|
||||
|
||||
RubyUnits::Unit.redefine!('kilogram') do |unit|
|
||||
unit.aliases += %w{KG}
|
||||
unit.aliases += %w[KG]
|
||||
end
|
||||
|
||||
RubyUnits::Unit.redefine!('gram') do |unit|
|
||||
unit.aliases += %w{gr}
|
||||
unit.aliases += %w[gr]
|
||||
end
|
||||
|
||||
RubyUnits::Unit.define('piece') do |unit|
|
||||
unit.definition = RubyUnits::Unit.new('1 each')
|
||||
unit.aliases = %w{pc pcs piece pieces} # locale: en
|
||||
unit.aliases += %w{st stuk stuks} # locale: nl
|
||||
unit.aliases = %w[pc pcs piece pieces] # locale: en
|
||||
unit.aliases += %w[st stuk stuks] # locale: nl
|
||||
unit.kind = :counting
|
||||
end
|
||||
|
||||
RubyUnits::Unit.define('bag') do |unit|
|
||||
unit.definition = RubyUnits::Unit.new('1 each')
|
||||
unit.aliases = %w{bag bags blt sachet sachets} # locale: en
|
||||
unit.aliases += %w{zak zakken zakje zakjes} # locale: nl
|
||||
unit.aliases = %w[bag bags blt sachet sachets] # locale: en
|
||||
unit.aliases += %w[zak zakken zakje zakjes] # locale: nl
|
||||
unit.kind = :counting
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -8,12 +8,12 @@ Foodsoft::Application.config.secret_key_base = begin
|
|||
if (token = ENV.fetch('SECRET_KEY_BASE', nil)).present?
|
||||
token
|
||||
elsif Rails.env.production? || Rails.env.staging?
|
||||
raise "You must set SECRET_KEY_BASE"
|
||||
raise 'You must set SECRET_KEY_BASE'
|
||||
elsif Rails.env.test?
|
||||
SecureRandom.hex(30) # doesn't really matter
|
||||
else
|
||||
sf = Rails.root.join('tmp', 'secret_key_base')
|
||||
if File.exists?(sf)
|
||||
if File.exist?(sf)
|
||||
File.read(sf)
|
||||
else
|
||||
puts "=> Generating initial SECRET_KEY_BASE in #{sf}"
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
module ActionDispatch
|
||||
module Session
|
||||
class SlugCookieStore < CookieStore
|
||||
alias_method :orig_set_cookie, :set_cookie
|
||||
alias orig_set_cookie set_cookie
|
||||
|
||||
def set_cookie(request, session_id, cookie)
|
||||
if script_name = FoodsoftConfig[:script_name]
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ SimpleForm.setup do |config|
|
|||
end
|
||||
end
|
||||
|
||||
config.wrappers :prepend, tag: 'div', class: "control-group", error_class: 'error' do |b|
|
||||
config.wrappers :prepend, tag: 'div', class: 'control-group', error_class: 'error' do |b|
|
||||
b.use :html5
|
||||
b.use :placeholder
|
||||
b.use :label
|
||||
|
|
@ -24,7 +24,7 @@ SimpleForm.setup do |config|
|
|||
end
|
||||
end
|
||||
|
||||
config.wrappers :append, tag: 'div', class: "control-group", error_class: 'error' do |b|
|
||||
config.wrappers :append, tag: 'div', class: 'control-group', error_class: 'error' do |b|
|
||||
b.use :html5
|
||||
b.use :placeholder
|
||||
b.use :label
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
# config/initializers/zeitwerk.rb
|
||||
ActiveSupport::Dependencies
|
||||
.autoload_paths
|
||||
.delete("#{Rails.root}/app/controllers/concerns")
|
||||
|
||||
.delete(Rails.root.join('app/controllers/concerns').to_s)
|
||||
|
|
|
|||
|
|
@ -21,31 +21,44 @@ SimpleNavigation::Configuration.run do |navigation|
|
|||
primary.item :orders, I18n.t('navigation.orders.title'), '#' do |subnav|
|
||||
subnav.item :ordering, I18n.t('navigation.orders.ordering'), group_orders_path
|
||||
subnav.item :ordering_archive, I18n.t('navigation.orders.archive'), archive_group_orders_path
|
||||
subnav.item :orders, I18n.t('navigation.orders.manage'), orders_path, if: Proc.new { current_user.role_orders? }
|
||||
subnav.item :pickups, I18n.t('navigation.orders.pickups'), pickups_path, if: Proc.new { current_user.role_pickups? }
|
||||
subnav.item :orders, I18n.t('navigation.orders.manage'), orders_path, if: proc { current_user.role_orders? }
|
||||
subnav.item :pickups, I18n.t('navigation.orders.pickups'), pickups_path, if: proc {
|
||||
current_user.role_pickups?
|
||||
}
|
||||
end
|
||||
|
||||
primary.item :articles, I18n.t('navigation.articles.title'), '#',
|
||||
if: Proc.new { current_user.role_article_meta? or current_user.role_suppliers? } do |subnav|
|
||||
if: proc { current_user.role_article_meta? or current_user.role_suppliers? } do |subnav|
|
||||
subnav.item :suppliers, I18n.t('navigation.articles.suppliers'), suppliers_path
|
||||
subnav.item :stockit, I18n.t('navigation.articles.stock'), stock_articles_path
|
||||
subnav.item :categories, I18n.t('navigation.articles.categories'), article_categories_path
|
||||
end
|
||||
|
||||
primary.item :finance, I18n.t('navigation.finances.title'), '#', if: Proc.new { current_user.role_finance? || current_user.role_invoices? } do |subnav|
|
||||
subnav.item :finance_home, I18n.t('navigation.finances.home'), finance_root_path, if: Proc.new { current_user.role_finance? }
|
||||
subnav.item :finance_home, I18n.t('navigation.finances.bank_accounts'), finance_bank_accounts_path, if: Proc.new { current_user.role_finance? }
|
||||
subnav.item :accounts, I18n.t('navigation.finances.accounts'), finance_ordergroups_path, if: Proc.new { current_user.role_finance? }
|
||||
subnav.item :balancing, I18n.t('navigation.finances.balancing'), finance_order_index_path, if: Proc.new { current_user.role_finance? }
|
||||
primary.item :finance, I18n.t('navigation.finances.title'), '#', if: proc {
|
||||
current_user.role_finance? || current_user.role_invoices?
|
||||
} do |subnav|
|
||||
subnav.item :finance_home, I18n.t('navigation.finances.home'), finance_root_path, if: proc {
|
||||
current_user.role_finance?
|
||||
}
|
||||
subnav.item :finance_home, I18n.t('navigation.finances.bank_accounts'), finance_bank_accounts_path, if: proc {
|
||||
current_user.role_finance?
|
||||
}
|
||||
subnav.item :accounts, I18n.t('navigation.finances.accounts'), finance_ordergroups_path, if: proc {
|
||||
current_user.role_finance?
|
||||
}
|
||||
subnav.item :balancing, I18n.t('navigation.finances.balancing'), finance_order_index_path, if: proc {
|
||||
current_user.role_finance?
|
||||
}
|
||||
subnav.item :invoices, I18n.t('navigation.finances.invoices'), finance_invoices_path
|
||||
end
|
||||
|
||||
primary.item :admin, I18n.t('navigation.admin.title'), '#', if: Proc.new { current_user.role_admin? } do |subnav|
|
||||
primary.item :admin, I18n.t('navigation.admin.title'), '#', if: proc { current_user.role_admin? } do |subnav|
|
||||
subnav.item :admin_home, I18n.t('navigation.admin.home'), admin_root_path
|
||||
subnav.item :users, I18n.t('navigation.admin.users'), admin_users_path
|
||||
subnav.item :ordergroups, I18n.t('navigation.admin.ordergroups'), admin_ordergroups_path
|
||||
subnav.item :workgroups, I18n.t('navigation.admin.workgroups'), admin_workgroups_path
|
||||
subnav.item :mail_delivery_status, I18n.t('navigation.admin.mail_delivery_status'), admin_mail_delivery_status_index_path
|
||||
subnav.item :mail_delivery_status, I18n.t('navigation.admin.mail_delivery_status'),
|
||||
admin_mail_delivery_status_index_path
|
||||
subnav.item :finances, I18n.t('navigation.admin.finance'), admin_finances_path
|
||||
subnav.item :config, I18n.t('navigation.admin.config'), admin_config_path
|
||||
end
|
||||
|
|
|
|||
|
|
@ -4,19 +4,19 @@
|
|||
# the maximum value specified for Puma. Default is set to 5 threads for minimum
|
||||
# and maximum; this matches the default thread size of Active Record.
|
||||
#
|
||||
threads_count = ENV.fetch("RAILS_MAX_THREADS") { 1 }
|
||||
threads_count = ENV.fetch('RAILS_MAX_THREADS') { 1 }
|
||||
threads threads_count, threads_count
|
||||
|
||||
# Specifies the `port` that Puma will listen on to receive requests; default is 3000.
|
||||
#
|
||||
port ENV.fetch("PORT") { 3000 }
|
||||
port ENV.fetch('PORT') { 3000 }
|
||||
|
||||
# Bind automatically to all systemd activated sockets
|
||||
bind_to_activated_sockets
|
||||
|
||||
# Specifies the `environment` that Puma will run in.
|
||||
#
|
||||
environment ENV.fetch("RAILS_ENV") { "development" }
|
||||
environment ENV.fetch('RAILS_ENV') { 'development' }
|
||||
|
||||
# Specifies the number of `workers` to boot in clustered mode.
|
||||
# Workers are forked webserver processes. If using threads and workers together
|
||||
|
|
@ -24,7 +24,7 @@ environment ENV.fetch("RAILS_ENV") { "development" }
|
|||
# Workers do not work on JRuby or Windows (both of which do not support
|
||||
# processes).
|
||||
#
|
||||
workers ENV.fetch("WEB_CONCURRENCY") { 8 }
|
||||
workers ENV.fetch('WEB_CONCURRENCY') { 8 }
|
||||
|
||||
# Use the `preload_app!` method when specifying a `workers` number.
|
||||
# This directive tells Puma to first boot the application and load code
|
||||
|
|
|
|||
|
|
@ -2,11 +2,11 @@
|
|||
Rails.application.routes.draw do
|
||||
mount Rswag::Ui::Engine => '/api-docs'
|
||||
mount Rswag::Api::Engine => '/api-docs'
|
||||
get "order_comments/new"
|
||||
get 'order_comments/new'
|
||||
|
||||
get "comments/new"
|
||||
get 'comments/new'
|
||||
|
||||
get "sessions/new"
|
||||
get 'sessions/new'
|
||||
|
||||
root to: 'sessions#redirect_to_foodcoop', as: nil
|
||||
|
||||
|
|
@ -24,8 +24,8 @@ Rails.application.routes.draw do
|
|||
post '/login/reset_password' => 'login#reset_password', as: :reset_password
|
||||
get '/login/new_password' => 'login#new_password', as: :new_password
|
||||
patch '/login/update_password' => 'login#update_password', as: :update_password
|
||||
match '/login/accept_invitation/:token' => 'login#accept_invitation', as: :accept_invitation, via: [:get, :post]
|
||||
resources :sessions, only: [:new, :create, :destroy]
|
||||
match '/login/accept_invitation/:token' => 'login#accept_invitation', as: :accept_invitation, via: %i[get post]
|
||||
resources :sessions, only: %i[new create destroy]
|
||||
|
||||
get '/foodcoop.css' => 'styles#foodcoop', as: 'foodcoop_css'
|
||||
|
||||
|
|
@ -65,11 +65,11 @@ Rails.application.routes.draw do
|
|||
|
||||
resources :group_order_articles
|
||||
|
||||
resources :order_comments, only: [:new, :create]
|
||||
resources :order_comments, only: %i[new create]
|
||||
|
||||
############ Foodcoop orga
|
||||
|
||||
resources :invites, only: [:new, :create]
|
||||
resources :invites, only: %i[new create]
|
||||
|
||||
resources :tasks do
|
||||
collection do
|
||||
|
|
@ -91,7 +91,7 @@ Rails.application.routes.draw do
|
|||
|
||||
resources :ordergroups, only: [:index]
|
||||
|
||||
resources :workgroups, only: [:index, :edit, :update]
|
||||
resources :workgroups, only: %i[index edit update]
|
||||
end
|
||||
|
||||
########### Article management
|
||||
|
|
@ -175,7 +175,7 @@ Rails.application.routes.draw do
|
|||
get :unpaid, on: :collection
|
||||
end
|
||||
|
||||
resources :links, controller: 'financial_links', only: [:create, :show] do
|
||||
resources :links, controller: 'financial_links', only: %i[create show] do
|
||||
collection do
|
||||
get :incomplete
|
||||
end
|
||||
|
|
@ -185,8 +185,10 @@ Rails.application.routes.draw do
|
|||
delete 'bank_transactions/:bank_transaction', action: 'remove_bank_transaction', as: 'remove_bank_transaction'
|
||||
|
||||
get :index_financial_transaction
|
||||
put 'financial_transactions/:financial_transaction', action: 'add_financial_transaction', as: 'add_financial_transaction'
|
||||
delete 'financial_transactions/:financial_transaction', action: 'remove_financial_transaction', as: 'remove_financial_transaction'
|
||||
put 'financial_transactions/:financial_transaction', action: 'add_financial_transaction',
|
||||
as: 'add_financial_transaction'
|
||||
delete 'financial_transactions/:financial_transaction', action: 'remove_financial_transaction',
|
||||
as: 'remove_financial_transaction'
|
||||
|
||||
get :index_invoice
|
||||
put 'invoices/:invoice', action: 'add_invoice', as: 'add_invoice'
|
||||
|
|
@ -200,12 +202,14 @@ Rails.application.routes.draw do
|
|||
resources :ordergroups, only: [:index] do
|
||||
resources :financial_transactions, as: :transactions
|
||||
end
|
||||
resources :financial_transactions, as: :foodcoop_financial_transactions, path: 'foodcoop/financial_transactions', only: [:index, :new, :create]
|
||||
resources :financial_transactions, as: :foodcoop_financial_transactions, path: 'foodcoop/financial_transactions',
|
||||
only: %i[index new create]
|
||||
get :transactions, controller: :financial_transactions, action: :index_collection
|
||||
delete 'transactions/:id', controller: :financial_transactions, action: :destroy, as: :transaction
|
||||
|
||||
get 'transactions/new_collection' => 'financial_transactions#new_collection', as: 'new_transaction_collection'
|
||||
post 'transactions/create_collection' => 'financial_transactions#create_collection', as: 'create_transaction_collection'
|
||||
post 'transactions/create_collection' => 'financial_transactions#create_collection',
|
||||
as: 'create_transaction_collection'
|
||||
|
||||
resources :bank_accounts, only: [:index] do
|
||||
member do
|
||||
|
|
@ -217,7 +221,7 @@ Rails.application.routes.draw do
|
|||
resources :bank_transactions, as: :transactions
|
||||
end
|
||||
|
||||
resources :bank_transactions, only: [:index, :show]
|
||||
resources :bank_transactions, only: %i[index show]
|
||||
end
|
||||
|
||||
########### Administration
|
||||
|
|
@ -251,11 +255,11 @@ Rails.application.routes.draw do
|
|||
get :memberships, on: :member
|
||||
end
|
||||
|
||||
resources :mail_delivery_status, only: [:index, :show, :destroy] do
|
||||
resources :mail_delivery_status, only: %i[index show destroy] do
|
||||
delete :index, on: :collection, action: :destroy_all
|
||||
end
|
||||
|
||||
resource :config, only: [:show, :update] do
|
||||
resource :config, only: %i[show update] do
|
||||
get :list
|
||||
end
|
||||
end
|
||||
|
|
@ -270,23 +274,23 @@ Rails.application.routes.draw do
|
|||
namespace :user do
|
||||
root to: 'users#show'
|
||||
get :financial_overview, to: 'ordergroup#financial_overview'
|
||||
resources :financial_transactions, only: [:index, :show, :create]
|
||||
resources :financial_transactions, only: %i[index show create]
|
||||
resources :group_order_articles
|
||||
end
|
||||
|
||||
resources :financial_transaction_classes, only: [:index, :show]
|
||||
resources :financial_transaction_types, only: [:index, :show]
|
||||
resources :financial_transactions, only: [:index, :show]
|
||||
resources :orders, only: [:index, :show]
|
||||
resources :order_articles, only: [:index, :show]
|
||||
resources :financial_transaction_classes, only: %i[index show]
|
||||
resources :financial_transaction_types, only: %i[index show]
|
||||
resources :financial_transactions, only: %i[index show]
|
||||
resources :orders, only: %i[index show]
|
||||
resources :order_articles, only: %i[index show]
|
||||
resources :group_order_articles
|
||||
resources :article_categories, only: [:index, :show]
|
||||
resources :article_categories, only: %i[index show]
|
||||
end
|
||||
end
|
||||
|
||||
############## Feedback
|
||||
|
||||
resource :feedback, only: [:new, :create], controller: 'feedback'
|
||||
resource :feedback, only: %i[new create], controller: 'feedback'
|
||||
|
||||
############## The rest
|
||||
|
||||
|
|
|
|||
|
|
@ -2,22 +2,22 @@
|
|||
# Learn more: http://github.com/javan/whenever
|
||||
|
||||
# Upcoming tasks notifier
|
||||
every :day, :at => '7:20 am' do
|
||||
rake "multicoops:run TASK=foodsoft:notify_upcoming_tasks"
|
||||
rake "multicoops:run TASK=foodsoft:notify_users_of_weekly_task"
|
||||
every :day, at: '7:20 am' do
|
||||
rake 'multicoops:run TASK=foodsoft:notify_upcoming_tasks'
|
||||
rake 'multicoops:run TASK=foodsoft:notify_users_of_weekly_task'
|
||||
end
|
||||
|
||||
# Import and assign bank transactions
|
||||
every :weekday, :at => %w(5:56am 6:04pm) do
|
||||
rake "multicoops:run TASK=foodsoft:import_and_assign_bank_transactions"
|
||||
every :weekday, at: %w[5:56am 6:04pm] do
|
||||
rake 'multicoops:run TASK=foodsoft:import_and_assign_bank_transactions'
|
||||
end
|
||||
|
||||
# Weekly taks
|
||||
every :sunday, :at => '7:14 am' do
|
||||
rake "multicoops:run TASK=foodsoft:create_upcoming_periodic_tasks"
|
||||
every :sunday, at: '7:14 am' do
|
||||
rake 'multicoops:run TASK=foodsoft:create_upcoming_periodic_tasks'
|
||||
end
|
||||
|
||||
# Finish ended orders
|
||||
every 1.minute do
|
||||
rake "multicoops:run TASK=foodsoft:finish_ended_orders"
|
||||
rake 'multicoops:run TASK=foodsoft:finish_ended_orders'
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
%w(
|
||||
%w[
|
||||
.ruby-version
|
||||
.rbenv-vars
|
||||
tmp/restart.txt
|
||||
tmp/caching-dev.txt
|
||||
).each { |path| Spring.watch(path) }
|
||||
].each { |path| Spring.watch(path) }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue