cleans up

This commit is contained in:
rgarcia
2016-12-21 18:55:28 +01:00
parent 0deba76db1
commit 25729ac259
3 changed files with 3 additions and 96 deletions

View File

@@ -1,7 +1,7 @@
module SignatureSheetsHelper
def signable_options
[[t("activerecord.models.proposal", count: 1), Proposal],
[[t("activerecord.models.proposal", count: 1), Proposal],
[t("activerecord.models.spending_proposal", count: 1), SpendingProposal]]
end

View File

@@ -125,10 +125,6 @@ class SpendingProposal < ActiveRecord::Base
return :organization if user.organization?
end
def voters
User.active.where(id: votes_for.voters)
end
def votable_by?(user)
reason_for_not_being_votable_by(user).blank?
end

View File

@@ -123,10 +123,10 @@ ActiveRecord::Schema.define(version: 20161221151239) do
t.string "visit_id"
t.datetime "hidden_at"
t.integer "flags_count", default: 0
t.datetime "ignored_flag_at"
t.integer "cached_votes_total", default: 0
t.integer "cached_votes_up", default: 0
t.integer "cached_votes_down", default: 0
t.datetime "ignored_flag_at"
t.integer "comments_count", default: 0
t.datetime "confirmed_hide_at"
t.integer "cached_anonymous_votes_total", default: 0
@@ -145,7 +145,6 @@ ActiveRecord::Schema.define(version: 20161221151239) do
add_index "debates", ["cached_votes_total"], name: "index_debates_on_cached_votes_total", using: :btree
add_index "debates", ["cached_votes_up"], name: "index_debates_on_cached_votes_up", using: :btree
add_index "debates", ["confidence_score"], name: "index_debates_on_confidence_score", using: :btree
add_index "debates", ["description"], name: "index_debates_on_description", using: :btree
add_index "debates", ["geozone_id"], name: "index_debates_on_geozone_id", using: :btree
add_index "debates", ["hidden_at"], name: "index_debates_on_hidden_at", using: :btree
add_index "debates", ["hot_score"], name: "index_debates_on_hot_score", using: :btree
@@ -211,14 +210,6 @@ ActiveRecord::Schema.define(version: 20161221151239) do
t.string "census_code"
end
create_table "geozones_poll_questions", force: :cascade do |t|
t.integer "geozone_id"
t.integer "question_id"
end
add_index "geozones_poll_questions", ["geozone_id"], name: "index_geozones_poll_questions_on_geozone_id", using: :btree
add_index "geozones_poll_questions", ["question_id"], name: "index_geozones_poll_questions_on_question_id", using: :btree
create_table "identities", force: :cascade do |t|
t.integer "user_id"
t.string "provider"
@@ -278,78 +269,6 @@ ActiveRecord::Schema.define(version: 20161221151239) do
add_index "organizations", ["user_id"], name: "index_organizations_on_user_id", using: :btree
create_table "poll_booth_assignments", force: :cascade do |t|
t.integer "booth_id"
t.integer "poll_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
create_table "poll_booths", force: :cascade do |t|
t.string "name"
t.string "location"
end
create_table "poll_officer_assignments", force: :cascade do |t|
t.integer "booth_assignment_id"
t.integer "officer_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
create_table "poll_officers", force: :cascade do |t|
t.integer "user_id"
end
create_table "poll_partial_results", force: :cascade do |t|
t.integer "question_id"
t.integer "author_id"
t.string "answer"
t.integer "amount"
t.string "origin"
end
add_index "poll_partial_results", ["answer"], name: "index_poll_partial_results_on_answer", using: :btree
add_index "poll_partial_results", ["author_id"], name: "index_poll_partial_results_on_author_id", using: :btree
add_index "poll_partial_results", ["origin"], name: "index_poll_partial_results_on_origin", using: :btree
add_index "poll_partial_results", ["question_id"], name: "index_poll_partial_results_on_question_id", using: :btree
create_table "poll_questions", force: :cascade do |t|
t.integer "proposal_id"
t.integer "poll_id"
t.integer "author_id"
t.string "author_visible_name"
t.string "title"
t.string "summary"
t.string "valid_answers"
t.text "description"
t.integer "comments_count"
t.datetime "hidden_at"
t.datetime "created_at"
t.datetime "updated_at"
t.boolean "all_geozones", default: false
t.tsvector "tsv"
end
add_index "poll_questions", ["author_id"], name: "index_poll_questions_on_author_id", using: :btree
add_index "poll_questions", ["poll_id"], name: "index_poll_questions_on_poll_id", using: :btree
add_index "poll_questions", ["proposal_id"], name: "index_poll_questions_on_proposal_id", using: :btree
add_index "poll_questions", ["tsv"], name: "index_poll_questions_on_tsv", using: :gin
create_table "poll_voters", force: :cascade do |t|
t.string "document_number"
t.string "document_type"
t.integer "booth_assignment_id", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
create_table "polls", force: :cascade do |t|
t.string "name"
t.datetime "starts_at"
t.datetime "ends_at"
end
create_table "proposal_notifications", force: :cascade do |t|
t.string "title"
t.text "body"
@@ -390,7 +309,6 @@ ActiveRecord::Schema.define(version: 20161221151239) do
add_index "proposals", ["author_id"], name: "index_proposals_on_author_id", using: :btree
add_index "proposals", ["cached_votes_up"], name: "index_proposals_on_cached_votes_up", using: :btree
add_index "proposals", ["confidence_score"], name: "index_proposals_on_confidence_score", using: :btree
add_index "proposals", ["description"], name: "index_proposals_on_description", using: :btree
add_index "proposals", ["geozone_id"], name: "index_proposals_on_geozone_id", using: :btree
add_index "proposals", ["hidden_at"], name: "index_proposals_on_hidden_at", using: :btree
add_index "proposals", ["hot_score"], name: "index_proposals_on_hot_score", using: :btree
@@ -563,7 +481,7 @@ ActiveRecord::Schema.define(version: 20161221151239) do
t.boolean "email_digest", default: true
t.boolean "email_on_direct_message", default: true
t.boolean "official_position_badge", default: false
t.datetime "password_changed_at", default: '2016-11-02 13:51:14', null: false
t.datetime "password_changed_at", default: '2016-12-21 17:55:08', null: false
t.boolean "created_from_signature", default: false
end
@@ -656,19 +574,12 @@ ActiveRecord::Schema.define(version: 20161221151239) do
add_foreign_key "annotations", "users"
add_foreign_key "failed_census_calls", "users"
add_foreign_key "flags", "users"
add_foreign_key "geozones_poll_questions", "geozones"
add_foreign_key "geozones_poll_questions", "poll_questions", column: "question_id"
add_foreign_key "identities", "users"
add_foreign_key "locks", "users"
add_foreign_key "managers", "users"
add_foreign_key "moderators", "users"
add_foreign_key "notifications", "users"
add_foreign_key "organizations", "users"
add_foreign_key "poll_partial_results", "poll_questions", column: "question_id"
add_foreign_key "poll_partial_results", "users", column: "author_id"
add_foreign_key "poll_questions", "polls"
add_foreign_key "poll_questions", "proposals"
add_foreign_key "poll_questions", "users", column: "author_id"
add_foreign_key "users", "geozones"
add_foreign_key "valuators", "users"
end