Skip to content

Instantly share code, notes, and snippets.

@ovargas27
Created August 9, 2011 23:29
Show Gist options
  • Save ovargas27/1135489 to your computer and use it in GitHub Desktop.
Save ovargas27/1135489 to your computer and use it in GitHub Desktop.
Devise and OAuth
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
class OAuthUser < ActiveRecord::Base
devise :omniauthable
has_many :post, :as => :authorizable
end
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