mv lib to app/lib use :zeitwerk
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
parent
af3444bba6
commit
e37ad34901
58 changed files with 39 additions and 37 deletions
|
|
@ -1,5 +1,5 @@
|
|||
class Api::V1::ArticleCategoriesController < Api::V1::BaseController
|
||||
include Concerns::CollectionScope
|
||||
include CollectionScope
|
||||
|
||||
def index
|
||||
render json: search_scope
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
class Api::V1::BaseController < ApplicationController
|
||||
include Concerns::AuthApi
|
||||
include AuthApi
|
||||
|
||||
protect_from_forgery with: :null_session
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
class Api::V1::FinancialTransactionClassesController < Api::V1::BaseController
|
||||
include Concerns::CollectionScope
|
||||
include CollectionScope
|
||||
|
||||
def index
|
||||
render json: search_scope
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
class Api::V1::FinancialTransactionTypesController < Api::V1::BaseController
|
||||
include Concerns::CollectionScope
|
||||
include CollectionScope
|
||||
|
||||
def index
|
||||
render json: search_scope
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
class Api::V1::FinancialTransactionsController < Api::V1::BaseController
|
||||
include Concerns::CollectionScope
|
||||
include CollectionScope
|
||||
|
||||
before_action -> { doorkeeper_authorize! 'finance:read', 'finance:write' }
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
class Api::V1::OrderArticlesController < Api::V1::BaseController
|
||||
include Concerns::CollectionScope
|
||||
include CollectionScope
|
||||
|
||||
before_action -> { doorkeeper_authorize! 'orders:read', 'orders:write' }
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
class Api::V1::OrdersController < Api::V1::BaseController
|
||||
include Concerns::CollectionScope
|
||||
include CollectionScope
|
||||
|
||||
before_action -> { doorkeeper_authorize! 'orders:read', 'orders:write' }
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
class Api::V1::User::FinancialTransactionsController < Api::V1::BaseController
|
||||
include Concerns::CollectionScope
|
||||
include CollectionScope
|
||||
|
||||
before_action -> { doorkeeper_authorize! 'finance:user' }
|
||||
before_action :require_ordergroup
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
class Api::V1::User::GroupOrderArticlesController < Api::V1::BaseController
|
||||
include Concerns::CollectionScope
|
||||
include CollectionScope
|
||||
|
||||
before_action -> { doorkeeper_authorize! 'group_orders:user' }
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
class ApplicationController < ActionController::Base
|
||||
include Concerns::FoodcoopScope
|
||||
include Concerns::Auth
|
||||
include Concerns::Locale
|
||||
include FoodcoopScope
|
||||
include Auth
|
||||
include Locale
|
||||
include PathHelper
|
||||
helper_method :current_user
|
||||
helper_method :available_locales
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
#
|
||||
# Split off from main +ApplicationController+ to allow e.g.
|
||||
# Doorkeeper to use it too.
|
||||
module Concerns::Auth
|
||||
module Auth
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
protected
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
#
|
||||
# Split off from main +ApplicationController+ to allow e.g.
|
||||
# Doorkeeper to use it too.
|
||||
module Concerns::AuthApi
|
||||
module AuthApi
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
protected
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
module Concerns::CollectionScope
|
||||
module CollectionScope
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
private
|
||||
|
||||
def scope
|
||||
raise NotImplementedError, 'Please override #scope when you use Concerns::CollectionScope'
|
||||
raise NotImplementedError, 'Please override #scope when you use CollectionScope'
|
||||
end
|
||||
|
||||
def default_per_page
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
#
|
||||
# Includes a +before_action+ for selecting foodcoop from url.
|
||||
#
|
||||
module Concerns::FoodcoopScope
|
||||
module FoodcoopScope
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
included do
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
module Concerns::Locale
|
||||
module Locale
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
included do
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
module Concerns::SendOrderPdf
|
||||
module SendOrderPdf
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
protected
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
# Controller for managing orders, i.e. all actions that require the "orders" role.
|
||||
# Normal ordering actions of members of order groups is handled by the OrderingController.
|
||||
class OrdersController < ApplicationController
|
||||
include Concerns::SendOrderPdf
|
||||
include SendOrderPdf
|
||||
|
||||
before_action :authenticate_pickups_or_orders
|
||||
before_action :authenticate_orders, except: [:receive, :receive_on_order_article_create, :receive_on_order_article_update, :show]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue