eac_users_support 0.2.3 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/app/controllers/eac_users_support/admin/users_controller.rb +16 -0
- data/config/locales/pt-BR.yml +5 -0
- data/config/routes.rb +6 -1
- data/lib/eac_users_support/version.rb +1 -1
- metadata +26 -26
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 6867d12aa8e309ef121f3e13b8041d9c3c89dd32f7f748552a3c0080c2be910d
|
4
|
+
data.tar.gz: e0dc2853d4f4e712a38f6af94b71256d82bce20dd736fff4ef1e94b29e475da1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c8b33f02eede8b89b22869aa4d55def5b32647518344369c2b1225118a427f784db3ea3dd1d606410aa8f4e78de6f1b9e94cc8b2a3f3b07c9185b3a6d41b80b2
|
7
|
+
data.tar.gz: f8a71bd792172d005d03622e635f56449506f5479d25a6b6be47069fdef71668f0a298475d0c33d1f9d0ac5d79aefff98969666a8cafaa9dc5b40c27cd8254d8
|
@@ -4,12 +4,28 @@ module EacUsersSupport
|
|
4
4
|
module Admin
|
5
5
|
class UsersController < ::EacUsersSupport::ApplicationController
|
6
6
|
active_scaffold ::EacUsersSupport::User do |conf|
|
7
|
+
conf.action_links.add :password_reset,
|
8
|
+
type: :member, method: :put, position: false,
|
9
|
+
label: ::I18n.t(:'eac_users_support.password_reset.action')
|
7
10
|
conf.columns.exclude :encrypted_password
|
8
11
|
%w[create update list].each do |action|
|
9
12
|
conf.send(action).columns.exclude :remember_created_at
|
10
13
|
end
|
11
14
|
end
|
12
15
|
|
16
|
+
def password_reset
|
17
|
+
process_action_link_action do |record|
|
18
|
+
record.password = ::Devise.friendly_token
|
19
|
+
if record.save
|
20
|
+
flash[:info] = ::I18n.t(:'eac_users_support.password_reset.successful',
|
21
|
+
user: record, password: record.password)
|
22
|
+
else
|
23
|
+
flash[:error] = ::I18n.t(:'eac_users_support.password_reset.failed', user: user) +
|
24
|
+
': ' + record.errors.to_s
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
13
29
|
protected
|
14
30
|
|
15
31
|
def before_create_save(record)
|
data/config/locales/pt-BR.yml
CHANGED
data/config/routes.rb
CHANGED
@@ -2,7 +2,12 @@
|
|
2
2
|
|
3
3
|
EacUsersSupport::Engine.routes.draw do
|
4
4
|
namespace(:admin) do
|
5
|
-
resources(:users)
|
5
|
+
resources(:users) do
|
6
|
+
as_routes
|
7
|
+
member do
|
8
|
+
put :password_reset
|
9
|
+
end
|
10
|
+
end
|
6
11
|
end
|
7
12
|
devise_for :users, class_name: 'EacUsersSupport::User', module: :devise, skip: [:registrations]
|
8
13
|
resource :user, only: [:edit] do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eac_users_support
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Esquilo Azul Company
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-02-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: active_scaffold
|
@@ -167,43 +167,43 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
167
167
|
version: '0'
|
168
168
|
requirements: []
|
169
169
|
rubyforge_project:
|
170
|
-
rubygems_version: 2.
|
170
|
+
rubygems_version: 2.7.7
|
171
171
|
signing_key:
|
172
172
|
specification_version: 4
|
173
173
|
summary: Ready-to-use support for users registration, login, logout, etc, for Rails.
|
174
174
|
test_files:
|
175
|
-
- test/dummy/Rakefile
|
176
|
-
- test/dummy/README.rdoc
|
177
|
-
- test/dummy/config.ru
|
178
|
-
- test/dummy/config/boot.rb
|
179
|
-
- test/dummy/config/database.yml
|
180
|
-
- test/dummy/config/secrets.yml
|
181
|
-
- test/dummy/config/locales/en.yml
|
182
|
-
- test/dummy/config/application.rb
|
183
|
-
- test/dummy/config/environments/development.rb
|
184
|
-
- test/dummy/config/environments/test.rb
|
185
|
-
- test/dummy/config/environments/production.rb
|
186
|
-
- test/dummy/config/environment.rb
|
187
175
|
- test/dummy/config/routes.rb
|
188
176
|
- test/dummy/config/initializers/assets.rb
|
189
177
|
- test/dummy/config/initializers/cookies_serializer.rb
|
190
|
-
- test/dummy/config/initializers/inflections.rb
|
191
178
|
- test/dummy/config/initializers/session_store.rb
|
179
|
+
- test/dummy/config/initializers/backtrace_silencers.rb
|
192
180
|
- test/dummy/config/initializers/wrap_parameters.rb
|
193
181
|
- test/dummy/config/initializers/filter_parameter_logging.rb
|
194
|
-
- test/dummy/config/initializers/
|
182
|
+
- test/dummy/config/initializers/inflections.rb
|
195
183
|
- test/dummy/config/initializers/mime_types.rb
|
196
|
-
- test/dummy/
|
197
|
-
- test/dummy/
|
198
|
-
- test/dummy/
|
199
|
-
- test/dummy/
|
200
|
-
- test/dummy/
|
201
|
-
- test/dummy/
|
202
|
-
- test/dummy/
|
203
|
-
- test/dummy/
|
184
|
+
- test/dummy/config/database.yml
|
185
|
+
- test/dummy/config/secrets.yml
|
186
|
+
- test/dummy/config/locales/en.yml
|
187
|
+
- test/dummy/config/environment.rb
|
188
|
+
- test/dummy/config/boot.rb
|
189
|
+
- test/dummy/config/application.rb
|
190
|
+
- test/dummy/config/environments/production.rb
|
191
|
+
- test/dummy/config/environments/test.rb
|
192
|
+
- test/dummy/config/environments/development.rb
|
193
|
+
- test/dummy/Rakefile
|
204
194
|
- test/dummy/public/favicon.ico
|
195
|
+
- test/dummy/public/404.html
|
205
196
|
- test/dummy/public/500.html
|
206
|
-
- test/dummy/
|
197
|
+
- test/dummy/public/422.html
|
198
|
+
- test/dummy/config.ru
|
199
|
+
- test/dummy/app/assets/stylesheets/application.css
|
200
|
+
- test/dummy/app/assets/javascripts/application.js
|
201
|
+
- test/dummy/app/helpers/application_helper.rb
|
202
|
+
- test/dummy/app/views/layouts/application.html.erb
|
203
|
+
- test/dummy/app/controllers/application_controller.rb
|
207
204
|
- test/dummy/bin/setup
|
205
|
+
- test/dummy/bin/bundle
|
208
206
|
- test/dummy/bin/rails
|
209
207
|
- test/dummy/bin/rake
|
208
|
+
- test/dummy/db/schema.rb
|
209
|
+
- test/dummy/README.rdoc
|