Add and apply Layout/EmptyLinesAfterModuleInclusion rule
This rule was added in rubocop 1.79. We were inconsistent about it, so we're adding it to get more consistency.
This commit is contained in:
@@ -101,6 +101,9 @@ Layout/EmptyLineBetweenDefs:
|
|||||||
Layout/EmptyLines:
|
Layout/EmptyLines:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
|
Layout/EmptyLinesAfterModuleInclusion:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
Layout/EmptyLinesAroundAccessModifier:
|
Layout/EmptyLinesAroundAccessModifier:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
class Admin::ActionComponent < ApplicationComponent
|
class Admin::ActionComponent < ApplicationComponent
|
||||||
include Admin::Namespace
|
include Admin::Namespace
|
||||||
|
|
||||||
attr_reader :action, :record, :options
|
attr_reader :action, :record, :options
|
||||||
|
|
||||||
def initialize(action, record, **options)
|
def initialize(action, record, **options)
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
class Admin::Banners::FormComponent < ApplicationComponent
|
class Admin::Banners::FormComponent < ApplicationComponent
|
||||||
include TranslatableFormHelper
|
include TranslatableFormHelper
|
||||||
include GlobalizeHelper
|
include GlobalizeHelper
|
||||||
|
|
||||||
attr_reader :banner
|
attr_reader :banner
|
||||||
|
|
||||||
def initialize(banner)
|
def initialize(banner)
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
class Admin::BudgetGroups::GroupsComponent < ApplicationComponent
|
class Admin::BudgetGroups::GroupsComponent < ApplicationComponent
|
||||||
include Admin::Namespace
|
include Admin::Namespace
|
||||||
|
|
||||||
attr_reader :groups
|
attr_reader :groups
|
||||||
|
|
||||||
def initialize(groups)
|
def initialize(groups)
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
class Admin::BudgetHeadings::FormComponent < ApplicationComponent
|
class Admin::BudgetHeadings::FormComponent < ApplicationComponent
|
||||||
include TranslatableFormHelper
|
include TranslatableFormHelper
|
||||||
include GlobalizeHelper
|
include GlobalizeHelper
|
||||||
|
|
||||||
attr_reader :heading, :path, :action
|
attr_reader :heading, :path, :action
|
||||||
|
|
||||||
def initialize(heading, path:, action:)
|
def initialize(heading, path:, action:)
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
class Admin::Budgets::IndexComponent < ApplicationComponent
|
class Admin::Budgets::IndexComponent < ApplicationComponent
|
||||||
include Header
|
include Header
|
||||||
|
|
||||||
attr_reader :budgets
|
attr_reader :budgets
|
||||||
|
|
||||||
def initialize(budgets)
|
def initialize(budgets)
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
class Admin::Budgets::ShowComponent < ApplicationComponent
|
class Admin::Budgets::ShowComponent < ApplicationComponent
|
||||||
include Header
|
include Header
|
||||||
|
|
||||||
attr_reader :budget
|
attr_reader :budget
|
||||||
|
|
||||||
def initialize(budget)
|
def initialize(budget)
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
class Admin::BudgetsWizard::Budgets::EditComponent < ApplicationComponent
|
class Admin::BudgetsWizard::Budgets::EditComponent < ApplicationComponent
|
||||||
include Header
|
include Header
|
||||||
|
|
||||||
attr_reader :budget
|
attr_reader :budget
|
||||||
|
|
||||||
def initialize(budget)
|
def initialize(budget)
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
class Admin::BudgetsWizard::Budgets::NewComponent < ApplicationComponent
|
class Admin::BudgetsWizard::Budgets::NewComponent < ApplicationComponent
|
||||||
include Header
|
include Header
|
||||||
|
|
||||||
attr_reader :budget
|
attr_reader :budget
|
||||||
use_helpers :single_heading?
|
use_helpers :single_heading?
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
class Admin::BudgetsWizard::Groups::EditComponent < ApplicationComponent
|
class Admin::BudgetsWizard::Groups::EditComponent < ApplicationComponent
|
||||||
include Header
|
include Header
|
||||||
|
|
||||||
attr_reader :group
|
attr_reader :group
|
||||||
|
|
||||||
def initialize(group)
|
def initialize(group)
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
class Admin::BudgetsWizard::Groups::IndexComponent < Admin::BudgetsWizard::BaseComponent
|
class Admin::BudgetsWizard::Groups::IndexComponent < Admin::BudgetsWizard::BaseComponent
|
||||||
include Header
|
include Header
|
||||||
|
|
||||||
attr_reader :groups, :new_group
|
attr_reader :groups, :new_group
|
||||||
|
|
||||||
def initialize(groups, new_group)
|
def initialize(groups, new_group)
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
class Admin::BudgetsWizard::Headings::EditComponent < ApplicationComponent
|
class Admin::BudgetsWizard::Headings::EditComponent < ApplicationComponent
|
||||||
include Header
|
include Header
|
||||||
|
|
||||||
attr_reader :heading
|
attr_reader :heading
|
||||||
|
|
||||||
def initialize(heading)
|
def initialize(heading)
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
class Admin::BudgetsWizard::Headings::IndexComponent < Admin::BudgetsWizard::BaseComponent
|
class Admin::BudgetsWizard::Headings::IndexComponent < Admin::BudgetsWizard::BaseComponent
|
||||||
include Header
|
include Header
|
||||||
|
|
||||||
attr_reader :headings, :new_heading
|
attr_reader :headings, :new_heading
|
||||||
|
|
||||||
def initialize(headings, new_heading)
|
def initialize(headings, new_heading)
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
class Admin::BudgetsWizard::Phases::EditComponent < ApplicationComponent
|
class Admin::BudgetsWizard::Phases::EditComponent < ApplicationComponent
|
||||||
include Header
|
include Header
|
||||||
|
|
||||||
attr_reader :phase
|
attr_reader :phase
|
||||||
|
|
||||||
def initialize(phase)
|
def initialize(phase)
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
class Admin::BudgetsWizard::Phases::IndexComponent < Admin::BudgetsWizard::BaseComponent
|
class Admin::BudgetsWizard::Phases::IndexComponent < Admin::BudgetsWizard::BaseComponent
|
||||||
include Header
|
include Header
|
||||||
|
|
||||||
attr_reader :budget
|
attr_reader :budget
|
||||||
|
|
||||||
def initialize(budget)
|
def initialize(budget)
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
class Admin::Geozones::IndexComponent < ApplicationComponent
|
class Admin::Geozones::IndexComponent < ApplicationComponent
|
||||||
include Header
|
include Header
|
||||||
|
|
||||||
attr_reader :geozones
|
attr_reader :geozones
|
||||||
use_helpers :render_map
|
use_helpers :render_map
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
class Admin::Legislation::DraftVersions::FormComponent < ApplicationComponent
|
class Admin::Legislation::DraftVersions::FormComponent < ApplicationComponent
|
||||||
include TranslatableFormHelper
|
include TranslatableFormHelper
|
||||||
include GlobalizeHelper
|
include GlobalizeHelper
|
||||||
|
|
||||||
attr_reader :draft_version, :url
|
attr_reader :draft_version, :url
|
||||||
use_helpers :admin_submit_action
|
use_helpers :admin_submit_action
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
class Admin::Locales::ShowComponent < ApplicationComponent
|
class Admin::Locales::ShowComponent < ApplicationComponent
|
||||||
include Header
|
include Header
|
||||||
|
|
||||||
attr_reader :locales_settings
|
attr_reader :locales_settings
|
||||||
|
|
||||||
def initialize(locales_settings)
|
def initialize(locales_settings)
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
class Admin::MachineLearning::ShowComponent < ApplicationComponent
|
class Admin::MachineLearning::ShowComponent < ApplicationComponent
|
||||||
include Header
|
include Header
|
||||||
|
|
||||||
attr_reader :machine_learning_job
|
attr_reader :machine_learning_job
|
||||||
|
|
||||||
def initialize(machine_learning_job)
|
def initialize(machine_learning_job)
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
class Admin::MenuComponent < ApplicationComponent
|
class Admin::MenuComponent < ApplicationComponent
|
||||||
include LinkListHelper
|
include LinkListHelper
|
||||||
|
|
||||||
use_helpers :can?
|
use_helpers :can?
|
||||||
|
|
||||||
def links
|
def links
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
class Admin::Poll::Questions::FormComponent < ApplicationComponent
|
class Admin::Poll::Questions::FormComponent < ApplicationComponent
|
||||||
include TranslatableFormHelper
|
include TranslatableFormHelper
|
||||||
include GlobalizeHelper
|
include GlobalizeHelper
|
||||||
|
|
||||||
attr_reader :question, :url
|
attr_reader :question, :url
|
||||||
use_helpers :can?
|
use_helpers :can?
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
class Admin::ProgressBars::FormComponent < ApplicationComponent
|
class Admin::ProgressBars::FormComponent < ApplicationComponent
|
||||||
include TranslatableFormHelper
|
include TranslatableFormHelper
|
||||||
include GlobalizeHelper
|
include GlobalizeHelper
|
||||||
|
|
||||||
attr_reader :progress_bar
|
attr_reader :progress_bar
|
||||||
|
|
||||||
def initialize(progress_bar)
|
def initialize(progress_bar)
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
class Admin::Proposals::IndexComponent < ApplicationComponent
|
class Admin::Proposals::IndexComponent < ApplicationComponent
|
||||||
include Header
|
include Header
|
||||||
|
|
||||||
attr_reader :proposals
|
attr_reader :proposals
|
||||||
|
|
||||||
def initialize(proposals)
|
def initialize(proposals)
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
class Admin::Proposals::SuccessfulComponent < ApplicationComponent
|
class Admin::Proposals::SuccessfulComponent < ApplicationComponent
|
||||||
include Header
|
include Header
|
||||||
|
|
||||||
attr_reader :proposals
|
attr_reader :proposals
|
||||||
|
|
||||||
def initialize(proposals)
|
def initialize(proposals)
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
class Admin::SiteCustomization::Images::IndexComponent < ApplicationComponent
|
class Admin::SiteCustomization::Images::IndexComponent < ApplicationComponent
|
||||||
include Header
|
include Header
|
||||||
|
|
||||||
attr_reader :images
|
attr_reader :images
|
||||||
|
|
||||||
def initialize(images)
|
def initialize(images)
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
class Admin::SiteCustomization::Pages::EditComponent < ApplicationComponent
|
class Admin::SiteCustomization::Pages::EditComponent < ApplicationComponent
|
||||||
include Header
|
include Header
|
||||||
|
|
||||||
attr_reader :page
|
attr_reader :page
|
||||||
|
|
||||||
def initialize(page)
|
def initialize(page)
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
class Admin::SiteCustomization::Pages::FormComponent < ApplicationComponent
|
class Admin::SiteCustomization::Pages::FormComponent < ApplicationComponent
|
||||||
include TranslatableFormHelper
|
include TranslatableFormHelper
|
||||||
include GlobalizeHelper
|
include GlobalizeHelper
|
||||||
|
|
||||||
attr_reader :page
|
attr_reader :page
|
||||||
|
|
||||||
def initialize(page)
|
def initialize(page)
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
class Admin::SiteCustomization::Pages::IndexComponent < ApplicationComponent
|
class Admin::SiteCustomization::Pages::IndexComponent < ApplicationComponent
|
||||||
include Header
|
include Header
|
||||||
|
|
||||||
attr_reader :pages
|
attr_reader :pages
|
||||||
|
|
||||||
def initialize(pages)
|
def initialize(pages)
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
class Admin::SiteCustomization::Pages::NewComponent < ApplicationComponent
|
class Admin::SiteCustomization::Pages::NewComponent < ApplicationComponent
|
||||||
include Header
|
include Header
|
||||||
|
|
||||||
attr_reader :page
|
attr_reader :page
|
||||||
|
|
||||||
def initialize(page)
|
def initialize(page)
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
class Admin::Tenants::EditComponent < ApplicationComponent
|
class Admin::Tenants::EditComponent < ApplicationComponent
|
||||||
include Header
|
include Header
|
||||||
|
|
||||||
attr_reader :tenant
|
attr_reader :tenant
|
||||||
|
|
||||||
def initialize(tenant)
|
def initialize(tenant)
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
class Admin::Tenants::IndexComponent < ApplicationComponent
|
class Admin::Tenants::IndexComponent < ApplicationComponent
|
||||||
include Header
|
include Header
|
||||||
|
|
||||||
attr_reader :tenants
|
attr_reader :tenants
|
||||||
|
|
||||||
def initialize(tenants)
|
def initialize(tenants)
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
class Admin::Tenants::NewComponent < ApplicationComponent
|
class Admin::Tenants::NewComponent < ApplicationComponent
|
||||||
include Header
|
include Header
|
||||||
|
|
||||||
attr_reader :tenant
|
attr_reader :tenant
|
||||||
use_helpers :current_user
|
use_helpers :current_user
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
class Admin::Widget::Cards::EditComponent < ApplicationComponent
|
class Admin::Widget::Cards::EditComponent < ApplicationComponent
|
||||||
include Header
|
include Header
|
||||||
|
|
||||||
attr_reader :card, :index_path, :form_path
|
attr_reader :card, :index_path, :form_path
|
||||||
|
|
||||||
def initialize(card, index_path:, form_path: nil)
|
def initialize(card, index_path:, form_path: nil)
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
class Admin::Widget::Cards::NewComponent < ApplicationComponent
|
class Admin::Widget::Cards::NewComponent < ApplicationComponent
|
||||||
include Header
|
include Header
|
||||||
|
|
||||||
attr_reader :card, :index_path, :form_path
|
attr_reader :card, :index_path, :form_path
|
||||||
|
|
||||||
def initialize(card, index_path:, form_path: nil)
|
def initialize(card, index_path:, form_path: nil)
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
class ApplicationComponent < ViewComponent::Base
|
class ApplicationComponent < ViewComponent::Base
|
||||||
include SettingsHelper
|
include SettingsHelper
|
||||||
|
|
||||||
use_helpers :back_link_to, :t
|
use_helpers :back_link_to, :t
|
||||||
delegate :default_form_builder, to: :controller
|
delegate :default_form_builder, to: :controller
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
class Budgets::Groups::IndexComponent < ApplicationComponent
|
class Budgets::Groups::IndexComponent < ApplicationComponent
|
||||||
include Header
|
include Header
|
||||||
|
|
||||||
attr_reader :budget
|
attr_reader :budget
|
||||||
|
|
||||||
def initialize(budget)
|
def initialize(budget)
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
class Budgets::Investments::FormComponent < ApplicationComponent
|
class Budgets::Investments::FormComponent < ApplicationComponent
|
||||||
include TranslatableFormHelper
|
include TranslatableFormHelper
|
||||||
include GlobalizeHelper
|
include GlobalizeHelper
|
||||||
|
|
||||||
attr_reader :investment, :url
|
attr_reader :investment, :url
|
||||||
use_helpers :current_user, :budget_heading_select_options, :suggest_data
|
use_helpers :current_user, :budget_heading_select_options, :suggest_data
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
class Budgets::Investments::NewComponent < ApplicationComponent
|
class Budgets::Investments::NewComponent < ApplicationComponent
|
||||||
include Header
|
include Header
|
||||||
|
|
||||||
attr_reader :budget
|
attr_reader :budget
|
||||||
|
|
||||||
def initialize(budget)
|
def initialize(budget)
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
module SDG::TagList
|
module SDG::TagList
|
||||||
extend ActiveSupport::Concern
|
extend ActiveSupport::Concern
|
||||||
|
|
||||||
attr_reader :record, :limit
|
attr_reader :record, :limit
|
||||||
|
|
||||||
def initialize(record, limit: nil)
|
def initialize(record, limit: nil)
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
class Debates::FormComponent < ApplicationComponent
|
class Debates::FormComponent < ApplicationComponent
|
||||||
include TranslatableFormHelper
|
include TranslatableFormHelper
|
||||||
include GlobalizeHelper
|
include GlobalizeHelper
|
||||||
|
|
||||||
attr_reader :debate
|
attr_reader :debate
|
||||||
use_helpers :suggest_data
|
use_helpers :suggest_data
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
class Debates::NewComponent < ApplicationComponent
|
class Debates::NewComponent < ApplicationComponent
|
||||||
include Header
|
include Header
|
||||||
|
|
||||||
attr_reader :debate
|
attr_reader :debate
|
||||||
use_helpers :new_window_link_to
|
use_helpers :new_window_link_to
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
class Moderation::Shared::IndexComponent < ApplicationComponent
|
class Moderation::Shared::IndexComponent < ApplicationComponent
|
||||||
include Header
|
include Header
|
||||||
|
|
||||||
attr_reader :records
|
attr_reader :records
|
||||||
|
|
||||||
def initialize(records)
|
def initialize(records)
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
class Moderation::Users::IndexComponent < ApplicationComponent
|
class Moderation::Users::IndexComponent < ApplicationComponent
|
||||||
include Header
|
include Header
|
||||||
|
|
||||||
attr_reader :users
|
attr_reader :users
|
||||||
|
|
||||||
def initialize(users)
|
def initialize(users)
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
class Proposals::FormComponent < ApplicationComponent
|
class Proposals::FormComponent < ApplicationComponent
|
||||||
include TranslatableFormHelper
|
include TranslatableFormHelper
|
||||||
include GlobalizeHelper
|
include GlobalizeHelper
|
||||||
|
|
||||||
attr_reader :proposal, :url
|
attr_reader :proposal, :url
|
||||||
use_helpers :current_user, :suggest_data, :geozone_select_options
|
use_helpers :current_user, :suggest_data, :geozone_select_options
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
class Proposals::NewComponent < ApplicationComponent
|
class Proposals::NewComponent < ApplicationComponent
|
||||||
include Header
|
include Header
|
||||||
|
|
||||||
attr_reader :proposal
|
attr_reader :proposal
|
||||||
use_helpers :new_window_link_to
|
use_helpers :new_window_link_to
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
class SDGManagement::Relations::IndexComponent < ApplicationComponent
|
class SDGManagement::Relations::IndexComponent < ApplicationComponent
|
||||||
include Header
|
include Header
|
||||||
|
|
||||||
attr_reader :records
|
attr_reader :records
|
||||||
|
|
||||||
def initialize(records)
|
def initialize(records)
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
class SDGManagement::Relations::SearchComponent < ApplicationComponent
|
class SDGManagement::Relations::SearchComponent < ApplicationComponent
|
||||||
include SDG::OptionsForSelect
|
include SDG::OptionsForSelect
|
||||||
|
|
||||||
attr_reader :label
|
attr_reader :label
|
||||||
|
|
||||||
def initialize(label:)
|
def initialize(label:)
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
class Admin::BaseController < ApplicationController
|
class Admin::BaseController < ApplicationController
|
||||||
include IpDeniedHandler
|
include IpDeniedHandler
|
||||||
|
|
||||||
layout "admin"
|
layout "admin"
|
||||||
before_action :authenticate_user!
|
before_action :authenticate_user!
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ class Admin::BudgetsController < Admin::BaseController
|
|||||||
include ReportAttributes
|
include ReportAttributes
|
||||||
include ImageAttributes
|
include ImageAttributes
|
||||||
include FeatureFlags
|
include FeatureFlags
|
||||||
|
|
||||||
feature_flag :budgets
|
feature_flag :budgets
|
||||||
|
|
||||||
has_filters %w[all open finished], only: :index
|
has_filters %w[all open finished], only: :index
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ class Admin::BudgetsWizard::BudgetsController < Admin::BudgetsWizard::BaseContro
|
|||||||
include Translatable
|
include Translatable
|
||||||
include ImageAttributes
|
include ImageAttributes
|
||||||
include FeatureFlags
|
include FeatureFlags
|
||||||
|
|
||||||
feature_flag :budgets
|
feature_flag :budgets
|
||||||
|
|
||||||
load_and_authorize_resource
|
load_and_authorize_resource
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
class Admin::Dashboard::ActionsController < Admin::Dashboard::BaseController
|
class Admin::Dashboard::ActionsController < Admin::Dashboard::BaseController
|
||||||
include DocumentAttributes
|
include DocumentAttributes
|
||||||
|
|
||||||
helper_method :dashboard_action, :resource
|
helper_method :dashboard_action, :resource
|
||||||
|
|
||||||
def index
|
def index
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
class Admin::Legislation::MilestonesController < Admin::MilestonesController
|
class Admin::Legislation::MilestonesController < Admin::MilestonesController
|
||||||
include FeatureFlags
|
include FeatureFlags
|
||||||
|
|
||||||
feature_flag :legislation
|
feature_flag :legislation
|
||||||
|
|
||||||
def index
|
def index
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
class Admin::Legislation::ProgressBarsController < Admin::ProgressBarsController
|
class Admin::Legislation::ProgressBarsController < Admin::ProgressBarsController
|
||||||
include FeatureFlags
|
include FeatureFlags
|
||||||
|
|
||||||
feature_flag :legislation
|
feature_flag :legislation
|
||||||
|
|
||||||
def index
|
def index
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ class Admin::Poll::PollsController < Admin::Poll::BaseController
|
|||||||
include Translatable
|
include Translatable
|
||||||
include ImageAttributes
|
include ImageAttributes
|
||||||
include ReportAttributes
|
include ReportAttributes
|
||||||
|
|
||||||
load_and_authorize_resource
|
load_and_authorize_resource
|
||||||
|
|
||||||
before_action :load_geozones, only: [:new, :create, :edit, :update]
|
before_action :load_geozones, only: [:new, :create, :edit, :update]
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ class Admin::ProposalsController < Admin::BaseController
|
|||||||
include HasOrders
|
include HasOrders
|
||||||
include CommentableActions
|
include CommentableActions
|
||||||
include FeatureFlags
|
include FeatureFlags
|
||||||
|
|
||||||
feature_flag :proposals
|
feature_flag :proposals
|
||||||
|
|
||||||
has_orders %w[created_at]
|
has_orders %w[created_at]
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
class Admin::SiteCustomization::CardsController < Admin::SiteCustomization::BaseController
|
class Admin::SiteCustomization::CardsController < Admin::SiteCustomization::BaseController
|
||||||
include Admin::Widget::CardsActions
|
include Admin::Widget::CardsActions
|
||||||
|
|
||||||
load_and_authorize_resource :page, class: "::SiteCustomization::Page"
|
load_and_authorize_resource :page, class: "::SiteCustomization::Page"
|
||||||
load_and_authorize_resource :card, through: :page, class: "Widget::Card"
|
load_and_authorize_resource :card, through: :page, class: "Widget::Card"
|
||||||
helper_method :index_path
|
helper_method :index_path
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
class Admin::SiteCustomization::PagesController < Admin::SiteCustomization::BaseController
|
class Admin::SiteCustomization::PagesController < Admin::SiteCustomization::BaseController
|
||||||
include Translatable
|
include Translatable
|
||||||
|
|
||||||
load_and_authorize_resource :page, class: "SiteCustomization::Page"
|
load_and_authorize_resource :page, class: "SiteCustomization::Page"
|
||||||
|
|
||||||
def index
|
def index
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
class Admin::Widget::CardsController < Admin::BaseController
|
class Admin::Widget::CardsController < Admin::BaseController
|
||||||
include Admin::Widget::CardsActions
|
include Admin::Widget::CardsActions
|
||||||
|
|
||||||
load_and_authorize_resource :card, class: "Widget::Card"
|
load_and_authorize_resource :card, class: "Widget::Card"
|
||||||
helper_method :index_path
|
helper_method :index_path
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
module Budgets
|
module Budgets
|
||||||
class GroupsController < ApplicationController
|
class GroupsController < ApplicationController
|
||||||
include FeatureFlags
|
include FeatureFlags
|
||||||
|
|
||||||
feature_flag :budgets
|
feature_flag :budgets
|
||||||
|
|
||||||
before_action :load_budget
|
before_action :load_budget
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ module Budgets
|
|||||||
module Investments
|
module Investments
|
||||||
class VotesController < ApplicationController
|
class VotesController < ApplicationController
|
||||||
include FeatureFlags
|
include FeatureFlags
|
||||||
|
|
||||||
feature_flag :remove_investments_supports, only: :destroy
|
feature_flag :remove_investments_supports, only: :destroy
|
||||||
|
|
||||||
load_and_authorize_resource :budget
|
load_and_authorize_resource :budget
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
module Budgets
|
module Budgets
|
||||||
class StatsController < ApplicationController
|
class StatsController < ApplicationController
|
||||||
include FeatureFlags
|
include FeatureFlags
|
||||||
|
|
||||||
feature_flag :budgets
|
feature_flag :budgets
|
||||||
|
|
||||||
before_action :load_budget
|
before_action :load_budget
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
class BudgetsController < ApplicationController
|
class BudgetsController < ApplicationController
|
||||||
include FeatureFlags
|
include FeatureFlags
|
||||||
include BudgetsHelper
|
include BudgetsHelper
|
||||||
|
|
||||||
feature_flag :budgets
|
feature_flag :budgets
|
||||||
|
|
||||||
before_action :load_budget, only: :show
|
before_action :load_budget, only: :show
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ module Admin::BudgetGroupsActions
|
|||||||
included do
|
included do
|
||||||
include Translatable
|
include Translatable
|
||||||
include FeatureFlags
|
include FeatureFlags
|
||||||
|
|
||||||
feature_flag :budgets
|
feature_flag :budgets
|
||||||
|
|
||||||
before_action :load_budget
|
before_action :load_budget
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ module Admin::BudgetHeadingsActions
|
|||||||
included do
|
included do
|
||||||
include Translatable
|
include Translatable
|
||||||
include FeatureFlags
|
include FeatureFlags
|
||||||
|
|
||||||
feature_flag :budgets
|
feature_flag :budgets
|
||||||
|
|
||||||
before_action :load_budget
|
before_action :load_budget
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
module HasFilters
|
module HasFilters
|
||||||
extend ActiveSupport::Concern
|
extend ActiveSupport::Concern
|
||||||
|
|
||||||
attr_reader :valid_filters, :current_filter
|
attr_reader :valid_filters, :current_filter
|
||||||
|
|
||||||
included do
|
included do
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
module HasOrders
|
module HasOrders
|
||||||
extend ActiveSupport::Concern
|
extend ActiveSupport::Concern
|
||||||
|
|
||||||
attr_reader :valid_orders, :current_order
|
attr_reader :valid_orders, :current_order
|
||||||
|
|
||||||
included do
|
included do
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
module ModerateActions
|
module ModerateActions
|
||||||
extend ActiveSupport::Concern
|
extend ActiveSupport::Concern
|
||||||
include Polymorphic
|
include Polymorphic
|
||||||
|
|
||||||
PER_PAGE = 50
|
PER_PAGE = 50
|
||||||
|
|
||||||
def index
|
def index
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
class Dashboard::PollsController < Dashboard::BaseController
|
class Dashboard::PollsController < Dashboard::BaseController
|
||||||
include DocumentAttributes
|
include DocumentAttributes
|
||||||
|
|
||||||
helper_method :poll
|
helper_method :poll
|
||||||
before_action :authorize_manage_polls
|
before_action :authorize_manage_polls
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
class DirectUploadsController < ApplicationController
|
class DirectUploadsController < ApplicationController
|
||||||
include DirectUploadsHelper
|
include DirectUploadsHelper
|
||||||
include ActionView::Helpers::UrlHelper
|
include ActionView::Helpers::UrlHelper
|
||||||
|
|
||||||
before_action :authenticate_user!
|
before_action :authenticate_user!
|
||||||
|
|
||||||
skip_authorization_check only: :create
|
skip_authorization_check only: :create
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
class Management::BaseController < ActionController::Base
|
class Management::BaseController < ActionController::Base
|
||||||
include TenantVariants
|
include TenantVariants
|
||||||
include GlobalizeFallbacks
|
include GlobalizeFallbacks
|
||||||
|
|
||||||
layout "management"
|
layout "management"
|
||||||
default_form_builder ConsulFormBuilder
|
default_form_builder ConsulFormBuilder
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ class Management::Budgets::InvestmentsController < Management::BaseController
|
|||||||
include DocumentAttributes
|
include DocumentAttributes
|
||||||
include MapLocationAttributes
|
include MapLocationAttributes
|
||||||
include FeatureFlags
|
include FeatureFlags
|
||||||
|
|
||||||
feature_flag :budgets
|
feature_flag :budgets
|
||||||
|
|
||||||
before_action :load_budget
|
before_action :load_budget
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
class Management::BudgetsController < Management::BaseController
|
class Management::BudgetsController < Management::BaseController
|
||||||
include FeatureFlags
|
include FeatureFlags
|
||||||
include HasFilters
|
include HasFilters
|
||||||
|
|
||||||
feature_flag :budgets
|
feature_flag :budgets
|
||||||
|
|
||||||
before_action :only_verified_users, except: :print_investments
|
before_action :only_verified_users, except: :print_investments
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ class Management::SessionsController < ActionController::Base
|
|||||||
include TenantVariants
|
include TenantVariants
|
||||||
include GlobalizeFallbacks
|
include GlobalizeFallbacks
|
||||||
include AccessDeniedHandler
|
include AccessDeniedHandler
|
||||||
|
|
||||||
default_form_builder ConsulFormBuilder
|
default_form_builder ConsulFormBuilder
|
||||||
|
|
||||||
def create
|
def create
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
class PagesController < ApplicationController
|
class PagesController < ApplicationController
|
||||||
include FeatureFlags
|
include FeatureFlags
|
||||||
|
|
||||||
skip_authorization_check
|
skip_authorization_check
|
||||||
|
|
||||||
feature_flag :help_page, if: lambda { params[:id] == "help/index" }
|
feature_flag :help_page, if: lambda { params[:id] == "help/index" }
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
class SDG::GoalsController < ApplicationController
|
class SDG::GoalsController < ApplicationController
|
||||||
include FeatureFlags
|
include FeatureFlags
|
||||||
|
|
||||||
feature_flag :sdg
|
feature_flag :sdg
|
||||||
load_and_authorize_resource find_by: :code, id_param: :code
|
load_and_authorize_resource find_by: :code, id_param: :code
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
class SDGManagement::BaseController < ApplicationController
|
class SDGManagement::BaseController < ApplicationController
|
||||||
include FeatureFlags
|
include FeatureFlags
|
||||||
|
|
||||||
feature_flag :sdg
|
feature_flag :sdg
|
||||||
|
|
||||||
layout "admin"
|
layout "admin"
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
class SDGManagement::CardsController < SDGManagement::BaseController
|
class SDGManagement::CardsController < SDGManagement::BaseController
|
||||||
include Admin::Widget::CardsActions
|
include Admin::Widget::CardsActions
|
||||||
|
|
||||||
helper_method :index_path
|
helper_method :index_path
|
||||||
|
|
||||||
load_and_authorize_resource :phase, class: "SDG::Phase", id_param: "sdg_phase_id"
|
load_and_authorize_resource :phase, class: "SDG::Phase", id_param: "sdg_phase_id"
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
class SDGManagement::HeaderController < SDGManagement::BaseController
|
class SDGManagement::HeaderController < SDGManagement::BaseController
|
||||||
include Admin::Widget::CardsActions
|
include Admin::Widget::CardsActions
|
||||||
|
|
||||||
helper_method :index_path
|
helper_method :index_path
|
||||||
|
|
||||||
before_action :load_cardable
|
before_action :load_cardable
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
class Valuation::BudgetsController < Valuation::BaseController
|
class Valuation::BudgetsController < Valuation::BaseController
|
||||||
include FeatureFlags
|
include FeatureFlags
|
||||||
|
|
||||||
feature_flag :budgets
|
feature_flag :budgets
|
||||||
|
|
||||||
load_and_authorize_resource
|
load_and_authorize_resource
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
class RemoteTranslations::Microsoft::Client
|
class RemoteTranslations::Microsoft::Client
|
||||||
include RemoteTranslations::Microsoft::SentencesParser
|
include RemoteTranslations::Microsoft::SentencesParser
|
||||||
|
|
||||||
CHARACTERS_LIMIT_PER_REQUEST = 5000
|
CHARACTERS_LIMIT_PER_REQUEST = 5000
|
||||||
PREVENTING_TRANSLATION_KEY = "notranslate".freeze
|
PREVENTING_TRANSLATION_KEY = "notranslate".freeze
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
class DeviseMailer < Devise::Mailer
|
class DeviseMailer < Devise::Mailer
|
||||||
include Devise::Controllers::UrlHelpers
|
include Devise::Controllers::UrlHelpers
|
||||||
|
|
||||||
default template_path: "devise/mailer"
|
default template_path: "devise/mailer"
|
||||||
|
|
||||||
protected
|
protected
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
class ApplicationRecord < ActiveRecord::Base
|
class ApplicationRecord < ActiveRecord::Base
|
||||||
include HumanName
|
include HumanName
|
||||||
include SkipValidation
|
include SkipValidation
|
||||||
|
|
||||||
self.abstract_class = true
|
self.abstract_class = true
|
||||||
|
|
||||||
def self.sample(count = 1)
|
def self.sample(count = 1)
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ class Budget
|
|||||||
|
|
||||||
translates :name, touch: true
|
translates :name, touch: true
|
||||||
include Globalizable
|
include Globalizable
|
||||||
|
|
||||||
translation_class_delegate :budget
|
translation_class_delegate :budget
|
||||||
|
|
||||||
class Translation
|
class Translation
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ class Budget
|
|||||||
|
|
||||||
translates :name, touch: true
|
translates :name, touch: true
|
||||||
include Globalizable
|
include Globalizable
|
||||||
|
|
||||||
translation_class_delegate :budget
|
translation_class_delegate :budget
|
||||||
|
|
||||||
class Translation
|
class Translation
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
class Budget::Stats
|
class Budget::Stats
|
||||||
include Statisticable
|
include Statisticable
|
||||||
|
|
||||||
alias_method :budget, :resource
|
alias_method :budget, :resource
|
||||||
|
|
||||||
def self.stats_methods
|
def self.stats_methods
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ class Comment < ApplicationRecord
|
|||||||
|
|
||||||
acts_as_paranoid column: :hidden_at
|
acts_as_paranoid column: :hidden_at
|
||||||
include ActsAsParanoidAliases
|
include ActsAsParanoidAliases
|
||||||
|
|
||||||
acts_as_votable
|
acts_as_votable
|
||||||
has_ancestry touch: true
|
has_ancestry touch: true
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
module Statisticable
|
module Statisticable
|
||||||
extend ActiveSupport::Concern
|
extend ActiveSupport::Concern
|
||||||
|
|
||||||
PARTICIPATIONS = %w[gender age geozone].freeze
|
PARTICIPATIONS = %w[gender age geozone].freeze
|
||||||
|
|
||||||
included do
|
included do
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ class Milestone < ApplicationRecord
|
|||||||
|
|
||||||
translates :title, :description, touch: true
|
translates :title, :description, touch: true
|
||||||
include Globalizable
|
include Globalizable
|
||||||
|
|
||||||
translation_class_delegate :status_id
|
translation_class_delegate :status_id
|
||||||
|
|
||||||
belongs_to :milestoneable, polymorphic: true
|
belongs_to :milestoneable, polymorphic: true
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
class Poll < ApplicationRecord
|
class Poll < ApplicationRecord
|
||||||
include Imageable
|
include Imageable
|
||||||
|
|
||||||
acts_as_paranoid column: :hidden_at
|
acts_as_paranoid column: :hidden_at
|
||||||
include ActsAsParanoidAliases
|
include ActsAsParanoidAliases
|
||||||
include Notifiable
|
include Notifiable
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
class Poll::Stats
|
class Poll::Stats
|
||||||
include Statisticable
|
include Statisticable
|
||||||
|
|
||||||
alias_method :poll, :resource
|
alias_method :poll, :resource
|
||||||
|
|
||||||
CHANNELS = Poll::Voter::VALID_ORIGINS
|
CHANNELS = Poll::Voter::VALID_ORIGINS
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
class Poll::WebVote
|
class Poll::WebVote
|
||||||
include ActiveModel::Validations
|
include ActiveModel::Validations
|
||||||
|
|
||||||
attr_reader :poll, :user
|
attr_reader :poll, :user
|
||||||
delegate :t, to: "ApplicationController.helpers"
|
delegate :t, to: "ApplicationController.helpers"
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ class ProgressBar < ApplicationRecord
|
|||||||
|
|
||||||
translates :title, touch: true
|
translates :title, touch: true
|
||||||
include Globalizable
|
include Globalizable
|
||||||
|
|
||||||
translation_class_delegate :primary?
|
translation_class_delegate :primary?
|
||||||
|
|
||||||
validates :progressable, presence: true
|
validates :progressable, presence: true
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ class Proposal < ApplicationRecord
|
|||||||
translates :summary, touch: true
|
translates :summary, touch: true
|
||||||
translates :retired_explanation, touch: true
|
translates :retired_explanation, touch: true
|
||||||
include Globalizable
|
include Globalizable
|
||||||
|
|
||||||
translation_class_delegate :retired_at
|
translation_class_delegate :retired_at
|
||||||
|
|
||||||
belongs_to :author, -> { with_hidden }, class_name: "User", inverse_of: :proposals
|
belongs_to :author, -> { with_hidden }, class_name: "User", inverse_of: :proposals
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
class SDG::Phase < ApplicationRecord
|
class SDG::Phase < ApplicationRecord
|
||||||
include Cardable
|
include Cardable
|
||||||
|
|
||||||
enum :kind, { sensitization: 0, planning: 1, monitoring: 2 }
|
enum :kind, { sensitization: 0, planning: 1, monitoring: 2 }
|
||||||
validates :kind, presence: true, uniqueness: true
|
validates :kind, presence: true, uniqueness: true
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
class SDG::ProcessEnabled
|
class SDG::ProcessEnabled
|
||||||
include SettingsHelper
|
include SettingsHelper
|
||||||
|
|
||||||
attr_reader :record_or_name
|
attr_reader :record_or_name
|
||||||
|
|
||||||
def initialize(record_or_name)
|
def initialize(record_or_name)
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
class SiteCustomization::Page < ApplicationRecord
|
class SiteCustomization::Page < ApplicationRecord
|
||||||
VALID_STATUSES = %w[draft published].freeze
|
VALID_STATUSES = %w[draft published].freeze
|
||||||
include Cardable
|
include Cardable
|
||||||
|
|
||||||
translates :title, touch: true
|
translates :title, touch: true
|
||||||
translates :subtitle, touch: true
|
translates :subtitle, touch: true
|
||||||
translates :content, touch: true
|
translates :content, touch: true
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
class User < ApplicationRecord
|
class User < ApplicationRecord
|
||||||
include Verification
|
include Verification
|
||||||
|
|
||||||
attribute :registering_from_web, default: false
|
attribute :registering_from_web, default: false
|
||||||
%i[newsletter email_digest email_on_direct_message public_activity recommended_debates
|
%i[newsletter email_digest email_on_direct_message public_activity recommended_debates
|
||||||
recommended_proposals].each do |field|
|
recommended_proposals].each do |field|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
class Widget::Card < ApplicationRecord
|
class Widget::Card < ApplicationRecord
|
||||||
include Imageable
|
include Imageable
|
||||||
|
|
||||||
belongs_to :cardable, polymorphic: true
|
belongs_to :cardable, polymorphic: true
|
||||||
|
|
||||||
translates :label, touch: true
|
translates :label, touch: true
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ require "rails_helper"
|
|||||||
|
|
||||||
describe Budgets::Ballot::BallotComponent do
|
describe Budgets::Ballot::BallotComponent do
|
||||||
include Rails.application.routes.url_helpers
|
include Rails.application.routes.url_helpers
|
||||||
|
|
||||||
before { vc_test_request.session[:ballot_referer] = "/" }
|
before { vc_test_request.session[:ballot_referer] = "/" }
|
||||||
let(:budget) { create(:budget, :balloting) }
|
let(:budget) { create(:budget, :balloting) }
|
||||||
let(:ballot) { create(:budget_ballot, user: create(:user), budget: budget) }
|
let(:ballot) { create(:budget_ballot, user: create(:user), budget: budget) }
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ require "rails_helper"
|
|||||||
|
|
||||||
describe Polls::Questions::ReadMoreComponent do
|
describe Polls::Questions::ReadMoreComponent do
|
||||||
include Rails.application.routes.url_helpers
|
include Rails.application.routes.url_helpers
|
||||||
|
|
||||||
let(:poll) { create(:poll) }
|
let(:poll) { create(:poll) }
|
||||||
let(:question) { create(:poll_question, poll: poll, title: "Question title?") }
|
let(:question) { create(:poll_question, poll: poll, title: "Question title?") }
|
||||||
let(:option) { create(:poll_question_option, question: question) }
|
let(:option) { create(:poll_question_option, question: question) }
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user