Add active attribute to administrateur model
This commit is contained in:
parent
d6f9736e36
commit
8688d62a24
3 changed files with 16 additions and 3 deletions
|
@ -0,0 +1,5 @@
|
||||||
|
class AddActiveToAdministrateurs < ActiveRecord::Migration[5.0]
|
||||||
|
def change
|
||||||
|
add_column :administrateurs, :active, :boolean, default: false
|
||||||
|
end
|
||||||
|
end
|
|
@ -30,6 +30,7 @@ ActiveRecord::Schema.define(version: 20180111153308) do
|
||||||
t.datetime "created_at"
|
t.datetime "created_at"
|
||||||
t.datetime "updated_at"
|
t.datetime "updated_at"
|
||||||
t.string "api_token"
|
t.string "api_token"
|
||||||
|
t.boolean "active", default: false
|
||||||
t.index ["email"], name: "index_administrateurs_on_email", unique: true, using: :btree
|
t.index ["email"], name: "index_administrateurs_on_email", unique: true, using: :btree
|
||||||
t.index ["reset_password_token"], name: "index_administrateurs_on_reset_password_token", unique: true, using: :btree
|
t.index ["reset_password_token"], name: "index_administrateurs_on_reset_password_token", unique: true, using: :btree
|
||||||
end
|
end
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
namespace :'2018_01_11_add_active_state_to_administrators' do
|
||||||
|
task set: :environment do
|
||||||
|
Administrateur.find_each do |administrateur|
|
||||||
|
administrateur.update_column(:active, true)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
Loading…
Add table
Reference in a new issue