specstar-controllers 0.0.5 → 0.0.6

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.
Files changed (2) hide show
  1. data/lib/specstar/controllers.rb +9 -6
  2. metadata +1 -1
@@ -17,14 +17,17 @@ module Specstar
17
17
  end
18
18
  end
19
19
 
20
+ def has_skip_before_filter_for_action?(controller, filter, action)
21
+ controller._process_action_callbacks.any? { |callback|
22
+ callback.chain.any? { |chain|
23
+ chain.kind == :before && chain.filter.to_s == filter.to_s && chain.per_key[:unless].any? { |item| item.include? "action_name == '#{action}'" }
24
+ }
25
+ }
26
+ end
27
+
20
28
  def has_skip_before_filter?(controller, filter, actions)
21
29
  if actions.present?
22
- controller._process_action_callbacks.select { |callback|
23
- callback.chain.select { |chain|
24
- actions_match = actions.select { |action| !chain.per_key[:unless].include?("action_name == '#{action}'") }.empty?
25
- chain.kind == :before && chain.filter.to_s == filter.to_s && actions_match
26
- }.size > 0
27
- }.size > 0
30
+ actions.all? { |action| has_skip_before_filter_for_action?(controller, filter, action) }
28
31
  else
29
32
  !has_before_filter?(controller, filter)
30
33
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: specstar-controllers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: