shark-on-lambda 0.6.8 → 0.6.9

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: 3160ca5ad6f560f9491766c14dfae252d96dccbd1e49a895d7d947570215fc20
4
- data.tar.gz: 69fdecedecb24227c46f2a6ed9753f7303c28d9a79997b18790c8a5114bdca31
3
+ metadata.gz: f091b300adf3d8f61348709fda7e061034795d63e23863cf8a5ad2bb69c2f99f
4
+ data.tar.gz: 464d169e160ed5037b86c9452a6fef0aff6f300e420f83f8998d4a837463d16c
5
5
  SHA512:
6
- metadata.gz: ef7dc3970a388734184a2300b8617ee3757cdc0416a7f3a1fc10b2c15e5e1124899511d734dc8bf199a5850064924327482f2d2049ce25ae50d4c6e78a916de8
7
- data.tar.gz: e95fd45fc70630c20d5a68ebc2b9671dff6056b6fbd522e7cfcd28367ae9b5fc29770bdd6e1c35f049ce4b3571f7fc346c4901773a7e405dd0cb2e9c30488b0d
6
+ metadata.gz: 4354b29deda5404521f86c5741ac88a24e9487ba9bbeb9721a9940e14c8118b79262ee7f70650d5940b5724e339f7dbf5ed560cef837008b27b3cb8c0597a396
7
+ data.tar.gz: 9ca791b0d2cc3a7b5aa3a0b8e88114f92cc4ed4fbc0ae8e00d4cdde402e4142ed4f465e75cc2457d87012bdd6843d45d82ef37329e55f90c8c8f0ce539637f95
data/changelog.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## Changelog
2
2
 
3
+ #### 0.6.9
4
+
5
+ - [Fix] Controllers now execute their parents' `before_actions` and `after_actions`.
6
+
3
7
  #### 0.6.8
4
8
 
5
9
  - [Fix] `Query` breaks when adding an item with a symbol as a key.
data/gems.locked CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- shark-on-lambda (0.6.8)
4
+ shark-on-lambda (0.6.9)
5
5
  activesupport
6
6
  jsonapi-rb
7
7
  rack
@@ -18,7 +18,7 @@ module SharkOnLambda
18
18
  end
19
19
 
20
20
  def after_actions
21
- @after_actions || []
21
+ collect_from_ancestors(:after_actions) + Array(@after_actions)
22
22
  end
23
23
 
24
24
  def before_action(symbol, only: [], except: [])
@@ -31,7 +31,18 @@ module SharkOnLambda
31
31
  end
32
32
 
33
33
  def before_actions
34
- @before_actions || []
34
+ collect_from_ancestors(:before_actions) + Array(@before_actions)
35
+ end
36
+
37
+ private
38
+
39
+ def collect_from_ancestors(method)
40
+ ancestors_without_self = ancestors[1..-1]
41
+ return [] if ancestors_without_self.empty?
42
+
43
+ ancestors_without_self.map! { |ancestor| ancestor.try(method) }
44
+ ancestors_without_self.compact!
45
+ ancestors_without_self.reduce([], &:+)
35
46
  end
36
47
  end
37
48
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SharkOnLambda
4
- VERSION = '0.6.8'
4
+ VERSION = '0.6.9'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shark-on-lambda
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.8
4
+ version: 0.6.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Huy Dinh
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-10-08 00:00:00.000000000 Z
11
+ date: 2019-10-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport