tramway 3.0.3.1 → 3.0.3.2

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: afcbecc810bcf507e214d52763f4d7022b467f86ceb45d373ff6164937f77c0c
4
- data.tar.gz: 8e6f39bf6a5a87b0e2585dc5c176db76b35fcd6803567e4b41461d6c919f1735
3
+ metadata.gz: 18f56f1bece8fece4b33c56698d52e56a39a30f6215c67de3766dc50b884910d
4
+ data.tar.gz: 2642cf5b5af6a391421684aecf4af9682d5b047956ac0c0be7744b81a6219b2a
5
5
  SHA512:
6
- metadata.gz: f817ceb11a8839695f205dbb6977b297749dc47439618a3157756609a233c327f54fbc7dd3876d0e386dff1e3d2c7dd7e1966bac9ae6d7af01a326aa243dc229
7
- data.tar.gz: 12a10aecf2d7de109888343497e9bac4e6be6e4c6ffb478923a13202cec563a25a4b37b74ff3a87ba076f8746cdcbe406bd80baf674e9aeadda0b0c7e35b8d62
6
+ metadata.gz: 30a9432d7e353e05d8a71fd4d84a6ff9fa906a57ca9719c6153b6972e6688fc1d8b7fe51d3c2e4cc97d5de943641ddc905e56aef8cc8488400f0e757a5d46380
7
+ data.tar.gz: f08b2459cddf0d95841620803b541edb3afb5bad80c85144848f998fcc9fd41203b43445450337d69f30766cd96d5d9d2a6c4cfdd728b94fa16d29133ab98091
data/docs/AGENTS.md CHANGED
@@ -645,6 +645,15 @@ In case you want to use container on the page, use `tramway_container` helper in
645
645
  ### Rule 34
646
646
  If for some model already has index and show pages via Tramway Entity, and the request explicitly needs state management. Do not create a new controller for that. Instead, create a new component for buttons and use it via `show_header_content` in Tramway Decorator for show page and new columns (Actions) in `list_attributes` for index page. This column should be rendered via the component and contain buttons for state management.
647
647
 
648
+ ### Rule 35
649
+ If you need select input for an attribute that enumerized via `enumerize` gem, use `collection: Model.attribute.values` in the field definition.
650
+
651
+ Example for `User` model with `role` attribute:
652
+
653
+ ```ruby
654
+ = f.select :model_attribute, User.role.values.map { [it.humanize, it] }
655
+ ```
656
+
648
657
  ## Controller Patterns
649
658
 
650
659
  - Keep actions short and explicit with guard clauses.
@@ -86,8 +86,12 @@ module Tramway
86
86
  @agents_file_path ||= File.join(destination_root, 'AGENTS.md')
87
87
  end
88
88
 
89
+ def project_tramway_agents_path
90
+ @project_tramway_agents_path ||= File.join(destination_root, 'docs/agents/tramway.md')
91
+ end
92
+
89
93
  def agents_template_url
90
- 'https://raw.githubusercontent.com/TrinityMonsters/tramway/refs/heads/main/docs/AGENTS.md'
94
+ 'https://github.com/Purple-Magic/base_project/blob/main/docs/agents/tramway.md'
91
95
  end
92
96
 
93
97
  def agents_template_body
@@ -235,6 +239,11 @@ module Tramway
235
239
  # rubocop:disable Metrics/MethodLength
236
240
  def ensure_agents_file
237
241
  with_agents_update_fallback do
242
+ if File.exist?(project_tramway_agents_path)
243
+ say_status(:info, "Skipping AGENTS.md update because #{project_tramway_agents_path} exists.")
244
+ return
245
+ end
246
+
238
247
  say_status(
239
248
  :info,
240
249
  "Tramway will replace the content between \"#{agents_section_start}\" and " \
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tramway
4
- VERSION = '3.0.3.1'
4
+ VERSION = '3.0.3.2'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tramway
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.3.1
4
+ version: 3.0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - kalashnikovisme