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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '092d15e8c799239a53ec76e7e5c3b6c7c9d6ac73cdf60967b2c23bb209d72fea'
4
- data.tar.gz: 87647334835fafc5bf4856b7815578088d45cc3f3eee05c27d110bf5676014c4
3
+ metadata.gz: 446432a08c42283f3320bceb38677d94825d6183b78f79faeeaf0560375065e2
4
+ data.tar.gz: 13ede23552b1d495a040c43c04a9c906260f395a71743805d88f1035fa29a716
5
5
  SHA512:
6
- metadata.gz: 9993b9a62d95af832c80c9def43d398d86ee7c4229c7340d827c1a96af79d3d74f33eba8a8800c0879807ac23bcc4a5847a9854a20efc467843f1e8e8ba2a82b
7
- data.tar.gz: dcec81da1e73cd747f3c2e4aacab03eb83be6f0ec5778bdb4909e0a6a8bad8aa4493d26de1cba04d8efc7727ff4ff0744037d1d6ee2fe625819d16598733e16a
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: @@model_class, class_name: self.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 state]
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
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Tramway
4
4
  module Core
5
- VERSION = '3.0.0.1'
5
+ VERSION = '4.0'
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: 3.0.0.1
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: 2021-12-19 00:00:00.000000000 Z
12
+ date: 2022-02-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: audited