authentasaurus 0.6.16pre → 0.6.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -14,7 +14,7 @@ module ActiveRecord::Authenticatable
|
|
14
14
|
# basic attributes
|
15
15
|
validates_presence_of :username, :hashed_password, :password_seed, :email, :name
|
16
16
|
validates_uniqueness_of :username, :email
|
17
|
-
validates_format_of :username, :with => /^[a-z0-9
|
17
|
+
validates_format_of :username, :with => /^[a-z0-9]*([a-z0-9]{4})+[a-z0-9]*$/ # alpha-numeric only and at least 4 characters
|
18
18
|
validates_format_of :email, :with => %r{[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}}
|
19
19
|
# password validations
|
20
20
|
validates_confirmation_of :password, :on => :create, :if => Proc.new {|user| user.hashed_password.nil? || user.password_seed.nil? }
|
@@ -25,13 +25,19 @@ module ActiveResource::ActsAsAuthenticatable
|
|
25
25
|
last_update_datetime = (last_update.kind_of?(String)) ? (DateTime.parse(last_update)) : (last_update)
|
26
26
|
|
27
27
|
if local_user.updated_at < last_update_datetime
|
28
|
-
|
29
|
-
local_user.update_attributes user.attributes
|
28
|
+
local_user.update_attributes user.attributes
|
30
29
|
end
|
31
30
|
else
|
32
31
|
local_user.password = password
|
32
|
+
local_user.password_confirmation = password
|
33
|
+
|
33
34
|
local_user.hashed_password = user.hashed_password
|
34
35
|
local_user.password_seed = user.password_seed
|
36
|
+
|
37
|
+
self.sync_to.default_data.each do |key,value|
|
38
|
+
local_user.send(key.to_s + '=', value)
|
39
|
+
end
|
40
|
+
|
35
41
|
local_user.save
|
36
42
|
end
|
37
43
|
end
|
@@ -50,6 +56,10 @@ module ActiveResource::ActsAsAuthenticatable
|
|
50
56
|
unless local_user.new_record?
|
51
57
|
local_user.update_attributes user.attributes
|
52
58
|
else
|
59
|
+
self.sync_to.default_data.each do |key,value|
|
60
|
+
local_user.send(key.to_s + '=', value)
|
61
|
+
end
|
62
|
+
|
53
63
|
local_user.save
|
54
64
|
end
|
55
65
|
else
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: authentasaurus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 37
|
5
|
+
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 6
|
9
|
-
-
|
10
|
-
version: 0.6.
|
9
|
+
- 17
|
10
|
+
version: 0.6.17
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Omar Mekky
|
@@ -18,7 +18,7 @@ autorequire:
|
|
18
18
|
bindir: bin
|
19
19
|
cert_chain: []
|
20
20
|
|
21
|
-
date: 2010-
|
21
|
+
date: 2010-09-20 00:00:00 +03:00
|
22
22
|
default_executable:
|
23
23
|
dependencies: []
|
24
24
|
|