Advertisement
Guest User

Untitled

a guest
May 30th, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. class Account < ActiveRecord::Base
  2. has_many :users, dependent: :destroy
  3. validates :name, presence: true, length: { maximum: 100 }
  4. end
  5.  
  6. class User < ActiveRecord::Base
  7. belongs_to :account
  8. validates :account_id, presence: true
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement