Add incompatible boolean column to Budget Investments table and factory

This commit is contained in:
Bertocq
2017-07-03 14:03:01 +02:00
parent c8b36719aa
commit e8c6c6ad8c
3 changed files with 18 additions and 5 deletions

View File

@@ -0,0 +1,5 @@
class AddIncompatibleToBudgetInvestments < ActiveRecord::Migration
def change
add_column :budget_investments, :incompatible, :bool, default: false, index: true
end
end

View File

@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20170626081337) do
ActiveRecord::Schema.define(version: 20170703120055) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@@ -95,8 +95,9 @@ ActiveRecord::Schema.define(version: 20170626081337) do
create_table "budget_ballots", force: :cascade do |t|
t.integer "user_id"
t.integer "budget_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.integer "ballot_lines_count", default: 0
end
create_table "budget_groups", force: :cascade do |t|
@@ -108,8 +109,8 @@ ActiveRecord::Schema.define(version: 20170626081337) do
create_table "budget_headings", force: :cascade do |t|
t.integer "group_id"
t.string "name", limit: 50
t.integer "price", limit: 8
t.string "name", limit: 50
t.integer "price", limit: 8
t.integer "population"
end
@@ -157,6 +158,7 @@ ActiveRecord::Schema.define(version: 20170626081337) do
t.integer "ballot_lines_count", default: 0
t.integer "previous_heading_id"
t.boolean "winner", default: false
t.boolean "incompatible", default: false
end
add_index "budget_investments", ["administrator_id"], name: "index_budget_investments_on_administrator_id", using: :btree

View File

@@ -266,6 +266,7 @@ FactoryGirl.define do
unfeasibility_explanation ''
external_url 'http://external_documention.org'
terms_of_service '1'
incompatible false
trait :with_confidence_score do
before(:save) { |i| i.calculate_confidence_score }
@@ -300,6 +301,11 @@ FactoryGirl.define do
winner true
end
trait :incompatible do
selected
incompatible true
end
trait :unselected do
selected false
feasibility "feasible"