Skip to content

Commit

Permalink
Delete spending proposals
Browse files Browse the repository at this point in the history
  • Loading branch information
voodoorai2000 committed May 31, 2019
1 parent 24dde9c commit d0b8fef
Show file tree
Hide file tree
Showing 90 changed files with 52 additions and 1,690 deletions.
5 changes: 0 additions & 5 deletions app/controllers/admin/api/stats_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ class Admin::Api::StatsController < Admin::Api::BaseController
def show
unless params[:event].present? ||
params[:visits].present? ||
params[:spending_proposals].present? ||
params[:budget_investments].present? ||
params[:user_supported_budgets].present?
return render json: {}, status: :bad_request
Expand All @@ -19,10 +18,6 @@ def show
ds.add "Visits", Visit.group_by_day(:started_at).count
end

if params[:spending_proposals].present?
ds.add "Spending proposals", SpendingProposal.group_by_day(:created_at).count
end

if params[:budget_investments].present?
ds.add "Budget Investments", Budget::Investment.group_by_day(:created_at).count
end
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/admin/budget_investments_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def load_budget
end

def load_investment
@investment = Budget::Investment.by_budget(@budget).find(params[:id])
@investment = @budget.investments.find(params[:id])
end

def load_admins
Expand Down
70 changes: 0 additions & 70 deletions app/controllers/admin/spending_proposals_controller.rb

This file was deleted.

4 changes: 1 addition & 3 deletions app/controllers/admin/stats_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ def show
@debate_votes = Vote.where(votable_type: "Debate").count
@proposal_votes = Vote.where(votable_type: "Proposal").count
@comment_votes = Vote.where(votable_type: "Comment").count

@votes = Vote.count

@user_level_two = User.active.level_two_verified.count
Expand All @@ -24,8 +25,6 @@ def show
.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
@investments = Budget::Investment.where(budget_id: budgets_ids).count
Expand All @@ -52,7 +51,6 @@ def direct_messages
@users_who_have_sent_message = DirectMessage.select(:sender_id).distinct.count
end


def budgets
@budgets = Budget.all
end
Expand Down
4 changes: 0 additions & 4 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,6 @@ def set_proposal_votes(proposals)
@proposal_votes = current_user ? current_user.proposal_votes(proposals) : {}
end

def set_spending_proposal_votes(spending_proposals)
@spending_proposal_votes = current_user ? current_user.spending_proposal_votes(spending_proposals) : {}
end

def set_comment_flags(comments)
@comment_flags = current_user ? current_user.comment_flags(comments) : {}
end
Expand Down
79 changes: 0 additions & 79 deletions app/controllers/management/spending_proposals_controller.rb

This file was deleted.

76 changes: 0 additions & 76 deletions app/controllers/spending_proposals_controller.rb

This file was deleted.

4 changes: 0 additions & 4 deletions app/helpers/admin_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ def menu_budgets?
controller_name.starts_with?("budget")
end

def menu_budget?
["spending_proposals"].include?(controller_name)
end

def menu_polls?
%w[polls active_polls recounts results questions answers].include?(controller_name) ||
controller.class.parent == Admin::Poll::Questions::Answers
Expand Down
5 changes: 0 additions & 5 deletions app/helpers/geozones_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,4 @@ def geozone_select_options
Geozone.all.order(name: :asc).collect { |g| [ g.name, g.id ] }
end

def geozone_name_from_id(g_id)
@all_geozones ||= Geozone.all.collect{ |g| [ g.id, g.name ] }.to_h
@all_geozones[g_id] || t("geozones.none")
end

end
2 changes: 1 addition & 1 deletion app/helpers/settings_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ def setting
@all_settings ||= Hash[ Setting.all.map{|s| [s.key, s.value.presence]} ]
end

end
end
25 changes: 0 additions & 25 deletions app/helpers/spending_proposals_helper.rb

This file was deleted.

10 changes: 0 additions & 10 deletions app/mailers/mailer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,6 @@ def email_verification(user, recipient, token, document_type, document_number)
end
end

def unfeasible_spending_proposal(spending_proposal)
@spending_proposal = spending_proposal
@author = spending_proposal.author
@email_to = @author.email

with_user(@author) do
mail(to: @email_to, subject: t("mailers.unfeasible_spending_proposal.subject", code: @spending_proposal.code))
end
end

def direct_message_for_receiver(direct_message)
@direct_message = direct_message
@receiver = @direct_message.receiver
Expand Down
2 changes: 0 additions & 2 deletions app/models/abilities/common.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,6 @@ def initialize(user)
proposal.published?
end
can :vote_featured, Proposal
can :vote, SpendingProposal
can :create, SpendingProposal

can :vote, Legislation::Proposal
can :vote_featured, Legislation::Proposal
Expand Down
3 changes: 1 addition & 2 deletions app/models/abilities/everyone.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ def initialize(user)
poll.expired? && poll.stats_enabled?
end
can :read, Poll::Question
can [:read, :welcome], Budget
can :read, SpendingProposal
can :read, User
can [:read, :welcome], Budget
can [:read], Budget
can [:read], Budget::Group
can [:read, :print, :json_data], Budget::Investment
Expand Down
1 change: 0 additions & 1 deletion app/models/geozone.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ class Geozone < ApplicationRecord
include Graphqlable

has_many :proposals
has_many :spending_proposals
has_many :debates
has_many :users
validates :name, presence: true
Expand Down
Loading

0 comments on commit d0b8fef

Please sign in to comment.