user_authentication 0.0.3 → 0.0.4
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.
- data/app/models/user.rb +5 -2
- data/app/models/user.rb~ +8 -0
- data/app/views/users/_login.html.erb +11 -0
- data/lib/random.rb +6 -0
- data/lib/random.rb~ +8 -0
- data/lib/user_authentication/version.rb +1 -1
- data/lib/user_authentication/version.rb~ +1 -1
- metadata +22 -2
data/app/models/user.rb
CHANGED
@@ -1,5 +1,8 @@
|
|
1
|
-
|
2
|
-
validates_presence_of :email
|
1
|
+
require File.expand_path('../../../lib/random', __FILE__)
|
3
2
|
|
3
|
+
class User < ActiveRecord::Base
|
4
4
|
has_secure_password
|
5
|
+
|
6
|
+
before_validation { |user| user.password = Random.password if user.password.nil? }
|
7
|
+
validates_presence_of :email
|
5
8
|
end
|
data/app/models/user.rb~
ADDED
data/lib/random.rb
ADDED
data/lib/random.rb~
ADDED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: user_authentication
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-10-
|
12
|
+
date: 2012-10-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -139,6 +139,22 @@ dependencies:
|
|
139
139
|
- - ~>
|
140
140
|
- !ruby/object:Gem::Version
|
141
141
|
version: 0.0.1
|
142
|
+
- !ruby/object:Gem::Dependency
|
143
|
+
name: webrat
|
144
|
+
requirement: !ruby/object:Gem::Requirement
|
145
|
+
none: false
|
146
|
+
requirements:
|
147
|
+
- - ! '>='
|
148
|
+
- !ruby/object:Gem::Version
|
149
|
+
version: '0'
|
150
|
+
type: :development
|
151
|
+
prerelease: false
|
152
|
+
version_requirements: !ruby/object:Gem::Requirement
|
153
|
+
none: false
|
154
|
+
requirements:
|
155
|
+
- - ! '>='
|
156
|
+
- !ruby/object:Gem::Version
|
157
|
+
version: '0'
|
142
158
|
description: A rails engine for email and password based user authentication.
|
143
159
|
email:
|
144
160
|
- sujoyg@gmail.com
|
@@ -149,8 +165,12 @@ files:
|
|
149
165
|
- app/controllers/application_controller.rb
|
150
166
|
- app/controllers/users_controller.rb
|
151
167
|
- app/models/user.rb
|
168
|
+
- app/models/user.rb~
|
169
|
+
- app/views/users/_login.html.erb
|
152
170
|
- config/routes.rb
|
153
171
|
- db/migrate/20121009010000_create_users.rb
|
172
|
+
- lib/random.rb
|
173
|
+
- lib/random.rb~
|
154
174
|
- lib/tasks/user_authentication_tasks.rake
|
155
175
|
- lib/user_authentication/version.rb
|
156
176
|
- lib/user_authentication/version.rb~
|