user_authentication 1.0.0 → 1.1.0
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.
- checksums.yaml +4 -4
- data/app/models/account.rb +0 -1
- data/app/models/account.rb~ +11 -0
- data/lib/user_authentication/version.rb +1 -1
- data/lib/user_authentication/version.rb~ +3 -0
- data/lib/user_authentication.rb~ +16 -0
- metadata +6 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 66bc3426a5ae74be5cac2e2469cddace55db69da
|
4
|
+
data.tar.gz: f78a03660b62ea4eb14ca4fe7481004fe4d18885
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 20e69008688ba3b3828e3cb07c03a6b62843d7c31b0ff7f5ce8c2e976502288a5af2d7655a81bf389dc701aee3d6e35708bc3d7ac7a142216445c872c3aa0580
|
7
|
+
data.tar.gz: 4178aaa68dba5325d7b63c5dd1c28420a0d256c946d6831b7cb39b66b43e5593587f2228d8ecccf774f3b023d9df82ad1cd3dd18bd0f16f956b376fb94aba483
|
data/app/models/account.rb
CHANGED
@@ -3,7 +3,6 @@ require File.expand_path('../../../lib/random', __FILE__)
|
|
3
3
|
class Account < ActiveRecord::Base
|
4
4
|
has_secure_password
|
5
5
|
|
6
|
-
before_validation { |account| account.password = Random.password if account.password.nil? }
|
7
6
|
validates :email, presence: true, uniqueness: true, email: true
|
8
7
|
end
|
9
8
|
|
@@ -0,0 +1,11 @@
|
|
1
|
+
require File.expand_path('../../../lib/random', __FILE__)
|
2
|
+
|
3
|
+
class Account < ActiveRecord::Base
|
4
|
+
has_secure_password
|
5
|
+
|
6
|
+
before_validation { |account| account.password = Random.password if account.password.nil? }
|
7
|
+
validates :email, presence: true, uniqueness: true, email: true
|
8
|
+
end
|
9
|
+
|
10
|
+
app_model = File.join Rails.root, 'app/models/account.rb'
|
11
|
+
require app_model if File.exists? app_model
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module UserAuthentication
|
2
|
+
class Engine < Rails::Engine
|
3
|
+
engine_name 'user_authentication'
|
4
|
+
|
5
|
+
initializer 'user_authentication_engine.app_controller' do |app|
|
6
|
+
ActiveSupport.on_load(:action_controller) do
|
7
|
+
require File.expand_path('../../app/controllers/application_controller', __FILE__)
|
8
|
+
require File.expand_path('../../app/helpers/application_helper', __FILE__)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
config.after_initialize do
|
13
|
+
require File.expand_path('../../app/models/account', __FILE__)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: user_authentication
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sujoy Gupta
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-07-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -149,6 +149,7 @@ files:
|
|
149
149
|
- app/controllers/application_controller.rb
|
150
150
|
- app/helpers/application_helper.rb
|
151
151
|
- app/models/account.rb
|
152
|
+
- app/models/account.rb~
|
152
153
|
- app/validators/email_validator.rb
|
153
154
|
- app/views/accounts/login.html.erb
|
154
155
|
- app/views/accounts/signup.html.erb
|
@@ -159,7 +160,9 @@ files:
|
|
159
160
|
- lib/random.rb
|
160
161
|
- lib/tasks/user_authentication_tasks.rake
|
161
162
|
- lib/user_authentication.rb
|
163
|
+
- lib/user_authentication.rb~
|
162
164
|
- lib/user_authentication/version.rb
|
165
|
+
- lib/user_authentication/version.rb~
|
163
166
|
homepage: http://github.com/sujoyg/user_authentication
|
164
167
|
licenses:
|
165
168
|
- MIT
|
@@ -180,7 +183,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
180
183
|
version: '0'
|
181
184
|
requirements: []
|
182
185
|
rubyforge_project:
|
183
|
-
rubygems_version: 2.
|
186
|
+
rubygems_version: 2.4.6
|
184
187
|
signing_key:
|
185
188
|
specification_version: 4
|
186
189
|
summary: A rails engine for email and password based account authentication.
|