any_login 1.5.1 → 1.5.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 26b0fb1dfbe9f3264c85b6c48f4ee21294d89508d85ba97593bddc40e9e54416
4
- data.tar.gz: 47d03dfbcc2c4de800d0be35da07a932d258b4bc515472fc544386d12f7ba67c
3
+ metadata.gz: f5bf2e4379dc3292f4370eccad6f0e9f25ae89d7f871525cfe8dc631b25ec38e
4
+ data.tar.gz: 8272a7055d6aca546c6f78375c026520691900b8f35c854724488cd767cf73dc
5
5
  SHA512:
6
- metadata.gz: d0731a0d850049fd8e7a8e7e526c9d150657735f1b134b0879b98c2c2336bb4419f5f90f6524fdce44c7593d9efa42958a32e4d1537316d40eaaeeec8b03e9d3
7
- data.tar.gz: 2e0004a1d244d33b754d2de757d5bab74027811130150689a36c29af3db3d075d31f6beb4f1626b90117196e07685a5257df2a7a96e13b940a130f5200def91c
6
+ metadata.gz: c44e654790b0df3ed3c8280e6f3bad9ea29513068a2f0fa7529a127884342dae5b707916bdee2b0d9b5a6e1f1c04b666c31419293c634f9532f7d262290279d0
7
+ data.tar.gz: 9b38b9cf3010608a432c818c8ae52b2f4ef4d12129ece50daf61cd8e048b6b2b8696fad525156ab99d962f8647260ea53e6a9222d04b5180510bf41e3d6ac200
@@ -6,11 +6,15 @@ module AnyLogin
6
6
 
7
7
  DEFAULT_SIGN_IN = proc do |loginable|
8
8
  reset_session
9
- sign_in AnyLogin.klass.to_s.parameterize.underscore.to_sym, loginable
9
+ sign_in Controller.mapping_key, loginable
10
10
  end
11
11
 
12
12
  def self.any_login_current_user_method
13
- @@any_login_current_user_method ||= "current_#{AnyLogin.klass.to_s.parameterize.underscore}".to_sym
13
+ @@any_login_current_user_method ||= "current_#{mapping_key}".to_sym
14
+ end
15
+
16
+ def self.mapping_key
17
+ @@mapping_key ||= ::Devise.mappings.detect {|_key, mapping| mapping.class_name == AnyLogin.klass.name }.first
14
18
  end
15
19
 
16
20
  def any_login_sign_in
@@ -21,7 +25,6 @@ module AnyLogin
21
25
 
22
26
  redirect_to main_app.send(AnyLogin.redirect_path_after_login)
23
27
  end
24
-
25
28
  end
26
29
 
27
30
  end
@@ -1,3 +1,3 @@
1
1
  module AnyLogin
2
- VERSION = '1.5.1'
2
+ VERSION = '1.5.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: any_login
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.1
4
+ version: 1.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Igor Kasyanchuk
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-08-30 00:00:00.000000000 Z
11
+ date: 2022-09-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -254,7 +254,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
254
254
  - !ruby/object:Gem::Version
255
255
  version: '0'
256
256
  requirements: []
257
- rubygems_version: 3.2.3
257
+ rubygems_version: 3.3.7
258
258
  signing_key:
259
259
  specification_version: 4
260
260
  summary: AnyLogin is created to speedup development process and allow developer's