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