tramway-core 3.0.0.2 → 4.0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/tramway/core/application.js +0 -4
- data/app/decorators/tramway/core/application_decorator.rb +1 -1
- data/app/helpers/tramway/core/inputs_helper.rb +7 -0
- data/app/views/tramway/core/shared/_input.html.haml +1 -1
- data/lib/tramway/core/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8890a9c13beaa7437586235ea24169dfd400bac802f1e09e02b3f00482b56353
|
4
|
+
data.tar.gz: 5b19c2fe614f4ec053c661e4fd6f65479d4987f8fe9731c930a0b923769c8df6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f61ca8ebb144658a152920461dabb7423cfc66418e124ab6973a80aa960a8365d9a027edbb2df5385ee33ba559ec2e89df423d8a3c1e781d2c60d52049d2a2a1
|
7
|
+
data.tar.gz: a57f6625750a1c6b528e461f1f2269bcdd7f302d046b00a8a7426c45aa7cf203082bb3fcaf7eece3871ca557fd307edc9120141f70a0521f85ec92b12fbe5b7d
|
@@ -1,10 +1,6 @@
|
|
1
|
-
// require popper FIXME should be optional requiring
|
2
1
|
//= require jquery
|
3
2
|
//= require jquery_ujs
|
4
3
|
//= require jquery3
|
5
|
-
//= require popper
|
6
|
-
// require popper FIXME should be optional requiring
|
7
|
-
//= require bootstrap
|
8
4
|
//= require bootstrap-datepicker-1.8.0
|
9
5
|
//= require bootstrap-datepicker-1.8.0.ru.min
|
10
6
|
//= require font_awesome5
|
@@ -62,7 +62,7 @@ class Tramway::Core::ApplicationDecorator
|
|
62
62
|
end
|
63
63
|
|
64
64
|
def decorate(object_or_array)
|
65
|
-
if object_or_array.class.superclass == ActiveRecord::Relation
|
65
|
+
if object_or_array.class.superclass == ActiveRecord::Relation || object_or_array.class.to_s.include?('ActiveRecord_AssociationRelation')
|
66
66
|
decorated_array = object_or_array.map do |obj|
|
67
67
|
new obj
|
68
68
|
end
|
@@ -5,6 +5,13 @@ module Tramway::Core::InputsHelper
|
|
5
5
|
include Tramway::Core::Inputs::PolymorphicAssociationsHelper
|
6
6
|
|
7
7
|
def association_params(form_object:, property:, value:, object:, options: {})
|
8
|
+
full_class_name_association = form_object.class.full_class_name_association(property)
|
9
|
+
|
10
|
+
if full_class_name_association.to_s == 'Tramway::User::User'
|
11
|
+
user = defined?(current_user) ? current_user : current_admin
|
12
|
+
value = user.id
|
13
|
+
end
|
14
|
+
|
8
15
|
build_input_attributes(object: object, property: property, options: options,
|
9
16
|
value: build_value_for_association(form_object, property, value),
|
10
17
|
collection: build_collection_for_association(form_object, property),
|
@@ -6,7 +6,7 @@
|
|
6
6
|
- type = type[:type]
|
7
7
|
- if type.class.in?([ Symbol, String ]) || type&.dig(:input_options)
|
8
8
|
- type = type.to_sym
|
9
|
-
-
|
9
|
+
- if type != :hidden && input_params.dig(:options, :label) != false
|
10
10
|
= form.label form_object.model.class.human_attribute_name property
|
11
11
|
- case type
|
12
12
|
- when :default
|
data/lib/tramway/core/version.rb
CHANGED
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
|
+
version: 4.0.0.1
|
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-
|
12
|
+
date: 2022-02-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: audited
|