keystone_ui-preferences 0.4.0 → 0.4.1
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 +4 -4
- data/README.md +7 -0
- data/lib/generators/keystone_ui/preferences/install/templates/create_keystone_ui_preferences_component_preferences.rb.erb +1 -1
- data/lib/generators/keystone_ui/preferences/update/templates/remove_extra_owner_index_from_keystone_ui_preferences_component_preferences.rb.erb +5 -0
- data/lib/generators/keystone_ui/preferences/update/update_generator.rb +25 -0
- data/lib/keystone_ui/preferences/version.rb +1 -1
- metadata +3 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c77e689992104b9ce8801267235141abba7ff559cd1aace5578115b757e3347a
|
|
4
|
+
data.tar.gz: 759ed45c55451ea970607bad67065807c739e6b625dc15c83497d0166f3bc5cd
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: dae10a0b401a87cbacc883c0f73c5278c61a7ea867130eaa3f519a10384e3231fc1435569d363c7fc009b6b4647c497e2a9e717083eecd0fdc49a5d9f31bc898
|
|
7
|
+
data.tar.gz: 0311250c39244319a91819c87af47e98fe1c4d7a4c896001f68374fa2da5a7c321eadc8042e11cf9ba9aa913963516221debaeceb4edeb79948a8c9904fdbdfe
|
data/README.md
CHANGED
|
@@ -18,6 +18,13 @@ bin/rails generate keystone_ui:preferences:install
|
|
|
18
18
|
bin/rails db:migrate
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
+
After updating the gem, run its update generator to copy any migrations added since it was installed:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
bin/rails generate keystone_ui:preferences:update
|
|
25
|
+
bin/rails db:migrate
|
|
26
|
+
```
|
|
27
|
+
|
|
21
28
|
Mount the engine in `config/routes.rb`. A table's Columns menu saves to it:
|
|
22
29
|
|
|
23
30
|
```ruby
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
class CreateKeystoneUiPreferencesComponentPreferences < ActiveRecord::Migration[<%= ActiveRecord::Migration.current_version %>]
|
|
2
2
|
def change
|
|
3
3
|
create_table :keystone_ui_preferences_component_preferences do |t|
|
|
4
|
-
t.references :owner, polymorphic: true, null: false
|
|
4
|
+
t.references :owner, polymorphic: true, null: false, index: false
|
|
5
5
|
t.string :component_key, null: false
|
|
6
6
|
t.json :value, null: false, default: {}
|
|
7
7
|
t.boolean :members_choose, default: true, null: false
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
class RemoveExtraOwnerIndexFromKeystoneUiPreferencesComponentPreferences < ActiveRecord::Migration[<%= ActiveRecord::Migration.current_version %>]
|
|
2
|
+
def change
|
|
3
|
+
remove_index :keystone_ui_preferences_component_preferences, %i[owner_type owner_id], name: "index_keystone_ui_preferences_component_preferences_on_owner", if_exists: true
|
|
4
|
+
end
|
|
5
|
+
end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "rails/generators"
|
|
4
|
+
require "rails/generators/active_record"
|
|
5
|
+
|
|
6
|
+
module KeystoneUi
|
|
7
|
+
module Preferences
|
|
8
|
+
module Generators
|
|
9
|
+
class UpdateGenerator < Rails::Generators::Base
|
|
10
|
+
include ActiveRecord::Generators::Migration
|
|
11
|
+
|
|
12
|
+
source_root File.expand_path("templates", __dir__)
|
|
13
|
+
|
|
14
|
+
desc "Updates KeystoneUi::Preferences: copies migrations added since it was installed."
|
|
15
|
+
|
|
16
|
+
def copy_remove_extra_owner_index_migration
|
|
17
|
+
migration_template(
|
|
18
|
+
"remove_extra_owner_index_from_keystone_ui_preferences_component_preferences.rb.erb",
|
|
19
|
+
"db/migrate/remove_extra_owner_index_from_keystone_ui_preferences_component_preferences.rb"
|
|
20
|
+
)
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: keystone_ui-preferences
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.4.
|
|
4
|
+
version: 0.4.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Tyler Schneider
|
|
@@ -89,6 +89,8 @@ files:
|
|
|
89
89
|
- config/routes.rb
|
|
90
90
|
- lib/generators/keystone_ui/preferences/install/install_generator.rb
|
|
91
91
|
- lib/generators/keystone_ui/preferences/install/templates/create_keystone_ui_preferences_component_preferences.rb.erb
|
|
92
|
+
- lib/generators/keystone_ui/preferences/update/templates/remove_extra_owner_index_from_keystone_ui_preferences_component_preferences.rb.erb
|
|
93
|
+
- lib/generators/keystone_ui/preferences/update/update_generator.rb
|
|
92
94
|
- lib/keystone_ui-preferences.rb
|
|
93
95
|
- lib/keystone_ui/preferences.rb
|
|
94
96
|
- lib/keystone_ui/preferences/configuration.rb
|