tramway-core 3.0.0.1 → 4.0
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/forms/tramway/core/application_forms/submit_helper.rb +1 -1
- data/app/helpers/tramway/core/inputs_helper.rb +7 -0
- data/app/models/tramway/core/application_record.rb +1 -6
- 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: 446432a08c42283f3320bceb38677d94825d6183b78f79faeeaf0560375065e2
|
4
|
+
data.tar.gz: 13ede23552b1d495a040c43c04a9c906260f395a71743805d88f1035fa29a716
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 394b4a884c0cf601cc9a204a97763b0d9e9747eca6d68f5d7860457a96d75d53f32b5399ceccdaae47679e426cd9318d6a9dcd09f1f26a83e1f711900fe71f10
|
7
|
+
data.tar.gz: 524ffa77175f6ffbda64c7d6812ba5ccaa34c160b9c21a02fdc26600d3434fa0c3d400de917aed327b9e841311387fa317a6e641f37abe3df2aff7729e700d53
|
@@ -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
|
@@ -20,7 +20,7 @@ module Tramway::Core::ApplicationForms::SubmitHelper
|
|
20
20
|
rescue StandardError => e
|
21
21
|
if e.try :name
|
22
22
|
Tramway::Error.raise_error :tramway, :core, :application_form, :save, :looks_like_you_have_method,
|
23
|
-
method_name: e.name.to_s.gsub('=', ''), model_class:
|
23
|
+
method_name: e.name.to_s.gsub('=', ''), model_class: model.class, class_name: self.class
|
24
24
|
else
|
25
25
|
raise e
|
26
26
|
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),
|
@@ -34,7 +34,7 @@ class Tramway::Core::ApplicationRecord < ActiveRecord::Base
|
|
34
34
|
# FIXME: detect inhertited locales
|
35
35
|
class << self
|
36
36
|
def human_attribute_name(attribute_name, *_args)
|
37
|
-
excepted_attributes = %w[created_at updated_at
|
37
|
+
excepted_attributes = %w[created_at updated_at]
|
38
38
|
if attribute_name.to_s.in? excepted_attributes
|
39
39
|
I18n.t "activerecord.attributes.tramway/core/application_record.#{attribute_name}"
|
40
40
|
else
|
@@ -64,9 +64,4 @@ class Tramway::Core::ApplicationRecord < ActiveRecord::Base
|
|
64
64
|
AASM::StateMachineStore.fetch(self).machine_names
|
65
65
|
end
|
66
66
|
end
|
67
|
-
|
68
|
-
# FIXME: detect inhertited locales
|
69
|
-
def human_state_name
|
70
|
-
I18n.t "activerecord.state_machines.tramway/core/application_record.state.states.#{state}"
|
71
|
-
end
|
72
67
|
end
|
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'
|
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:
|
12
|
+
date: 2022-02-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: audited
|