Advertisement
Guest User

Untitled

a guest
Apr 16th, 2014
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. class User < ActiveRecord::Base
  2. has_one :safe
  3. has_many :contacts
  4. end
  5.  
  6. class Safe < ActiveRecord::Base
  7. belongs_to :user
  8. end
  9.  
  10. class CreateSafes < ActiveRecord::Migration
  11. def change
  12. create_table :saves do |t|
  13. t.string :safe_key
  14.  
  15. t.timestamps
  16. end
  17. end
  18. end
  19.  
  20. class CreateUsers < ActiveRecord::Migration
  21. def change
  22. create_table :users do |t|
  23. t.string :email
  24. t.string :password
  25.  
  26. t.timestamps
  27. end
  28. end
  29. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement