Created
August 9, 2011 23:29
-
-
Save ovargas27/1135489 to your computer and use it in GitHub Desktop.
Devise and OAuth
This file contains 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 DeviseUser < ActiveRecord::Base | |
devise :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable | |
attr_accessible :email, :name, :password, :password_confirmation, :remember_me | |
has_many :posts, :as => :authorizable | |
end |
This file contains 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 OAuthUser < ActiveRecord::Base | |
devise :omniauthable | |
has_many :post, :as => :authorizable | |
end |
This file contains 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 Post < ActiveRecord::Base | |
belongs_to :authorizable, :polymorphic => true | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment