Apply PercentLiteralDelimiters rubocop rule
This commit is contained in:
@@ -353,6 +353,3 @@ Security/MarshalLoad:
|
|||||||
|
|
||||||
Security/YAMLLoad:
|
Security/YAMLLoad:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
Style/PercentLiteralDelimiters:
|
|
||||||
Enabled: true
|
|
||||||
|
|||||||
@@ -68,5 +68,8 @@ Rails/TimeZone:
|
|||||||
RSpec/NotToNot:
|
RSpec/NotToNot:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
|
Style/PercentLiteralDelimiters:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
Style/StringLiterals:
|
Style/StringLiterals:
|
||||||
EnforcedStyle: double_quotes
|
EnforcedStyle: double_quotes
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
class Admin::ActivityController < Admin::BaseController
|
class Admin::ActivityController < Admin::BaseController
|
||||||
has_filters %w{all on_users on_proposals on_debates on_comments on_system_emails}
|
has_filters %w[all on_users on_proposals on_debates on_comments on_system_emails]
|
||||||
|
|
||||||
def show
|
def show
|
||||||
@activity = Activity.for_render.send(@current_filter)
|
@activity = Activity.for_render.send(@current_filter)
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
class Admin::BannersController < Admin::BaseController
|
class Admin::BannersController < Admin::BaseController
|
||||||
include Translatable
|
include Translatable
|
||||||
|
|
||||||
has_filters %w{all with_active with_inactive}, only: :index
|
has_filters %w[all with_active with_inactive], only: :index
|
||||||
|
|
||||||
before_action :banner_sections, only: [:edit, :new, :create, :update]
|
before_action :banner_sections, only: [:edit, :new, :create, :update]
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ class Admin::BudgetsController < Admin::BaseController
|
|||||||
include FeatureFlags
|
include FeatureFlags
|
||||||
feature_flag :budgets
|
feature_flag :budgets
|
||||||
|
|
||||||
has_filters %w{open finished}, only: :index
|
has_filters %w[open finished], only: :index
|
||||||
|
|
||||||
before_action :load_budget, except: [:index, :new, :create]
|
before_action :load_budget, except: [:index, :new, :create]
|
||||||
load_and_authorize_resource
|
load_and_authorize_resource
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
class Admin::HiddenBudgetInvestmentsController < Admin::BaseController
|
class Admin::HiddenBudgetInvestmentsController < Admin::BaseController
|
||||||
include FeatureFlags
|
include FeatureFlags
|
||||||
|
|
||||||
has_filters %w{all with_confirmed_hide without_confirmed_hide}, only: :index
|
has_filters %w[all with_confirmed_hide without_confirmed_hide], only: :index
|
||||||
|
|
||||||
feature_flag :budgets
|
feature_flag :budgets
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
class Admin::HiddenCommentsController < Admin::BaseController
|
class Admin::HiddenCommentsController < Admin::BaseController
|
||||||
has_filters %w{without_confirmed_hide all with_confirmed_hide}
|
has_filters %w[without_confirmed_hide all with_confirmed_hide]
|
||||||
|
|
||||||
before_action :load_comment, only: [:confirm_hide, :restore]
|
before_action :load_comment, only: [:confirm_hide, :restore]
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ class Admin::HiddenDebatesController < Admin::BaseController
|
|||||||
|
|
||||||
feature_flag :debates
|
feature_flag :debates
|
||||||
|
|
||||||
has_filters %w{without_confirmed_hide all with_confirmed_hide}, only: :index
|
has_filters %w[without_confirmed_hide all with_confirmed_hide], only: :index
|
||||||
|
|
||||||
before_action :load_debate, only: [:confirm_hide, :restore]
|
before_action :load_debate, only: [:confirm_hide, :restore]
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
class Admin::HiddenUsersController < Admin::BaseController
|
class Admin::HiddenUsersController < Admin::BaseController
|
||||||
has_filters %w{without_confirmed_hide all with_confirmed_hide}, only: :index
|
has_filters %w[without_confirmed_hide all with_confirmed_hide], only: :index
|
||||||
|
|
||||||
before_action :load_user, only: [:confirm_hide, :restore]
|
before_action :load_user, only: [:confirm_hide, :restore]
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
class Admin::OrganizationsController < Admin::BaseController
|
class Admin::OrganizationsController < Admin::BaseController
|
||||||
has_filters %w{pending all verified rejected}, only: :index
|
has_filters %w[pending all verified rejected], only: :index
|
||||||
|
|
||||||
load_and_authorize_resource except: :search
|
load_and_authorize_resource except: :search
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
class Admin::ProposalNotificationsController < Admin::BaseController
|
class Admin::ProposalNotificationsController < Admin::BaseController
|
||||||
|
|
||||||
has_filters %w{without_confirmed_hide all with_confirmed_hide}, only: :index
|
has_filters %w[without_confirmed_hide all with_confirmed_hide], only: :index
|
||||||
|
|
||||||
before_action :load_proposal, only: [:confirm_hide, :restore]
|
before_action :load_proposal, only: [:confirm_hide, :restore]
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ module Budgets
|
|||||||
|
|
||||||
feature_flag :budgets
|
feature_flag :budgets
|
||||||
|
|
||||||
has_orders %w{most_voted newest oldest}, only: :show
|
has_orders %w[most_voted newest oldest], only: :show
|
||||||
has_orders ->(c) { c.instance_variable_get(:@budget).investments_orders }, only: :index
|
has_orders ->(c) { c.instance_variable_get(:@budget).investments_orders }, only: :index
|
||||||
|
|
||||||
valid_filters = %w[not_unfeasible feasible unfeasible unselected selected winners]
|
valid_filters = %w[not_unfeasible feasible unfeasible unselected selected winners]
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
class CommunitiesController < ApplicationController
|
class CommunitiesController < ApplicationController
|
||||||
TOPIC_ORDERS = %w{newest most_commented oldest}.freeze
|
TOPIC_ORDERS = %w[newest most_commented oldest].freeze
|
||||||
before_action :set_order, :set_community, :load_topics, :load_participants
|
before_action :set_order, :set_community, :load_topics, :load_participants
|
||||||
|
|
||||||
has_orders TOPIC_ORDERS
|
has_orders TOPIC_ORDERS
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ class DebatesController < ApplicationController
|
|||||||
invisible_captcha only: [:create, :update], honeypot: :subtitle
|
invisible_captcha only: [:create, :update], honeypot: :subtitle
|
||||||
|
|
||||||
has_orders ->(c) { Debate.debates_orders(c.current_user) }, only: :index
|
has_orders ->(c) { Debate.debates_orders(c.current_user) }, only: :index
|
||||||
has_orders %w{most_voted newest oldest}, only: :show
|
has_orders %w[most_voted newest oldest], only: :show
|
||||||
|
|
||||||
load_and_authorize_resource
|
load_and_authorize_resource
|
||||||
helper_method :resource_model, :resource_name
|
helper_method :resource_model, :resource_name
|
||||||
|
|||||||
@@ -13,8 +13,8 @@ class Legislation::ProposalsController < Legislation::BaseController
|
|||||||
|
|
||||||
invisible_captcha only: [:create, :update], honeypot: :subtitle
|
invisible_captcha only: [:create, :update], honeypot: :subtitle
|
||||||
|
|
||||||
has_orders %w{confidence_score created_at}, only: :index
|
has_orders %w[confidence_score created_at], only: :index
|
||||||
has_orders %w{most_voted newest oldest}, only: :show
|
has_orders %w[most_voted newest oldest], only: :show
|
||||||
|
|
||||||
helper_method :resource_model, :resource_name
|
helper_method :resource_model, :resource_name
|
||||||
respond_to :html, :js
|
respond_to :html, :js
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ class Legislation::QuestionsController < Legislation::BaseController
|
|||||||
load_and_authorize_resource :process
|
load_and_authorize_resource :process
|
||||||
load_and_authorize_resource :question, through: :process
|
load_and_authorize_resource :question, through: :process
|
||||||
|
|
||||||
has_orders %w{most_voted newest oldest}, only: :show
|
has_orders %w[most_voted newest oldest], only: :show
|
||||||
|
|
||||||
def show
|
def show
|
||||||
@commentable = @question
|
@commentable = @question
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ class Moderation::Budgets::InvestmentsController < Moderation::BaseController
|
|||||||
include FeatureFlags
|
include FeatureFlags
|
||||||
include ModerateActions
|
include ModerateActions
|
||||||
|
|
||||||
has_filters %w{pending_flag_review all with_ignored_flag}, only: :index
|
has_filters %w[pending_flag_review all with_ignored_flag], only: :index
|
||||||
has_orders %w{flags created_at}, only: :index
|
has_orders %w[flags created_at], only: :index
|
||||||
|
|
||||||
feature_flag :budgets
|
feature_flag :budgets
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
class Moderation::CommentsController < Moderation::BaseController
|
class Moderation::CommentsController < Moderation::BaseController
|
||||||
include ModerateActions
|
include ModerateActions
|
||||||
|
|
||||||
has_filters %w{pending_flag_review all with_ignored_flag}, only: :index
|
has_filters %w[pending_flag_review all with_ignored_flag], only: :index
|
||||||
has_orders %w{flags newest}, only: :index
|
has_orders %w[flags newest], only: :index
|
||||||
|
|
||||||
before_action :load_resources, only: [:index, :moderate]
|
before_action :load_resources, only: [:index, :moderate]
|
||||||
|
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ class Moderation::DebatesController < Moderation::BaseController
|
|||||||
include ModerateActions
|
include ModerateActions
|
||||||
include FeatureFlags
|
include FeatureFlags
|
||||||
|
|
||||||
has_filters %w{pending_flag_review all with_ignored_flag}, only: :index
|
has_filters %w[pending_flag_review all with_ignored_flag], only: :index
|
||||||
has_orders %w{flags created_at}, only: :index
|
has_orders %w[flags created_at], only: :index
|
||||||
|
|
||||||
feature_flag :debates
|
feature_flag :debates
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
class Moderation::ProposalNotificationsController < Moderation::BaseController
|
class Moderation::ProposalNotificationsController < Moderation::BaseController
|
||||||
include ModerateActions
|
include ModerateActions
|
||||||
|
|
||||||
has_filters %w{pending_review all ignored}, only: :index
|
has_filters %w[pending_review all ignored], only: :index
|
||||||
has_orders %w{created_at moderated}, only: :index
|
has_orders %w[created_at moderated], only: :index
|
||||||
|
|
||||||
before_action :load_resources, only: [:index, :moderate]
|
before_action :load_resources, only: [:index, :moderate]
|
||||||
|
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ class Moderation::ProposalsController < Moderation::BaseController
|
|||||||
include ModerateActions
|
include ModerateActions
|
||||||
include FeatureFlags
|
include FeatureFlags
|
||||||
|
|
||||||
has_filters %w{pending_flag_review all with_ignored_flag}, only: :index
|
has_filters %w[pending_flag_review all with_ignored_flag], only: :index
|
||||||
has_orders %w{flags created_at}, only: :index
|
has_orders %w[flags created_at], only: :index
|
||||||
|
|
||||||
feature_flag :proposals
|
feature_flag :proposals
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ class TopicsController < ApplicationController
|
|||||||
before_action :load_community
|
before_action :load_community
|
||||||
before_action :load_topic, only: [:show, :edit, :update, :destroy]
|
before_action :load_topic, only: [:show, :edit, :update, :destroy]
|
||||||
|
|
||||||
has_orders %w{most_voted newest oldest}, only: :show
|
has_orders %w[most_voted newest oldest], only: :show
|
||||||
|
|
||||||
skip_authorization_check only: :show
|
skip_authorization_check only: :show
|
||||||
load_and_authorize_resource except: :show
|
load_and_authorize_resource except: :show
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ class Tracking::BudgetInvestmentsController < Tracking::BaseController
|
|||||||
before_action :load_budget
|
before_action :load_budget
|
||||||
before_action :load_investment, only: [:show, :edit]
|
before_action :load_investment, only: [:show, :edit]
|
||||||
|
|
||||||
has_orders %w{oldest}, only: [:show, :edit]
|
has_orders %w[oldest], only: [:show, :edit]
|
||||||
|
|
||||||
load_and_authorize_resource :investment, class: "Budget::Investment"
|
load_and_authorize_resource :investment, class: "Budget::Investment"
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
class UsersController < ApplicationController
|
class UsersController < ApplicationController
|
||||||
has_filters %w{proposals debates budget_investments comments follows}, only: :show
|
has_filters %w[proposals debates budget_investments comments follows], only: :show
|
||||||
|
|
||||||
load_and_authorize_resource
|
load_and_authorize_resource
|
||||||
helper_method :author?
|
helper_method :author?
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ class Valuation::BudgetInvestmentsController < Valuation::BaseController
|
|||||||
before_action :load_budget
|
before_action :load_budget
|
||||||
before_action :load_investment, only: [:show, :edit, :valuate]
|
before_action :load_investment, only: [:show, :edit, :valuate]
|
||||||
|
|
||||||
has_orders %w{oldest}, only: [:show, :edit]
|
has_orders %w[oldest], only: [:show, :edit]
|
||||||
has_filters %w{valuating valuation_finished}, only: :index
|
has_filters %w[valuating valuation_finished], only: :index
|
||||||
|
|
||||||
load_and_authorize_resource :investment, class: "Budget::Investment"
|
load_and_authorize_resource :investment, class: "Budget::Investment"
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ class Activity < ApplicationRecord
|
|||||||
belongs_to :actionable, -> { with_hidden }, polymorphic: true
|
belongs_to :actionable, -> { with_hidden }, polymorphic: true
|
||||||
belongs_to :user, -> { with_hidden }
|
belongs_to :user, -> { with_hidden }
|
||||||
|
|
||||||
VALID_ACTIONS = %w(hide block restore valuate email)
|
VALID_ACTIONS = %w[hide block restore valuate email]
|
||||||
|
|
||||||
validates :action, inclusion: {in: VALID_ACTIONS}
|
validates :action, inclusion: {in: VALID_ACTIONS}
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ class Budget < ApplicationRecord
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
CURRENCY_SYMBOLS = %w(€ $ £ ¥).freeze
|
CURRENCY_SYMBOLS = %w[€ $ £ ¥].freeze
|
||||||
|
|
||||||
validates_translation :name, presence: true
|
validates_translation :name, presence: true
|
||||||
validates :phase, inclusion: { in: Budget::Phase::PHASE_KINDS }
|
validates :phase, inclusion: { in: Budget::Phase::PHASE_KINDS }
|
||||||
@@ -173,13 +173,13 @@ class Budget < ApplicationRecord
|
|||||||
def investments_orders
|
def investments_orders
|
||||||
case phase
|
case phase
|
||||||
when "accepting", "reviewing"
|
when "accepting", "reviewing"
|
||||||
%w{random}
|
%w[random]
|
||||||
when "publishing_prices", "balloting", "reviewing_ballots"
|
when "publishing_prices", "balloting", "reviewing_ballots"
|
||||||
%w{random price}
|
%w[random price]
|
||||||
when "finished"
|
when "finished"
|
||||||
%w{random}
|
%w[random]
|
||||||
else
|
else
|
||||||
%w{random confidence_score}
|
%w[random confidence_score]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
class Budget
|
class Budget
|
||||||
class Phase < ApplicationRecord
|
class Phase < ApplicationRecord
|
||||||
PHASE_KINDS = %w(drafting informing accepting reviewing selecting valuating publishing_prices balloting
|
PHASE_KINDS = %w[drafting informing accepting reviewing selecting valuating publishing_prices balloting
|
||||||
reviewing_ballots finished).freeze
|
reviewing_ballots finished].freeze
|
||||||
PUBLISHED_PRICES_PHASES = %w(publishing_prices balloting reviewing_ballots finished).freeze
|
PUBLISHED_PRICES_PHASES = %w[publishing_prices balloting reviewing_ballots finished].freeze
|
||||||
SUMMARY_MAX_LENGTH = 1000
|
SUMMARY_MAX_LENGTH = 1000
|
||||||
DESCRIPTION_MAX_LENGTH = 2000
|
DESCRIPTION_MAX_LENGTH = 2000
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
class Budget
|
class Budget
|
||||||
class ReclassifiedVote < ApplicationRecord
|
class ReclassifiedVote < ApplicationRecord
|
||||||
REASONS = %w(heading_changed unfeasible)
|
REASONS = %w[heading_changed unfeasible]
|
||||||
|
|
||||||
belongs_to :user
|
belongs_to :user
|
||||||
belongs_to :investment
|
belongs_to :investment
|
||||||
|
|||||||
@@ -161,7 +161,7 @@ class Debate < ApplicationRecord
|
|||||||
end
|
end
|
||||||
|
|
||||||
def self.debates_orders(user)
|
def self.debates_orders(user)
|
||||||
orders = %w{hot_score confidence_score created_at relevance}
|
orders = %w[hot_score confidence_score created_at relevance]
|
||||||
orders << "recommendations" if Setting["feature.user.recommendations_on_debates"] && user&.recommended_debates
|
orders << "recommendations" if Setting["feature.user.recommendations_on_debates"] && user&.recommended_debates
|
||||||
return orders
|
return orders
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
class Legislation::DraftVersion < ApplicationRecord
|
class Legislation::DraftVersion < ApplicationRecord
|
||||||
VALID_STATUSES = %w(draft published)
|
VALID_STATUSES = %w[draft published]
|
||||||
|
|
||||||
acts_as_paranoid column: :hidden_at
|
acts_as_paranoid column: :hidden_at
|
||||||
include ActsAsParanoidAliases
|
include ActsAsParanoidAliases
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
class Poll::PartialResult < ApplicationRecord
|
class Poll::PartialResult < ApplicationRecord
|
||||||
|
|
||||||
VALID_ORIGINS = %w{web booth}
|
VALID_ORIGINS = %w[web booth]
|
||||||
|
|
||||||
belongs_to :question, -> { with_hidden }
|
belongs_to :question, -> { with_hidden }
|
||||||
belongs_to :author, -> { with_hidden }, class_name: "User", foreign_key: "author_id"
|
belongs_to :author, -> { with_hidden }, class_name: "User", foreign_key: "author_id"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
class Poll::Recount < ApplicationRecord
|
class Poll::Recount < ApplicationRecord
|
||||||
|
|
||||||
VALID_ORIGINS = %w{web booth letter}.freeze
|
VALID_ORIGINS = %w[web booth letter].freeze
|
||||||
|
|
||||||
belongs_to :author, -> { with_hidden }, class_name: "User", foreign_key: "author_id"
|
belongs_to :author, -> { with_hidden }, class_name: "User", foreign_key: "author_id"
|
||||||
belongs_to :booth_assignment
|
belongs_to :booth_assignment
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
class RelatedContent < ApplicationRecord
|
class RelatedContent < ApplicationRecord
|
||||||
RELATED_CONTENT_SCORE_THRESHOLD = Setting["related_content_score_threshold"].to_f
|
RELATED_CONTENT_SCORE_THRESHOLD = Setting["related_content_score_threshold"].to_f
|
||||||
RELATIONABLE_MODELS = %w{proposals debates budgets investments}.freeze
|
RELATIONABLE_MODELS = %w[proposals debates budgets investments].freeze
|
||||||
|
|
||||||
acts_as_paranoid column: :hidden_at
|
acts_as_paranoid column: :hidden_at
|
||||||
include ActsAsParanoidAliases
|
include ActsAsParanoidAliases
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ class Signature < ApplicationRecord
|
|||||||
end
|
end
|
||||||
|
|
||||||
def document_types
|
def document_types
|
||||||
%w(1 2 3 4)
|
%w[1 2 3 4]
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ class SignatureSheet < ApplicationRecord
|
|||||||
belongs_to :signable, polymorphic: true
|
belongs_to :signable, polymorphic: true
|
||||||
belongs_to :author, class_name: "User", foreign_key: "author_id"
|
belongs_to :author, class_name: "User", foreign_key: "author_id"
|
||||||
|
|
||||||
VALID_SIGNABLES = %w(Proposal Budget::Investment)
|
VALID_SIGNABLES = %w[Proposal Budget::Investment]
|
||||||
|
|
||||||
has_many :signatures
|
has_many :signatures
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
class Widget::Feed < ApplicationRecord
|
class Widget::Feed < ApplicationRecord
|
||||||
self.table_name = "widget_feeds"
|
self.table_name = "widget_feeds"
|
||||||
|
|
||||||
KINDS = %w(proposals debates processes)
|
KINDS = %w[proposals debates processes]
|
||||||
|
|
||||||
def active?
|
def active?
|
||||||
setting.value.present?
|
setting.value.present?
|
||||||
|
|||||||
@@ -58,7 +58,7 @@
|
|||||||
<strong><%= t("admin.menu.title_booths") %></strong>
|
<strong><%= t("admin.menu.title_booths") %></strong>
|
||||||
</a>
|
</a>
|
||||||
<ul id="booths_menu" <%= "class=is-active" if menu_booths? || controller_name == "polls" && action_name == "booth_assignments" %>>
|
<ul id="booths_menu" <%= "class=is-active" if menu_booths? || controller_name == "polls" && action_name == "booth_assignments" %>>
|
||||||
<li <%= "class=is-active" if %w(officers officer_assignments).include?(controller_name) %>>
|
<li <%= "class=is-active" if %w[officers officer_assignments].include?(controller_name) %>>
|
||||||
<%= link_to t("admin.menu.poll_officers"), admin_officers_path %>
|
<%= link_to t("admin.menu.poll_officers"), admin_officers_path %>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
@@ -74,8 +74,8 @@
|
|||||||
<%= link_to t("admin.menu.poll_booth_assignments"), booth_assignments_admin_polls_path %>
|
<%= link_to t("admin.menu.poll_booth_assignments"), booth_assignments_admin_polls_path %>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li <%= "class=is-active" if %w(shifts booths).include?(controller_name) &&
|
<li <%= "class=is-active" if %w[shifts booths].include?(controller_name) &&
|
||||||
%w(available new).include?(action_name) %>>
|
%w[available new].include?(action_name) %>>
|
||||||
<%= link_to t("admin.menu.poll_shifts"), available_admin_booths_path %>
|
<%= link_to t("admin.menu.poll_shifts"), available_admin_booths_path %>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
@@ -90,7 +90,7 @@
|
|||||||
</li>
|
</li>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<% messages_sections = %w(newsletters emails_download admin_notifications system_emails) %>
|
<% messages_sections = %w[newsletters emails_download admin_notifications system_emails] %>
|
||||||
<% messages_menu_active = messages_sections.include?(controller_name) %>
|
<% messages_menu_active = messages_sections.include?(controller_name) %>
|
||||||
<li class="section-title" <%= "class=is-active" if messages_menu_active %>>
|
<li class="section-title" <%= "class=is-active" if messages_menu_active %>>
|
||||||
<a href="#">
|
<a href="#">
|
||||||
|
|||||||
@@ -21,8 +21,8 @@ set :log_level, :info
|
|||||||
set :pty, true
|
set :pty, true
|
||||||
set :use_sudo, false
|
set :use_sudo, false
|
||||||
|
|
||||||
set :linked_files, %w{config/database.yml config/secrets.yml config/unicorn.rb config/environments/production.rb}
|
set :linked_files, %w[config/database.yml config/secrets.yml config/unicorn.rb config/environments/production.rb]
|
||||||
set :linked_dirs, %w{log tmp public/system public/assets public/ckeditor_assets}
|
set :linked_dirs, %w[log tmp public/system public/assets public/ckeditor_assets]
|
||||||
|
|
||||||
set :keep_releases, 5
|
set :keep_releases, 5
|
||||||
|
|
||||||
@@ -31,12 +31,12 @@ set :local_user, ENV["USER"]
|
|||||||
set :delayed_job_workers, 2
|
set :delayed_job_workers, 2
|
||||||
set :delayed_job_roles, :background
|
set :delayed_job_roles, :background
|
||||||
|
|
||||||
set(:config_files, %w(
|
set(:config_files, %w[
|
||||||
log_rotation
|
log_rotation
|
||||||
database.yml
|
database.yml
|
||||||
secrets.yml
|
secrets.yml
|
||||||
unicorn.rb
|
unicorn.rb
|
||||||
))
|
])
|
||||||
|
|
||||||
set :whenever_roles, -> { :app }
|
set :whenever_roles, -> { :app }
|
||||||
|
|
||||||
|
|||||||
@@ -6,5 +6,5 @@ set :ssh_options, port: deploysecret(:ssh_port)
|
|||||||
set :stage, :preproduction
|
set :stage, :preproduction
|
||||||
set :rails_env, :preproduction
|
set :rails_env, :preproduction
|
||||||
|
|
||||||
server deploysecret(:server1), user: deploysecret(:user), roles: %w(web app db importer cron background)
|
server deploysecret(:server1), user: deploysecret(:user), roles: %w[web app db importer cron background]
|
||||||
server deploysecret(:server2), user: deploysecret(:user), roles: %w(web app db importer)
|
server deploysecret(:server2), user: deploysecret(:user), roles: %w[web app db importer]
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ set :ssh_options, port: deploysecret(:ssh_port)
|
|||||||
set :stage, :production
|
set :stage, :production
|
||||||
set :rails_env, :production
|
set :rails_env, :production
|
||||||
|
|
||||||
server deploysecret(:server1), user: deploysecret(:user), roles: %w(web app db importer cron background)
|
server deploysecret(:server1), user: deploysecret(:user), roles: %w[web app db importer cron background]
|
||||||
#server deploysecret(:server2), user: deploysecret(:user), roles: %w(web app db importer cron background)
|
#server deploysecret(:server2), user: deploysecret(:user), roles: %w(web app db importer cron background)
|
||||||
#server deploysecret(:server3), user: deploysecret(:user), roles: %w(web app db importer)
|
#server deploysecret(:server3), user: deploysecret(:user), roles: %w(web app db importer)
|
||||||
#server deploysecret(:server4), user: deploysecret(:user), roles: %w(web app db importer)
|
#server deploysecret(:server4), user: deploysecret(:user), roles: %w(web app db importer)
|
||||||
|
|||||||
@@ -6,4 +6,4 @@ set :ssh_options, port: deploysecret(:ssh_port)
|
|||||||
set :stage, :staging
|
set :stage, :staging
|
||||||
set :rails_env, :staging
|
set :rails_env, :staging
|
||||||
|
|
||||||
server deploysecret(:server), user: deploysecret(:user), roles: %w(web app db importer cron)
|
server deploysecret(:server), user: deploysecret(:user), roles: %w[web app db importer cron]
|
||||||
|
|||||||
@@ -9,12 +9,12 @@ Rails.application.config.assets.version = "1.0"
|
|||||||
# Precompile additional assets.
|
# Precompile additional assets.
|
||||||
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
|
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
|
||||||
# Rails.application.config.assets.precompile += %w( search.js )
|
# Rails.application.config.assets.precompile += %w( search.js )
|
||||||
Rails.application.config.assets.precompile += %w( ckeditor/config.js )
|
Rails.application.config.assets.precompile += %w[ckeditor/config.js]
|
||||||
Rails.application.config.assets.precompile += %w( ie_lt9.js )
|
Rails.application.config.assets.precompile += %w[ie_lt9.js]
|
||||||
Rails.application.config.assets.precompile += %w( stat_graphs.js )
|
Rails.application.config.assets.precompile += %w[stat_graphs.js]
|
||||||
Rails.application.config.assets.precompile += %w( dashboard_graphs.js )
|
Rails.application.config.assets.precompile += %w[dashboard_graphs.js]
|
||||||
Rails.application.config.assets.precompile += %w( print.css )
|
Rails.application.config.assets.precompile += %w[print.css]
|
||||||
Rails.application.config.assets.precompile += %w( ie.css )
|
Rails.application.config.assets.precompile += %w[ie.css]
|
||||||
Rails.application.config.assets.precompile += %w( pdf_fonts.css )
|
Rails.application.config.assets.precompile += %w[pdf_fonts.css]
|
||||||
|
|
||||||
# Loads custom images and custom fonts before app/assets/images and app/assets/fonts
|
# Loads custom images and custom fonts before app/assets/images and app/assets/fonts
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
SocialShareButton.configure do |config|
|
SocialShareButton.configure do |config|
|
||||||
config.allow_sites = %w(twitter facebook google_plus telegram)
|
config.allow_sites = %w[twitter facebook google_plus telegram]
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
%w(
|
%w[
|
||||||
.ruby-version
|
.ruby-version
|
||||||
.rbenv-vars
|
.rbenv-vars
|
||||||
tmp/restart.txt
|
tmp/restart.txt
|
||||||
tmp/caching-dev.txt
|
tmp/caching-dev.txt
|
||||||
).each { |path| Spring.watch(path) }
|
].each { |path| Spring.watch(path) }
|
||||||
|
|||||||
@@ -944,7 +944,7 @@ describe "Budget Investments" do
|
|||||||
scenario "Show up to 5 suggestions", :js do
|
scenario "Show up to 5 suggestions", :js do
|
||||||
login_as(author)
|
login_as(author)
|
||||||
|
|
||||||
%w(first second third fourth fifth sixth).each do |ordinal|
|
%w[first second third fourth fifth sixth].each do |ordinal|
|
||||||
create(factory, title: "#{ordinal.titleize} #{factory}, has search term", budget: budget)
|
create(factory, title: "#{ordinal.titleize} #{factory}, has search term", budget: budget)
|
||||||
end
|
end
|
||||||
create(factory, title: "This is the last #{factory}", budget: budget)
|
create(factory, title: "This is the last #{factory}", budget: budget)
|
||||||
@@ -960,7 +960,7 @@ describe "Budget Investments" do
|
|||||||
scenario "No found suggestions", :js do
|
scenario "No found suggestions", :js do
|
||||||
login_as(author)
|
login_as(author)
|
||||||
|
|
||||||
%w(first second third fourth fifth sixth).each do |ordinal|
|
%w[first second third fourth fifth sixth].each do |ordinal|
|
||||||
create(factory, title: "#{ordinal.titleize} #{factory}, has search term", budget: budget)
|
create(factory, title: "#{ordinal.titleize} #{factory}, has search term", budget: budget)
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -975,7 +975,7 @@ describe "Budget Investments" do
|
|||||||
scenario "Don't show suggestions from a different budget", :js do
|
scenario "Don't show suggestions from a different budget", :js do
|
||||||
login_as(author)
|
login_as(author)
|
||||||
|
|
||||||
%w(first second third fourth fifth sixth).each do |ordinal|
|
%w[first second third fourth fifth sixth].each do |ordinal|
|
||||||
create(factory, title: "#{ordinal.titleize} #{factory}, has search term", budget: budget)
|
create(factory, title: "#{ordinal.titleize} #{factory}, has search term", budget: budget)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -890,7 +890,7 @@ describe "Proposals" do
|
|||||||
expect(page).not_to have_content archived_proposal.title
|
expect(page).not_to have_content archived_proposal.title
|
||||||
end
|
end
|
||||||
|
|
||||||
orders = %w{hot_score confidence_score created_at relevance}
|
orders = %w[hot_score confidence_score created_at relevance]
|
||||||
orders.each do |order|
|
orders.each do |order|
|
||||||
visit proposals_path(order: order)
|
visit proposals_path(order: order)
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ describe DocumentParser do
|
|||||||
end
|
end
|
||||||
|
|
||||||
it "adds upper and lowercase letter when the letter is present" do
|
it "adds upper and lowercase letter when the letter is present" do
|
||||||
expect(DocumentParser.get_document_number_variants(1, "1234567A")).to eq(%w(1234567 01234567 1234567a 1234567A 01234567a 01234567A))
|
expect(DocumentParser.get_document_number_variants(1, "1234567A")).to eq(%w[1234567 01234567 1234567a 1234567A 01234567a 01234567A])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ describe TagSanitizer do
|
|||||||
|
|
||||||
describe "#sanitize_tag_list" do
|
describe "#sanitize_tag_list" do
|
||||||
it "returns a new tag list with sanitized tags" do
|
it "returns a new tag list with sanitized tags" do
|
||||||
expect(subject.sanitize_tag_list(%w{x=1 y?z})).to eq(%w(x1 yz))
|
expect(subject.sanitize_tag_list(%w[x=1 y?z])).to eq(%w[x1 yz])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user