authlogic_facebook 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.0
1
+ 1.2.0
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{authlogic_facebook}
8
- s.version = "1.1.0"
8
+ s.version = "1.2.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Rusty Burchfield"]
12
- s.date = %q{2010-03-12}
12
+ s.date = %q{2010-03-19}
13
13
  s.description = %q{Authlogic plugin to support Facebook without Facebooker. A small unobtrusive gem (mini_fb) is used instead.}
14
14
  s.email = %q{GICodeWarrior@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -39,6 +39,15 @@ module AuthlogicFacebook
39
39
  end
40
40
  alias_method :facebook_uid_field=, :facebook_uid_field
41
41
 
42
+ # What method should be used to find the facebook account?
43
+ #
44
+ # * <tt>Default:</tt> :find_by_#{facebook_uid_field}
45
+ # * <tt>Accepts:</tt> Symbol or String
46
+ def facebook_finder(value=nil)
47
+ rw_config(:facebook_finder, value, nil)
48
+ end
49
+ alias_method :facebook_finder=, :facebook_finder
50
+
42
51
  # What extended permissions should be requested from the user?
43
52
  #
44
53
  # * <tt>Default:</tt> []
@@ -89,7 +98,7 @@ module AuthlogicFacebook
89
98
  def validate_by_facebook
90
99
  if facebook_callback?
91
100
  facebook_uid = facebook_session['uid']
92
- self.attempted_record = klass.first(:conditions => {facebook_uid_field => facebook_uid})
101
+ self.attempted_record = klass.send(facebook_finder, facebook_uid)
93
102
 
94
103
  if self.attempted_record || !facebook_auto_register?
95
104
  return !!self.attempted_record
@@ -162,6 +171,10 @@ module AuthlogicFacebook
162
171
  self.class.facebook_uid_field
163
172
  end
164
173
 
174
+ def facebook_finder
175
+ self.class.facebook_finder || "find_by_#{facebook_uid_field}"
176
+ end
177
+
165
178
  def facebook_login_params
166
179
  {'api_key' => self.class.facebook_api_key,
167
180
  'req_perms' => self.class.facebook_permissions.join(','),
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: authlogic_facebook
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rusty Burchfield
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-03-12 00:00:00 -08:00
12
+ date: 2010-03-19 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency