tramway-api 1.8.1 → 1.8.1.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: 3065ba5d3d8a135210084aae9fdeea5291bfbc25c195bffa97e544491b7c9776
4
- data.tar.gz: 9e604ff996584c0982dc2abd7ce7da324060d89f53e55383cf2dc24caa47ed03
3
+ metadata.gz: 4d1e2133a961aaba201c222f211ca45a609f559b89d44622c345e802f29f67a6
4
+ data.tar.gz: f8856dba0c3e478af5436cdf93df7a77cfb4b876fed6ce1c3a41c9f7da710674
5
5
  SHA512:
6
- metadata.gz: cd85298817523d5f697e9c4074f45bc258f004f8d07865ea2297248d62ba42327f20a2fbd9dde83d2d1d714769e8df0cfd6207da65309085ad804a3f4861de14
7
- data.tar.gz: f101fd0601e24a0b96488daadad96d5dd8d8db666aa52d839e403444b4478f9d33325e8ef926b06a7a83277036b12478716ca2fff5b924706a50ac824252e2b9
6
+ metadata.gz: 8143cc790cebc76de7dcd2746204bc8503a4a74ed9b4eefb3068e65cc456b6920a775d0cc107acd01c9dd651cd4c87a6394cf6cf807ca37626a13bd2b60adc08
7
+ data.tar.gz: 45b9ec7765178d2d26869ec69bfc315b4c714fd5632aa1d86e537ea793617aac85a59dd3f08ea11f3139d5b008ebf49772888557c13859bd7a0975d68a8cd21e
@@ -56,6 +56,7 @@ module Tramway
56
56
 
57
57
  def action_is_available(project:, role: :open, model_name:, action:, current_user: nil)
58
58
  actions = select_actions(project: project, role: role, model_name: model_name)
59
+ raise "Looks like you did not used array type to define action permissions. Remember it should be this way: `#{model_name} => [ :#{action} ]` or `#{model_name} => [ { #{action}: lambda { |record, current_user| your_condition } } ]`" if actions.present? && !actions.is_a?(Array)
59
60
  availability = actions&.select do |a|
60
61
  if a.is_a? Symbol
61
62
  a == action.to_sym
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Tramway
4
4
  module Api
5
- VERSION = '1.8.1'
5
+ VERSION = '1.8.1.1'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tramway-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.1
4
+ version: 1.8.1.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: 2020-03-23 00:00:00.000000000 Z
11
+ date: 2020-03-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: active_model_serializers