tramway 0.5.1.1 → 0.5.1.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: f4ba049579087665a532f06011144ca74a591cb7704769c8a2c69c99aca81aad
4
- data.tar.gz: 44b743f0aa80d9d6b074a325505b66a8c7a019f1c59103fd6ea79e5faf567ed8
3
+ metadata.gz: f2716febb35463e08d23262e008c607f0114f5cc49d1734ecbed30c3133e9e06
4
+ data.tar.gz: 408cfb199f328e21f03f2d99eb04c6a16d5eb875709dede6c2a71292ebb7647b
5
5
  SHA512:
6
- metadata.gz: 88a6ba5eda48febc6aec0c5c15915ee276161ddedbaa281fed6a65e68b0dc55e4d04e53a6505d68fb9e9a5871249ea2b565ac9d828dbf2b186d8bd11368b663c
7
- data.tar.gz: 25ae018d2242c6adc460e1058489109c2fae3d151243b8240d925ed1a63e0d1e19beef90d3c23cf036d34d207816c316051c8db5d681628ea2bedb0743e1a33f
6
+ metadata.gz: bf77038d704285581baf87b69900c4af9ecf06c6cf5b158c68062ce92c7c8414f3b3e9a1bc77eafe730dfe709b432ba4c5633ba162873d67ec8e7e26004aac7e
7
+ data.tar.gz: 3ea8c39ac64b9571779c8684d209188c5255c9820967eddfd528f0f5d4d3d66ff0645fd2e62d3906501b432d48393d1cfa7a99a23bda9bdf3382fa8aa3293ff7
data/README.md CHANGED
@@ -2,6 +2,7 @@
2
2
  Unite Ruby on Rails brilliance. Streamline development with Tramway.
3
3
 
4
4
  * [Installation](https://github.com/Purple-Magic/tramway#installation)
5
+ * [Getting Started](https://github.com/Purple-Magic/tramway?tab=readme-ov-file#getting-started)
5
6
  * [Usage](https://github.com/Purple-Magic/tramway#usage)
6
7
  * [Tramway Entities](https://github.com/Purple-Magic/tramway#tramway-entities)
7
8
  * [Tramway Decorators](https://github.com/Purple-Magic/tramway#tramway-decorators)
@@ -17,7 +17,7 @@ module Tramway
17
17
  private
18
18
 
19
19
  def model_class
20
- @model_class ||= params[:entity].classify.constantize
20
+ @model_class ||= params[:entity][:name].classify.constantize
21
21
  end
22
22
  end
23
23
  end
data/config/routes.rb CHANGED
@@ -2,6 +2,29 @@
2
2
 
3
3
  Tramway::Engine.routes.draw do
4
4
  Tramway.config.entities.each do |entity|
5
- resources entity.name.pluralize.to_sym, only: entity.pages, controller: :entities, defaults: { entity: entity.name }
5
+ define_resource = lambda do |resource_name, entity| # rubocop:disable Lint/ShadowingOuterLocalVariable
6
+ resources resource_name.pluralize.to_sym,
7
+ only: [:index],
8
+ controller: '/tramway/entities',
9
+ defaults: { entity: }
10
+ end
11
+
12
+ if entity.name.include?('/')
13
+ *namespaces, resource_name = entity.name.split('/')
14
+
15
+ define_namespace = lambda do |index|
16
+ namespace namespaces[index].to_sym do
17
+ if namespaces[index] == namespaces.last
18
+ define_resource.call(resource_name, entity)
19
+ else
20
+ define_namespace.call(namespaces[index + 1])
21
+ end
22
+ end
23
+ end
24
+
25
+ define_namespace.call(0)
26
+ else
27
+ define_resource.call(entity.name, entity)
28
+ end
6
29
  end
7
30
  end
@@ -25,7 +25,16 @@ module.exports = {
25
25
  'text-4xl',
26
26
  'font-bold',
27
27
  'xl:hidden',
28
+ 'grid-cols-[1fr]',
29
+ 'grid-cols-[1fr,1fr]',
28
30
  'grid-cols-[1fr,1fr,1fr]',
31
+ 'grid-cols-[1fr,1fr,1fr,1fr]',
32
+ 'grid-cols-[1fr,1fr,1fr,1fr,1fr]',
33
+ 'grid-cols-[1fr,1fr,1fr,1fr,1fr,1fr]',
34
+ 'grid-cols-[1fr,1fr,1fr,1fr,1fr,1fr,1fr]',
35
+ 'grid-cols-[1fr,1fr,1fr,1fr,1fr,1fr,1fr,1fr]',
36
+ 'grid-cols-[1fr,1fr,1fr,1fr,1fr,1fr,1fr,1fr,1fr]',
37
+ 'grid-cols-[1fr,1fr,1fr,1fr,1fr,1fr,1fr,1fr,1fr,1fr]',
29
38
  'text-right',
30
39
  'w-2/3',
31
40
  'flex',
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tramway
4
- VERSION = '0.5.1.1'
4
+ VERSION = '0.5.1.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: 0.5.1.1
4
+ version: 0.5.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - kalashnikovisme