adds scopes for final/voting_days officer_assignments
This commit is contained in:
@@ -10,5 +10,8 @@ class Poll
|
||||
validates :date, presence: true, uniqueness: { scope: [:officer_id, :booth_assignment_id] }
|
||||
|
||||
delegate :poll_id, :booth_id, to: :booth_assignment
|
||||
|
||||
scope :voting_days, -> { where(final: false) }
|
||||
scope :final, -> { where(final: true) }
|
||||
end
|
||||
end
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 20170130101121) do
|
||||
ActiveRecord::Schema.define(version: 20170130103550) do
|
||||
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "plpgsql"
|
||||
@@ -413,9 +413,10 @@ ActiveRecord::Schema.define(version: 20170130101121) do
|
||||
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
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.datetime "date"
|
||||
t.boolean "final", default: false
|
||||
end
|
||||
|
||||
create_table "poll_officers", force: :cascade do |t|
|
||||
|
||||
Reference in New Issue
Block a user