tramway-admin 1.11.0.1 → 1.11.1

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: 6d5a2a917c26543b66a2e6373da1c9c9fed2e1517dea45f3fd75184407779a84
4
- data.tar.gz: f307a2a294a5f093c9f6d0205ec8cb73d7d31901dbc0d963305d84b87a642a8f
3
+ metadata.gz: e0b72f16b791b5f4e02438b86c0158f146f67ec8c669e76f8394cfb8d2755b6a
4
+ data.tar.gz: 1fe10f082766bc7965a9457413093244a8e93c01c2317c7c163eb877ecfabab4
5
5
  SHA512:
6
- metadata.gz: ecbc2ab0fcc75e7f687b1091e776b7ad9d1dc21a9a341af9869817fd82465f9ad8862d9397e46d81db137616d95ec44f5cf4221f9fbb4ec6fdfe87cf90d2f716
7
- data.tar.gz: de1d46d1b7d59882b3ba729195f35e61d21197bf60e921b5a30c4d33777848096d9007b94d7dbd6be30690ab4394e1104de07743c92a1718c6dffe4ab7eaef89
6
+ metadata.gz: 6576cc72537fe1db1c5e3d174d16ef35d9e36204ee65fac8443432f714bdb8aa2c5be1553a6a7cd7cf1e8a118b47d319851a765a8fde5ca83435842dffa52bbf
7
+ data.tar.gz: 4d6c24eeb41db4922aba8800d04a04e65769d16182e8d686e804b069ec71103d0523d8360bd43e0bc280b9995c7cf4c55c243e71dd5f261ca5703a7bb65d4e16
@@ -20,19 +20,8 @@
20
20
  - object.class.show_attributes.each do |attribute_name|
21
21
  - value = object.send attribute_name
22
22
  = render 'tramway/admin/shared/show/attribute_tr', attribute_name: attribute_name, value: value, object: object
23
+ = render 'tramway/admin/shared/show/associations', object: object
23
24
  - else
24
25
  - object.attributes.each do |attribute_name, value|
25
26
  = render 'tramway/admin/shared/show/attribute_tr', attribute_name: attribute_name, value: value, object: object
26
- - object.associations(:has_many).each do |association|
27
- %tr
28
- %td
29
- = model_class.human_attribute_name association.name
30
- = link_to fa_icon(:plus), new_record_path(model: association.class_name, redirect: current_model_record_path(object)), class: 'btn btn-primary'
31
- %td{ colspan: 2 }
32
- %table.table.table-striped.table-bordered
33
- - object.send(association.name).each do |association_object|
34
- %tr
35
- %td
36
- = association_object.id
37
- %td
38
- = association_object.name
27
+ = render 'tramway/admin/shared/show/associations', object: object
@@ -0,0 +1,13 @@
1
+ - object.associations(:has_many).each do |association|
2
+ %tr
3
+ %td
4
+ = model_class.human_attribute_name association.name
5
+ = link_to fa_icon(:plus), new_record_path(model: association.class_name, redirect: current_model_record_path(object)), class: 'btn btn-primary'
6
+ %td{ colspan: 2 }
7
+ %table.table.table-striped.table-bordered
8
+ - object.send(association.name).each do |association_object|
9
+ %tr
10
+ %td
11
+ = association_object.id
12
+ %td
13
+ = link_to association_object.name, record_path(association_object.id, model: 'Project')
@@ -4,5 +4,5 @@
4
4
  %td
5
5
  = value
6
6
  %td
7
- - if attribute_name != 'state' && object.model.class.state_machines.keys.include?(attribute_name.to_sym)
7
+ - if attribute_name.to_s != 'state' && object.model.class.state_machines.keys.include?(attribute_name.to_sym)
8
8
  = state_events_buttons object, state_method: attribute_name, model_param_name: :record, route_method: :current_model_record_path
@@ -2,19 +2,23 @@ module Tramway
2
2
  module Admin
3
3
  module RecordRoutesHelper
4
4
  def record_path(*args, **options)
5
- super args, options.merge(model: params[:model])
5
+ options[:model] ||= params[:model]
6
+ super args, options
6
7
  end
7
8
 
8
9
  def edit_record_path(*args, **options)
9
- super args, options.merge(model: params[:model])
10
+ options[:model] ||= params[:model]
11
+ super args, options
10
12
  end
11
13
 
12
14
  def new_record_path(*args, **options)
13
- super args, options.merge(model: params[:model])
15
+ options[:model] ||= params[:model]
16
+ super args, options
14
17
  end
15
18
 
16
19
  def records_path(*args, **options)
17
- super args, options.merge(model: params[:model])
20
+ options[:model] ||= params[:model]
21
+ super args, options
18
22
  end
19
23
  end
20
24
  end
@@ -1,5 +1,5 @@
1
1
  module Tramway
2
2
  module Admin
3
- VERSION = '1.11.0.1'
3
+ VERSION = '1.11.1'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tramway-admin
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.11.0.1
4
+ version: 1.11.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Kalashnikov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-03-29 00:00:00.000000000 Z
11
+ date: 2019-04-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bootstrap-kaminari-views
@@ -234,6 +234,7 @@ files:
234
234
  - app/views/tramway/admin/shared/_input.html.haml
235
235
  - app/views/tramway/admin/shared/_show.html.haml
236
236
  - app/views/tramway/admin/shared/errors/server_error.html.haml
237
+ - app/views/tramway/admin/shared/show/_associations.html.haml
237
238
  - app/views/tramway/admin/shared/show/_attribute_tr.html.haml
238
239
  - app/views/tramway/admin/singletons/_form.html.haml
239
240
  - app/views/tramway/admin/singletons/edit.html.haml