mv lib to app/lib use :zeitwerk
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
viehlieb 2022-10-18 17:23:18 +02:00
parent af3444bba6
commit e37ad34901
58 changed files with 39 additions and 37 deletions

View file

@ -1,5 +1,5 @@
class Api::V1::ArticleCategoriesController < Api::V1::BaseController
include Concerns::CollectionScope
include CollectionScope
def index
render json: search_scope

View file

@ -1,5 +1,5 @@
class Api::V1::BaseController < ApplicationController
include Concerns::AuthApi
include AuthApi
protect_from_forgery with: :null_session

View file

@ -1,5 +1,5 @@
class Api::V1::FinancialTransactionClassesController < Api::V1::BaseController
include Concerns::CollectionScope
include CollectionScope
def index
render json: search_scope

View file

@ -1,5 +1,5 @@
class Api::V1::FinancialTransactionTypesController < Api::V1::BaseController
include Concerns::CollectionScope
include CollectionScope
def index
render json: search_scope

View file

@ -1,5 +1,5 @@
class Api::V1::FinancialTransactionsController < Api::V1::BaseController
include Concerns::CollectionScope
include CollectionScope
before_action -> { doorkeeper_authorize! 'finance:read', 'finance:write' }

View file

@ -1,5 +1,5 @@
class Api::V1::OrderArticlesController < Api::V1::BaseController
include Concerns::CollectionScope
include CollectionScope
before_action -> { doorkeeper_authorize! 'orders:read', 'orders:write' }

View file

@ -1,5 +1,5 @@
class Api::V1::OrdersController < Api::V1::BaseController
include Concerns::CollectionScope
include CollectionScope
before_action -> { doorkeeper_authorize! 'orders:read', 'orders:write' }

View file

@ -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

View file

@ -1,5 +1,5 @@
class Api::V1::User::GroupOrderArticlesController < Api::V1::BaseController
include Concerns::CollectionScope
include CollectionScope
before_action -> { doorkeeper_authorize! 'group_orders:user' }

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -2,7 +2,7 @@
#
# Includes a +before_action+ for selecting foodcoop from url.
#
module Concerns::FoodcoopScope
module FoodcoopScope
extend ActiveSupport::Concern
included do

View file

@ -1,4 +1,4 @@
module Concerns::Locale
module Locale
extend ActiveSupport::Concern
included do

View file

@ -1,4 +1,4 @@
module Concerns::SendOrderPdf
module SendOrderPdf
extend ActiveSupport::Concern
protected

View file

@ -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]