tramway-admin 2.1.3.1 → 2.1.3.2

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: aeabc39d2bc0ce9ea3504bf578a0016a46e6278cbb27cdfbe8f393bf68f482fd
4
- data.tar.gz: 6d65c6e3b06f0b6ef86a285a7dad3bbd713eaa7cecb72d0440be493f8381eb88
3
+ metadata.gz: 80721c33dfdeba8fa169d9b695539daa6d60815a75108a1321c8942136e3a3ee
4
+ data.tar.gz: d4f17bcedd4cfe6113e6ef600d657a7f6761f38e6c9a766047c627aa6238f4ca
5
5
  SHA512:
6
- metadata.gz: 900820722317c55bcc7cafb5a64632d75af778e91a6009b7edcc6dbf8a19ba6a6c5a21bbc18af6037f71e8a839d844fec7a244b4e0964758dea0b8f47cbdff98
7
- data.tar.gz: 36830caf1c44bba27810e610cda58030470511dd2c8c854ff0e10ce7a9fc6d5b5aa47e4cc70686e6ced584743d934abda6cae0d3956e2d1f3f8f02226f858b6f
6
+ metadata.gz: f75e4b1819128e66cb47c93e103aabd9e829c1741004c79fdaf56db6f5bf0b959e63f7d93a665e854c82080047e40658dd5d2bc4474513f82d89eae2768b132e
7
+ data.tar.gz: 7a88d91517c5d3ee316b110ff4c14b82811cc68efaaaca61623f4008c51928bf96c7249048007c332b9a1ebd4764659ba821bc9e5e8fd7034e9cf5f1234a8b7c
@@ -21,7 +21,7 @@ module Tramway
21
21
  protected
22
22
 
23
23
  def check_available!
24
- raise 'Tramway::Admin - Model or Form is not available' if !model_given? && !form_given?
24
+ raise 'Tramway::Admin - Model or Form is not available. Looks like current user does not have access to change this model. Update your tramway initializer file' if !model_given? && !form_given?
25
25
  end
26
26
 
27
27
  def check_available_scope!
@@ -0,0 +1,15 @@
1
+ module Tramway::Admin::Preview
2
+ def set_previewable_models(*models)
3
+ @previewable_models ||= []
4
+ @previewable_models += models.map(&:to_s)
5
+ end
6
+
7
+ def previewable_models
8
+ @previewable_models
9
+ end
10
+
11
+ def is_available_to_preview?(model_class)
12
+ @previewable_models ||= []
13
+ @previewable_models.include? model_class.to_s
14
+ end
15
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Tramway
4
4
  module Admin
5
- VERSION = '2.1.3.1'
5
+ VERSION = '2.1.3.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: 2.1.3.1
4
+ version: 2.1.3.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: 2021-08-21 00:00:00.000000000 Z
11
+ date: 2021-10-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tramway-core
@@ -305,6 +305,7 @@ files:
305
305
  - lib/tramway/admin/generators/templates/form.rb.erb
306
306
  - lib/tramway/admin/navbar.rb
307
307
  - lib/tramway/admin/notifications.rb
308
+ - lib/tramway/admin/preview.rb
308
309
  - lib/tramway/admin/record_routes_helper.rb
309
310
  - lib/tramway/admin/records_models.rb
310
311
  - lib/tramway/admin/singleton_models.rb