specstar-controllers 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/specstar/controllers.rb +10 -6
- metadata +2 -2
data/lib/specstar/controllers.rb
CHANGED
@@ -18,15 +18,19 @@ module Specstar
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def has_skip_before_filter?(controller, filter, actions)
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
21
|
+
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
|
25
27
|
}.size > 0
|
26
|
-
|
28
|
+
else
|
29
|
+
!has_before_filter?(controller, filter)
|
30
|
+
end
|
27
31
|
end
|
28
32
|
|
29
|
-
def has_before_filter?(controller, filter, action)
|
33
|
+
def has_before_filter?(controller, filter, action=nil)
|
30
34
|
callbacks = controller.is_a?(ApplicationController) ? controller._process_action_callbacks : controller._dispatch_callbacks
|
31
35
|
callbacks.select { |callback|
|
32
36
|
callback.chain.select { |chain|
|
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.
|
4
|
+
version: 0.0.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-10-
|
12
|
+
date: 2012-10-30 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description:
|
15
15
|
email: sujoyg@gmail.com
|