simplec 0.5.0 → 0.6.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: 3c321ea208ca11d4f51f7f14b78860240c552691
4
- data.tar.gz: 9c6f4ed8b8f77ff80f33db6bfb129c11a78e0a3e
3
+ metadata.gz: 3e3189399a08bf6dc14a452311b79f7f48eb6a16
4
+ data.tar.gz: 179e5ac787ed6456ac46282808591748ba10e560
5
5
  SHA512:
6
- metadata.gz: cceb2399b420e69f3f04f8e39fdbc34b4a60884fe8caba37005b73a7ce22f7f85609e3e15b64d8dfa8763b17225dab6046bece6c5e713c9c06554aa5058ae7cb
7
- data.tar.gz: d0bbce5fd5760a1dad808f12a07d2ed27497821879a1041c59b96ce69275acedf735489fcf816c66a3f4af209c9ca6a272497461ed452ab6a8f47c99ffd4dc05
6
+ metadata.gz: 61dcc253ee7661aaea00164e559700fedd731d5932049fb9f21e285a65fd4840e35a3c1dbc84f433cd79bf61611cf75b0bffe7abd6876a4db7ce63774dba7f72
7
+ data.tar.gz: 8d0115591036074ab888821f17b04fdfdd2692bb941273a8329fa61d25104763ea1630215a06b5fac7ed714bd1ea9bfff5b1a44f93f05a1d1589f825cb51fa1e
data/README.md CHANGED
@@ -11,9 +11,10 @@ ecosystem.
11
11
 
12
12
  ## Dependencies
13
13
 
14
- - rails >= 5.0.5
14
+ - rails >= 5.1.0
15
15
 
16
- This probably can be lowered to older versions.
16
+ If you want to use this with earlier versions of rails, please create a
17
+ github issue.
17
18
 
18
19
  - pg >= 0.21.0; Postgres >= 9.5
19
20
 
@@ -331,6 +332,11 @@ See this page for a good cheat sheet: http://markevans.github.io/dragonfly/image
331
332
  gem install yard
332
333
  yard server -r --no-cache --no-save --verbose --debug --backtrace
333
334
 
335
+ ## Moving Backwards
336
+
337
+ - Depends on 5.1.x because of on_load hooks, specifically
338
+ :action_controller_base. Could be moved back, but need to figure out
339
+ equivalent ways of loading in the engine.
334
340
 
335
341
  ## Contributors
336
342
 
data/lib/simplec.rb CHANGED
@@ -12,6 +12,13 @@ module Simplec
12
12
 
13
13
  # Get application view helpers.
14
14
  #
15
+ # @note
16
+ # A copy of ApplicationHelper has been removed from the module tree but is still active!
17
+ #
18
+ # If that occurs it is because the Module has been changed but app needs to
19
+ # be restarted because they are loaded at initialize. require_dependency
20
+ # might be able to fix it.
21
+ #
15
22
  # @example append helper
16
23
  # Simplec.helpers << ::ApplicationHelper
17
24
  #
@@ -22,14 +22,12 @@ module Simplec
22
22
  # @return [Simplec::Page]
23
23
  def page(path, options={})
24
24
  @_page ||= Hash.new
25
- return @_page[path] if @_page[path]
26
-
27
- _subdomain = options[:subdomain] ?
28
- Subdomain.find_by!(name: options[:subdomain]) :
29
- subdomain
25
+ key = "#{subdomain(options[:subdomain])};#{path}"
26
+ return @_page[key] if @_page[key]
30
27
 
31
28
  # TODO add raise option for find_by!
32
- @_page[path] = _subdomain.pages.find_by!(path: path)
29
+ @_page[key] = subdomain(options[:subdomain]).pages.
30
+ includes(:subdomain).find_by!(path: path)
33
31
  end
34
32
 
35
33
  # Get the path of a page.
@@ -83,7 +83,7 @@ module Simplec
83
83
  #
84
84
  # Example:
85
85
  #
86
- # <% subpages('/give-volunteer', conditions: ->{ order(title: :asc) }).each do |page| %>
86
+ # <% subpages('give-volunteer', conditions: ->{ order(title: :asc) }).each do |page| %>
87
87
  # ... do something with page ...
88
88
  # <% end%>
89
89
  def subpages(page_or_path, options={})
@@ -106,7 +106,7 @@ module Simplec
106
106
  return @_subpages[key] = Array.new
107
107
  end
108
108
 
109
- @_subpages[key] = page.children
109
+ @_subpages[key] = page.children.includes(:subdomain)
110
110
  end
111
111
 
112
112
  @_subpages[key].respond_to?(:merge) && options[:conditions] ?
@@ -1,3 +1,3 @@
1
1
  module Simplec
2
- VERSION = '0.5.0'
2
+ VERSION = '0.6.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simplec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Smith
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 5.0.5
19
+ version: 5.1.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 5.0.5
26
+ version: 5.1.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: pg
29
29
  requirement: !ruby/object:Gem::Requirement