udongo 5.6.0 → 5.7.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c231e5e9aea6f903692f1014fe670226c1468686
4
- data.tar.gz: e09bb6286fc0065fb9e052e6c76fde6c83e1ed87
3
+ metadata.gz: a533eec4e517a96747f4933567fc71892c76c25f
4
+ data.tar.gz: bf6fe21d215d9f065081c836b344afffcf04b2da
5
5
  SHA512:
6
- metadata.gz: 22d3465905e554c8f92449b0b22600956ec5043d9be927a8867da60b160a61dbea210ba138259f9ba4f78417c858e0f8f349ceac119d1177625123f2740a3c21
7
- data.tar.gz: f20a95ca08384967a248a583b85c8939821dcb139843bc7800db7c096b1357d296c6a867449610a0079d127fb8764136e98bfe7062873e1cca52aee169f556d1
6
+ metadata.gz: 3334640c6d1adcaf63ba4133e1f7f1c3f32e5c0f646bf6a74630d13bdaeff8b7efd356a2c55e93376e34f1de3c1e2b4f4e48a306bda89b3fd79779cb02a718f9
7
+ data.tar.gz: 4ae9622b209f8d27bb14c896a2c2f7603dad8db21a5dd39eef42102aee5424150b69a9dbbc66bfec39112f5a5bfa9c547de4beef0b9bb524702c53eb109be94a
@@ -0,0 +1,5 @@
1
+ module NavigationHelper
2
+ def navigation(identifier)
3
+ ::Navigation.find_in_cache(identifier)
4
+ end
5
+ end
@@ -1,4 +1,7 @@
1
1
  class Navigation < ApplicationRecord
2
+ include Concerns::Cacheable
3
+ cache_by :identifier
4
+
2
5
  has_many :items, class_name: 'NavigationItem', dependent: :destroy
3
6
 
4
7
  validates :description, presence: true
data/changelog.md CHANGED
@@ -1,3 +1,10 @@
1
+ 5.7.0 - 2017-03-22
2
+ --
3
+ * The ```Navigation``` model now includes the cacheable concern.
4
+ * A ```NavigationHelper``` module was added which makes it easier to fetch a
5
+ navigation by identifier.
6
+
7
+
1
8
  5.6.0 - 2017-03-18
2
9
  --
3
10
  * The article title is truncated to 40 chars in the overview and breadcrumbs.
@@ -1,3 +1,3 @@
1
1
  module Udongo
2
- VERSION = '5.6.0'
2
+ VERSION = '5.7.0'
3
3
  end
data/readme.md CHANGED
@@ -547,6 +547,19 @@ class Backend::AdminsController < Backend::BaseController
547
547
  end
548
548
  ```
549
549
 
550
+ # ERB Helpers
551
+ ## Snippet
552
+ Find a snippet from cache by its identifier and decorate it.
553
+ ```snippet(:identifier)```
554
+
555
+ ## Page
556
+ Find a page from cache by its identifier and decorate it.
557
+ ```page(:identifier)```
558
+
559
+ ## Navigation
560
+ Find a navigation from cache by its identifier.
561
+ ```navigation(:identifier)```
562
+
550
563
  # Javascript libs
551
564
  ## Select2
552
565
  This library is loaded by default in the backend.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: udongo
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.6.0
4
+ version: 5.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Davy Hellemans
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-03-18 00:00:00.000000000 Z
12
+ date: 2017-03-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -505,6 +505,7 @@ files:
505
505
  - app/helpers/backend/pagination_helper.rb
506
506
  - app/helpers/icon_helper.rb
507
507
  - app/helpers/link_helper.rb
508
+ - app/helpers/navigation_helper.rb
508
509
  - app/helpers/page_helper.rb
509
510
  - app/helpers/snippet_helper.rb
510
511
  - app/helpers/udongo_helper.rb