egov_utils 0.1.26 → 0.1.27

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: 18a523079b611c16cb2d396f77d105946a0f82359afc2bdf264c8eca9ead5b54
4
- data.tar.gz: 83d00e43acb7ac7d1a1996214ebf417601085642629575c13bc5ce8a650fd183
3
+ metadata.gz: 0d348bf4a95152401f8f4dd63902d7554a3b7dcff277709ecea617f8308ed346
4
+ data.tar.gz: 05c443eab6eeb9ffdef710579ac6c52e158e93ea86f738001d7e97090a280448
5
5
  SHA512:
6
- metadata.gz: de2382de5425cb8f9399b933057b3bace3e2ded8cbf66c4f4a65b29ebdaf8c1582afbd72e6bc3feccb8a69abc512af21f68d2c7b2ba010a624b1e8a7e00a8bef
7
- data.tar.gz: 69e22c0e7132b03f8fa34ceb14619bdbdd6419f8b13e7fb7a878a8d2dc95a7c947022db81b377b0f53079869e228b8965bffdc4f33210075a47cd14625c03558
6
+ metadata.gz: 0ecddd413f9a261b1f1139b38d32ea022508d1fd7685bd72f77accf72f24564234d22489371636a2dacaa9d174de471c9ead7606808c1e7896fdb761bc9db573
7
+ data.tar.gz: 46fc87b2aa6dc2558613495cc2287c2aefdb7bc49c4440ccf4eedb2edbc0c7a31a2d09fc47f1875e581de0554809f1fd39e966cd711e1bd0a01de2a191454ea2
@@ -26,7 +26,10 @@ module EgovUtils
26
26
 
27
27
  # Make sure no one can sign in with an empty login or password
28
28
  return nil if login.empty? || password.empty?
29
- user = find_by(login: login) || find_by(mail: login)
29
+
30
+ # Fail over to case-insensitive if none was found
31
+ user = find_by(login: login) || where( arel_table[:login].lower.eq(login.downcase) ).first
32
+
30
33
  if user
31
34
  # user is already in local database
32
35
  return nil unless user.password_check?(password)
@@ -91,7 +91,7 @@ module EgovUtils
91
91
  if request.get?
92
92
  url = request.original_url
93
93
  else
94
- url = url_for(:controller => params[:controller], :action => params[:action], :id => params[:id], :project_id => params[:project_id])
94
+ url = url_for(:controller => params[:controller], :action => params[:action], :id => params[:id], only_path: true)
95
95
  end
96
96
  respond_to do |format|
97
97
  format.html {
@@ -1,3 +1,3 @@
1
1
  module EgovUtils
2
- VERSION = '0.1.26'
2
+ VERSION = '0.1.27'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: egov_utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.26
4
+ version: 0.1.27
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ondřej Ezr
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-08 00:00:00.000000000 Z
11
+ date: 2017-12-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails