thecore_auth_commons 2.3.3 → 2.3.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/db/seeds.rb +7 -6
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cef4f18cff6ec30d74f2c7b5ac5c2a4c361acc67dd2f63eb1602fa42d927462b
4
- data.tar.gz: 37e079d69c7b6ee10aaf17e8e04cf208b4ce1d2fe986ad4e883821a76500d036
3
+ metadata.gz: ef336ba07dfb2b7045b03c7c6ddd046cc57f9494563917a728877f9ee2830191
4
+ data.tar.gz: e71c6255f11bca1c7c625e0eaf150d5ece5a38104285be9d15f3b7a95fdd3b3c
5
5
  SHA512:
6
- metadata.gz: ea0146c83408bf070be2b9c7583f3d7b711994358116057084701d0a0c9fa351ea545b56263d97a7d1b161caacfa783333999031ddc635212720f8fafe1fc56c
7
- data.tar.gz: 273f80f3a8fa1c9b9a2a2eb03f270c116d6715542704ee122a61066cf7f8e1f937ca9af263aab6f17db382e299e63e4ffe268e32e1528c671995668c16c0fdae
6
+ metadata.gz: a5d025b7c10645755d7e550da428eff612e2fb8e671eeef0c0f711d725b7086312b63053e5880d75ec897ce82e177a56c6090786b9ba53b1cedd8f039f459c6a
7
+ data.tar.gz: 037a7431dd095a9cd2452847aab62e08d7d7e34a643a1bb2b49870ff01d81dbbcef64ad740c08efab5e8c27abe7741c1dd1ca979a72816903763baf7a5395010
data/db/seeds.rb CHANGED
@@ -2,12 +2,13 @@ puts "Loading ThecoreAuthCommons seeds"
2
2
  email = ENV["ADMIN_EMAIL"].presence || "admin@example.com"
3
3
  psswd = ENV["ADMIN_PASSWORD"].presence || "changeme"
4
4
 
5
- u = User.find_or_initialize_by(email: email)
6
- u.username = "Administrator"
7
- u.password = u.password_confirmation = psswd
8
- u.admin = true
9
- u.save(validate: false)
10
-
5
+ unless User.where(admin: true).exists?
6
+ u = User.find_or_initialize_by(email: email)
7
+ u.username = "Administrator"
8
+ u.password = u.password_confirmation = psswd
9
+ u.admin = true
10
+ u.save(validate: false)
11
+ end
11
12
 
12
13
  @values = {
13
14
  predicates: %i[can cannot],
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thecore_auth_commons
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.3
4
+ version: 2.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabriele Tassoni
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-24 00:00:00.000000000 Z
11
+ date: 2021-03-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails