thecore_print_commons 3.0.3 → 3.0.5

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: 893987695fbd693d63533b2297545a8dc1301ccff8433f2f1e2f29ada9557d79
4
- data.tar.gz: 4f7905fd0410ab37910198409289a6ed5ac16211e6b1807a1ff9e201ab86d264
3
+ metadata.gz: b3b7503441e21a848118fe588d5cd9d814d13df3f9d1716c1ff9c5c909f93323
4
+ data.tar.gz: d36bf02ed4a6079ea9ea7c163fb8b8f9aff7dd51cc9e7882fdaf219a02dd2e73
5
5
  SHA512:
6
- metadata.gz: 22b3f43660218c7b76e67b64a47972b658a8a8a604e83bdecd55be04e868e7deffc692aec92ff3823c1b5f93696b1e68da54a4a1646e82c14e1f95f8db59b19d
7
- data.tar.gz: bd964c90f0425c9f7cabdd809d0d00e052415273c1a8f7ad24bacc03b74d91fcc040950f7b39efc4fbec128acc47d1a3534a3f1dbcbbeb235901e740d12c33d2
6
+ metadata.gz: 4e0caa41391da6343ea0588c4b5649ea9b37625f3be8a8d033f772414393fc52417272b4434ec1a4c746a6a91305ca032bd0a12d5610fd89a146848ae7d7e64f
7
+ data.tar.gz: af833505c5e7edbf97ce78231202849a80428b2e8c52dc47cf9d8c6c5d0264f2dccd553d8cc30f94b02a17d20d7f37696fe5fd736721e8820d111d25e31751c1
@@ -14,7 +14,12 @@ module RailsAdmin::Printer
14
14
  9100
15
15
  end
16
16
  end
17
- field :default, :toggle
17
+
18
+ if Object.const_defined?('RailsAdminToggleable')
19
+ field :default, :toggle
20
+ else
21
+ field :default
22
+ end
18
23
 
19
24
  show do
20
25
  field :temperature
@@ -25,7 +30,7 @@ module RailsAdmin::Printer
25
30
  field :temperature
26
31
  field :description
27
32
  end
28
-
33
+
29
34
  field :is_online do
30
35
  read_only true
31
36
  formatted_value do # used in form views
@@ -0,0 +1,2 @@
1
+
2
+ Rails.application.config.paths['db/migrate'] << File.expand_path("../../db/migrate", __dir__)
@@ -1,6 +1,6 @@
1
- class CreatePrinters < ActiveRecord::Migration[4.2]
1
+ class CreatePrinters < ActiveRecord::Migration[7.0]
2
2
  def change
3
- create_table :printers do |t|
3
+ create_table :printers, if_not_exists: true do |t|
4
4
  t.string :name
5
5
  t.text :description
6
6
  t.string :ip
@@ -10,8 +10,8 @@ class CreatePrinters < ActiveRecord::Migration[4.2]
10
10
 
11
11
  t.timestamps null: false
12
12
  end
13
- add_index :printers, :name
14
- add_index :printers, :description
15
- add_index :printers, :ip
13
+ add_index :printers, :name, if_not_exists: true
14
+ add_index :printers, :description, if_not_exists: true
15
+ add_index :printers, :ip, if_not_exists: true
16
16
  end
17
17
  end
@@ -1,5 +1,5 @@
1
- class AddTemperatureToPrinter < ActiveRecord::Migration[4.2]
1
+ class AddTemperatureToPrinter < ActiveRecord::Migration[7.0]
2
2
  def change
3
- add_column :printers, :temperature, :integer
3
+ add_column :printers, :temperature, :integer, if_not_exists: true
4
4
  end
5
5
  end
@@ -1,6 +1,6 @@
1
- class CreatePrintTemplates < ActiveRecord::Migration[4.2]
1
+ class CreatePrintTemplates < ActiveRecord::Migration[7.0]
2
2
  def change
3
- create_table :print_templates do |t|
3
+ create_table :print_templates, if_not_exists: true do |t|
4
4
  t.string :name
5
5
  t.text :description
6
6
  t.text :template
@@ -1,4 +1,4 @@
1
- class AddPrintTemplateIdToPrinter < ActiveRecord::Migration[4.2]
1
+ class AddPrintTemplateIdToPrinter < ActiveRecord::Migration[7.0]
2
2
  def change
3
3
  add_reference :printers, :print_template, index: true, foreign_key: true
4
4
  end
@@ -1,5 +1,5 @@
1
- class AddDefaultToPrinter < ActiveRecord::Migration[4.2]
1
+ class AddDefaultToPrinter < ActiveRecord::Migration[7.0]
2
2
  def change
3
- add_column :printers, :default, :boolean, default: false
3
+ add_column :printers, :default, :boolean, default: false, if_not_exists: true
4
4
  end
5
5
  end
@@ -1,5 +1,5 @@
1
- class AddPortToPrinter < ActiveRecord::Migration[4.2]
1
+ class AddPortToPrinter < ActiveRecord::Migration[7.0]
2
2
  def change
3
- add_column :printers, :port, :integer, default: 9100
3
+ add_column :printers, :port, :integer, default: 9100, if_not_exists: true
4
4
  end
5
5
  end
@@ -1,17 +1,4 @@
1
1
  module ThecorePrintCommons
2
2
  class Engine < ::Rails::Engine
3
-
4
- initializer 'thecore_print_commons.add_to_migrations' do |app|
5
- # Adds the list of Thecore Engines, so to manage seeds loading, i.e.:
6
- # Thecore::Base.thecore_engines.each { |engine| engine.load_seed }
7
- Thecore::Base.thecore_engines << self.class
8
- unless app.root.to_s.match root.to_s
9
- # APPEND TO MAIN APP MIGRATIONS FROM THIS GEM
10
- config.paths['db/migrate'].expanded.each do |expanded_path|
11
- app.config.paths['db/migrate'] << expanded_path
12
- end
13
- end
14
- end
15
-
16
3
  end
17
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thecore_print_commons
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.3
4
+ version: 3.0.5
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-02-06 00:00:00.000000000 Z
11
+ date: 2023-02-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thecore_background_jobs
@@ -43,6 +43,7 @@ files:
43
43
  - app/models/printer.rb
44
44
  - app/workers/print_worker.rb
45
45
  - config/initializers/abilities_thecore_print_commons_concern.rb
46
+ - config/initializers/add_to_db_migrate.rb
46
47
  - config/initializers/after_initialize_for_thecore_print_commons.rb
47
48
  - config/initializers/thecore_print_commons_static_links.rb
48
49
  - config/locales/telnet_print.activerecord.it.yml