thecore_auth_commons 3.0.12 → 3.1.0

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: 75c8351339623ea4fd13daf13e0fa5c6bad69cec8a74b7222ccd228098c48e82
4
- data.tar.gz: 070405ac9ed1fa492d2dfffdeca3e286835e89fccdaf4f27f00f4e98b83632e0
3
+ metadata.gz: ca809778683a4861e9df36ada9e3f545472be60eb4ff104ef2d284f9ad03dc31
4
+ data.tar.gz: 06a7c2c55bb8365cc95f4b07099f3295862c6773852147a93e22e3f17a6097aa
5
5
  SHA512:
6
- metadata.gz: b0636ff4d42321cccc6423e1f53cda949cc7fd64c2b86e4d856c47baf38243421c3de5c5c0525796c6c9a084da4fdb5e00db6dee092b4f6f63dbadd3bfc44aa1
7
- data.tar.gz: 4f81899e74c48352921746583dc6a81362744bb57e3e417d658c9a4bd7ea0eb88381d853971ed64270430d7f59e00abe2feb5e0bb4a2931d6ffbca69681f43ba
6
+ metadata.gz: cf7b2840d9248b7184aa500288f32ba9557488451296aad914c3841ee912be87ad1fca249c094bfca5827362c97e9b0e488632c66546d3e50f9e8c6fd7f7d651
7
+ data.tar.gz: 2328fd3d524efb5b7b2039bb44ee2e5df3d72a1e4e1e0c81e72c3f8f00d21a2b12aa37e9c6bf2f4c410a646d67ab8bdacceb73b2dde48bf89e2d8149b623a3de
@@ -1,12 +1,10 @@
1
1
  Rails.application.configure do
2
2
  config.after_initialize do
3
3
  # In development be sure to load all the namespaces
4
- # in order to have working reflection and meta-programming.
4
+ # in order to have working reflection
5
5
  Zeitwerk::Loader.eager_load_all if Rails.env.development?
6
6
 
7
7
  Ability.send(:include, ThecoreAuthCommonsCanCanCanConcern)
8
8
  User.send(:include, ThecoreAuthCommonsUserConcern)
9
- # User.devise_modules.delete(:recoverable) if ThecoreSettings::Setting.where(ns: :devise, key: :recoverable).first.present? && ThecoreSettings::Setting.where(ns: :devise, key: :recoverable).first.raw == "disable"
10
- # User.devise_modules.delete(:registerable) if ThecoreSettings::Setting.where(ns: :devise, key: :registerable).first.present? && ThecoreSettings::Setting.where(ns: :devise, key: :registerable).first.raw == "disable"
11
9
  end
12
10
  end
data/db/seeds.rb CHANGED
@@ -1,4 +1,8 @@
1
1
  puts "Loading ThecoreAuthCommons seeds"
2
+
3
+ # Need this since in the rake task is not aeger loaded
4
+ Zeitwerk::Loader.eager_load_all
5
+
2
6
  email = "admin@#{ENV["BASE_DOMAIN"].presence || "example.com"}"
3
7
  psswd = ENV["ADMIN_PASSWORD"].presence || "changeme"
4
8
 
@@ -18,7 +22,11 @@ end
18
22
  def fill table
19
23
  model = table.to_s.classify.constantize
20
24
  model.reset_column_information
21
- model.upsert_all @values[table].map { |p| {name: p, created_at: Time.now, updated_at: Time.now} }, unique_by: [:name]
25
+ puts " - Filling table #{table} with #{@values[table].count} elements:"
26
+ @values[table].each do |name|
27
+ puts " - Name: #{name}"
28
+ model.find_or_create_by name: name
29
+ end
22
30
  end
23
31
 
24
32
  fill :predicates
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: 3.0.12
4
+ version: 3.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabriele Tassoni
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-06-12 00:00:00.000000000 Z
11
+ date: 2023-06-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: devise