tramway-core 4.0.2.1 → 4.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: 071cf2ccd054e5bde3e9ecc232476ec1a48d2aa4e3d51246befdd770a6e89876
4
- data.tar.gz: 7aa40b3777e070784dd0f0ca57baf12b4fd6378e5911b1e3dfa25ec6b427e24f
3
+ metadata.gz: 184c883be6f97ec2221a8c5bd73d912a68e9ae2bebe53738ec1dbd3db215d231
4
+ data.tar.gz: 9dc73c594a9576eb720ca94cc5a74c5f657a3c67bafd60f8b8dc840a23c057d7
5
5
  SHA512:
6
- metadata.gz: 8ff54066670f690934e828bd599b8cbeac5ad3cf27c43d2d56f54425f0bbf38708ae9d0bea74983d35a8b08a6a5393ed88810bd5e37672290653293dcb170919
7
- data.tar.gz: 521157e341cc6eada7c4c1c4e97b620e5233dc28d15adbe148d53daa0b397d138b4084d69228379cd6a1e45e5fe7bf065f19181080f23d3ee00fc828b4bf8636
6
+ metadata.gz: e8d2da19e2722c086ad643ea55c1cebae2bff6ffb35cdfb822935fd267671b2e29ea22d51b5739aa4f782f8aeabec447be7fa42f081e700d2907942080194480
7
+ data.tar.gz: 50d41cc9356e53d5136a1172d7586442b7e0765080eb26858c9c1def7386754115b9d9b0a5b968e3202c6123ffed5e6447618f7ef266427be5e2d91ad230d7fc
@@ -10,6 +10,7 @@ class Tramway::Core::ApplicationDecorator
10
10
  include ::Tramway::Core::CopyToClipboardHelper
11
11
  include ::Tramway::Core::Associations::ObjectHelper
12
12
  include ::Tramway::Core::Attributes::ViewHelper
13
+ include ::Tramway::Core::Concerns::TableBuilder
13
14
  include ::Tramway::ClassNameHelpers
14
15
 
15
16
  def initialize(object)
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Tramway::Core::Concerns::TableBuilder
4
+ def table(**options, &block)
5
+ content_tag(:table, class: 'table table-bordered table-striped', **options) do
6
+ yield if block
7
+ end
8
+ end
9
+
10
+ def thead(**options, &block)
11
+ content_tag(:thead, **options) do
12
+ yield if block
13
+ end
14
+ end
15
+
16
+ def th(**options, &block)
17
+ content_tag(:th, **options) do
18
+ yield if block
19
+ end
20
+ end
21
+
22
+ def td(**options, &block)
23
+ content_tag(:td, **options) do
24
+ yield if block
25
+ end
26
+ end
27
+
28
+ def tr(**options, &block)
29
+ content_tag(:tr, **options) do
30
+ yield if block
31
+ end
32
+ end
33
+ end
@@ -35,6 +35,7 @@ class Tramway::Core::ApplicationForm
35
35
  class << self
36
36
  include Tramway::Core::ApplicationForms::AssociationClassHelpers
37
37
  include Tramway::Core::ApplicationForms::ConstantClassActions
38
+ include Tramway::Core::ApplicationForms::Frontend
38
39
 
39
40
  delegate :defined_enums, to: :model_class
40
41
 
@@ -1,9 +1,9 @@
1
1
  module Tramway::Core::ApplicationForms::Frontend
2
2
  def react_component(on = false)
3
- @@react_component = on
3
+ @react_component = on
4
4
  end
5
5
 
6
6
  def is_react_component?
7
- @@react_component ||= false
7
+ @react_component ||= false
8
8
  end
9
9
  end
@@ -23,7 +23,6 @@ class Tramway::Core::ApplicationRecord < ActiveRecord::Base
23
23
  end
24
24
  end
25
25
 
26
-
27
26
  include ::PgSearch::Model
28
27
 
29
28
  def creator
@@ -43,7 +42,7 @@ class Tramway::Core::ApplicationRecord < ActiveRecord::Base
43
42
  end
44
43
 
45
44
  def search_by(*attributes, **associations)
46
- pg_search_scope :full_text_search, against: attributes, associated_against: associations
45
+ pg_search_scope :full_text_search, against: attributes, associated_against: associations, using: [:tsearch, :trigram]
47
46
  end
48
47
 
49
48
  def uploader(attribute_name, uploader_name, **options)
@@ -20,6 +20,8 @@
20
20
  = form.association property, **association_params(**input_params).merge(as: :hidden)
21
21
  - when :polymorphic_association
22
22
  = form.input property, **polymorphic_association_params(**input_params.merge(value: value))
23
+ - when :react_component
24
+ = react_component "#{property.camelize}Input", value: value
23
25
  - else
24
26
  - options = input_params[:options] || {}
25
27
  = form.input property, **simple_params(**input_params.merge(type: type)).merge(options)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Tramway
4
4
  module Core
5
- VERSION = '4.0.2.1'
5
+ VERSION = '4.1.2'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tramway-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.2.1
4
+ version: 4.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Kalashnikov
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2022-02-14 00:00:00.000000000 Z
12
+ date: 2022-06-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: audited
@@ -161,22 +161,22 @@ dependencies:
161
161
  name: mini_magick
162
162
  requirement: !ruby/object:Gem::Requirement
163
163
  requirements:
164
- - - ">="
165
- - !ruby/object:Gem::Version
166
- version: 4.8.0
167
164
  - - "~>"
168
165
  - !ruby/object:Gem::Version
169
166
  version: '4.8'
167
+ - - ">="
168
+ - !ruby/object:Gem::Version
169
+ version: 4.8.0
170
170
  type: :runtime
171
171
  prerelease: false
172
172
  version_requirements: !ruby/object:Gem::Requirement
173
173
  requirements:
174
- - - ">="
175
- - !ruby/object:Gem::Version
176
- version: 4.8.0
177
174
  - - "~>"
178
175
  - !ruby/object:Gem::Version
179
176
  version: '4.8'
177
+ - - ">="
178
+ - !ruby/object:Gem::Version
179
+ version: 4.8.0
180
180
  - !ruby/object:Gem::Dependency
181
181
  name: pg_search
182
182
  requirement: !ruby/object:Gem::Requirement
@@ -320,6 +320,7 @@ files:
320
320
  - app/decorators/tramway/core/associations/object_helper.rb
321
321
  - app/decorators/tramway/core/attributes/view_helper.rb
322
322
  - app/decorators/tramway/core/concerns/attributes_decorator_helper.rb
323
+ - app/decorators/tramway/core/concerns/table_builder.rb
323
324
  - app/decorators/tramway/core/delegating/class_helper.rb
324
325
  - app/forms/tramway/core/application_form.rb
325
326
  - app/forms/tramway/core/application_forms/association_class_helpers.rb
@@ -413,7 +414,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
413
414
  - !ruby/object:Gem::Version
414
415
  version: '0'
415
416
  requirements: []
416
- rubygems_version: 3.0.3.1
417
+ rubygems_version: 3.1.6
417
418
  signing_key:
418
419
  specification_version: 4
419
420
  summary: Core for all Tramway Rails Engines