Support for threadsafe mode
This commit is contained in:
parent
0c19b7300e
commit
41d69fd6c6
48 changed files with 50 additions and 75 deletions
|
@ -1,6 +1,6 @@
|
|||
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
|
||||
class BillingSubscriptionsController < ApplicationController
|
||||
include NonprofitHelper
|
||||
include Controllers::NonprofitHelper
|
||||
|
||||
before_filter :authenticate_nonprofit_admin!
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
|
||||
class CampaignGiftOptionsController < ApplicationController
|
||||
include CampaignHelper
|
||||
include Controllers::CampaignHelper
|
||||
|
||||
before_filter :authenticate_campaign_editor!, only: [:create, :destroy, :update, :update_order]
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
|
||||
module Campaigns; class CampaignGiftOptionsController < ApplicationController
|
||||
include CampaignHelper
|
||||
include Controllers::CampaignHelper
|
||||
|
||||
before_filter :authenticate_campaign_editor!, only: [:index]
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
|
||||
module Campaigns
|
||||
class DonationsController < ApplicationController
|
||||
include CampaignHelper
|
||||
include Controllers::CampaignHelper
|
||||
|
||||
before_filter :authenticate_campaign_editor!, only: [:index]
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
|
||||
module Campaigns
|
||||
class SupportersController < ApplicationController
|
||||
include CampaignHelper
|
||||
include Controllers::CampaignHelper
|
||||
|
||||
before_filter :authenticate_campaign_editor!, only: [:index]
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
|
||||
class CampaignsController < ApplicationController
|
||||
include CampaignHelper
|
||||
include Controllers::CampaignHelper
|
||||
|
||||
helper_method :current_campaign_editor?
|
||||
before_filter :authenticate_confirmed_user!, only: [:create, :name_and_id, :duplicate]
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
|
||||
class EmailSettingsController < ApplicationController
|
||||
include NonprofitHelper
|
||||
include Controllers::NonprofitHelper
|
||||
before_filter :authenticate_nonprofit_user!
|
||||
|
||||
def index
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
|
||||
class EventDiscountsController < ApplicationController
|
||||
include EventHelper
|
||||
include Controllers::EventHelper
|
||||
before_filter :authenticate_event_editor!, :except => [:index]
|
||||
|
||||
def create
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
|
||||
class EventsController < ApplicationController
|
||||
include EventHelper
|
||||
include Controllers::EventHelper
|
||||
|
||||
helper_method :current_event_editor?
|
||||
before_filter :authenticate_nonprofit_user!, only: :name_and_id
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
|
||||
class MapsController < ApplicationController
|
||||
include NonprofitHelper
|
||||
include Controllers::NonprofitHelper
|
||||
|
||||
before_filter :authenticate_super_associate!, only: :all_supporters
|
||||
before_filter :authenticate_nonprofit_user!, only: [:all_npo_supporters, :specific_npo_supporters]
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
|
||||
module Nonprofits
|
||||
class ActivitiesController < ApplicationController
|
||||
include NonprofitHelper
|
||||
include Controllers::NonprofitHelper
|
||||
before_filter :authenticate_nonprofit_user!
|
||||
|
||||
# get /nonprofits/:nonprofit_id/supporters/:supporter_id/activities
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
|
||||
module Nonprofits
|
||||
class BankAccountsController < ApplicationController
|
||||
include NonprofitHelper
|
||||
include Controllers::NonprofitHelper
|
||||
|
||||
before_filter :authenticate_nonprofit_admin!
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
|
||||
module Nonprofits
|
||||
class ButtonController < ApplicationController
|
||||
include NonprofitHelper
|
||||
include Controllers::NonprofitHelper
|
||||
|
||||
|
||||
before_filter :authenticate_user!
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
|
||||
module Nonprofits
|
||||
class CardsController < ApplicationController
|
||||
include NonprofitHelper
|
||||
include Controllers::NonprofitHelper
|
||||
|
||||
before_filter :authenticate_nonprofit_user!
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
|
||||
module Nonprofits
|
||||
class ChargesController < ApplicationController
|
||||
include NonprofitHelper
|
||||
include Controllers::NonprofitHelper
|
||||
|
||||
before_filter :authenticate_nonprofit_user!, only: :index
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
module Nonprofits
|
||||
class CustomFieldJoinsController < ApplicationController
|
||||
|
||||
include NonprofitHelper
|
||||
include Controllers::NonprofitHelper
|
||||
before_filter :authenticate_nonprofit_user!
|
||||
|
||||
def index
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
|
||||
module Nonprofits
|
||||
class CustomFieldMastersController < ApplicationController
|
||||
include NonprofitHelper
|
||||
include Controllers::NonprofitHelper
|
||||
before_filter :authenticate_nonprofit_user!
|
||||
|
||||
def index
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
|
||||
module Nonprofits
|
||||
class DonationsController < ApplicationController
|
||||
include NonprofitHelper
|
||||
include Controllers::NonprofitHelper
|
||||
|
||||
before_filter :authenticate_nonprofit_user!, only: [:index, :update]
|
||||
before_filter :authenticate_campaign_editor!, only: [:create_offsite]
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
|
||||
module Nonprofits
|
||||
class EmailListsController < ApplicationController
|
||||
include NonprofitHelper
|
||||
include Controllers::NonprofitHelper
|
||||
|
||||
before_filter :authenticate_nonprofit_user!
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
|
||||
module Nonprofits
|
||||
class ImportsController < ApplicationController
|
||||
include NonprofitHelper
|
||||
include Controllers::NonprofitHelper
|
||||
|
||||
before_filter :authenticate_nonprofit_user!
|
||||
# post /nonprofits/:nonprofit_id/imports
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
|
||||
module Nonprofits
|
||||
class MiscellaneousNpInfosController < ApplicationController
|
||||
include NonprofitHelper
|
||||
include Controllers::NonprofitHelper
|
||||
|
||||
helper_method :current_nonprofit_user?
|
||||
before_filter :authenticate_nonprofit_user!
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
module Nonprofits
|
||||
class NonprofitKeysController < ApplicationController
|
||||
include NonprofitHelper
|
||||
include Controllers::NonprofitHelper
|
||||
before_filter :authenticate_nonprofit_user!
|
||||
|
||||
# get /nonprofits/:nonprofit_id/nonprofit_keys
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
|
||||
module Nonprofits
|
||||
class PaymentsController < ApplicationController
|
||||
include NonprofitHelper
|
||||
include Controllers::NonprofitHelper
|
||||
|
||||
before_filter :authenticate_nonprofit_user!
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
|
||||
module Nonprofits
|
||||
class PayoutsController < ApplicationController
|
||||
include NonprofitHelper
|
||||
include Controllers::NonprofitHelper
|
||||
|
||||
before_filter :authenticate_nonprofit_admin!, only: :create
|
||||
before_filter :authenticate_nonprofit_user!, only: [:index, :show]
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
|
||||
module Nonprofits
|
||||
class RecurringDonationsController < ApplicationController
|
||||
include NonprofitHelper
|
||||
include Controllers::NonprofitHelper
|
||||
|
||||
before_filter :authenticate_nonprofit_user!, except: [:create]
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
|
||||
module Nonprofits
|
||||
class RefundsController < ApplicationController
|
||||
include NonprofitHelper
|
||||
include Controllers::NonprofitHelper
|
||||
|
||||
before_filter :authenticate_nonprofit_user!
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
|
||||
module Nonprofits
|
||||
class ReportsController < ApplicationController
|
||||
include NonprofitHelper
|
||||
include Controllers::NonprofitHelper
|
||||
before_filter :authenticate_nonprofit_user!
|
||||
|
||||
def end_of_year
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
|
||||
module Nonprofits
|
||||
class SupporterEmailsController < ApplicationController
|
||||
include NonprofitHelper
|
||||
include Controllers::NonprofitHelper
|
||||
before_filter :authenticate_nonprofit_user!
|
||||
|
||||
def create
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
|
||||
module Nonprofits
|
||||
class SupporterNotesController < ApplicationController
|
||||
include NonprofitHelper
|
||||
include Controllers::NonprofitHelper
|
||||
|
||||
before_filter :authenticate_nonprofit_user!, except: [:create]
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
|
||||
module Nonprofits
|
||||
class SupportersController < ApplicationController
|
||||
include NonprofitHelper
|
||||
include Controllers::NonprofitHelper
|
||||
|
||||
before_filter :authenticate_nonprofit_user!, except: [:new, :create]
|
||||
#before_filter(except: [:create, :mailchimp_landing]){authenticate_min_nonprofit_plan(2)}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
|
||||
module Nonprofits
|
||||
class TagJoinsController < ApplicationController
|
||||
include NonprofitHelper
|
||||
include Controllers::NonprofitHelper
|
||||
before_filter :authenticate_nonprofit_user!
|
||||
|
||||
def index
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
|
||||
module Nonprofits
|
||||
class TagMastersController < ApplicationController
|
||||
include NonprofitHelper
|
||||
include Controllers::NonprofitHelper
|
||||
before_filter :authenticate_nonprofit_user!
|
||||
|
||||
def index
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
|
||||
class NonprofitsController < ApplicationController
|
||||
include NonprofitHelper
|
||||
include Controllers::NonprofitHelper
|
||||
|
||||
helper_method :current_nonprofit_user?
|
||||
before_filter :authenticate_nonprofit_user!, only: [:dashboard, :dashboard_metrics, :dashboard_todos, :payment_history, :profile_todos, :recurring_donation_stats, :update, :verify_identity]
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
|
||||
class RolesController < ApplicationController
|
||||
include NonprofitHelper
|
||||
include Controllers::NonprofitHelper
|
||||
|
||||
before_filter :authenticate_nonprofit_admin!
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
|
||||
class SettingsController < ApplicationController
|
||||
include NonprofitHelper
|
||||
include Controllers::NonprofitHelper
|
||||
|
||||
helper_method :current_nonprofit_user?
|
||||
before_filter :authenticate_user!
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
|
||||
class TicketLevelsController < ApplicationController
|
||||
include EventHelper
|
||||
include Controllers::EventHelper
|
||||
|
||||
before_filter :authenticate_event_editor!, :except => [:index, :show]
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
|
||||
class TicketsController < ApplicationController
|
||||
include EventHelper
|
||||
include Controllers::EventHelper
|
||||
|
||||
helper_method :current_event_admin?, :current_event_editor?
|
||||
before_filter :authenticate_event_editor!, :except => [:create, :add_note]
|
||||
|
|
|
@ -15,10 +15,10 @@ module Commitchange
|
|||
|
||||
# Custom directories with classes and modules you want to be autoloadable.
|
||||
# config.autoload_paths += %W(#{config.root}/extras)
|
||||
config.autoload_paths += Dir["#{config.root}/lib/**/"]
|
||||
config.eager_load_paths += Dir["#{config.root}/lib/**/"]
|
||||
|
||||
config.paths.add File.join('app', 'api'), glob: File.join('**', '*.rb')
|
||||
config.autoload_paths += Dir[Rails.root.join('app', 'api', '*')]
|
||||
config.eager_load_paths += Dir[Rails.root.join('app', 'api', '*')]
|
||||
|
||||
# Only load the plugins named here, in the order given (default is alphabetical).
|
||||
# :all can be used as a placeholder for all plugins not explicitly named.
|
||||
|
|
|
@ -52,6 +52,7 @@ Commitchange::Application.configure do
|
|||
|
||||
config.log_level = :debug
|
||||
|
||||
config.threadsafe!
|
||||
# Turn this on if you want to mess with code inside /node_modules
|
||||
# config.browserify_rails.evaluate_node_modules = true
|
||||
|
||||
|
|
|
@ -41,4 +41,5 @@ Commitchange::Application.configure do
|
|||
config.log_level = :debug
|
||||
|
||||
config.action_controller.allow_forgery_protection = false
|
||||
config.threadsafe!
|
||||
end
|
||||
|
|
|
@ -1,15 +0,0 @@
|
|||
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
|
||||
require 'import_data'
|
||||
|
||||
module ConstructCustomField
|
||||
|
||||
# Given a row of import data (accessible like a hash)...
|
||||
# - filter out all the custom field keys (prefixed with 'custom:x')
|
||||
# - create an array of hashes for every custom field
|
||||
# - used in Supporter.import
|
||||
def self.from_import_data(supp_id, h)
|
||||
return h.select{|key,_| key =~ /^custom:/}.map{|key,val| {'supporter_id'=>supp_id, 'value'=>val, 'name'=>key.gsub(/^custom:/,'')}}
|
||||
end
|
||||
|
||||
end
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
|
||||
require 'import_data'
|
||||
|
||||
module ConstructTag
|
||||
|
||||
# Given a row of import data (accessible like a hash)...
|
||||
# - use only the 'tags' column from the import row
|
||||
# - split the tags by commas and trim whitespace from the ends
|
||||
# - return an array of hash data for every tag_join to be created
|
||||
# - called from Supporter.import
|
||||
def self.from_import_data(supp_id, h)
|
||||
return [] if h['tags'].blank?
|
||||
return h['tags'].split(';').map(&:strip).map{|name| {'supporter_id' => supp_id, 'name' => name}}
|
||||
end
|
||||
|
||||
end
|
|
@ -1,6 +1,6 @@
|
|||
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
|
||||
module CampaignHelper
|
||||
include NonprofitHelper
|
||||
module Controllers::CampaignHelper
|
||||
include Controllers::NonprofitHelper
|
||||
|
||||
private
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
|
||||
module EventHelper
|
||||
include NonprofitHelper
|
||||
module Controllers::EventHelper
|
||||
include Controllers::NonprofitHelper
|
||||
|
||||
private
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
|
||||
module NonprofitHelper
|
||||
module Controllers::NonprofitHelper
|
||||
|
||||
private
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
|
||||
require 'rails/generators'
|
||||
class Api::EntityGenerator < Rails::Generators::NamedBase
|
||||
source_root File.expand_path('../templates', __FILE__)
|
||||
def copy_to_entity
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
|
||||
require 'rails/generators'
|
||||
class Api::ResourceGenerator < Rails::Generators::NamedBase
|
||||
source_root File.expand_path('../templates', __FILE__)
|
||||
def copy_to_resource
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
|
||||
require 'rails/generators'
|
||||
class Api::ValidatorGenerator < Rails::Generators::NamedBase
|
||||
source_root File.expand_path('../templates', __FILE__)
|
||||
|
||||
|
|
Loading…
Reference in a new issue