diff --git a/.erb-lint.yml b/.erb-lint.yml index 71b368cee..5c2007e61 100644 --- a/.erb-lint.yml +++ b/.erb-lint.yml @@ -6,8 +6,12 @@ linters: enabled: false SpaceAroundErbTag: enabled: true + SpaceIndentation: + enabled: true SpaceInHtmlTag: enabled: true + TrailingWhitespace: + enabled: true Rubocop: enabled: true only: diff --git a/.rubocop.yml b/.rubocop.yml index b1c79a16c..cf9fb516e 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -353,6 +353,3 @@ Security/MarshalLoad: Security/YAMLLoad: Enabled: true - -Style/PercentLiteralDelimiters: - Enabled: true diff --git a/.rubocop_basic.yml b/.rubocop_basic.yml index bfeedbc27..d264ee91c 100644 --- a/.rubocop_basic.yml +++ b/.rubocop_basic.yml @@ -3,9 +3,6 @@ require: rubocop-rspec AllCops: DisplayCopNames: true DisplayStyleGuide: true - Include: - - "**/Rakefile" - - "**/config.ru" Exclude: - "db/migrate/**/*" - "db/schema.rb" @@ -29,6 +26,9 @@ Layout/IndentationConsistency: Layout/IndentationWidth: Enabled: true +Layout/EmptyLines: + Enabled: true + Layout/EndOfLine: EnforcedStyle: lf @@ -71,5 +71,8 @@ Rails/TimeZone: RSpec/NotToNot: Enabled: true +Style/PercentLiteralDelimiters: + Enabled: true + Style/StringLiterals: EnforcedStyle: double_quotes diff --git a/app/controllers/admin/activity_controller.rb b/app/controllers/admin/activity_controller.rb index ce9c04183..44357c5fb 100644 --- a/app/controllers/admin/activity_controller.rb +++ b/app/controllers/admin/activity_controller.rb @@ -1,5 +1,5 @@ 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 @activity = Activity.for_render.send(@current_filter) diff --git a/app/controllers/admin/banners_controller.rb b/app/controllers/admin/banners_controller.rb index 1a486bb56..fed5fe8c8 100644 --- a/app/controllers/admin/banners_controller.rb +++ b/app/controllers/admin/banners_controller.rb @@ -1,7 +1,7 @@ class Admin::BannersController < Admin::BaseController 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] diff --git a/app/controllers/admin/budget_phases_controller.rb b/app/controllers/admin/budget_phases_controller.rb index 3dd08675b..0979e852f 100644 --- a/app/controllers/admin/budget_phases_controller.rb +++ b/app/controllers/admin/budget_phases_controller.rb @@ -17,13 +17,13 @@ class Admin::BudgetPhasesController < Admin::BaseController private - def load_phase - @phase = Budget::Phase.find(params[:id]) - end + def load_phase + @phase = Budget::Phase.find(params[:id]) + end - def budget_phase_params - valid_attributes = [:starts_at, :ends_at, :enabled] - params.require(:budget_phase).permit(*valid_attributes, translation_params(Budget::Phase)) - end + def budget_phase_params + valid_attributes = [:starts_at, :ends_at, :enabled] + params.require(:budget_phase).permit(*valid_attributes, translation_params(Budget::Phase)) + end end diff --git a/app/controllers/admin/budgets_controller.rb b/app/controllers/admin/budgets_controller.rb index fdfaaf017..aac0f979e 100644 --- a/app/controllers/admin/budgets_controller.rb +++ b/app/controllers/admin/budgets_controller.rb @@ -4,7 +4,7 @@ class Admin::BudgetsController < Admin::BaseController include FeatureFlags 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] load_and_authorize_resource diff --git a/app/controllers/admin/dashboard_controller.rb b/app/controllers/admin/dashboard_controller.rb index 5fb5e3c13..f7aa5c440 100644 --- a/app/controllers/admin/dashboard_controller.rb +++ b/app/controllers/admin/dashboard_controller.rb @@ -3,4 +3,4 @@ class Admin::DashboardController < Admin::BaseController def index end -end \ No newline at end of file +end diff --git a/app/controllers/admin/debates_controller.rb b/app/controllers/admin/debates_controller.rb index 44ac33926..05fee888a 100644 --- a/app/controllers/admin/debates_controller.rb +++ b/app/controllers/admin/debates_controller.rb @@ -13,8 +13,8 @@ class Admin::DebatesController < Admin::BaseController private - def resource_model - Debate - end + def resource_model + Debate + end end diff --git a/app/controllers/admin/emails_download_controller.rb b/app/controllers/admin/emails_download_controller.rb index 434dc071f..3bafa7668 100644 --- a/app/controllers/admin/emails_download_controller.rb +++ b/app/controllers/admin/emails_download_controller.rb @@ -12,7 +12,7 @@ class Admin::EmailsDownloadController < Admin::BaseController private - def users_segment_emails_csv(users_segment) - UserSegments.user_segment_emails(users_segment).join(",") - end + def users_segment_emails_csv(users_segment) + UserSegments.user_segment_emails(users_segment).join(",") + end end diff --git a/app/controllers/admin/hidden_budget_investments_controller.rb b/app/controllers/admin/hidden_budget_investments_controller.rb index f34818361..08b95dffc 100644 --- a/app/controllers/admin/hidden_budget_investments_controller.rb +++ b/app/controllers/admin/hidden_budget_investments_controller.rb @@ -1,7 +1,7 @@ class Admin::HiddenBudgetInvestmentsController < Admin::BaseController 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 diff --git a/app/controllers/admin/hidden_comments_controller.rb b/app/controllers/admin/hidden_comments_controller.rb index 561fe3aef..e17926b36 100644 --- a/app/controllers/admin/hidden_comments_controller.rb +++ b/app/controllers/admin/hidden_comments_controller.rb @@ -1,5 +1,5 @@ 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] diff --git a/app/controllers/admin/hidden_debates_controller.rb b/app/controllers/admin/hidden_debates_controller.rb index 3e93db0a6..84374f63c 100644 --- a/app/controllers/admin/hidden_debates_controller.rb +++ b/app/controllers/admin/hidden_debates_controller.rb @@ -3,7 +3,7 @@ class Admin::HiddenDebatesController < Admin::BaseController 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] diff --git a/app/controllers/admin/hidden_users_controller.rb b/app/controllers/admin/hidden_users_controller.rb index 8237b7fd4..6035d5804 100644 --- a/app/controllers/admin/hidden_users_controller.rb +++ b/app/controllers/admin/hidden_users_controller.rb @@ -1,5 +1,5 @@ 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] diff --git a/app/controllers/admin/homepage_controller.rb b/app/controllers/admin/homepage_controller.rb index 50a433df5..4c70827d4 100644 --- a/app/controllers/admin/homepage_controller.rb +++ b/app/controllers/admin/homepage_controller.rb @@ -9,20 +9,20 @@ class Admin::HomepageController < Admin::BaseController private - def load_header - @header = ::Widget::Card.header - end + def load_header + @header = ::Widget::Card.header + end - def load_recommendations - @recommendations = Setting.where(key: "feature.user.recommendations").first - end + def load_recommendations + @recommendations = Setting.where(key: "feature.user.recommendations").first + end - def load_cards - @cards = ::Widget::Card.body - end + def load_cards + @cards = ::Widget::Card.body + end - def load_feeds - @feeds = Widget::Feed.order("created_at") - end + def load_feeds + @feeds = Widget::Feed.order("created_at") + end end diff --git a/app/controllers/admin/milestone_statuses_controller.rb b/app/controllers/admin/milestone_statuses_controller.rb index b7cbb7b4d..f365629c0 100644 --- a/app/controllers/admin/milestone_statuses_controller.rb +++ b/app/controllers/admin/milestone_statuses_controller.rb @@ -41,11 +41,11 @@ class Admin::MilestoneStatusesController < Admin::BaseController private - def load_status - @status = Milestone::Status.find(params[:id]) - end + def load_status + @status = Milestone::Status.find(params[:id]) + end - def status_params - params.require(:milestone_status).permit([:name, :description]) - end + def status_params + params.require(:milestone_status).permit([:name, :description]) + end end diff --git a/app/controllers/admin/officials_controller.rb b/app/controllers/admin/officials_controller.rb index e0a0a86ca..5cc004c54 100644 --- a/app/controllers/admin/officials_controller.rb +++ b/app/controllers/admin/officials_controller.rb @@ -30,4 +30,4 @@ class Admin::OfficialsController < Admin::BaseController params.require(:user).permit(:official_position, :official_level) end -end \ No newline at end of file +end diff --git a/app/controllers/admin/organizations_controller.rb b/app/controllers/admin/organizations_controller.rb index 9c26147e2..117d7037a 100644 --- a/app/controllers/admin/organizations_controller.rb +++ b/app/controllers/admin/organizations_controller.rb @@ -1,5 +1,5 @@ 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 diff --git a/app/controllers/admin/poll/active_polls_controller.rb b/app/controllers/admin/poll/active_polls_controller.rb index 97665ac2f..17690a803 100644 --- a/app/controllers/admin/poll/active_polls_controller.rb +++ b/app/controllers/admin/poll/active_polls_controller.rb @@ -22,7 +22,6 @@ class Admin::Poll::ActivePollsController < Admin::Poll::BaseController end end - private def load_active_poll diff --git a/app/controllers/admin/poll/questions/answers/videos_controller.rb b/app/controllers/admin/poll/questions/answers/videos_controller.rb index 7628ab081..3e76531d8 100644 --- a/app/controllers/admin/poll/questions/answers/videos_controller.rb +++ b/app/controllers/admin/poll/questions/answers/videos_controller.rb @@ -34,9 +34,9 @@ class Admin::Poll::Questions::Answers::VideosController < Admin::Poll::BaseContr def destroy notice = if @video.destroy - t("flash.actions.destroy.poll_question_answer_video") + t("flash.actions.destroy.poll_question_answer_video") else - t("flash.actions.destroy.error") + t("flash.actions.destroy.error") end redirect_back(fallback_location: (request.referrer || root_path), notice: notice) end diff --git a/app/controllers/admin/proposal_notifications_controller.rb b/app/controllers/admin/proposal_notifications_controller.rb index 1fee9a055..f83cb1580 100644 --- a/app/controllers/admin/proposal_notifications_controller.rb +++ b/app/controllers/admin/proposal_notifications_controller.rb @@ -1,6 +1,6 @@ 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] diff --git a/app/controllers/admin/valuator_groups_controller.rb b/app/controllers/admin/valuator_groups_controller.rb index 6e8930122..7e2e6bb16 100644 --- a/app/controllers/admin/valuator_groups_controller.rb +++ b/app/controllers/admin/valuator_groups_controller.rb @@ -49,4 +49,4 @@ class Admin::ValuatorGroupsController < Admin::BaseController params.require(:valuator_group).permit(:name) end -end \ No newline at end of file +end diff --git a/app/controllers/budgets/groups_controller.rb b/app/controllers/budgets/groups_controller.rb index e309a3c8c..d289cca49 100644 --- a/app/controllers/budgets/groups_controller.rb +++ b/app/controllers/budgets/groups_controller.rb @@ -21,4 +21,4 @@ module Budgets @group = @budget.groups.find_by_slug_or_id! params[:id] end end -end \ No newline at end of file +end diff --git a/app/controllers/budgets/investments_controller.rb b/app/controllers/budgets/investments_controller.rb index 5a57dd1f4..18127079b 100644 --- a/app/controllers/budgets/investments_controller.rb +++ b/app/controllers/budgets/investments_controller.rb @@ -30,7 +30,7 @@ module 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 valid_filters = %w[not_unfeasible feasible unfeasible unselected selected winners] diff --git a/app/controllers/communities_controller.rb b/app/controllers/communities_controller.rb index fc8298d41..ff3996322 100644 --- a/app/controllers/communities_controller.rb +++ b/app/controllers/communities_controller.rb @@ -1,5 +1,5 @@ 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 has_orders TOPIC_ORDERS @@ -13,27 +13,27 @@ class CommunitiesController < ApplicationController private - def set_order - @order = valid_order? ? params[:order] : "newest" - end + def set_order + @order = valid_order? ? params[:order] : "newest" + end - def set_community - @community = Community.find(params[:id]) - end + def set_community + @community = Community.find(params[:id]) + end - def load_topics - @topics = @community.topics.send("sort_by_#{@order}").page(params[:page]) - end + def load_topics + @topics = @community.topics.send("sort_by_#{@order}").page(params[:page]) + end - def load_participants - @participants = @community.participants - end + def load_participants + @participants = @community.participants + end - def valid_order? - params[:order].present? && TOPIC_ORDERS.include?(params[:order]) - end + def valid_order? + params[:order].present? && TOPIC_ORDERS.include?(params[:order]) + end - def communitable_exists? - @community.proposal.present? || @community.investment.present? - end + def communitable_exists? + @community.proposal.present? || @community.investment.present? + end end diff --git a/app/controllers/dashboard/supports_controller.rb b/app/controllers/dashboard/supports_controller.rb index 3605c6132..177cc24fb 100644 --- a/app/controllers/dashboard/supports_controller.rb +++ b/app/controllers/dashboard/supports_controller.rb @@ -15,7 +15,6 @@ class Dashboard::SupportsController < Dashboard::BaseController accumulate_supports(grouped_votes) end - def supports @supports ||= Vote .where(votable: proposal, diff --git a/app/controllers/debates_controller.rb b/app/controllers/debates_controller.rb index c0def9803..b83f2ddc2 100644 --- a/app/controllers/debates_controller.rb +++ b/app/controllers/debates_controller.rb @@ -14,7 +14,7 @@ class DebatesController < ApplicationController invisible_captcha only: [:create, :update], honeypot: :subtitle 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 helper_method :resource_model, :resource_name diff --git a/app/controllers/direct_messages_controller.rb b/app/controllers/direct_messages_controller.rb index 07f39d941..fa520dfcf 100644 --- a/app/controllers/direct_messages_controller.rb +++ b/app/controllers/direct_messages_controller.rb @@ -33,4 +33,4 @@ class DirectMessagesController < ApplicationController def parsed_params direct_message_params.merge(sender: @sender, receiver: @receiver) end -end \ No newline at end of file +end diff --git a/app/controllers/direct_uploads_controller.rb b/app/controllers/direct_uploads_controller.rb index a067a5d04..5b19977f7 100644 --- a/app/controllers/direct_uploads_controller.rb +++ b/app/controllers/direct_uploads_controller.rb @@ -39,10 +39,10 @@ class DirectUploadsController < ApplicationController private - def direct_upload_params - params.require(:direct_upload) - .permit(:resource, :resource_type, :resource_id, :resource_relation, - :attachment, :cached_attachment, attachment_attributes: []) - end + def direct_upload_params + params.require(:direct_upload) + .permit(:resource, :resource_type, :resource_id, :resource_relation, + :attachment, :cached_attachment, attachment_attributes: []) + end -end \ No newline at end of file +end diff --git a/app/controllers/follows_controller.rb b/app/controllers/follows_controller.rb index 78185b5b4..4331a52eb 100644 --- a/app/controllers/follows_controller.rb +++ b/app/controllers/follows_controller.rb @@ -17,12 +17,12 @@ class FollowsController < ApplicationController private - def find_followable - params[:followable_type].constantize.find(params[:followable_id]) - end + def find_followable + params[:followable_type].constantize.find(params[:followable_id]) + end - def followable_translation_key(followable) - followable.class.name.parameterize(separator: "_") - end + def followable_translation_key(followable) + followable.class.name.parameterize(separator: "_") + end end diff --git a/app/controllers/installation_controller.rb b/app/controllers/installation_controller.rb index 79c244e5e..4a9174f53 100644 --- a/app/controllers/installation_controller.rb +++ b/app/controllers/installation_controller.rb @@ -10,14 +10,14 @@ class InstallationController < ApplicationController private - def consul_installation_details - { - release: "1.0.0" - }.merge(features: settings_feature_flags) - end + def consul_installation_details + { + release: "1.0.0" + }.merge(features: settings_feature_flags) + end - def settings_feature_flags - Setting.where("key LIKE 'feature.%'").each_with_object({}) { |x, n| n[x.key.remove("feature.")] = x.value } - end + def settings_feature_flags + Setting.where("key LIKE 'feature.%'").each_with_object({}) { |x, n| n[x.key.remove("feature.")] = x.value } + end end diff --git a/app/controllers/legislation/processes_controller.rb b/app/controllers/legislation/processes_controller.rb index 85374f27a..c450963e4 100644 --- a/app/controllers/legislation/processes_controller.rb +++ b/app/controllers/legislation/processes_controller.rb @@ -10,7 +10,6 @@ class Legislation::ProcessesController < Legislation::BaseController before_action :set_random_seed, only: :proposals before_action :check_past, only: :resume - def index @current_filter ||= "open" @processes = ::Legislation::Process.send(@current_filter).published diff --git a/app/controllers/legislation/proposals_controller.rb b/app/controllers/legislation/proposals_controller.rb index 944a4f6aa..4db3b0e72 100644 --- a/app/controllers/legislation/proposals_controller.rb +++ b/app/controllers/legislation/proposals_controller.rb @@ -13,8 +13,8 @@ class Legislation::ProposalsController < Legislation::BaseController invisible_captcha only: [:create, :update], honeypot: :subtitle - has_orders %w{confidence_score created_at}, only: :index - has_orders %w{most_voted newest oldest}, only: :show + has_orders %w[confidence_score created_at], only: :index + has_orders %w[most_voted newest oldest], only: :show helper_method :resource_model, :resource_name respond_to :html, :js diff --git a/app/controllers/legislation/questions_controller.rb b/app/controllers/legislation/questions_controller.rb index d50443281..7ee66fd64 100644 --- a/app/controllers/legislation/questions_controller.rb +++ b/app/controllers/legislation/questions_controller.rb @@ -2,7 +2,7 @@ class Legislation::QuestionsController < Legislation::BaseController load_and_authorize_resource :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 @commentable = @question diff --git a/app/controllers/management/dashboard_controller.rb b/app/controllers/management/dashboard_controller.rb index 87b134270..abb605341 100644 --- a/app/controllers/management/dashboard_controller.rb +++ b/app/controllers/management/dashboard_controller.rb @@ -3,4 +3,4 @@ class Management::DashboardController < Management::BaseController def index end -end \ No newline at end of file +end diff --git a/app/controllers/management/email_verifications_controller.rb b/app/controllers/management/email_verifications_controller.rb index 7d511fe4b..ef304de26 100644 --- a/app/controllers/management/email_verifications_controller.rb +++ b/app/controllers/management/email_verifications_controller.rb @@ -20,4 +20,4 @@ class Management::EmailVerificationsController < Management::BaseController params.require(:email_verification).permit(:document_type, :document_number, :email) end -end \ No newline at end of file +end diff --git a/app/controllers/management/user_invites_controller.rb b/app/controllers/management/user_invites_controller.rb index 4d9b4909f..cbe3d1914 100644 --- a/app/controllers/management/user_invites_controller.rb +++ b/app/controllers/management/user_invites_controller.rb @@ -10,4 +10,4 @@ class Management::UserInvitesController < Management::BaseController end end -end \ No newline at end of file +end diff --git a/app/controllers/moderation/budgets/investments_controller.rb b/app/controllers/moderation/budgets/investments_controller.rb index a56534259..8944c78fa 100644 --- a/app/controllers/moderation/budgets/investments_controller.rb +++ b/app/controllers/moderation/budgets/investments_controller.rb @@ -2,8 +2,8 @@ class Moderation::Budgets::InvestmentsController < Moderation::BaseController include FeatureFlags include ModerateActions - has_filters %w{pending_flag_review all with_ignored_flag}, only: :index - has_orders %w{flags created_at}, only: :index + has_filters %w[pending_flag_review all with_ignored_flag], only: :index + has_orders %w[flags created_at], only: :index feature_flag :budgets diff --git a/app/controllers/moderation/comments_controller.rb b/app/controllers/moderation/comments_controller.rb index d5fbf7954..6a93108ba 100644 --- a/app/controllers/moderation/comments_controller.rb +++ b/app/controllers/moderation/comments_controller.rb @@ -1,8 +1,8 @@ class Moderation::CommentsController < Moderation::BaseController include ModerateActions - has_filters %w{pending_flag_review all with_ignored_flag}, only: :index - has_orders %w{flags newest}, only: :index + has_filters %w[pending_flag_review all with_ignored_flag], only: :index + has_orders %w[flags newest], only: :index before_action :load_resources, only: [:index, :moderate] diff --git a/app/controllers/moderation/debates_controller.rb b/app/controllers/moderation/debates_controller.rb index aaa3d9f89..a85d300d2 100644 --- a/app/controllers/moderation/debates_controller.rb +++ b/app/controllers/moderation/debates_controller.rb @@ -2,8 +2,8 @@ class Moderation::DebatesController < Moderation::BaseController include ModerateActions include FeatureFlags - has_filters %w{pending_flag_review all with_ignored_flag}, only: :index - has_orders %w{flags created_at}, only: :index + has_filters %w[pending_flag_review all with_ignored_flag], only: :index + has_orders %w[flags created_at], only: :index feature_flag :debates diff --git a/app/controllers/moderation/proposal_notifications_controller.rb b/app/controllers/moderation/proposal_notifications_controller.rb index d36e0614e..abd680d5f 100644 --- a/app/controllers/moderation/proposal_notifications_controller.rb +++ b/app/controllers/moderation/proposal_notifications_controller.rb @@ -1,8 +1,8 @@ class Moderation::ProposalNotificationsController < Moderation::BaseController include ModerateActions - has_filters %w{pending_review all ignored}, only: :index - has_orders %w{created_at moderated}, only: :index + has_filters %w[pending_review all ignored], only: :index + has_orders %w[created_at moderated], only: :index before_action :load_resources, only: [:index, :moderate] diff --git a/app/controllers/moderation/proposals_controller.rb b/app/controllers/moderation/proposals_controller.rb index f15aca85d..6d358c1bf 100644 --- a/app/controllers/moderation/proposals_controller.rb +++ b/app/controllers/moderation/proposals_controller.rb @@ -2,8 +2,8 @@ class Moderation::ProposalsController < Moderation::BaseController include ModerateActions include FeatureFlags - has_filters %w{pending_flag_review all with_ignored_flag}, only: :index - has_orders %w{flags created_at}, only: :index + has_filters %w[pending_flag_review all with_ignored_flag], only: :index + has_orders %w[flags created_at], only: :index feature_flag :proposals diff --git a/app/controllers/officing/ballot_sheets_controller.rb b/app/controllers/officing/ballot_sheets_controller.rb index 9a4f08401..835e8a23b 100644 --- a/app/controllers/officing/ballot_sheets_controller.rb +++ b/app/controllers/officing/ballot_sheets_controller.rb @@ -32,39 +32,39 @@ class Officing::BallotSheetsController < Officing::BaseController private - def namespace - "officing" - end + def namespace + "officing" + end - def load_poll - @poll = Poll.find(params[:poll_id]) - end + def load_poll + @poll = Poll.find(params[:poll_id]) + end - def load_ballot_sheets - @ballot_sheets = Poll::BallotSheet.where(poll: @poll) - end + def load_ballot_sheets + @ballot_sheets = Poll::BallotSheet.where(poll: @poll) + end - def load_ballot_sheet - @ballot_sheet = Poll::BallotSheet.find(params[:id]) - end + def load_ballot_sheet + @ballot_sheet = Poll::BallotSheet.find(params[:id]) + end - def load_officer_assignments - @officer_assignments = ::Poll::OfficerAssignment. - includes(booth_assignment: [:booth]). - joins(:booth_assignment). - final. - where(id: current_user.poll_officer.officer_assignment_ids). - where("poll_booth_assignments.poll_id = ?", @poll.id). - where(date: Date.current) - end + def load_officer_assignments + @officer_assignments = ::Poll::OfficerAssignment. + includes(booth_assignment: [:booth]). + joins(:booth_assignment). + final. + where(id: current_user.poll_officer.officer_assignment_ids). + where("poll_booth_assignments.poll_id = ?", @poll.id). + where(date: Date.current) + end - def load_officer_assignment - @officer_assignment = current_user.poll_officer.officer_assignments.final - .find_by(id: ballot_sheet_params[:officer_assignment_id]) - end + def load_officer_assignment + @officer_assignment = current_user.poll_officer.officer_assignments.final + .find_by(id: ballot_sheet_params[:officer_assignment_id]) + end - def ballot_sheet_params - params.permit(:data, :poll_id, :officer_assignment_id) - end + def ballot_sheet_params + params.permit(:data, :poll_id, :officer_assignment_id) + end end diff --git a/app/controllers/officing/booth_controller.rb b/app/controllers/officing/booth_controller.rb index 584c92de0..6da408e67 100644 --- a/app/controllers/officing/booth_controller.rb +++ b/app/controllers/officing/booth_controller.rb @@ -13,12 +13,12 @@ class Officing::BoothController < Officing::BaseController private - def booth_params - params.require(:booth).permit(:id) - end + def booth_params + params.require(:booth).permit(:id) + end - def set_booth(booth) - session[:booth_id] = booth.id - end + def set_booth(booth) + session[:booth_id] = booth.id + end end diff --git a/app/controllers/related_contents_controller.rb b/app/controllers/related_contents_controller.rb index 0c31d5f69..a36ba23f9 100644 --- a/app/controllers/related_contents_controller.rb +++ b/app/controllers/related_contents_controller.rb @@ -30,22 +30,22 @@ class RelatedContentsController < ApplicationController private - def score(action) - @related = RelatedContent.find params[:id] - @related.send("score_#{action}", current_user) + def score(action) + @related = RelatedContent.find params[:id] + @related.send("score_#{action}", current_user) - render template: "relationable/_refresh_score_actions" - end + render template: "relationable/_refresh_score_actions" + end - def valid_url? - params[:url].start_with?(Setting["url"]) - end + def valid_url? + params[:url].start_with?(Setting["url"]) + end - def relationable_object - @relationable = params[:relationable_klass].singularize.camelize.constantize.find_by(id: params[:relationable_id]) - end + def relationable_object + @relationable = params[:relationable_klass].singularize.camelize.constantize.find_by(id: params[:relationable_id]) + end - def related_object + def related_object if valid_url? url = params[:url] @@ -55,7 +55,7 @@ class RelatedContentsController < ApplicationController @related = related_klass.singularize.camelize.constantize.find_by(id: related_id) end - rescue + rescue nil - end + end end diff --git a/app/controllers/sandbox_controller.rb b/app/controllers/sandbox_controller.rb index ec813c49f..ca18b4588 100644 --- a/app/controllers/sandbox_controller.rb +++ b/app/controllers/sandbox_controller.rb @@ -31,15 +31,15 @@ class SandboxController < ApplicationController private - def set_layout - if params[:template] && params[:template].split("_").first == "admin" - "admin" - else - "application" + def set_layout + if params[:template] && params[:template].split("_").first == "admin" + "admin" + else + "application" + end end - end - def namespace - "admin" - end + def namespace + "admin" + end end diff --git a/app/controllers/topics_controller.rb b/app/controllers/topics_controller.rb index f3f0dd7ef..7c75e2fa0 100644 --- a/app/controllers/topics_controller.rb +++ b/app/controllers/topics_controller.rb @@ -4,7 +4,7 @@ class TopicsController < ApplicationController before_action :load_community 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 load_and_authorize_resource except: :show @@ -46,15 +46,15 @@ class TopicsController < ApplicationController private - def topic_params - params.require(:topic).permit(:title, :description) - end + def topic_params + params.require(:topic).permit(:title, :description) + end - def load_community - @community = Community.find(params[:community_id]) - end + def load_community + @community = Community.find(params[:community_id]) + end - def load_topic - @topic = Topic.find(params[:id]) - end + def load_topic + @topic = Topic.find(params[:id]) + end end diff --git a/app/controllers/tracking/budget_investments_controller.rb b/app/controllers/tracking/budget_investments_controller.rb index 65afda323..946f61143 100644 --- a/app/controllers/tracking/budget_investments_controller.rb +++ b/app/controllers/tracking/budget_investments_controller.rb @@ -8,7 +8,7 @@ class Tracking::BudgetInvestmentsController < Tracking::BaseController before_action :load_budget 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" diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 905bcf8c8..690b74f68 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -1,5 +1,5 @@ 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 helper_method :author? diff --git a/app/controllers/valuation/budget_investments_controller.rb b/app/controllers/valuation/budget_investments_controller.rb index 66398f14f..6c33a2766 100644 --- a/app/controllers/valuation/budget_investments_controller.rb +++ b/app/controllers/valuation/budget_investments_controller.rb @@ -9,8 +9,8 @@ class Valuation::BudgetInvestmentsController < Valuation::BaseController before_action :load_budget before_action :load_investment, only: [:show, :edit, :valuate] - has_orders %w{oldest}, only: [:show, :edit] - has_filters %w{valuating valuation_finished}, only: :index + has_orders %w[oldest], only: [:show, :edit] + has_filters %w[valuating valuation_finished], only: :index load_and_authorize_resource :investment, class: "Budget::Investment" diff --git a/app/controllers/verification/verified_user_controller.rb b/app/controllers/verification/verified_user_controller.rb index e637bb232..bc55f19f4 100644 --- a/app/controllers/verification/verified_user_controller.rb +++ b/app/controllers/verification/verified_user_controller.rb @@ -21,4 +21,4 @@ class Verification::VerifiedUserController < ApplicationController data end -end \ No newline at end of file +end diff --git a/app/controllers/welcome_controller.rb b/app/controllers/welcome_controller.rb index b6bb138c4..fee05dfd1 100644 --- a/app/controllers/welcome_controller.rb +++ b/app/controllers/welcome_controller.rb @@ -33,9 +33,9 @@ class WelcomeController < ApplicationController private - def set_user_recommendations - @recommended_debates = Debate.recommendations(current_user).sort_by_recommendations.limit(3) - @recommended_proposals = Proposal.recommendations(current_user).sort_by_recommendations.limit(3) - end + def set_user_recommendations + @recommended_debates = Debate.recommendations(current_user).sort_by_recommendations.limit(3) + @recommended_proposals = Proposal.recommendations(current_user).sort_by_recommendations.limit(3) + end end diff --git a/app/helpers/cache_keys_helper.rb b/app/helpers/cache_keys_helper.rb index 75fc4a0ea..9b37807fb 100644 --- a/app/helpers/cache_keys_helper.rb +++ b/app/helpers/cache_keys_helper.rb @@ -27,4 +27,4 @@ module CacheKeysHelper "#{commentable.class.name}-#{commentable.id}" end -end \ No newline at end of file +end diff --git a/app/helpers/direct_uploads_helper.rb b/app/helpers/direct_uploads_helper.rb index 87ed630d7..d697b5127 100644 --- a/app/helpers/direct_uploads_helper.rb +++ b/app/helpers/direct_uploads_helper.rb @@ -13,4 +13,4 @@ module DirectUploadsHelper class: "delete remove-cached-attachment" end -end \ No newline at end of file +end diff --git a/app/helpers/flags_helper.rb b/app/helpers/flags_helper.rb index 9983b34ae..c02dcefad 100644 --- a/app/helpers/flags_helper.rb +++ b/app/helpers/flags_helper.rb @@ -10,20 +10,20 @@ module FlagsHelper private - def flagged?(flaggable) - if flaggable.is_a? Comment - @comment_flags[flaggable.id] unless flaggable.commentable_type == "Poll" - else - Flag.flagged?(current_user, flaggable) + def flagged?(flaggable) + if flaggable.is_a? Comment + @comment_flags[flaggable.id] unless flaggable.commentable_type == "Poll" + else + Flag.flagged?(current_user, flaggable) + end end - end - def own_flaggable?(flaggable) - if flaggable.is_a? Comment - flaggable.user_id == current_user.id - else - flaggable.author_id == current_user.id + def own_flaggable?(flaggable) + if flaggable.is_a? Comment + flaggable.user_id == current_user.id + else + flaggable.author_id == current_user.id + end end - end end diff --git a/app/helpers/map_locations_helper.rb b/app/helpers/map_locations_helper.rb index eeab8681a..d0f51f5f6 100644 --- a/app/helpers/map_locations_helper.rb +++ b/app/helpers/map_locations_helper.rb @@ -47,24 +47,24 @@ module MapLocationsHelper private - def prepare_map_settings(map_location, editable, parent_class, investments_coordinates=nil) - options = { - map: "", - map_center_latitude: map_location_latitude(map_location), - map_center_longitude: map_location_longitude(map_location), - map_zoom: map_location_zoom(map_location), - map_tiles_provider: Rails.application.secrets.map_tiles_provider, - map_tiles_provider_attribution: Rails.application.secrets.map_tiles_provider_attribution, - marker_editable: editable, - marker_remove_selector: "##{map_location_remove_marker_link_id(map_location)}", - latitude_input_selector: "##{map_location_input_id(parent_class, "latitude")}", - longitude_input_selector: "##{map_location_input_id(parent_class, "longitude")}", - zoom_input_selector: "##{map_location_input_id(parent_class, "zoom")}", - marker_investments_coordinates: investments_coordinates - } - options[:marker_latitude] = map_location.latitude if map_location.latitude.present? - options[:marker_longitude] = map_location.longitude if map_location.longitude.present? - options - end + def prepare_map_settings(map_location, editable, parent_class, investments_coordinates=nil) + options = { + map: "", + map_center_latitude: map_location_latitude(map_location), + map_center_longitude: map_location_longitude(map_location), + map_zoom: map_location_zoom(map_location), + map_tiles_provider: Rails.application.secrets.map_tiles_provider, + map_tiles_provider_attribution: Rails.application.secrets.map_tiles_provider_attribution, + marker_editable: editable, + marker_remove_selector: "##{map_location_remove_marker_link_id(map_location)}", + latitude_input_selector: "##{map_location_input_id(parent_class, "latitude")}", + longitude_input_selector: "##{map_location_input_id(parent_class, "longitude")}", + zoom_input_selector: "##{map_location_input_id(parent_class, "zoom")}", + marker_investments_coordinates: investments_coordinates + } + options[:marker_latitude] = map_location.latitude if map_location.latitude.present? + options[:marker_longitude] = map_location.longitude if map_location.longitude.present? + options + end end diff --git a/app/helpers/shifts_helper.rb b/app/helpers/shifts_helper.rb index 7ea17baf2..965cbde4e 100644 --- a/app/helpers/shifts_helper.rb +++ b/app/helpers/shifts_helper.rb @@ -37,7 +37,7 @@ module ShiftsHelper private - def officer_shifts(task_id, booth) - @officer.shifts.where(task: task_id, booth: booth).map(&:date) - end + def officer_shifts(task_id, booth) + @officer.shifts.where(task: task_id, booth: booth).map(&:date) + end end diff --git a/app/helpers/welcome_helper.rb b/app/helpers/welcome_helper.rb index fa729492e..8f674574c 100644 --- a/app/helpers/welcome_helper.rb +++ b/app/helpers/welcome_helper.rb @@ -48,9 +48,9 @@ module WelcomeHelper def calculate_offset(debates, proposals, apply_offset) if debates.any? && proposals.any? offset = if apply_offset - "medium-offset-2 large-offset-2" + "medium-offset-2 large-offset-2" else - "end" + "end" end end end diff --git a/app/mailers/devise_mailer.rb b/app/mailers/devise_mailer.rb index 9f1bb6f4e..89f2a76b6 100644 --- a/app/mailers/devise_mailer.rb +++ b/app/mailers/devise_mailer.rb @@ -5,9 +5,9 @@ class DeviseMailer < Devise::Mailer protected - def devise_mail(record, action, opts = {}) - I18n.with_locale record.locale do - super(record, action, opts) + def devise_mail(record, action, opts = {}) + I18n.with_locale record.locale do + super(record, action, opts) + end end - end end diff --git a/app/mailers/mailer.rb b/app/mailers/mailer.rb index 9defb0f15..b8c473980 100644 --- a/app/mailers/mailer.rb +++ b/app/mailers/mailer.rb @@ -129,16 +129,16 @@ class Mailer < ApplicationMailer private - def with_user(user, &block) - I18n.with_locale(user.locale) do - yield + def with_user(user, &block) + I18n.with_locale(user.locale) do + yield + end end - end - def prevent_delivery_to_users_without_email - if @email_to.blank? - mail.perform_deliveries = false + def prevent_delivery_to_users_without_email + if @email_to.blank? + mail.perform_deliveries = false + end end - end end diff --git a/app/models/activity.rb b/app/models/activity.rb index ed617c97a..1bc3851b8 100644 --- a/app/models/activity.rb +++ b/app/models/activity.rb @@ -2,7 +2,7 @@ class Activity < ApplicationRecord belongs_to :actionable, -> { with_hidden }, polymorphic: true 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} diff --git a/app/models/admin_notification.rb b/app/models/admin_notification.rb index 5e86f3d28..3fdec9c16 100644 --- a/app/models/admin_notification.rb +++ b/app/models/admin_notification.rb @@ -35,14 +35,14 @@ class AdminNotification < ApplicationRecord private - def validate_segment_recipient - errors.add(:segment_recipient, :invalid) unless valid_segment_recipient? - end - - def complete_link_url - return unless link.present? - unless self.link[/\Ahttp:\/\//] || self.link[/\Ahttps:\/\//] - self.link = "http://#{self.link}" + def validate_segment_recipient + errors.add(:segment_recipient, :invalid) unless valid_segment_recipient? + end + + def complete_link_url + return unless link.present? + unless self.link[/\Ahttp:\/\//] || self.link[/\Ahttps:\/\//] + self.link = "http://#{self.link}" + end end - end end diff --git a/app/models/ahoy/data_source.rb b/app/models/ahoy/data_source.rb index ba8a2cf14..78c228fc4 100644 --- a/app/models/ahoy/data_source.rb +++ b/app/models/ahoy/data_source.rb @@ -32,17 +32,17 @@ module Ahoy private - def collections - @collections ||= [] - end + def collections + @collections ||= [] + end - def shared_keys - @shared_keys ||= [] - end + def shared_keys + @shared_keys ||= [] + end - def add_key(key) - shared_keys.push(key) unless shared_keys.include? key - end + def add_key(key) + shared_keys.push(key) unless shared_keys.include? key + end end diff --git a/app/models/budget.rb b/app/models/budget.rb index c4fe62eeb..8b8b7c6f6 100644 --- a/app/models/budget.rb +++ b/app/models/budget.rb @@ -20,7 +20,7 @@ class Budget < ApplicationRecord end end - CURRENCY_SYMBOLS = %w(€ $ £ ¥).freeze + CURRENCY_SYMBOLS = %w[€ $ £ ¥].freeze validates_translation :name, presence: true validates :phase, inclusion: { in: Budget::Phase::PHASE_KINDS } @@ -173,13 +173,13 @@ class Budget < ApplicationRecord def investments_orders case phase when "accepting", "reviewing" - %w{random} + %w[random] when "publishing_prices", "balloting", "reviewing_ballots" - %w{random price} + %w[random price] when "finished" - %w{random} + %w[random] else - %w{random confidence_score} + %w[random confidence_score] end end @@ -205,28 +205,28 @@ class Budget < ApplicationRecord private - def sanitize_descriptions - s = WYSIWYGSanitizer.new - Budget::Phase::PHASE_KINDS.each do |phase| - sanitized = s.sanitize(send("description_#{phase}")) - send("description_#{phase}=", sanitized) + def sanitize_descriptions + s = WYSIWYGSanitizer.new + Budget::Phase::PHASE_KINDS.each do |phase| + sanitized = s.sanitize(send("description_#{phase}")) + send("description_#{phase}=", sanitized) + end end - end - def generate_phases - Budget::Phase::PHASE_KINDS.each do |phase| - Budget::Phase.create( - budget: self, - kind: phase, - prev_phase: phases&.last, - starts_at: phases&.last&.ends_at || Date.current, - ends_at: (phases&.last&.ends_at || Date.current) + 1.month - ) + def generate_phases + Budget::Phase::PHASE_KINDS.each do |phase| + Budget::Phase.create( + budget: self, + kind: phase, + prev_phase: phases&.last, + starts_at: phases&.last&.ends_at || Date.current, + ends_at: (phases&.last&.ends_at || Date.current) + 1.month + ) + end end - end - def generate_slug? - slug.nil? || drafting? - end + def generate_slug? + slug.nil? || drafting? + end end diff --git a/app/models/budget/group.rb b/app/models/budget/group.rb index 71eebb308..bcf217182 100644 --- a/app/models/budget/group.rb +++ b/app/models/budget/group.rb @@ -36,8 +36,8 @@ class Budget private - def generate_slug? - slug.nil? || budget.drafting? - end + def generate_slug? + slug.nil? || budget.drafting? + end end end diff --git a/app/models/budget/heading.rb b/app/models/budget/heading.rb index 0e218d6fb..3e3d8b07d 100644 --- a/app/models/budget/heading.rb +++ b/app/models/budget/heading.rb @@ -56,8 +56,8 @@ class Budget private - def generate_slug? - slug.nil? || budget.drafting? - end + def generate_slug? + slug.nil? || budget.drafting? + end end end diff --git a/app/models/budget/investment/exporter.rb b/app/models/budget/investment/exporter.rb index e355600f3..cf4972198 100644 --- a/app/models/budget/investment/exporter.rb +++ b/app/models/budget/investment/exporter.rb @@ -14,54 +14,54 @@ class Budget::Investment::Exporter private - def headers - [ - I18n.t("admin.budget_investments.index.list.id"), - I18n.t("admin.budget_investments.index.list.title"), - I18n.t("admin.budget_investments.index.list.supports"), - I18n.t("admin.budget_investments.index.list.admin"), - I18n.t("admin.budget_investments.index.list.valuator"), - I18n.t("admin.budget_investments.index.list.valuation_group"), - I18n.t("admin.budget_investments.index.list.geozone"), - I18n.t("admin.budget_investments.index.list.feasibility"), - I18n.t("admin.budget_investments.index.list.valuation_finished"), - I18n.t("admin.budget_investments.index.list.selected"), - I18n.t("admin.budget_investments.index.list.visible_to_valuators"), - I18n.t("admin.budget_investments.index.list.author_username") - ] - end - - def csv_values(investment) - [ - investment.id.to_s, - investment.title, - investment.total_votes.to_s, - admin(investment), - investment.assigned_valuators || "-", - investment.assigned_valuation_groups || "-", - investment.heading.name, - price(investment), - investment.valuation_finished? ? I18n.t("shared.yes") : I18n.t("shared.no"), - investment.selected? ? I18n.t("shared.yes") : I18n.t("shared.no"), - investment.visible_to_valuators? ? I18n.t("shared.yes") : I18n.t("shared.no"), - investment.author.username - ] - end - - def admin(investment) - if investment.administrator.present? - investment.administrator.name - else - I18n.t("admin.budget_investments.index.no_admin_assigned") + def headers + [ + I18n.t("admin.budget_investments.index.list.id"), + I18n.t("admin.budget_investments.index.list.title"), + I18n.t("admin.budget_investments.index.list.supports"), + I18n.t("admin.budget_investments.index.list.admin"), + I18n.t("admin.budget_investments.index.list.valuator"), + I18n.t("admin.budget_investments.index.list.valuation_group"), + I18n.t("admin.budget_investments.index.list.geozone"), + I18n.t("admin.budget_investments.index.list.feasibility"), + I18n.t("admin.budget_investments.index.list.valuation_finished"), + I18n.t("admin.budget_investments.index.list.selected"), + I18n.t("admin.budget_investments.index.list.visible_to_valuators"), + I18n.t("admin.budget_investments.index.list.author_username") + ] end - end - def price(investment) - price_string = "admin.budget_investments.index.feasibility.#{investment.feasibility}" - if investment.feasible? - "#{I18n.t(price_string)} (#{investment.formatted_price})" - else - I18n.t(price_string) + def csv_values(investment) + [ + investment.id.to_s, + investment.title, + investment.total_votes.to_s, + admin(investment), + investment.assigned_valuators || "-", + investment.assigned_valuation_groups || "-", + investment.heading.name, + price(investment), + investment.valuation_finished? ? I18n.t("shared.yes") : I18n.t("shared.no"), + investment.selected? ? I18n.t("shared.yes") : I18n.t("shared.no"), + investment.visible_to_valuators? ? I18n.t("shared.yes") : I18n.t("shared.no"), + investment.author.username + ] + end + + def admin(investment) + if investment.administrator.present? + investment.administrator.name + else + I18n.t("admin.budget_investments.index.no_admin_assigned") + end + end + + def price(investment) + price_string = "admin.budget_investments.index.feasibility.#{investment.feasibility}" + if investment.feasible? + "#{I18n.t(price_string)} (#{investment.formatted_price})" + else + I18n.t(price_string) + end end - end end diff --git a/app/models/budget/phase.rb b/app/models/budget/phase.rb index 56d125d1d..ccaf2f78d 100644 --- a/app/models/budget/phase.rb +++ b/app/models/budget/phase.rb @@ -1,8 +1,8 @@ class Budget class Phase < ApplicationRecord - PHASE_KINDS = %w(drafting informing accepting reviewing selecting valuating publishing_prices balloting - reviewing_ballots finished).freeze - PUBLISHED_PRICES_PHASES = %w(publishing_prices balloting reviewing_ballots finished).freeze + PHASE_KINDS = %w[drafting informing accepting reviewing selecting valuating publishing_prices balloting + reviewing_ballots finished].freeze + PUBLISHED_PRICES_PHASES = %w[publishing_prices balloting reviewing_ballots finished].freeze SUMMARY_MAX_LENGTH = 1000 DESCRIPTION_MAX_LENGTH = 2000 diff --git a/app/models/budget/reclassification.rb b/app/models/budget/reclassification.rb index 7eefc0d33..f698ad381 100644 --- a/app/models/budget/reclassification.rb +++ b/app/models/budget/reclassification.rb @@ -47,4 +47,4 @@ class Budget end end -end \ No newline at end of file +end diff --git a/app/models/budget/reclassified_vote.rb b/app/models/budget/reclassified_vote.rb index 3f11aa388..6b3ad99d8 100644 --- a/app/models/budget/reclassified_vote.rb +++ b/app/models/budget/reclassified_vote.rb @@ -1,6 +1,6 @@ class Budget class ReclassifiedVote < ApplicationRecord - REASONS = %w(heading_changed unfeasible) + REASONS = %w[heading_changed unfeasible] belongs_to :user belongs_to :investment @@ -9,4 +9,4 @@ class Budget validates :investment, presence: true validates :reason, inclusion: {in: REASONS, allow_nil: false} end -end \ No newline at end of file +end diff --git a/app/models/budget/valuator_group_assignment.rb b/app/models/budget/valuator_group_assignment.rb index 3aa93cb14..cfacce16c 100644 --- a/app/models/budget/valuator_group_assignment.rb +++ b/app/models/budget/valuator_group_assignment.rb @@ -3,4 +3,4 @@ class Budget belongs_to :valuator_group, counter_cache: :budget_investments_count belongs_to :investment, counter_cache: true end -end \ No newline at end of file +end diff --git a/app/models/comment_notifier.rb b/app/models/comment_notifier.rb index 68b350e6b..be8a9d69a 100644 --- a/app/models/comment_notifier.rb +++ b/app/models/comment_notifier.rb @@ -11,25 +11,25 @@ class CommentNotifier private - def send_comment_email - unless @comment.commentable.is_a?(Legislation::Annotation) - Mailer.comment(@comment).deliver_later if email_on_comment? + def send_comment_email + unless @comment.commentable.is_a?(Legislation::Annotation) + Mailer.comment(@comment).deliver_later if email_on_comment? + end end - end - def send_reply_email - Mailer.reply(@comment).deliver_later if email_on_comment_reply? - end + def send_reply_email + Mailer.reply(@comment).deliver_later if email_on_comment_reply? + end - def email_on_comment? - commentable_author = @comment.commentable.author - commentable_author != @author && commentable_author.email_on_comment? - end + def email_on_comment? + commentable_author = @comment.commentable.author + commentable_author != @author && commentable_author.email_on_comment? + end - def email_on_comment_reply? - return false unless @comment.reply? - parent_author = @comment.parent.author - parent_author != @author && parent_author.email_on_comment_reply? - end + def email_on_comment_reply? + return false unless @comment.reply? + parent_author = @comment.parent.author + parent_author != @author && parent_author.email_on_comment_reply? + end end diff --git a/app/models/community.rb b/app/models/community.rb index c4430a2ca..3a40b682c 100644 --- a/app/models/community.rb +++ b/app/models/community.rb @@ -44,18 +44,18 @@ class Community < ApplicationRecord private - def users_who_commented - topics_ids = topics.pluck(:id) - query = "comments.commentable_id IN (?)and comments.commentable_type = 'Topic'" - User.by_comments(query, topics_ids) - end + def users_who_commented + topics_ids = topics.pluck(:id) + query = "comments.commentable_id IN (?)and comments.commentable_type = 'Topic'" + User.by_comments(query, topics_ids) + end - def users_who_topics_author - author_ids = topics.pluck(:author_id) - User.by_authors(author_ids) - end + def users_who_topics_author + author_ids = topics.pluck(:author_id) + User.by_authors(author_ids) + end - def author_from_community - from_proposal? ? User.where(id: proposal&.author_id) : User.where(id: investment&.author_id) - end + def author_from_community + from_proposal? ? User.where(id: proposal&.author_id) : User.where(id: investment&.author_id) + end end diff --git a/app/models/concerns/search_cache.rb b/app/models/concerns/search_cache.rb index e3e211647..fd01c98a0 100644 --- a/app/models/concerns/search_cache.rb +++ b/app/models/concerns/search_cache.rb @@ -12,23 +12,23 @@ module SearchCache private - def searchable_values_sql - searchable_values - .select{ |k, _| k.present? } - .collect{ |value, weight| set_tsvector(value, weight) } - .join(" || ") - end + def searchable_values_sql + searchable_values + .select{ |k, _| k.present? } + .collect{ |value, weight| set_tsvector(value, weight) } + .join(" || ") + end - def set_tsvector(value, weight) - "setweight(to_tsvector('spanish', unaccent(coalesce(#{quote(strip_html(value))}, ''))), #{quote(weight)})" - end + def set_tsvector(value, weight) + "setweight(to_tsvector('spanish', unaccent(coalesce(#{quote(strip_html(value))}, ''))), #{quote(weight)})" + end - def quote(value) - ActiveRecord::Base.connection.quote(value) - end + def quote(value) + ActiveRecord::Base.connection.quote(value) + end - def strip_html(value) - ActionController::Base.helpers.sanitize(value, tags: []) - end + def strip_html(value) + ActionController::Base.helpers.sanitize(value, tags: []) + end end diff --git a/app/models/concerns/statisticable.rb b/app/models/concerns/statisticable.rb index b45de3f6f..144367559 100644 --- a/app/models/concerns/statisticable.rb +++ b/app/models/concerns/statisticable.rb @@ -6,6 +6,42 @@ module Statisticable attr_reader :resource end + class_methods do + def stats_methods + base_stats_methods + gender_methods + age_methods + geozone_methods + end + + def base_stats_methods + %i[total_participants participations] + participation_check_methods + end + + def participation_check_methods + PARTICIPATIONS.map { |participation| :"#{participation}?" } + end + + def gender_methods + %i[total_male_participants total_female_participants male_percentage female_percentage] + end + + def age_methods + [:participants_by_age] + end + + def geozone_methods + %i[participants_by_geozone total_no_demographic_data] + end + + def stats_cache(*method_names) + method_names.each do |method_name| + alias_method :"raw_#{method_name}", method_name + + define_method method_name do + stats_cache(method_name) { send(:"raw_#{method_name}") } + end + end + end + end + def initialize(resource) @resource = resource end @@ -150,40 +186,4 @@ module Statisticable I18n.t("stats.age_range", start: start, finish: finish) end end - - class_methods do - def stats_methods - base_stats_methods + gender_methods + age_methods + geozone_methods - end - - def base_stats_methods - %i[total_participants participations] + participation_check_methods - end - - def participation_check_methods - PARTICIPATIONS.map { |participation| :"#{participation}?" } - end - - def gender_methods - %i[total_male_participants total_female_participants male_percentage female_percentage] - end - - def age_methods - [:participants_by_age] - end - - def geozone_methods - %i[participants_by_geozone total_no_demographic_data] - end - - def stats_cache(*method_names) - method_names.each do |method_name| - alias_method :"raw_#{method_name}", method_name - - define_method method_name do - stats_cache(method_name) { send(:"raw_#{method_name}") } - end - end - end - end end diff --git a/app/models/debate.rb b/app/models/debate.rb index b3a23200a..152059eaf 100644 --- a/app/models/debate.rb +++ b/app/models/debate.rb @@ -161,7 +161,7 @@ class Debate < ApplicationRecord end 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 return orders end diff --git a/app/models/direct_upload.rb b/app/models/direct_upload.rb index 088c8ea64..277f1af6e 100644 --- a/app/models/direct_upload.rb +++ b/app/models/direct_upload.rb @@ -47,20 +47,20 @@ class DirectUpload private - def parent_resource_attachment_validations - @relation.valid? + def parent_resource_attachment_validations + @relation.valid? - if @relation.errors.key? :attachment - errors.add(:attachment, @relation.errors.full_messages_for(:attachment)) + if @relation.errors.key? :attachment + errors.add(:attachment, @relation.errors.full_messages_for(:attachment)) + end end - end - def relation_attributtes - { - attachment: @attachment, - cached_attachment: @cached_attachment, - user: @user - } - end + def relation_attributtes + { + attachment: @attachment, + cached_attachment: @cached_attachment, + user: @user + } + end end diff --git a/app/models/document.rb b/app/models/document.rb index 3edf203d6..67c220e64 100644 --- a/app/models/document.rb +++ b/app/models/document.rb @@ -60,11 +60,11 @@ class Document < ApplicationRecord def custom_hash_data(attachment) original_filename = if !attachment.instance.persisted? && attachment.instance.remove - attachment.instance.original_filename + attachment.instance.original_filename elsif !attachment.instance.persisted? - attachment.instance.attachment_file_name + attachment.instance.attachment_file_name else - attachment.instance.title + attachment.instance.title end "#{attachment.instance.user_id}/#{original_filename}" end diff --git a/app/models/legislation/draft_version.rb b/app/models/legislation/draft_version.rb index 57f1039a4..56a42fd07 100644 --- a/app/models/legislation/draft_version.rb +++ b/app/models/legislation/draft_version.rb @@ -1,5 +1,5 @@ class Legislation::DraftVersion < ApplicationRecord - VALID_STATUSES = %w(draft published) + VALID_STATUSES = %w[draft published] acts_as_paranoid column: :hidden_at include ActsAsParanoidAliases diff --git a/app/models/newsletter.rb b/app/models/newsletter.rb index bac4d8ef7..df088ce8e 100644 --- a/app/models/newsletter.rb +++ b/app/models/newsletter.rb @@ -55,16 +55,16 @@ class Newsletter < ApplicationRecord private - def validate_segment_recipient - errors.add(:segment_recipient, :invalid) unless valid_segment_recipient? - end + def validate_segment_recipient + errors.add(:segment_recipient, :invalid) unless valid_segment_recipient? + end - def valid_email?(email) - email.match(/\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\Z/i) - end + def valid_email?(email) + email.match(/\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\Z/i) + end - def log_delivery(recipient_email) - user = User.where(email: recipient_email).first - Activity.log(user, :email, self) - end + def log_delivery(recipient_email) + user = User.where(email: recipient_email).first + Activity.log(user, :email, self) + end end diff --git a/app/models/notification.rb b/app/models/notification.rb index e5a8e2b95..66343ae6a 100644 --- a/app/models/notification.rb +++ b/app/models/notification.rb @@ -82,16 +82,16 @@ class Notification < ApplicationRecord private - def self.batch_size - 10000 - end + def self.batch_size + 10000 + end - def self.batch_interval - 20.minutes - end + def self.batch_interval + 20.minutes + end - def self.first_batch_run_at - Time.current - end + def self.first_batch_run_at + Time.current + end end diff --git a/app/models/poll/pair_answer.rb b/app/models/poll/pair_answer.rb index 2b314565c..215d638d7 100644 --- a/app/models/poll/pair_answer.rb +++ b/app/models/poll/pair_answer.rb @@ -18,7 +18,6 @@ class Poll::PairAnswer < ApplicationRecord validates :answer_right, inclusion: { in: ->(a) { a.question.question_answers.visibles }}, unless: ->(a) { a.question.blank? } - scope :by_author, ->(author_id) { where(author_id: author_id) } scope :by_question, ->(question_id) { where(question_id: question_id) } diff --git a/app/models/poll/partial_result.rb b/app/models/poll/partial_result.rb index 036e80b75..23821bd60 100644 --- a/app/models/poll/partial_result.rb +++ b/app/models/poll/partial_result.rb @@ -1,6 +1,6 @@ class Poll::PartialResult < ApplicationRecord - VALID_ORIGINS = %w{web booth} + VALID_ORIGINS = %w[web booth] belongs_to :question, -> { with_hidden } belongs_to :author, -> { with_hidden }, class_name: "User", foreign_key: "author_id" diff --git a/app/models/poll/recount.rb b/app/models/poll/recount.rb index 9cd744cc0..56fe36889 100644 --- a/app/models/poll/recount.rb +++ b/app/models/poll/recount.rb @@ -1,6 +1,6 @@ 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 :booth_assignment diff --git a/app/models/proposal_notification.rb b/app/models/proposal_notification.rb index 20fe1f0cb..3ea3ea906 100644 --- a/app/models/proposal_notification.rb +++ b/app/models/proposal_notification.rb @@ -56,8 +56,8 @@ class ProposalNotification < ApplicationRecord private - def set_author - self.update(author_id: self.proposal.author_id) if self.proposal - end + def set_author + self.update(author_id: self.proposal.author_id) if self.proposal + end end diff --git a/app/models/related_content.rb b/app/models/related_content.rb index 4a74ba3c7..25a46c6c4 100644 --- a/app/models/related_content.rb +++ b/app/models/related_content.rb @@ -1,6 +1,6 @@ class RelatedContent < ApplicationRecord 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 include ActsAsParanoidAliases @@ -36,28 +36,28 @@ class RelatedContent < ApplicationRecord private - def create_opposite_related_content - related_content = RelatedContent.create!(opposite_related_content: self, parent_relationable: child_relationable, - child_relationable: parent_relationable, author: author) - self.opposite_related_content = related_content - end + def create_opposite_related_content + related_content = RelatedContent.create!(opposite_related_content: self, parent_relationable: child_relationable, + child_relationable: parent_relationable, author: author) + self.opposite_related_content = related_content + end - def score(value, user) - score_with_opposite(value, user) - hide_with_opposite if (related_content_scores.sum(:value) / related_content_scores_count) < RELATED_CONTENT_SCORE_THRESHOLD - end + def score(value, user) + score_with_opposite(value, user) + hide_with_opposite if (related_content_scores.sum(:value) / related_content_scores_count) < RELATED_CONTENT_SCORE_THRESHOLD + end - def hide_with_opposite - hide - opposite_related_content.hide - end + def hide_with_opposite + hide + opposite_related_content.hide + end - def create_author_score - score_positive(author) - end + def create_author_score + score_positive(author) + end - def score_with_opposite(value, user) - RelatedContentScore.create(user: user, related_content: self, value: value) - RelatedContentScore.create(user: user, related_content: opposite_related_content, value: value) - end + def score_with_opposite(value, user) + RelatedContentScore.create(user: user, related_content: self, value: value) + RelatedContentScore.create(user: user, related_content: opposite_related_content, value: value) + end end diff --git a/app/models/signature.rb b/app/models/signature.rb index a3b58fc08..584f69567 100644 --- a/app/models/signature.rb +++ b/app/models/signature.rb @@ -93,7 +93,7 @@ class Signature < ApplicationRecord end def document_types - %w(1 2 3 4) + %w[1 2 3 4] end end diff --git a/app/models/signature_sheet.rb b/app/models/signature_sheet.rb index c7d102dca..beaeb4caa 100644 --- a/app/models/signature_sheet.rb +++ b/app/models/signature_sheet.rb @@ -2,7 +2,7 @@ class SignatureSheet < ApplicationRecord belongs_to :signable, polymorphic: true 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 diff --git a/app/models/user.rb b/app/models/user.rb index 2f787f34d..b5ffacd5f 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -358,7 +358,6 @@ class User < ApplicationRecord followables.compact.map { |followable| followable.tags.map(&:name) }.flatten.compact.uniq end - def self.current_user Thread.current[:user] end diff --git a/app/models/votation_type.rb b/app/models/votation_type.rb index c84418401..95fd384e2 100644 --- a/app/models/votation_type.rb +++ b/app/models/votation_type.rb @@ -110,7 +110,6 @@ class VotationType < ApplicationRecord end end - result end diff --git a/app/models/widget/feed.rb b/app/models/widget/feed.rb index 553d35db6..c0a18cfc4 100644 --- a/app/models/widget/feed.rb +++ b/app/models/widget/feed.rb @@ -1,7 +1,7 @@ class Widget::Feed < ApplicationRecord self.table_name = "widget_feeds" - KINDS = %w(proposals debates processes) + KINDS = %w[proposals debates processes] def active? setting.value.present? diff --git a/app/views/account/show.html.erb b/app/views/account/show.html.erb index 871e2de0d..b1fda5247 100644 --- a/app/views/account/show.html.erb +++ b/app/views/account/show.html.erb @@ -16,7 +16,7 @@
-

<%= t("account.show.personal")%>

+

<%= t("account.show.personal") %>

<% if @account.organization? %> @@ -49,9 +49,8 @@ <% end %>
- <% if @account.email.present? %> -

<%= t("account.show.notifications")%>

+

<%= t("account.show.notifications") %>

<%= f.label :email_on_comment do %> diff --git a/app/views/admin/_menu.html.erb b/app/views/admin/_menu.html.erb index e535c9d44..91245c0cf 100644 --- a/app/views/admin/_menu.html.erb +++ b/app/views/admin/_menu.html.erb @@ -58,7 +58,7 @@ <%= t("admin.menu.title_booths") %>
    > -
  • > +
  • > <%= link_to t("admin.menu.poll_officers"), admin_officers_path %>
  • @@ -74,8 +74,8 @@ <%= link_to t("admin.menu.poll_booth_assignments"), booth_assignments_admin_polls_path %> -
  • > +
  • > <%= link_to t("admin.menu.poll_shifts"), available_admin_booths_path %>
@@ -90,7 +90,7 @@ <% 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) %>
  • > @@ -205,7 +205,7 @@
  • > - <%= link_to t("admin.menu.moderators"), admin_moderators_path%> + <%= link_to t("admin.menu.moderators"), admin_moderators_path %>
  • > @@ -281,7 +281,7 @@ <%= t("admin.menu.title_settings") %> -
      > +
        >
      • > <%= link_to t("admin.menu.settings"), admin_settings_path %>
      • @@ -300,7 +300,7 @@
      • > - <%= link_to t("admin.menu.site_customization.content_blocks"), admin_site_customization_content_blocks_path%> + <%= link_to t("admin.menu.site_customization.content_blocks"), admin_site_customization_content_blocks_path %>
      • > diff --git a/app/views/admin/administrators/index.html.erb b/app/views/admin/administrators/index.html.erb index 469905279..304760c7e 100644 --- a/app/views/admin/administrators/index.html.erb +++ b/app/views/admin/administrators/index.html.erb @@ -15,7 +15,7 @@ <%= t("admin.shared.actions") %> <% @administrators.each do |administrator| %> - + <%= administrator.id %> diff --git a/app/views/admin/banners/_errors.html.erb b/app/views/admin/banners/_errors.html.erb index e50720971..0f3eaa3f4 100644 --- a/app/views/admin/banners/_errors.html.erb +++ b/app/views/admin/banners/_errors.html.erb @@ -1,6 +1,6 @@ <% if @banner.errors.any? %> - +
        -<% end %> \ No newline at end of file +<% end %> diff --git a/app/views/admin/banners/_form.html.erb b/app/views/admin/banners/_form.html.erb index 4bb19e227..f6e17cf10 100644 --- a/app/views/admin/banners/_form.html.erb +++ b/app/views/admin/banners/_form.html.erb @@ -15,7 +15,7 @@ class: "js-calendar-full", id: "post_started_at" %>
  • - <% date_ended_at = @banner.post_ended_at.present? ? I18n.localize(@banner.post_ended_at) : ""%> + <% date_ended_at = @banner.post_ended_at.present? ? I18n.localize(@banner.post_ended_at) : "" %>
    <%= f.label :post_ended_at, t("admin.banners.banner.post_ended_at") %> <%= f.text_field :post_ended_at, @@ -40,7 +40,7 @@ <%= translations_form.text_field :description, placeholder: t("admin.banners.banner.description"), data: {js_banner_description: "js_banner_description"}, - label: t("admin.banners.banner.description") %> + label: t("admin.banners.banner.description") %>
    <% end %>
    diff --git a/app/views/admin/banners/edit.html.erb b/app/views/admin/banners/edit.html.erb index 17cb11405..26b4f49b0 100644 --- a/app/views/admin/banners/edit.html.erb +++ b/app/views/admin/banners/edit.html.erb @@ -7,4 +7,4 @@ <%= render "form" %>
    - \ No newline at end of file + diff --git a/app/views/admin/banners/index.html.erb b/app/views/admin/banners/index.html.erb index 8ab4463d8..8c099f4f8 100644 --- a/app/views/admin/banners/index.html.erb +++ b/app/views/admin/banners/index.html.erb @@ -11,9 +11,9 @@ - - - + + + diff --git a/app/views/admin/banners/new.html.erb b/app/views/admin/banners/new.html.erb index dc5eb4ca3..1174fc81c 100644 --- a/app/views/admin/banners/new.html.erb +++ b/app/views/admin/banners/new.html.erb @@ -7,4 +7,4 @@ <%= render "form" %> - \ No newline at end of file + diff --git a/app/views/admin/budget_investments/_investments.html.erb b/app/views/admin/budget_investments/_investments.html.erb index 59044bb55..5c6d12e31 100644 --- a/app/views/admin/budget_investments/_investments.html.erb +++ b/app/views/admin/budget_investments/_investments.html.erb @@ -1,6 +1,5 @@ <%= t("admin.budget_investments.index.download_current_selection") %> - <% if params[:advanced_filters].include?("winners") %> <% if display_calculate_winners_button?(@budget) %> <%= link_to calculate_winner_button_text(@budget), @@ -9,7 +8,7 @@ class: "button hollow float-right clear" %> <% else %> - <%= t("admin.budgets.winners.calculate")%> + <%= t("admin.budgets.winners.calculate") %>
    <%= t("admin.budget_investments.index.cannot_calculate_winners") %> @@ -28,7 +27,7 @@
    <%= t("admin.banners.banner.post_started_at")%><%= t("admin.banners.banner.post_ended_at")%><%= t("admin.actions.actions")%><%= t("admin.banners.banner.post_started_at") %><%= t("admin.banners.banner.post_ended_at") %><%= t("admin.actions.actions") %>
    - + diff --git a/app/views/admin/budget_investments/edit.html.erb b/app/views/admin/budget_investments/edit.html.erb index ef6540c9e..736a17db4 100644 --- a/app/views/admin/budget_investments/edit.html.erb +++ b/app/views/admin/budget_investments/edit.html.erb @@ -127,7 +127,6 @@ label: t("admin.budget_investments.edit.milestone_tags") %> -
    <%= f.submit(class: "button", value: t("admin.budget_investments.edit.submit_button")) %>
    diff --git a/app/views/admin/dashboard/actions/_form.html.erb b/app/views/admin/dashboard/actions/_form.html.erb index b069d74b7..8a8588d77 100644 --- a/app/views/admin/dashboard/actions/_form.html.erb +++ b/app/views/admin/dashboard/actions/_form.html.erb @@ -1,4 +1,4 @@ -<%= render 'shared/errors' %> +<%= render "shared/errors" %>
    @@ -70,13 +70,13 @@ <% if feature?(:allow_attached_documents) %>

    - <%= render 'documents/nested_documents', documentable: dashboard_action, f: f %> + <%= render "documents/nested_documents", documentable: dashboard_action, f: f %>
    <% end %> diff --git a/app/views/admin/dashboard/actions/edit.html.erb b/app/views/admin/dashboard/actions/edit.html.erb index 5a94ec443..9ab97a45d 100644 --- a/app/views/admin/dashboard/actions/edit.html.erb +++ b/app/views/admin/dashboard/actions/edit.html.erb @@ -4,7 +4,7 @@
    - <%= form_for dashboard_action, url: { action: 'update' } do |f| %> - <%= render 'form', f: f %> + <%= form_for dashboard_action, url: { action: "update" } do |f| %> + <%= render "form", f: f %> <% end %>
    diff --git a/app/views/admin/dashboard/actions/index.html.erb b/app/views/admin/dashboard/actions/index.html.erb index 5d3e7ca61..72dd4baa8 100644 --- a/app/views/admin/dashboard/actions/index.html.erb +++ b/app/views/admin/dashboard/actions/index.html.erb @@ -1,5 +1,5 @@ <%= link_to t("admin.dashboard.actions.index.create"), - new_admin_dashboard_action_path, class: 'button success float-right' %> + new_admin_dashboard_action_path, class: "button success float-right" %>

    <%= t("admin.dashboard.actions.index.title") %> @@ -28,8 +28,8 @@

    - - + + diff --git a/app/views/admin/poll/_menu.html.erb b/app/views/admin/poll/_menu.html.erb index 08efd87dc..38c8bc5c4 100644 --- a/app/views/admin/poll/_menu.html.erb +++ b/app/views/admin/poll/_menu.html.erb @@ -1 +1 @@ -<%= render "admin/menu" %> \ No newline at end of file +<%= render "admin/menu" %> diff --git a/app/views/admin/poll/booth_assignments/_results.html.erb b/app/views/admin/poll/booth_assignments/_results.html.erb index fdbc4da3f..535485096 100644 --- a/app/views/admin/poll/booth_assignments/_results.html.erb +++ b/app/views/admin/poll/booth_assignments/_results.html.erb @@ -9,4 +9,4 @@ <%= render "admin/poll/results/recount", resource: @booth_assignment %> <%= render "admin/poll/results/result" %> <% end %> - \ No newline at end of file + diff --git a/app/views/admin/poll/booth_assignments/search_booths.js.erb b/app/views/admin/poll/booth_assignments/search_booths.js.erb index c773ce518..cdbc6f59a 100644 --- a/app/views/admin/poll/booth_assignments/search_booths.js.erb +++ b/app/views/admin/poll/booth_assignments/search_booths.js.erb @@ -1 +1 @@ -$("#search-booths-results").html("<%= j render "search_booths_results" %>"); \ No newline at end of file +$("#search-booths-results").html("<%= j render "search_booths_results" %>"); diff --git a/app/views/admin/poll/booth_assignments/show.html.erb b/app/views/admin/poll/booth_assignments/show.html.erb index 64d73ebaf..26e6650d9 100644 --- a/app/views/admin/poll/booth_assignments/show.html.erb +++ b/app/views/admin/poll/booth_assignments/show.html.erb @@ -67,7 +67,7 @@ <% unless @poll.recounts_confirmed? %> diff --git a/app/views/admin/poll/booths/new.html.erb b/app/views/admin/poll/booths/new.html.erb index 54e64c907..7e59fcd67 100644 --- a/app/views/admin/poll/booths/new.html.erb +++ b/app/views/admin/poll/booths/new.html.erb @@ -6,4 +6,4 @@ <%= form_for @booth, url: admin_booths_path(@booth) do |f| %> <%= render "form", f: f %> -<% end %> \ No newline at end of file +<% end %> diff --git a/app/views/admin/poll/officer_assignments/by_officer.html.erb b/app/views/admin/poll/officer_assignments/by_officer.html.erb index 21e4c9b0c..f6507d6b0 100644 --- a/app/views/admin/poll/officer_assignments/by_officer.html.erb +++ b/app/views/admin/poll/officer_assignments/by_officer.html.erb @@ -21,7 +21,7 @@ <% @officer_assignments.each do |officer_assignment| %> - + <% end %> diff --git a/app/views/admin/poll/officer_assignments/search_officers.js.erb b/app/views/admin/poll/officer_assignments/search_officers.js.erb index 9a97db091..300ec21b4 100644 --- a/app/views/admin/poll/officer_assignments/search_officers.js.erb +++ b/app/views/admin/poll/officer_assignments/search_officers.js.erb @@ -1 +1 @@ -$("#search-officers-results").html("<%= j render "search_officers_results" %>"); \ No newline at end of file +$("#search-officers-results").html("<%= j render "search_officers_results" %>"); diff --git a/app/views/admin/poll/questions/answers/images/new.html.erb b/app/views/admin/poll/questions/answers/images/new.html.erb index dfd4b8cfb..a6e401047 100644 --- a/app/views/admin/poll/questions/answers/images/new.html.erb +++ b/app/views/admin/poll/questions/answers/images/new.html.erb @@ -1,13 +1,13 @@
    <%= form_for(Poll::Question::Answer.new, - url: admin_answer_images_path(@answer), - method: :post) do |f| %> - <%= render "shared/errors", resource: @answer %> + url: admin_answer_images_path(@answer), + method: :post) do |f| %> + <%= render "shared/errors", resource: @answer %> -
    - <%= render "images/nested_image", imageable: @answer, f: f, image_fields: :images %> -
    +
    + <%= render "images/nested_image", imageable: @answer, f: f, image_fields: :images %> +
    - <%= f.submit t("admin.questions.answers.images.save_image"), class: "button success" %> + <%= f.submit t("admin.questions.answers.images.save_image"), class: "button success" %> <% end %>
    diff --git a/app/views/admin/poll/results/_recount.html.erb b/app/views/admin/poll/results/_recount.html.erb index f4ab43954..f876c593e 100644 --- a/app/views/admin/poll/results/_recount.html.erb +++ b/app/views/admin/poll/results/_recount.html.erb @@ -11,4 +11,4 @@ -
    <%= link_to_investments_sorted_by :id %><%= link_to_investments_sorted_by :id %> <%= link_to_investments_sorted_by :title %> <%= link_to_investments_sorted_by :supports %> <%= t("admin.budget_investments.index.list.admin") %><%= t("admin.dashboard.actions.action_type.#{action.action_type}") %> <%= active_human_readable(action.active) %> <%= active_human_readable(action.published_proposal) %><%= number_with_delimiter(action.day_offset, delimiter: '.') %><%= number_with_delimiter(action.required_supports, delimiter: '.') %><%= number_with_delimiter(action.day_offset, delimiter: ".") %><%= number_with_delimiter(action.required_supports, delimiter: ".") %> <%= action.order %> <%= link_to t("admin.dashboard.actions.index.edit"), diff --git a/app/views/admin/dashboard/actions/new.html.erb b/app/views/admin/dashboard/actions/new.html.erb index 0ef2c672c..67e8e54ad 100644 --- a/app/views/admin/dashboard/actions/new.html.erb +++ b/app/views/admin/dashboard/actions/new.html.erb @@ -4,7 +4,7 @@
    - <%= form_for dashboard_action, url: { action: 'create' } do |f| %> - <%= render 'form', f: f %> + <%= form_for dashboard_action, url: { action: "create" } do |f| %> + <%= render "form", f: f %> <% end %>
    diff --git a/app/views/admin/dashboard/administrator_tasks/_form.html.erb b/app/views/admin/dashboard/administrator_tasks/_form.html.erb index e5d9cdfe6..ef0156f79 100644 --- a/app/views/admin/dashboard/administrator_tasks/_form.html.erb +++ b/app/views/admin/dashboard/administrator_tasks/_form.html.erb @@ -17,7 +17,7 @@ <%= administrator_task.source.action.title %>
    - <%= form_for administrator_task, url: { action: 'update' } do |f| %> + <%= form_for administrator_task, url: { action: "update" } do |f| %> <%= f.submit(value: t("admin.dashboard.administrator_tasks.form.solve"), class: "button") %> <% end %> diff --git a/app/views/admin/dashboard/administrator_tasks/edit.html.erb b/app/views/admin/dashboard/administrator_tasks/edit.html.erb index aaae4582d..71c0b9fce 100644 --- a/app/views/admin/dashboard/administrator_tasks/edit.html.erb +++ b/app/views/admin/dashboard/administrator_tasks/edit.html.erb @@ -5,4 +5,4 @@

    <%= t("admin.dashboard.administrator_tasks.edit.solving") %>

    -<%= render 'form' %> +<%= render "form" %> diff --git a/app/views/admin/debates/show.html.erb b/app/views/admin/debates/show.html.erb index af37f7bf3..2494efa3d 100644 --- a/app/views/admin/debates/show.html.erb +++ b/app/views/admin/debates/show.html.erb @@ -12,7 +12,7 @@ <% end %>
    - <%= render '/shared/author_info', resource: @debate %> + <%= render "/shared/author_info", resource: @debate %>  •  <%= l @debate.created_at.to_date %> @@ -21,7 +21,7 @@ <%= link_to t("debates.show.comments", count: @debate.comments_count), "#comments" %>  •  - <%= render 'debates/flag_actions', debate: @debate %> + <%= render "debates/flag_actions", debate: @debate %>
    @@ -37,20 +37,20 @@
    - <%= t('votes.agree') %> + <%= t("votes.agree") %> - <%= votes_percentage('likes', @debate) %> + <%= votes_percentage("likes", @debate) %>
     • 
    - <%= t('votes.disagree') %> + <%= t("votes.disagree") %> - <%= votes_percentage('dislikes', @debate) %> + <%= votes_percentage("dislikes", @debate) %>
    -<%= render 'shared/tags', taggable: @debate %> +<%= render "shared/tags", taggable: @debate %> diff --git a/app/views/admin/download_settings/_modal.html.erb b/app/views/admin/download_settings/_modal.html.erb index d66a2e186..9d6f86493 100644 --- a/app/views/admin/download_settings/_modal.html.erb +++ b/app/views/admin/download_settings/_modal.html.erb @@ -1,8 +1,8 @@
    -

    <%= t('download.modal.title') %>

    +

    <%= t("download.modal.title") %>

    <%= form_tag current_path_with_query_params(format: :csv), method: :get do |f| %> - <%= render 'admin/download_settings/form_hidden_params' %> - <%= render 'admin/download_settings/form', resource: resource, download_settings: get_attrs(get_model(resource[:name])) %> + <%= render "admin/download_settings/form_hidden_params" %> + <%= render "admin/download_settings/form", resource: resource, download_settings: get_attrs(get_model(resource[:name])) %>
    diff --git a/app/views/admin/download_settings/edit.html.erb b/app/views/admin/download_settings/edit.html.erb index 43485871f..c5c1e039e 100644 --- a/app/views/admin/download_settings/edit.html.erb +++ b/app/views/admin/download_settings/edit.html.erb @@ -6,7 +6,7 @@

    <%= t("download.edit.#{@download_resource[:name]}") %> <%= t("download.edit.config.#{@download_resource[:config].to_s}") unless @download_resource[:config] == 0 %>

    <%= form_tag admin_update_download_settings_path(resource: @download_resource[:name], config: @download_resource[:config]), method: :put do %> - <%= render 'form', resource: @download_resource, download_settings: @download_settings %> + <%= render "form", resource: @download_resource, download_settings: @download_settings %>
    <%= submit_tag t("download.edit.submit"), class: "button success expanded" %> diff --git a/app/views/admin/hidden_comments/index.html.erb b/app/views/admin/hidden_comments/index.html.erb index 8500dce58..ca26aef31 100644 --- a/app/views/admin/hidden_comments/index.html.erb +++ b/app/views/admin/hidden_comments/index.html.erb @@ -1,7 +1,6 @@

    <%= t("admin.hidden_comments.index.title") %>

    <%= t("admin.shared.moderated_content") %>

    - <%= render "shared/filter_subnav", i18n_namespace: "admin.hidden_comments.index" %> <% if @comments.any? %> diff --git a/app/views/admin/hidden_debates/index.html.erb b/app/views/admin/hidden_debates/index.html.erb index 92bb70c8c..25cfd7102 100644 --- a/app/views/admin/hidden_debates/index.html.erb +++ b/app/views/admin/hidden_debates/index.html.erb @@ -1,7 +1,6 @@

    <%= t("admin.hidden_debates.index.title") %>

    <%= t("admin.shared.moderated_content") %>

    - <%= render "shared/filter_subnav", i18n_namespace: "admin.hidden_debates.index" %> <% if @debates.any? %> diff --git a/app/views/admin/legislation/draft_versions/index.html.erb b/app/views/admin/legislation/draft_versions/index.html.erb index 0abbf128d..c4f6ccc25 100644 --- a/app/views/admin/legislation/draft_versions/index.html.erb +++ b/app/views/admin/legislation/draft_versions/index.html.erb @@ -38,7 +38,7 @@
    <% if draft_version.status == "draft" %> <%= t("admin.legislation.draft_versions.statuses.draft") %> - <%= link_to "(#{t(".preview")})", legislation_process_draft_version_path(@process, draft_version) %> + <%= link_to "(#{t(".preview")})", legislation_process_draft_version_path(@process, draft_version) %> <% else %> <%= t("admin.legislation.draft_versions.statuses.published") %> <% end %> diff --git a/app/views/admin/legislation/questions/_question_option_fields.html.erb b/app/views/admin/legislation/questions/_question_option_fields.html.erb index e1f729a0e..c610c298c 100644 --- a/app/views/admin/legislation/questions/_question_option_fields.html.erb +++ b/app/views/admin/legislation/questions/_question_option_fields.html.erb @@ -9,7 +9,7 @@
    - <%= link_to_remove_association t("admin.legislation.questions.question_option_fields.remove_option"), f, class: "delete"%> + <%= link_to_remove_association t("admin.legislation.questions.question_option_fields.remove_option"), f, class: "delete" %>
    diff --git a/app/views/admin/organizations/index.html.erb b/app/views/admin/organizations/index.html.erb index c42f3fcd6..9b3d3249f 100644 --- a/app/views/admin/organizations/index.html.erb +++ b/app/views/admin/organizations/index.html.erb @@ -57,7 +57,7 @@ <% if can? :reject, organization %> <%= link_to t("admin.organizations.index.reject"), reject_admin_organization_path(organization, request.query_parameters), - method: :put, class: "button hollow alert small-5"%> + method: :put, class: "button hollow alert small-5" %> <% end %>
    - <%= total_recounts_by_booth(@booth_assignment) || "-" %> + <%= total_recounts_by_booth(@booth_assignment) || "-" %>
    <%= l(officer_assignment.date.to_date)%> <%= content_tag :strong, t("polls.final_date") if officer_assignment.final %><%= l(officer_assignment.date.to_date) %> <%= content_tag :strong, t("polls.final_date") if officer_assignment.final %> <%= booth_name_with_location(officer_assignment.booth_assignment.booth) %>
    <%= resource.recounts.sum(:total_amount) %>
    \ No newline at end of file + diff --git a/app/views/admin/poll/results/_result.html.erb b/app/views/admin/poll/results/_result.html.erb index e2fe5f037..511f278ef 100644 --- a/app/views/admin/poll/results/_result.html.erb +++ b/app/views/admin/poll/results/_result.html.erb @@ -18,4 +18,4 @@ <% end %> -<% end %> \ No newline at end of file +<% end %> diff --git a/app/views/admin/poll/shifts/search_officers.js.erb b/app/views/admin/poll/shifts/search_officers.js.erb index 9a97db091..300ec21b4 100644 --- a/app/views/admin/poll/shifts/search_officers.js.erb +++ b/app/views/admin/poll/shifts/search_officers.js.erb @@ -1 +1 @@ -$("#search-officers-results").html("<%= j render "search_officers_results" %>"); \ No newline at end of file +$("#search-officers-results").html("<%= j render "search_officers_results" %>"); diff --git a/app/views/admin/proposals/toggle_selection.js.erb b/app/views/admin/proposals/toggle_selection.js.erb index 4963b7b7c..0f7f171ba 100644 --- a/app/views/admin/proposals/toggle_selection.js.erb +++ b/app/views/admin/proposals/toggle_selection.js.erb @@ -1 +1 @@ -$("#<%= dom_id(@proposal) %> .js-select").html('<%= j render("select_proposal", proposal: @proposal) %>'); +$("#<%= dom_id(@proposal) %> .js-select").html("<%= j render("select_proposal", proposal: @proposal) %>"); diff --git a/app/views/admin/signature_sheets/show.html.erb b/app/views/admin/signature_sheets/show.html.erb index 622842099..91fdc270a 100644 --- a/app/views/admin/signature_sheets/show.html.erb +++ b/app/views/admin/signature_sheets/show.html.erb @@ -18,7 +18,6 @@ <%= simple_format @signature_sheet.required_fields_to_verify %> -
    <%= t("admin.signature_sheets.show.verified", diff --git a/app/views/admin/site_customization/documents/new.html.erb b/app/views/admin/site_customization/documents/new.html.erb index 9a4971564..461629b07 100644 --- a/app/views/admin/site_customization/documents/new.html.erb +++ b/app/views/admin/site_customization/documents/new.html.erb @@ -2,7 +2,7 @@ <%= form_for @document, url: admin_site_customization_documents_path do |f| %> - <%= f.file_field 'attachment', label: t("admin.documents.new.label_attachment") %> + <%= f.file_field "attachment", label: t("admin.documents.new.label_attachment") %>
    <%= f.submit t("admin.documents.new.submit_button"), class: "button success" %> diff --git a/app/views/admin/site_customization/information_texts/_tabs.html.erb b/app/views/admin/site_customization/information_texts/_tabs.html.erb index d3d195503..4947e2a8c 100644 --- a/app/views/admin/site_customization/information_texts/_tabs.html.erb +++ b/app/views/admin/site_customization/information_texts/_tabs.html.erb @@ -1,4 +1,4 @@ -
      +
        <% information_texts_tabs.each do |tab| %>
      • <% if tab.to_s == @tab %> diff --git a/app/views/admin/site_customization/pages/index.html.erb b/app/views/admin/site_customization/pages/index.html.erb index bf1b24569..d902086fc 100644 --- a/app/views/admin/site_customization/pages/index.html.erb +++ b/app/views/admin/site_customization/pages/index.html.erb @@ -61,4 +61,3 @@ <%= page_entries_info @pages %>
    <% end %> - diff --git a/app/views/admin/stats/direct_messages.html.erb b/app/views/admin/stats/direct_messages.html.erb index 4a8a55829..df5621a13 100644 --- a/app/views/admin/stats/direct_messages.html.erb +++ b/app/views/admin/stats/direct_messages.html.erb @@ -1,6 +1,6 @@ <%= back_link_to %> -

    <%= t("admin.stats.direct_messages.title")%>

    +

    <%= t("admin.stats.direct_messages.title") %>

    diff --git a/app/views/admin/stats/graph.html.erb b/app/views/admin/stats/graph.html.erb index af6d1111a..13c473347 100644 --- a/app/views/admin/stats/graph.html.erb +++ b/app/views/admin/stats/graph.html.erb @@ -1,5 +1,5 @@ <% content_for :head do %> - <%= javascript_include_tag "stat_graphs", 'data-turbolinks-track' => true %> + <%= javascript_include_tag "stat_graphs", "data-turbolinks-track" => true %> <% end %> -<%= render 'graph', name: @name, event: @event, count: @count %> +<%= render "graph", name: @name, event: @event, count: @count %> diff --git a/app/views/admin/stats/polls.html.erb b/app/views/admin/stats/polls.html.erb index c2b0b8481..d40e4280b 100644 --- a/app/views/admin/stats/polls.html.erb +++ b/app/views/admin/stats/polls.html.erb @@ -1,6 +1,6 @@ <%= back_link_to %> -

    <%= t("admin.stats.polls.title")%>

    +

    <%= t("admin.stats.polls.title") %>

    @@ -76,7 +76,7 @@ - <%= t("admin.stats.polls.table.origin_total") %>: + <%= t("admin.stats.polls.table.origin_total") %>: <%= ::Poll::Answer.where(question: poll.questions) .select(:author_id).distinct.count %> @@ -84,4 +84,4 @@ -<% end %> \ No newline at end of file +<% end %> diff --git a/app/views/admin/stats/proposal_notifications.html.erb b/app/views/admin/stats/proposal_notifications.html.erb index e26ac3431..4a5501177 100644 --- a/app/views/admin/stats/proposal_notifications.html.erb +++ b/app/views/admin/stats/proposal_notifications.html.erb @@ -1,6 +1,6 @@ <%= back_link_to %> -

    <%= t("admin.stats.proposal_notifications.title")%>

    +

    <%= t("admin.stats.proposal_notifications.title") %>

    diff --git a/app/views/admin/stats/show.html.erb b/app/views/admin/stats/show.html.erb index 18c69b304..4f754fcb0 100644 --- a/app/views/admin/stats/show.html.erb +++ b/app/views/admin/stats/show.html.erb @@ -101,7 +101,7 @@

    <%= t "admin.stats.show.summary.verified_users_who_didnt_vote_proposals" %>
    - <%=number_with_delimiter(@user_ids_who_didnt_vote_proposals)%> + <%= number_with_delimiter(@user_ids_who_didnt_vote_proposals) %>

    diff --git a/app/views/admin/tags/index.html.erb b/app/views/admin/tags/index.html.erb index 57ca27ffd..3bdad5a9c 100644 --- a/app/views/admin/tags/index.html.erb +++ b/app/views/admin/tags/index.html.erb @@ -4,7 +4,7 @@ <%= form_for(@tag, url: admin_tags_path, as: :tag) do |f| %>
    <%= f.label :name, t("admin.tags.name.placeholder") %> - <%= f.text_field :name, placeholder: t("admin.tags.name.placeholder"), label: false %> + <%= f.text_field :name, placeholder: t("admin.tags.name.placeholder"), label: false %>
    <%= f.submit(t("admin.tags.create"), class: "button success") %> diff --git a/app/views/admin/users/index.html.erb b/app/views/admin/users/index.html.erb index e5c68c36e..612f5d81d 100644 --- a/app/views/admin/users/index.html.erb +++ b/app/views/admin/users/index.html.erb @@ -11,7 +11,6 @@ <% end %>
    -
    <%= render "users" %>
    diff --git a/app/views/admin/valuator_groups/_valuator.html.erb b/app/views/admin/valuator_groups/_valuator.html.erb index 8f98a8173..1632a4c40 100644 --- a/app/views/admin/valuator_groups/_valuator.html.erb +++ b/app/views/admin/valuator_groups/_valuator.html.erb @@ -1,4 +1,4 @@
  • - <%= link_to valuator.description_or_email, + <%= link_to valuator.description_or_email, admin_valuator_path(valuator) %> -
  • \ No newline at end of file + diff --git a/app/views/admin/valuator_groups/edit.html.erb b/app/views/admin/valuator_groups/edit.html.erb index fe57117b6..b73095d2e 100644 --- a/app/views/admin/valuator_groups/edit.html.erb +++ b/app/views/admin/valuator_groups/edit.html.erb @@ -6,4 +6,4 @@ <%= f.text_field :name, label: false %> <%= f.submit t("admin.valuator_groups.form.edit"), class: "button success" %> <% end %> -
    \ No newline at end of file +
    diff --git a/app/views/admin/verifications/_failed_census_call.html.erb b/app/views/admin/verifications/_failed_census_call.html.erb index 793fdb2e4..8161e4b40 100644 --- a/app/views/admin/verifications/_failed_census_call.html.erb +++ b/app/views/admin/verifications/_failed_census_call.html.erb @@ -3,4 +3,4 @@ <%= failed_census_call.document_number %> <%= l(failed_census_call.date_of_birth) %> <%= failed_census_call.postal_code %> -
    \ No newline at end of file +
    diff --git a/app/views/admin/widget/_menu.html.erb b/app/views/admin/widget/_menu.html.erb index 08efd87dc..38c8bc5c4 100644 --- a/app/views/admin/widget/_menu.html.erb +++ b/app/views/admin/widget/_menu.html.erb @@ -1 +1 @@ -<%= render "admin/menu" %> \ No newline at end of file +<%= render "admin/menu" %> diff --git a/app/views/admin/widget/cards/edit.html.erb b/app/views/admin/widget/cards/edit.html.erb index b9e6045c9..fd7260ba7 100644 --- a/app/views/admin/widget/cards/edit.html.erb +++ b/app/views/admin/widget/cards/edit.html.erb @@ -6,4 +6,4 @@ <% end %> -<%= render "form" %> \ No newline at end of file +<%= render "form" %> diff --git a/app/views/budgets/investments/_ballot.html.erb b/app/views/budgets/investments/_ballot.html.erb index a94f0a5f2..2913d2a32 100644 --- a/app/views/budgets/investments/_ballot.html.erb +++ b/app/views/budgets/investments/_ballot.html.erb @@ -51,7 +51,7 @@ budget_investments_path(budget_id: investment.budget_id, heading_id: investment.heading_id)) %> <% change_ballot = link_to(t("budgets.ballots.reasons_for_not_balloting.change_ballot"), - budget_ballot_path(@budget))%> + budget_ballot_path(@budget)) %>

    diff --git a/app/views/budgets/investments/_content_blocks.html.erb b/app/views/budgets/investments/_content_blocks.html.erb index 30f938a94..53df67d34 100644 --- a/app/views/budgets/investments/_content_blocks.html.erb +++ b/app/views/budgets/investments/_content_blocks.html.erb @@ -1,7 +1,7 @@ <% if @heading.allow_custom_content %>

    <% end %> diff --git a/app/views/budgets/investments/_feasibility_link.html.erb b/app/views/budgets/investments/_feasibility_link.html.erb index 118a02e7f..080efcd18 100644 --- a/app/views/budgets/investments/_feasibility_link.html.erb +++ b/app/views/budgets/investments/_feasibility_link.html.erb @@ -8,4 +8,4 @@ <% else %> <%= link_to t("budgets.investments.index.sidebar.unfeasible"), budget_investments_path(@budget, heading_id: @heading, unfeasible: 1) %> -<% end %> \ No newline at end of file +<% end %> diff --git a/app/views/budgets/investments/index.html.erb b/app/views/budgets/investments/index.html.erb index 34a6ff711..f1e53520b 100644 --- a/app/views/budgets/investments/index.html.erb +++ b/app/views/budgets/investments/index.html.erb @@ -21,7 +21,7 @@ <%= render "/budgets/investments/header" %> <% end %> - <% if params[:search].present? || params[:advanced_search].present? %> + <% if params[:search].present? || params[:advanced_search].present? %>
    diff --git a/app/views/comments/_commentable_tree.html.erb b/app/views/comments/_commentable_tree.html.erb index f6631ea4c..07ba48f52 100644 --- a/app/views/comments/_commentable_tree.html.erb +++ b/app/views/comments/_commentable_tree.html.erb @@ -29,7 +29,7 @@ <% @comment_tree.root_comments.each do |comment| %> <%= render "comments/comment", { comment: comment, valuation: valuation, - allow_comments: allow_comments } %> + allow_comments: allow_comments } %> <% end %> <%= paginate @comment_tree.root_comments %>
    diff --git a/app/views/comments/new.js.erb b/app/views/comments/new.js.erb index ad92cb822..2ecab68a2 100644 --- a/app/views/comments/new.js.erb +++ b/app/views/comments/new.js.erb @@ -2,4 +2,3 @@ var field_with_errors = "#js-comment-form-<%= dom_id %> #comment-body-<%= dom_id %>"; App.Comments.display_error(field_with_errors, "<%= j render("comments/errors") %>"); - diff --git a/app/views/comments/vote.js.erb b/app/views/comments/vote.js.erb index e56fb3d65..2fe859cbd 100644 --- a/app/views/comments/vote.js.erb +++ b/app/views/comments/vote.js.erb @@ -1 +1 @@ -$("#<%= dom_id(@comment) %>_votes").html("<%= j render("comments/votes", comment: @comment) %>"); \ No newline at end of file +$("#<%= dom_id(@comment) %>_votes").html("<%= j render("comments/votes", comment: @comment) %>"); diff --git a/app/views/communities/_participant.html.erb b/app/views/communities/_participant.html.erb index fd9ed1dd0..278deb0d9 100644 --- a/app/views/communities/_participant.html.erb +++ b/app/views/communities/_participant.html.erb @@ -6,7 +6,7 @@
    - <%= link_to participant.name, user_path(participant)%> + <%= link_to participant.name, user_path(participant) %> <% if author?(@community, participant) %> diff --git a/app/views/communities/_subnav.html.erb b/app/views/communities/_subnav.html.erb index be2b6ed30..e4b36b532 100644 --- a/app/views/communities/_subnav.html.erb +++ b/app/views/communities/_subnav.html.erb @@ -30,12 +30,12 @@
    - <%= render partial: 'participant', collection: @participants %> + <%= render partial: "participant", collection: @participants %>
    <% if @community.proposal.present? %>
    - <%= render partial: 'poll', collection: @community.proposal.polls %> + <%= render partial: "poll", collection: @community.proposal.polls %>
    <% end %>
    diff --git a/app/views/dashboard/_goal.html.erb b/app/views/dashboard/_goal.html.erb index 824da44c9..b100e1952 100644 --- a/app/views/dashboard/_goal.html.erb +++ b/app/views/dashboard/_goal.html.erb @@ -3,7 +3,7 @@ <%= t("dashboard.goal.target_supports", count: number_with_precision(goal.required_supports, - delimiter: '.', precision: 0)) %> + delimiter: ".", precision: 0)) %>
    diff --git a/app/views/dashboard/_mailing_resource.html.erb b/app/views/dashboard/_mailing_resource.html.erb index ef6e933f0..ed85a5642 100644 --- a/app/views/dashboard/_mailing_resource.html.erb +++ b/app/views/dashboard/_mailing_resource.html.erb @@ -3,7 +3,7 @@

    <%= t("dashboard.menu.mailing") %>

    - <%= Setting['proposals.email_short_title'] %> + <%= Setting["proposals.email_short_title"] %>

    diff --git a/app/views/dashboard/_menu.html.erb b/app/views/dashboard/_menu.html.erb index 2948f35eb..7ab7244c6 100644 --- a/app/views/dashboard/_menu.html.erb +++ b/app/views/dashboard/_menu.html.erb @@ -1,12 +1,12 @@
    \ No newline at end of file +
    diff --git a/app/views/documents/_nested_documents.html.erb b/app/views/documents/_nested_documents.html.erb index 8a4814aee..239a77de4 100644 --- a/app/views/documents/_nested_documents.html.erb +++ b/app/views/documents/_nested_documents.html.erb @@ -2,7 +2,7 @@ <%= f.label :documents, t("documents.form.title") %>

    <%= documentables_note(documentable) %>

    -
    +
    <%= f.fields_for :documents do |documents_builder| %> <%= render "documents/document_fields", f: documents_builder %> <% end %> diff --git a/app/views/images/destroy.js.erb b/app/views/images/destroy.js.erb index 0fb79df5d..647e14a49 100644 --- a/app/views/images/destroy.js.erb +++ b/app/views/images/destroy.js.erb @@ -1 +1 @@ -App.Imageable.removeImage("<%= dom_id(@image) %>") \ No newline at end of file +App.Imageable.removeImage("<%= dom_id(@image) %>") diff --git a/app/views/layouts/_admin_header.html.erb b/app/views/layouts/_admin_header.html.erb index d05e61515..1995fa7ff 100644 --- a/app/views/layouts/_admin_header.html.erb +++ b/app/views/layouts/_admin_header.html.erb @@ -12,7 +12,7 @@
    -
    <%= t("application.menu")%>
    +
    <%= t("application.menu") %>
    diff --git a/app/views/layouts/_common_head.html.erb b/app/views/layouts/_common_head.html.erb index 54779408c..377045e03 100644 --- a/app/views/layouts/_common_head.html.erb +++ b/app/views/layouts/_common_head.html.erb @@ -1,7 +1,7 @@ -<%= content_for?(:title) ? yield(:title) : default_title %> +<%= content_for?(:title) ? yield(:title) : default_title %> <%= stylesheet_link_tag "application" %> <%= javascript_include_tag "application", "data-turbolinks-track" => true %> <%= csrf_meta_tags %> diff --git a/app/views/layouts/_header.html.erb b/app/views/layouts/_header.html.erb index e93075833..a65f1a8b0 100644 --- a/app/views/layouts/_header.html.erb +++ b/app/views/layouts/_header.html.erb @@ -17,7 +17,7 @@ - <%= t("application.menu")%> + <%= t("application.menu") %>
    diff --git a/app/views/layouts/_meta_tags.html.erb b/app/views/layouts/_meta_tags.html.erb index 443f7352f..a729d2a77 100644 --- a/app/views/layouts/_meta_tags.html.erb +++ b/app/views/layouts/_meta_tags.html.erb @@ -1,5 +1,5 @@ " /> + content="<%= content_for?(:meta_description) ? yield(:meta_description) : setting["meta_description"] %>" /> " /> + content="<%= content_for?(:meta_keywords) ? yield(:meta_keywords) : setting["meta_keywords"] %>" /> diff --git a/app/views/layouts/_notification_item.html.erb b/app/views/layouts/_notification_item.html.erb index 5e2d6060c..7a21a3c38 100644 --- a/app/views/layouts/_notification_item.html.erb +++ b/app/views/layouts/_notification_item.html.erb @@ -27,4 +27,4 @@ <% end %> -<% end %> \ No newline at end of file +<% end %> diff --git a/app/views/layouts/_tracking_data.html.erb b/app/views/layouts/_tracking_data.html.erb index a0be1bafa..eef99b5cb 100644 --- a/app/views/layouts/_tracking_data.html.erb +++ b/app/views/layouts/_tracking_data.html.erb @@ -1 +1 @@ -/> + /> diff --git a/app/views/layouts/dashboard.html.erb b/app/views/layouts/dashboard.html.erb index b0928105f..53da7404d 100644 --- a/app/views/layouts/dashboard.html.erb +++ b/app/views/layouts/dashboard.html.erb @@ -6,13 +6,13 @@ <%= render "layouts/tracking_data" %> <%= render "layouts/meta_tags" %> - <%= content_for?(:title) ? yield(:title) : setting['org_name'] %> + <%= content_for?(:title) ? yield(:title) : setting["org_name"] %> <%= content_for :canonical %> <%= stylesheet_link_tag "application" %> - <%= javascript_include_tag "application", 'data-turbolinks-track' => true %> + <%= javascript_include_tag "application", "data-turbolinks-track" => true %> <%= csrf_meta_tags %> <%= favicon_link_tag "favicon.ico" %> <%= favicon_link_tag image_path_for("apple-touch-icon-200.png"), @@ -21,12 +21,12 @@ type: "image/png" %> <%= content_for :social_media_meta_tags %> - <%= setting['per_page_code_head'].try(:html_safe) %> + <%= setting["per_page_code_head"].try(:html_safe) %> - <%= setting['per_page_code_body'].try(:html_safe) %> + <%= setting["per_page_code_body"].try(:html_safe) %> -

    <%= setting['org_name'] %>

    +

    <%= setting["org_name"] %>

    diff --git a/app/views/layouts/dashboard/_proposal_totals.html.erb b/app/views/layouts/dashboard/_proposal_totals.html.erb index 51dc85986..b828d44ad 100644 --- a/app/views/layouts/dashboard/_proposal_totals.html.erb +++ b/app/views/layouts/dashboard/_proposal_totals.html.erb @@ -13,7 +13,7 @@
    -
    <%= number_with_delimiter(community_members_count, delimiter: '.') %>
    +
    <%= number_with_delimiter(community_members_count, delimiter: ".") %>
    <%= t("layouts.dashboard.proposal_totals.community") %>
    @@ -22,9 +22,9 @@
    - <%= number_with_delimiter(proposal.votes_for.size, delimiter: '.') %> + <%= number_with_delimiter(proposal.votes_for.size, delimiter: ".") %> / - <%= number_with_delimiter(next_goal_supports, delimiter: '.') %> + <%= number_with_delimiter(next_goal_supports, delimiter: ".") %>
    <%= t("layouts.dashboard.proposal_totals.supports", count: proposal.votes_for.size) %> @@ -47,9 +47,9 @@
    diff --git a/app/views/layouts/mailer.html.erb b/app/views/layouts/mailer.html.erb index b11d38a3a..a3911df41 100644 --- a/app/views/layouts/mailer.html.erb +++ b/app/views/layouts/mailer.html.erb @@ -3,7 +3,7 @@ <%= t("mailers.title") %> - + diff --git a/app/views/layouts/proposals_dashboard.html.erb b/app/views/layouts/proposals_dashboard.html.erb index a98f26f23..20507a6a5 100644 --- a/app/views/layouts/proposals_dashboard.html.erb +++ b/app/views/layouts/proposals_dashboard.html.erb @@ -6,13 +6,13 @@ <%= render "layouts/tracking_data" %> <%= render "layouts/meta_tags" %> - <%= content_for?(:title) ? yield(:title) : setting['org_name'] %> + <%= content_for?(:title) ? yield(:title) : setting["org_name"] %> <%= content_for :canonical %> <%= stylesheet_link_tag "application" %> - <%= javascript_include_tag "application", 'data-turbolinks-track' => true %> + <%= javascript_include_tag "application", "data-turbolinks-track" => true %> <%= csrf_meta_tags %> <%= favicon_link_tag "favicon.ico" %> <%= favicon_link_tag image_path_for("apple-touch-icon-200.png"), @@ -21,12 +21,12 @@ type: "image/png" %> <%= content_for :social_media_meta_tags %> - <%= setting['per_page_code_head'].try(:html_safe) %> + <%= setting["per_page_code_head"].try(:html_safe) %> - <%= setting['per_page_code_body'].try(:html_safe) %> + <%= setting["per_page_code_body"].try(:html_safe) %> -

    <%= setting['org_name'] %>

    +

    <%= setting["org_name"] %>

    diff --git a/app/views/legislation/annotations/_annotation_link.html.erb b/app/views/legislation/annotations/_annotation_link.html.erb index 74f841abd..b047f52cb 100644 --- a/app/views/legislation/annotations/_annotation_link.html.erb +++ b/app/views/legislation/annotations/_annotation_link.html.erb @@ -1,3 +1,3 @@ <%= link_to legislation_process_draft_version_annotation_path(annotation.draft_version.process, annotation.draft_version, annotation, sub_annotation_ids: "") do %> -<% end %> \ No newline at end of file +<% end %> diff --git a/app/views/legislation/annotations/_comment_header.html.erb b/app/views/legislation/annotations/_comment_header.html.erb index 26cd21469..12a386206 100644 --- a/app/views/legislation/annotations/_comment_header.html.erb +++ b/app/views/legislation/annotations/_comment_header.html.erb @@ -7,4 +7,4 @@ <%= render "annotation_link", annotation: annotation %> - \ No newline at end of file + diff --git a/app/views/legislation/draft_versions/show.html.erb b/app/views/legislation/draft_versions/show.html.erb index 7a4bc8912..80ad1f886 100644 --- a/app/views/legislation/draft_versions/show.html.erb +++ b/app/views/legislation/draft_versions/show.html.erb @@ -64,8 +64,7 @@
    + data-legislation-open-phase="<%= @process.allegations_phase.open? %>"> <% end %> <%= @draft_version.body_html.html_safe %>
    diff --git a/app/views/legislation/processes/_debate.html.erb b/app/views/legislation/processes/_debate.html.erb index fe4c02cef..57f0b5f71 100644 --- a/app/views/legislation/processes/_debate.html.erb +++ b/app/views/legislation/processes/_debate.html.erb @@ -14,4 +14,4 @@

    <%= t("legislation.processes.debate.participate") %>

    -<% end %> \ No newline at end of file +<% end %> diff --git a/app/views/legislation/processes/_resume_proposal.html.erb b/app/views/legislation/processes/_resume_proposal.html.erb index 22b39ed53..9ebb41e12 100644 --- a/app/views/legislation/processes/_resume_proposal.html.erb +++ b/app/views/legislation/processes/_resume_proposal.html.erb @@ -1,5 +1,5 @@ <% Legislation::Proposal.where(legislation_process_id: @process) - .where(selected: true).order('cached_votes_score desc').each do |proposal| %> + .where(selected: true).order("cached_votes_score desc").each do |proposal| %>
    diff --git a/app/views/legislation/processes/index.html.erb b/app/views/legislation/processes/index.html.erb index bae92b596..adcbcb4af 100644 --- a/app/views/legislation/processes/index.html.erb +++ b/app/views/legislation/processes/index.html.erb @@ -32,7 +32,7 @@
    diff --git a/app/views/legislation/processes/resume.html.erb b/app/views/legislation/processes/resume.html.erb index 32596455c..323a20c39 100644 --- a/app/views/legislation/processes/resume.html.erb +++ b/app/views/legislation/processes/resume.html.erb @@ -10,7 +10,7 @@
    <% else %> <% if @process.debate_phase.enabled? %> diff --git a/app/views/legislation/processes/resume_to_xlsx.xlsx.axlsx b/app/views/legislation/processes/resume_to_xlsx.xlsx.axlsx index 27486bd08..55696d6f2 100644 --- a/app/views/legislation/processes/resume_to_xlsx.xlsx.axlsx +++ b/app/views/legislation/processes/resume_to_xlsx.xlsx.axlsx @@ -16,7 +16,7 @@ wb.add_worksheet(name: "Resume") do |sheet| if @process.proposals_phase.enabled? && !Legislation::Proposal.where(legislation_process_id: @process).where(selected: true).empty? sheet.add_row [t("legislation.summary.proposal_phase"), t("legislation.proposals.total", count: Legislation::Proposal.where(legislation_process_id: @process).where(selected: true).count)] - Legislation::Proposal.where(legislation_process_id: @process).where(selected: true).order('cached_votes_score desc').each do |proposal| + Legislation::Proposal.where(legislation_process_id: @process).where(selected: true).order("cached_votes_score desc").each do |proposal| sheet.add_row [proposal.title, (proposal.cached_votes_total - proposal.cached_votes_down).to_s + space + t("legislation.summary.votes")] sheet.add_hyperlink :location => legislation_process_proposal_url(proposal.legislation_process_id, proposal), :ref => sheet.rows.last.cells.first diff --git a/app/views/legislation/proposals/_comments.html.erb b/app/views/legislation/proposals/_comments.html.erb index 6615c682b..092ec8140 100644 --- a/app/views/legislation/proposals/_comments.html.erb +++ b/app/views/legislation/proposals/_comments.html.erb @@ -16,7 +16,7 @@ <% end %> <% @comment_tree.root_comments.each do |comment| %> - <%= render "comments/comment", comment: comment %> + <%= render "comments/comment", comment: comment %> <% end %> <%= paginate @comment_tree.root_comments %>
    diff --git a/app/views/legislation/proposals/_featured_votes.html.erb b/app/views/legislation/proposals/_featured_votes.html.erb index a6263ee2e..01f05497c 100644 --- a/app/views/legislation/proposals/_featured_votes.html.erb +++ b/app/views/legislation/proposals/_featured_votes.html.erb @@ -19,7 +19,7 @@ <%= t("votes.organizations") %>

    - <% elsif user_signed_in? && !proposal.votable_by?(current_user)%> + <% elsif user_signed_in? && !proposal.votable_by?(current_user) %>