diff --git a/app/controllers/admin/budget_investments_controller.rb b/app/controllers/admin/budget_investments_controller.rb index 043c06394..6797f63d0 100644 --- a/app/controllers/admin/budget_investments_controller.rb +++ b/app/controllers/admin/budget_investments_controller.rb @@ -84,8 +84,8 @@ class Admin::BudgetInvestmentsController < Admin::BaseController def budget_investment_params params.require(:budget_investment) .permit(:title, :description, :external_url, :heading_id, :administrator_id, :tag_list, - :valuation_tag_list, :incompatible, :visible_to_valuators, :selected, valuator_ids: [], - valuator_group_ids: []) + :valuation_tag_list, :incompatible, :visible_to_valuators, :selected, + valuator_ids: [], valuator_group_ids: []) end def load_budget diff --git a/app/controllers/admin/proposal_notifications_controller.rb b/app/controllers/admin/proposal_notifications_controller.rb index 625e670fa..1fee9a055 100644 --- a/app/controllers/admin/proposal_notifications_controller.rb +++ b/app/controllers/admin/proposal_notifications_controller.rb @@ -5,8 +5,10 @@ class Admin::ProposalNotificationsController < Admin::BaseController before_action :load_proposal, only: [:confirm_hide, :restore] def index - @proposal_notifications = ProposalNotification.only_hidden.send(@current_filter).order(hidden_at: :desc) - .page(params[:page]) + @proposal_notifications = ProposalNotification.only_hidden + .send(@current_filter) + .order(hidden_at: :desc) + .page(params[:page]) end def confirm_hide diff --git a/app/controllers/admin/stats_controller.rb b/app/controllers/admin/stats_controller.rb index 543f24a61..774254777 100644 --- a/app/controllers/admin/stats_controller.rb +++ b/app/controllers/admin/stats_controller.rb @@ -3,23 +3,28 @@ class Admin::StatsController < Admin::BaseController def show @event_types = Ahoy::Event.group(:name).count - @visits = Visit.count - @debates = Debate.with_hidden.count + @visits = Visit.count + @debates = Debate.with_hidden.count @proposals = Proposal.with_hidden.count - @comments = Comment.not_valuations.with_hidden.count + @comments = Comment.not_valuations.with_hidden.count - @debate_votes = Vote.where(votable_type: 'Debate').count + @debate_votes = Vote.where(votable_type: 'Debate').count @proposal_votes = Vote.where(votable_type: 'Proposal').count - @comment_votes = Vote.where(votable_type: 'Comment').count + @comment_votes = Vote.where(votable_type: 'Comment').count @votes = Vote.count - @user_level_two = User.active.level_two_verified.count + @user_level_two = User.active.level_two_verified.count @user_level_three = User.active.level_three_verified.count - @verified_users = User.active.level_two_or_three_verified.count + @verified_users = User.active.level_two_or_three_verified.count @unverified_users = User.active.unverified.count @users = User.active.count - @user_ids_who_voted_proposals = ActsAsVotable::Vote.where(votable_type: 'Proposal').distinct.count(:voter_id) + + @user_ids_who_voted_proposals = ActsAsVotable::Vote.where(votable_type: 'Proposal') + .distinct + .count(:voter_id) + @user_ids_who_didnt_vote_proposals = @verified_users - @user_ids_who_voted_proposals + @spending_proposals = SpendingProposal.count budgets_ids = Budget.where.not(phase: 'finished').pluck(:id) @budgets = budgets_ids.size diff --git a/app/controllers/admin/verifications_controller.rb b/app/controllers/admin/verifications_controller.rb index 72685a199..8ff249772 100644 --- a/app/controllers/admin/verifications_controller.rb +++ b/app/controllers/admin/verifications_controller.rb @@ -5,8 +5,10 @@ class Admin::VerificationsController < Admin::BaseController end def search - @users = User.incomplete_verification.search(params[:name_or_email]).page(params[:page]).for_render + @users = User.incomplete_verification.search(params[:name_or_email]) + .page(params[:page]) + .for_render render :index end -end \ No newline at end of file +end diff --git a/app/controllers/admin/widget/cards_controller.rb b/app/controllers/admin/widget/cards_controller.rb index 1b452df87..f51b269c5 100644 --- a/app/controllers/admin/widget/cards_controller.rb +++ b/app/controllers/admin/widget/cards_controller.rb @@ -39,13 +39,17 @@ class Admin::Widget::CardsController < Admin::BaseController private def card_params - params.require(:widget_card).permit(:label, :title, :description, :link_text, :link_url, - :button_text, :button_url, :alignment, :header, - image_attributes: [:id, :title, :attachment, :cached_attachment, :user_id, :_destroy]) + image_attributes = [:id, :title, :attachment, :cached_attachment, :user_id, :_destroy] + + params.require(:widget_card).permit( + :label, :title, :description, :link_text, :link_url, + :button_text, :button_url, :alignment, :header, + image_attributes: image_attributes + ) end def header_card? params[:header_card].present? end -end \ No newline at end of file +end