Permalink
Browse files

trying to fix heroku

  • Loading branch information...
BlueHotDog committed Apr 21, 2012
1 parent dd6fbb1 commit 4668200ccd52ac9cbaae0d9f6fe009aba525a135
Showing with 16 additions and 14 deletions.
  1. +15 −13 app/models/authorization.rb
  2. +1 −1 db/migrate/20120421102650_create_authorizations.rb
@@ -1,17 +1,19 @@
class Authorization < ActiveRecord::Base
- belongs_to :user
- validates :provider, :uid, :presence => true
+ belongs_to :user
+ validates :provider, :uid, :presence => true
- def self.find_or_create(auth_hash)
- if ! auth = find_by_provider_and_uid(auth_hash["provider"], auth_hash["uid"])
- if auth_hash.provider == "github"
- user = User.new :name => auth_hash["extra"].raw_info.name, :email => auth_hash["extra"].raw_info.email
- else
- return false
- end
- auth = create :user => user, :provider => auth_hash["provider"], :uid => auth_hash["uid"]
- end
- auth
- end
+ #def self.find_or_create(auth_hash)
+ # omniauth = request.env["omniauth.auth"]
+ # auth = find_by_provider_and_uid(auth_hash["provider"], auth_hash["uid"])
+ # unless auth
+ # if auth_hash.provider == "github"
+ # user = User.new :name => auth_hash["extra"].raw_info.name, :email => auth_hash["extra"].raw_info.email
+ # else
+ # return false
+ # end
+ # auth = create :user => user, :provider => auth_hash["provider"], :uid => auth_hash["uid"]
+ # end
+ # auth
+ #end
end
@@ -2,7 +2,7 @@ class CreateAuthorizations < ActiveRecord::Migration
def change
create_table :authorizations do |t|
t.string :provider
- t.integer :uid
+ t.string :uid
t.integer :user_id
t.timestamps
end

0 comments on commit 4668200

Please sign in to comment.