tramway 3.0.3 → 3.0.3.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/app/components/tramway/nav/item/button_component.html.haml +1 -1
- data/docs/AGENTS.md +5 -2
- data/lib/tramway/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: afcbecc810bcf507e214d52763f4d7022b467f86ceb45d373ff6164937f77c0c
|
|
4
|
+
data.tar.gz: 8e6f39bf6a5a87b0e2585dc5c176db76b35fcd6803567e4b41461d6c919f1735
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f817ceb11a8839695f205dbb6977b297749dc47439618a3157756609a233c327f54fbc7dd3876d0e386dff1e3d2c7dd7e1966bac9ae6d7af01a326aa243dc229
|
|
7
|
+
data.tar.gz: 12a10aecf2d7de109888343497e9bac4e6be6e4c6ffb478923a13202cec563a25a4b37b74ff3a87ba076f8746cdcbe406bd80baf674e9aeadda0b0c7e35b8d62
|
data/docs/AGENTS.md
CHANGED
|
@@ -134,7 +134,7 @@ Normalize input with `normalizes` (from Tramway) for attributes like email, phon
|
|
|
134
134
|
When you need form-level validation, use Tramway Form `validates` on the form object (ActiveModel/ActiveRecord validation options like `presence: true` work, and `with:` is optional unless a validator requires it). Keep data integrity validations in the model unless the request explicitly needs form-only logic.
|
|
135
135
|
|
|
136
136
|
### Rule 3
|
|
137
|
-
Use Tramway Navbar for navigation
|
|
137
|
+
Use Tramway Navbar for navigation. Put there basic links: Login, Logout.
|
|
138
138
|
|
|
139
139
|
### Rule 4
|
|
140
140
|
Use Tramway Flash for user notifications.
|
|
@@ -477,7 +477,7 @@ end
|
|
|
477
477
|
In specs ALWAYS use factories (FactoryBot gem) to create models and attributes hash. In case there is no factory for the model, create one inside `spec/factories/#{pluralized model_name}.rb`.
|
|
478
478
|
|
|
479
479
|
### Rule 20
|
|
480
|
-
In case you need enumerize for model attribute, make sure to use `enumerize` gem for that. DO NOT use `boolean` or `integer` types for enumerations.
|
|
480
|
+
In case you need enumerize for model attribute, make sure to use `enumerize` gem for that. DO NOT use `boolean` or `integer` types for enumerations. Make sure you made `extend Enumerize` in `ApplicationRecord`.
|
|
481
481
|
|
|
482
482
|
### Rule 21
|
|
483
483
|
In case you need something that looks like enumerize but it's a process state, use `aasm` gem for that.
|
|
@@ -642,6 +642,9 @@ In case you want to use container on the page, use `tramway_container` helper in
|
|
|
642
642
|
id: 'flash-container'
|
|
643
643
|
```
|
|
644
644
|
|
|
645
|
+
### Rule 34
|
|
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
|
+
|
|
645
648
|
## Controller Patterns
|
|
646
649
|
|
|
647
650
|
- Keep actions short and explicit with guard clauses.
|
data/lib/tramway/version.rb
CHANGED