Skip to content

Instantly share code, notes, and snippets.

@Frank004
Created October 19, 2016 22: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 Frank004/ee1ec9f108fc66ec5bd071d89cbe277a to your computer and use it in GitHub Desktop.
Save Frank004/ee1ec9f108fc66ec5bd071d89cbe277a to your computer and use it in GitHub Desktop.
class Role < ActiveRecord::Base
has_many :users
end
class User < ActiveRecord::Base
belongs_to :role
end
class User < ActiveRecord::Base
has_one :client_user
has_one :service_user
end
class ClientUser < ActiveRecord::Base
belongs_to :user, dependent: :destroy
end
class ServiceUser < ActiveRecord::Base
belongs_to :user, dependent: :destroy
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment