Skip to content

Commit

Permalink
Fixed problem with model and strategy.
Browse files Browse the repository at this point in the history
The strategy will now return true correctly when it is valid, and the
user has gotten it's authenticate_facebook_user as a class method, not
as an instance method :-)
  • Loading branch information
thhermansen committed Jun 13, 2010
1 parent 60f93ec commit ab493ec
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions lib/devise_facebook_open_graph/model.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@ module ClassMethods
def facebook_auto_create_account?
!!facebook_auto_create_account
end
end


def authenticate_facebook_user(facebook_uid)
self.class.send "find_by_" + facebook_uid_field, facebook_uid
def authenticate_facebook_user(facebook_uid)
self.class.send "find_by_" + facebook_uid_field, facebook_uid
end
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/devise_facebook_open_graph/strategy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class FacebookOpenGraphAuthenticatable < ::Devise::Strategies::Base
# current application's domain cookies.
#
def valid?
mapping.respond_to?(:authenticate_facebook_user) && cookies.has_key?(::DeviseFacebookOpenGraph::Facebook::Config.facebook_session_name)
mapping.to.respond_to?(:authenticate_facebook_user) && cookies.has_key?(::DeviseFacebookOpenGraph::Facebook::Config.facebook_session_name)
end

def authenticate!
Expand Down

0 comments on commit ab493ec

Please sign in to comment.