thecore_backend_commons 2.2.7 → 2.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f3990a879206f64ef45e97055d4c916fc6f266149bcdea444a52d936145759a2
4
- data.tar.gz: e3326840ba18d6bb924353ef44942ee89bea249bd6e636a2cbccd92bb8554203
3
+ metadata.gz: a71a84f3ec7b4d1f7b04f5364a3fe06cb276780877e7e42f900e2dc127db08f5
4
+ data.tar.gz: 1e4864c9729010d64fb31c01cc83cd239c926624b35490d761693220a57a81f9
5
5
  SHA512:
6
- metadata.gz: 33aa79c1181d64f948bc47fa933e3b30e700cedbd29988fc4ffe1d3a1dcaa1cd9a7fcaee2766e3fc2c49f91deb7fe24e00b29efb31bb0ab6fcc4ac3d8d835b27
7
- data.tar.gz: de66eba73c841d628c448d155af30812d3876d5d92cbcff94137568aaf49a80e45d63cfd2f9961aa99700d9ae903a9fbc17f16b1fd33c98c5ad1b3222f616416
6
+ metadata.gz: f3461a0da170cbab9aeae2fa65b7a2c0f57bcbc454b491ae4378a4a6cbd31cf991f8e3a7c1d31132ee4b78f505269c5d055c4f8b683207b0e966975b32d830db
7
+ data.tar.gz: ed8dd31419464a8c1bc486646add1ddd099438500a478747ae93006e62403735837da75aa00b85519f240946e001c55c9a3984f9be272587a30fb825e192b13b
@@ -0,0 +1,25 @@
1
+ class CreateRailsAdminSettings < ActiveRecord::Migration[5.0]
2
+ def change
3
+ create_table :rails_admin_settings do |t|
4
+ t.boolean :enabled, default: true
5
+ t.string :kind, null: false, default: 'string'
6
+ t.string :ns, default: 'main'
7
+ t.string :key, null: false
8
+ if Object.const_defined?('Geocoder')
9
+ t.float :latitude
10
+ t.float :longitude
11
+ end
12
+ t.text :raw
13
+ t.string :label
14
+ if defined?(Paperclip)
15
+ t.attachment :file
16
+ elsif defined?(CarrierWave)
17
+ t.string :file
18
+ end
19
+ t.timestamps
20
+ end
21
+
22
+ add_index :rails_admin_settings, :key
23
+ add_index :rails_admin_settings, [:ns, :key], unique: true
24
+ end
25
+ end
data/db/seeds.rb ADDED
@@ -0,0 +1,2 @@
1
+ puts "Loading ThecoreBackendCommons seeds"
2
+ Settings.app_name = "The Core by Gabriele Tassoni"
@@ -4,7 +4,5 @@ module ThecoreBackendCommonsUser
4
4
  extend ActiveSupport::Concern
5
5
 
6
6
  included do
7
- validates :username, uniqueness: { case_sensitive: false }, presence: true, length: { in: 4..15 }
8
- validates_format_of :username, with: /\A[a-zA-Z0-9]*\z/, on: :create, message: "can only contain letters and digits"
9
7
  end
10
8
  end
@@ -2,6 +2,7 @@ require 'thecore_auth_commons'
2
2
  require 'devise-i18n'
3
3
  require 'http_accept_language'
4
4
  require 'rails-i18n'
5
+ require 'rails_admin_settings'
5
6
 
6
7
  require 'patches/thecore'
7
8
  require 'concerns/thecore_backend_commons_user'
@@ -1,6 +1,9 @@
1
1
  module ThecoreBackendCommons
2
2
  class Engine < ::Rails::Engine
3
3
  initializer 'thecore_backend_commons.add_to_migrations' do |app|
4
+ # Adds the list of Thecore Engines, so to manage seeds loading, i.e.:
5
+ # Thecore::Base.thecore_engines.each { |engine| engine.load_seed }
6
+ Thecore::Base.thecore_engines << self.class
4
7
  unless app.root.to_s.match root.to_s
5
8
  # APPEND TO MAIN APP MIGRATIONS FROM THIS GEM
6
9
  config.paths['db/migrate'].expanded.each do |expanded_path|
@@ -1,3 +1,3 @@
1
1
  module ThecoreBackendCommons
2
- VERSION = '2.2.7'
2
+ VERSION = "#{`git describe --tags $(git rev-list --tags --max-count=1)`.chomp}"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thecore_backend_commons
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.7
4
+ version: 2.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabriele Tassoni
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-05-19 00:00:00.000000000 Z
11
+ date: 2021-03-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thecore_auth_commons
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '2.1'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rails_admin_settings
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '1.5'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '1.5'
69
83
  description: Wrapper to keep all the common libraries and setups needed by Thecore
70
84
  UI Backend(s).
71
85
  email:
@@ -83,7 +97,8 @@ files:
83
97
  - config/locales/en.devise.custom.yml
84
98
  - config/locales/it.devise.custom.yml
85
99
  - config/routes.rb
86
- - db/migrate/20190920115549_create_active_storage_tables.active_storage.rb
100
+ - db/migrate/20161227101954_create_rails_admin_settings.rb
101
+ - db/seeds.rb
87
102
  - lib/concerns/thecore_backend_commons_user.rb
88
103
  - lib/patches/active_record_extensions.rb
89
104
  - lib/patches/application_record_loader.rb
@@ -1,27 +0,0 @@
1
- # This migration comes from active_storage (originally 20170806125915)
2
- class CreateActiveStorageTables < ActiveRecord::Migration[5.2]
3
- def change
4
- create_table :active_storage_blobs do |t|
5
- t.string :key, null: false
6
- t.string :filename, null: false
7
- t.string :content_type
8
- t.text :metadata
9
- t.bigint :byte_size, null: false
10
- t.string :checksum, null: false
11
- t.datetime :created_at, null: false
12
-
13
- t.index [ :key ], unique: true
14
- end
15
-
16
- create_table :active_storage_attachments do |t|
17
- t.string :name, null: false
18
- t.references :record, null: false, polymorphic: true, index: false
19
- t.references :blob, null: false
20
-
21
- t.datetime :created_at, null: false
22
-
23
- t.index [ :record_type, :record_id, :name, :blob_id ], name: "index_active_storage_attachments_uniqueness", unique: true
24
- t.foreign_key :active_storage_blobs, column: :blob_id
25
- end
26
- end
27
- end