Created
June 11, 2015 15:13
-
-
Save Frank004/710071d36cc2818c2ca8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class User < ActiveRecord::Base | |
devise :database_authenticatable, :registerable, | |
:recoverable, :rememberable, :trackable, :validatable,:authentication_keys => [:login] | |
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class User < ActiveRecord::Base | |
devise :database_authenticatable, :registerable, | |
:recoverable, :rememberable, :trackable, :validatable,:authentication_keys => [:login] | |
belongs_to :loginable, :polymorphic => true | |
end | |
class ClientUser < ActiveRecord::Base | |
has_one :user, :as => :loginable, :dependent => :destroy | |
end | |
class ServiceUser < ActiveRecord::Base | |
has_one :user, :as => :loginable, :dependent => :destroy | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment