Use Rails 5 conventions in ballot migrations
These migrations and models were added after the Rails 5 branch was created but before it was merged.
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
class Poll::Ballot < ActiveRecord::Base
|
class Poll::Ballot < ApplicationRecord
|
||||||
belongs_to :ballot_sheet, class_name: Poll::BallotSheet
|
belongs_to :ballot_sheet, class_name: Poll::BallotSheet
|
||||||
|
|
||||||
validates :ballot_sheet_id, presence: true
|
validates :ballot_sheet_id, presence: true
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class Poll::BallotSheet < ActiveRecord::Base
|
class Poll::BallotSheet < ApplicationRecord
|
||||||
belongs_to :poll
|
belongs_to :poll
|
||||||
belongs_to :officer_assignment
|
belongs_to :officer_assignment
|
||||||
has_many :ballots, class_name: Poll::Ballot
|
has_many :ballots, class_name: Poll::Ballot
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class AddBallotedHeadingIdToUsers < ActiveRecord::Migration
|
class AddBallotedHeadingIdToUsers < ActiveRecord::Migration[4.2]
|
||||||
def change
|
def change
|
||||||
add_column :users, :balloted_heading_id, :integer, default: nil
|
add_column :users, :balloted_heading_id, :integer, default: nil
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class AddBudgetToPolls < ActiveRecord::Migration
|
class AddBudgetToPolls < ActiveRecord::Migration[4.2]
|
||||||
def change
|
def change
|
||||||
add_reference :polls, :budget, index: { unique: true }, foreign_key: true
|
add_reference :polls, :budget, index: { unique: true }, foreign_key: true
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class CreatePollBallotSheets < ActiveRecord::Migration
|
class CreatePollBallotSheets < ActiveRecord::Migration[4.2]
|
||||||
def change
|
def change
|
||||||
create_table :poll_ballot_sheets do |t|
|
create_table :poll_ballot_sheets do |t|
|
||||||
t.text :data
|
t.text :data
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class CreatePollBallot < ActiveRecord::Migration
|
class CreatePollBallot < ActiveRecord::Migration[4.2]
|
||||||
def change
|
def change
|
||||||
create_table :poll_ballots do |t|
|
create_table :poll_ballots do |t|
|
||||||
t.integer :ballot_sheet_id
|
t.integer :ballot_sheet_id
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class AddPhysicalToBudgetBallot < ActiveRecord::Migration
|
class AddPhysicalToBudgetBallot < ActiveRecord::Migration[4.2]
|
||||||
def change
|
def change
|
||||||
add_column :budget_ballots, :physical, :boolean, default: false
|
add_column :budget_ballots, :physical, :boolean, default: false
|
||||||
add_column :budget_ballots, :poll_ballot_id, :integer
|
add_column :budget_ballots, :poll_ballot_id, :integer
|
||||||
|
|||||||
Reference in New Issue
Block a user