shield-contrib 0.0.2 → 0.0.3

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.
@@ -1,8 +1,8 @@
1
1
  module Shield
2
2
  module Contrib
3
- VERSION = "0.0.2"
3
+ VERSION = "0.0.3"
4
4
  end
5
5
 
6
6
  autoload :Ohm, "shield/contrib/ohm"
7
7
  autoload :Sinatra, "shield/contrib/sinatra"
8
- end
8
+ end
@@ -4,7 +4,8 @@ module Shield
4
4
  def self.included(model)
5
5
  model.extend Shield::Model
6
6
  model.extend Fetch
7
- model.attribute :email
7
+
8
+ model.attributes << :email unless model.attributes.include?(:email)
8
9
  model.index :email
9
10
 
10
11
  model.attribute :crypted_password
@@ -20,6 +21,14 @@ module Shield
20
21
  end
21
22
  end
22
23
 
24
+ def email=(email)
25
+ write_local(:email, email.to_s.downcase.strip)
26
+ end
27
+
28
+ def email
29
+ read_local(:email)
30
+ end
31
+
23
32
  attr_reader :password
24
33
  attr_accessor :password_confirmation
25
34
 
@@ -35,10 +44,6 @@ module Shield
35
44
  end
36
45
  end
37
46
 
38
- def email
39
- read_local(:email).to_s.downcase.strip
40
- end
41
-
42
47
  def password=(password)
43
48
  unless password.to_s.empty?
44
49
  self.crypted_password = Shield::Password.encrypt(password)
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 2
9
- version: 0.0.2
8
+ - 3
9
+ version: 0.0.3
10
10
  platform: ruby
11
11
  authors:
12
12
  - Michel Martens
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2010-12-19 00:00:00 +08:00
19
+ date: 2011-01-03 00:00:00 +08:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency