Skip to content

Instantly share code, notes, and snippets.

@soulfly
Created September 13, 2017 13:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save soulfly/23d973efe383fc4981de3ca4ccc18cbb to your computer and use it in GitHub Desktop.
Save soulfly/23d973efe383fc4981de3ca4ccc18cbb to your computer and use it in GitHub Desktop.
class User < ApplicationRecord
validates :login, presence: true, uniqueness: true
end
class CreateUsers < ActiveRecord::Migration[5.1]
def change
create_table :users do |t|
t.string :login
t.string :full_name
t.timestamps
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment