tramway-admin 1.21.1 → 1.21.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: d7a306e3b4dbdacac51abc14f24b44565af961a361feb8c94e42717f2fc286ed
4
- data.tar.gz: 3d5d8d5aec53b2be67f9e1df584710e68c1d75994fa3c167795712af16600e3e
3
+ metadata.gz: d9d081922ba193397dcb8b747ab6374c0c2b5f55a1419f00715f2cb7e57947cc
4
+ data.tar.gz: ffc260a5619cd6e03c6afebfb57e27d1c1c48767b4c88af2cdf7a9cb04a0bdc2
5
5
  SHA512:
6
- metadata.gz: 51ce1312cc9b939fd1ef4ee82394fda6f454a2ffed9039bd1216e0a8e7a0d2998629c01d47a93b383e1e6422f04663d59bc719bf4d6153958da322198d0d2015
7
- data.tar.gz: 003c8cd220f6ff8fe380cc563e54ae4ca8ff8d310668cb5c7e99d459c8cd62b1b4d410fba2915cf5d0b034dbaa7b422a85c1adad27a496d02bc980aff3b0fb28
6
+ metadata.gz: 9902ffec400d49cfff4e7d1ef44a7897810f139a812fc64412b5e8a9eeeea9a3577399f0ce167ed9e2d861776615a96ce0d001a3a89713ee91396610f56e5795
7
+ data.tar.gz: cc1b9ce877f20e392676738dd0d7f9fbf2def59e7b789401bd1b808a3abbcaf61e108a00b8ec8f4289d7472ca0b26146d815422dde042adf506fbda1c6e7b40e
@@ -20,15 +20,11 @@ module Tramway
20
20
  protected
21
21
 
22
22
  def check_available!
23
- unless model_given?
24
- raise 'Model is not available'
25
- end
23
+ raise 'Model is not available' unless model_given?
26
24
  end
27
25
 
28
26
  def check_available_scope!
29
- if params[:scope].present? && !available_scope_given?
30
- raise 'Scope is not available'
31
- end
27
+ raise 'Scope is not available' if params[:scope].present? && !available_scope_given?
32
28
  end
33
29
 
34
30
  def collections_counts
@@ -15,6 +15,7 @@ module Tramway
15
15
  include ::Tramway::Admin::InputsHelper
16
16
  include ::Tramway::Admin::FocusGeneratorHelper
17
17
  include ::Tramway::Collections::Helper
18
+ include ::Tramway::Core::CopyToClipboardHelper
18
19
 
19
20
  def object_type(object)
20
21
  object_class_name = if object.class.ancestors.include? ::Tramway::Core::ApplicationDecorator
@@ -81,11 +81,11 @@ module Tramway::Admin
81
81
 
82
82
  if association.options[:as].present? # polymorphic? conditiion
83
83
  new_record_path model: association.class_name,
84
- redirect: current_model_record_path(object),
85
- association.options[:class_name].underscore => {
86
- association.options[:as] => object.id,
87
- association.type => object.class.model_name
88
- }
84
+ redirect: current_model_record_path(object),
85
+ association.options[:class_name].underscore => {
86
+ association.options[:as] => object.id,
87
+ association.type => object.class.model_name
88
+ }
89
89
  else
90
90
  new_record_path model: association.class_name,
91
91
  redirect: current_model_record_path(object.model),
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Tramway::Admin::AdditionalButtons
2
4
  def set_additional_buttons(buttons, project:)
3
5
  @additional_buttons ||= {}
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Tramway::Admin::Notifications
2
4
  def set_notificable_queries(**queries)
3
5
  @notificable_queries ||= {}
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Tramway::Admin::RecordsModels
2
4
  def set_available_models(*models, project:, role: :admin)
3
5
  @available_models ||= {}
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Tramway::Admin::SingletonModels
2
4
  def set_singleton_models(*models, project:, role: :admin)
3
5
  @singleton_models ||= {}
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Tramway
4
4
  module Admin
5
- VERSION = '1.21.1'
5
+ VERSION = '1.21.2'
6
6
  end
7
7
  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.21.1
4
+ version: 1.21.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Kalashnikov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-01-26 00:00:00.000000000 Z
11
+ date: 2020-01-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bootstrap-kaminari-views