Merge branch 'master' of github.com:internetee/registry

Conflicts:
	db/schema.rb
This commit is contained in:
Andres Keskküla 2014-09-25 15:30:20 +03:00
commit 641522ff08
31 changed files with 513 additions and 30 deletions

View file

@ -0,0 +1,24 @@
class AddDeviseToUsers < ActiveRecord::Migration
def self.up
change_table(:users) do |t|
## Database authenticatable
t.string :email
## Trackable
t.integer :sign_in_count, default: 0, null: false
t.datetime :current_sign_in_at
t.datetime :last_sign_in_at
t.inet :current_sign_in_ip
t.inet :last_sign_in_ip
end
end
def self.down
remove_column :users, :email
remove_column :users, :sign_in_count
remove_column :users, :current_sign_in_at
remove_column :users, :last_sign_in_at
remove_column :users, :current_sign_in_ip
remove_column :users, :last_sign_in_ip
end
end

View file

@ -0,0 +1,5 @@
class AddAdminToUsers < ActiveRecord::Migration
def change
add_column :users, :admin, :boolean, default: false
end
end

View file

@ -0,0 +1,5 @@
class AddIdentityCodeToUsers < ActiveRecord::Migration
def change
add_column :users, :identity_code, :string
end
end

View file

@ -0,0 +1,5 @@
class AddRegistrarToUsers < ActiveRecord::Migration
def change
add_column :users, :registrar_id, :integer
end
end

View file

@ -11,7 +11,11 @@
#
# It's strongly recommended that you check this file into your version control system.
<<<<<<< HEAD
ActiveRecord::Schema.define(version: 20140925073734) do
=======
ActiveRecord::Schema.define(version: 20140925101927) do
>>>>>>> 662806d8c92f67dda55ee91326dfb5f89ddfc230
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@ -190,6 +194,15 @@ ActiveRecord::Schema.define(version: 20140925073734) do
t.integer "role_id"
t.datetime "created_at"
t.datetime "updated_at"
t.string "email"
t.integer "sign_in_count", default: 0, null: false
t.datetime "current_sign_in_at"
t.datetime "last_sign_in_at"
t.inet "current_sign_in_ip"
t.inet "last_sign_in_ip"
t.boolean "admin", default: false
t.string "identity_code"
t.integer "registrar_id"
end
end

View file

@ -23,3 +23,6 @@ elkdata = Registrar.where(
).first_or_create
EppUser.where(username: 'elkdata', password: '8932iods', active: true, registrar: elkdata).first_or_create
User.where(username: 'gitlab', password: '12345', email: 'enquiries@gitlab.eu', admin: true, identity_code: '37810013855').first_or_create
User.where(username: 'zone', password: '54321', email: 'info-info@zone.ee', admin: false, identity_code: '37810010085', registrar_id: zone.id).first_or_create