egov_utils 0.7.1 → 0.7.4

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: d0fb4d51f6f37b8c70952049ec7570dec41ad52272155c457f24a3326223319b
4
- data.tar.gz: b689068162ba29eed688e46a44ebb92286634187854c29aa73d1e898f53abc69
3
+ metadata.gz: 77ce0843ebb4bc70b8389b530dd43dd45c232cea4c741ec014995c77cb259e61
4
+ data.tar.gz: 954dbe830452f604e681b87a6d33b8cefea419bcf141fbd5cebd088b3316e7c9
5
5
  SHA512:
6
- metadata.gz: c58af4cd7c8f02e87536fb5b5f0b347b4d03ddfc326a93c8e705627b3631d064206fc0fccef02e72f45b40f6679f6de048c36044230273a9964aead64f441ec5
7
- data.tar.gz: ed7a4cc54856c518f91b35791974700f3485af6210899a7c940e7eb75114800a4f3104368ba4db650646ac8fd73d6a51817902430c2dc9fe0c7d900f399fa7fb
6
+ metadata.gz: b7394626c5d9f1771c679de090479739c1d78f212d9cada20f4dafbc6eebfcbedc336348c7b2b34192f6ce6b20165136cbc9d3750090f5b06318001038d56675
7
+ data.tar.gz: 1f3f2e7c890eac9696bcf862d856758cee4280fe49e9ff5bc20d98af8884ee020d2ebff85e4fbe644f3050ddc0365ef1972d093a334f38d212ea331116028415
@@ -9,7 +9,7 @@ module EgovUtils
9
9
  respond_to do |format|
10
10
  if params['_type'] == 'query'
11
11
  format.json{ render json: {
12
- results: @people_schema.entities.collect do |p|
12
+ results: @people_schema.entities.includes(:residence).collect do |p|
13
13
  {id: p.id, text: p.to_s, residence: p.residence.to_s}
14
14
  end
15
15
  }}
@@ -64,7 +64,7 @@ module EgovUtils
64
64
  @user = User.find_by(id: params[:id])
65
65
  render_404 and return if @user.nil? || @user.active?
66
66
  authorize!(:manage, User)
67
- @user.update(active: true)
67
+ @user.update(active: true, last_login_at: Time.current)
68
68
  redirect_back(fallback_location: @user)
69
69
  end
70
70
 
@@ -66,8 +66,8 @@ module EgovUtils
66
66
 
67
67
  if user && !user.new_record?
68
68
  # Check last login
69
- if user.days_before_inactive && user.last_login_at < (Time.now - user.days_before_inactive.days)
70
- user.update_column(active: false)
69
+ if user.days_before_inactive && (user.last_login_at || user.created_at) < (Time.now - user.days_before_inactive.days)
70
+ user.update_column(:active, false)
71
71
  end
72
72
 
73
73
  user.update_column(:last_login_at, Time.now) if user.active?
@@ -1,3 +1,3 @@
1
1
  module EgovUtils
2
- VERSION = '0.7.1'
2
+ VERSION = '0.7.4'
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.7.1
4
+ version: 0.7.4
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: 2022-04-01 00:00:00.000000000 Z
11
+ date: 2022-05-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails