ama_layout 7.0.1 → 7.0.2
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.
- checksums.yaml +4 -4
- data/lib/ama_layout/decorators/agent/navigation_decorator.rb +0 -1
- data/lib/ama_layout/decorators/moneris_decorator.rb +0 -1
- data/lib/ama_layout/decorators/navigation_decorator.rb +0 -1
- data/lib/ama_layout/decorators/navigation_item_decorator.rb +0 -1
- data/lib/ama_layout/decorators/notification_decorator.rb +0 -1
- data/lib/ama_layout/draper_replacement.rb +20 -16
- data/lib/ama_layout/version.rb +1 -1
- data/spec/ama_layout/decorators/navigation_decorator_spec.rb +9 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d1a9ad2f7ef87e3b1464aa180876d6d204053473
|
4
|
+
data.tar.gz: df05f8193fb1540b9e3d1082dbb6862ac307d5a4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6f000569a3ab7c8bac593ab429cd1b2051e02bc9f1aea6cd371946e28319b033175e3a32aa5701de2a7bb406ecc0f4164b41fd78410ff96268fc9f7062834998
|
7
|
+
data.tar.gz: ec90b510eaeb659fb231e0187d7cbdcd1616bc2737ab106cd57ce470497bcf5a1cb1a62dcfffcf2d8248fd7207a7ca032bbaad8420e650afd684a0727d5ad6aa
|
@@ -1,27 +1,31 @@
|
|
1
1
|
module AmaLayout
|
2
2
|
module DraperReplacement
|
3
|
-
|
3
|
+
extend ActiveSupport::Concern
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
end
|
5
|
+
included do
|
6
|
+
attr_accessor :object, :controller
|
8
7
|
|
9
|
-
|
10
|
-
|
11
|
-
|
8
|
+
def h(view_data = {})
|
9
|
+
AmaLayoutView.new(view_data: view_data)
|
10
|
+
end
|
12
11
|
|
13
|
-
|
14
|
-
|
15
|
-
|
12
|
+
def initialize(args = {})
|
13
|
+
self.object = args
|
14
|
+
end
|
16
15
|
|
17
|
-
|
18
|
-
|
16
|
+
def method_missing(method, *args, &block)
|
17
|
+
return super unless delegatable?(method)
|
19
18
|
|
20
|
-
|
21
|
-
|
19
|
+
(object || DraperReplacement).send(method, *args, &block)
|
20
|
+
end
|
21
|
+
|
22
|
+
def delegatable?(method)
|
23
|
+
object.respond_to?(method) || DraperReplacement.respond_to?(method)
|
24
|
+
end
|
22
25
|
|
23
|
-
|
24
|
-
|
26
|
+
def self.decorate_collection(objects = {})
|
27
|
+
objects.map { |o| self.new(o) }
|
28
|
+
end
|
25
29
|
end
|
26
30
|
end
|
27
31
|
end
|
data/lib/ama_layout/version.rb
CHANGED
@@ -229,8 +229,16 @@ describe AmaLayout::NavigationDecorator do
|
|
229
229
|
end
|
230
230
|
|
231
231
|
describe '#notification_sidebar' do
|
232
|
+
before(:each) do
|
233
|
+
user.notifications.create(
|
234
|
+
type: :warning,
|
235
|
+
header: 'decorated_notification',
|
236
|
+
content: 'decorated_notification'
|
237
|
+
)
|
238
|
+
end
|
239
|
+
|
232
240
|
it 'renders content to the page' do
|
233
|
-
expect(subject.notification_sidebar).to include(
|
241
|
+
expect(subject.notification_sidebar).to include('decorated_notification')
|
234
242
|
end
|
235
243
|
end
|
236
244
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ama_layout
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.0.
|
4
|
+
version: 7.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael van den Beuken
|
@@ -18,7 +18,7 @@ authors:
|
|
18
18
|
autorequire:
|
19
19
|
bindir: bin
|
20
20
|
cert_chain: []
|
21
|
-
date: 2017-08-
|
21
|
+
date: 2017-08-31 00:00:00.000000000 Z
|
22
22
|
dependencies:
|
23
23
|
- !ruby/object:Gem::Dependency
|
24
24
|
name: foundation-rails
|