plutonium 0.15.16 → 0.15.18

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: a19b3d772cd65c45437466aab60afeb70d235bac9c2da42daf4153a3cefec7e0
4
- data.tar.gz: d07fd148541e1a8b04db4da812552d60ee0070b62dcd6cc56df8adf4dc67e6c1
3
+ metadata.gz: 101dea0b2a6fa8d1cc3fcf5d16f5ab1d932efd7ab90fa9d23561c78bfa3af777
4
+ data.tar.gz: dc712fdd97f6783eec587fb8ad5066326be59c93f603027e11410e7f9d66ed7a
5
5
  SHA512:
6
- metadata.gz: 0ad497ecf8b3e56fab630b2ac3e6388d26a75ed784cec0fa5275f5307062f3a20916df91ff053d061b5cab8b31c51d677e30df633ea838849731812f6e67333d
7
- data.tar.gz: 8c4088f28c64b474217bcbe2e71cf73c522b75486573a05b999a486cf1eeaf788508f53754dbf537651c354ef8fb8a24e01f60b7f3acadbbcd8fe80591df7ad1
6
+ metadata.gz: a0e86bf5065b802c8808ac2704a134cf8cdbc6730602fc29864d34e163599e71c981c8f3a0730d3de9270ba37b9698c5ff58acfba8558318a760c3bfde1804fa
7
+ data.tar.gz: ad31b7f1e0ca7dd07c249bfceed34ff136bd7dda5b8815786a443882da9fd8dd8429355e175afce71a488de7639324c866a794196a24bf57c6085c6dc112c139
@@ -43,7 +43,7 @@ module Pu
43
43
  inject_into_class(
44
44
  "app/models/application_record.rb",
45
45
  "ApplicationRecord",
46
- " include Plutonium::Resource::Record\n"
46
+ " include Plutonium::Resource::Record\n\n"
47
47
  )
48
48
  end
49
49
  end
@@ -15,10 +15,13 @@ module Pu
15
15
 
16
16
  def start
17
17
  source_feature = select_feature msg: "Select source feature"
18
- source_module = (source_feature == "main_app") ? "ResourceRecord" : "#{source_feature.camelize}::ResourceRecord"
18
+ source_module = (source_feature == "main_app") ? "ApplicationRecord" : "#{source_feature.camelize}::ResourceRecord"
19
19
 
20
20
  Plutonium.eager_load_rails!
21
- available_resources = source_module.constantize.descendants.map(&:to_s).sort
21
+ available_resources = source_module.constantize.descendants.reject do |model|
22
+ next true if model.abstract_class?
23
+ next true if source_module == "ApplicationRecord" && model.ancestors.any? { |ancestor| ancestor.to_s.end_with?("::ResourceRecord") }
24
+ end.map(&:to_s).sort
22
25
  error "No resources found" if available_resources.blank?
23
26
  selected_resources = prompt.multi_select("Select resources", available_resources)
24
27
 
@@ -6,8 +6,8 @@ module Plutonium
6
6
  include Phlex::Rails::Helpers::CSPMetaTag
7
7
  include Phlex::Rails::Helpers::CSRFMetaTags
8
8
  include Phlex::Rails::Helpers::FaviconLinkTag
9
- include Phlex::Rails::Helpers::StyleSheetLinkTag
10
- include Phlex::Rails::Helpers::JavaScriptIncludeTag
9
+ include Phlex::Rails::Helpers::StylesheetLinkTag
10
+ include Phlex::Rails::Helpers::JavascriptIncludeTag
11
11
 
12
12
  def view_template(&)
13
13
  doctype
@@ -1,5 +1,5 @@
1
1
  module Plutonium
2
- VERSION = "0.15.16"
2
+ VERSION = "0.15.18"
3
3
  NEXT_MAJOR_VERSION = VERSION.split(".").tap { |v|
4
4
  v[1] = v[1].to_i + 1
5
5
  v[2] = 0
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: plutonium
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.16
4
+ version: 0.15.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan Froelich
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-11-19 00:00:00.000000000 Z
11
+ date: 2024-11-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: zeitwerk