comfortable_mexican_sofa 1.4.16 → 1.4.17

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.4.16
1
+ 1.4.17
@@ -11,8 +11,8 @@ class CmsContentController < ApplicationController
11
11
  :only => [:render_css, :render_js]
12
12
 
13
13
  def render_html(status = 200)
14
- if layout = @cms_page.layout
15
- app_layout = (layout.app_layout.blank? || request.xhr?) ? false : layout.app_layout
14
+ if @cms_layout = @cms_page.layout
15
+ app_layout = (@cms_layout.app_layout.blank? || request.xhr?) ? false : @cms_layout.app_layout
16
16
  render :inline => @cms_page.content, :layout => app_layout, :status => status
17
17
  else
18
18
  render :text => I18n.t('cms.content.layout_not_found'), :status => 404
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{comfortable_mexican_sofa}
8
- s.version = "1.4.16"
8
+ s.version = "1.4.17"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Oleg Khabarov", "The Working Group Inc"]
@@ -20,13 +20,13 @@ module ComfortableMexicanSofa::ControllerMethods
20
20
  # by the cms page and/or layout)
21
21
  def render(options = {}, locals = {}, &block)
22
22
  if options.is_a?(Hash) && path = options.delete(:cms_page)
23
- site = Cms::Site.find_site(request.host.downcase, request.fullpath)
24
- page = site && site.pages.find_by_full_path(path)
25
- if page
26
- cms_app_layout = page.layout.try(:app_layout)
23
+ @cms_site = Cms::Site.find_site(request.host.downcase, request.fullpath)
24
+ @cms_page = @cms_site && @cms_site.pages.find_by_full_path(path)
25
+ if @cms_page
26
+ @cms_layout = @cms_page.layout
27
+ cms_app_layout = @cms_layout.try(:app_layout)
27
28
  options[:layout] ||= cms_app_layout.blank?? nil : cms_app_layout
28
- options[:inline] = page.content
29
- @cms_page = page
29
+ options[:inline] = @cms_page.content
30
30
  super(options, locals, &block)
31
31
  else
32
32
  raise ComfortableMexicanSofa::MissingPage.new(path)
@@ -4,7 +4,10 @@ class CmsContentControllerTest < ActionController::TestCase
4
4
 
5
5
  def test_render_page
6
6
  get :render_html, :cms_path => ''
7
- assert_equal assigns(:cms_page), cms_pages(:default)
7
+ assert_equal cms_sites(:default), assigns(:cms_site)
8
+ assert_equal cms_layouts(:default), assigns(:cms_layout)
9
+ assert_equal cms_pages(:default), assigns(:cms_page)
10
+
8
11
  assert_response :success
9
12
  assert_equal rendered_content_formatter(
10
13
  '
@@ -45,6 +45,9 @@ class RenderCmsTest < ActionDispatch::IntegrationTest
45
45
  page.save!
46
46
  get '/render-implicit'
47
47
  assert_response :success
48
+ assert assigns(:cms_site)
49
+ assert assigns(:cms_layout)
50
+ assert assigns(:cms_page)
48
51
  end
49
52
 
50
53
  def test_get_with_explicit_cms_template
@@ -53,6 +56,9 @@ class RenderCmsTest < ActionDispatch::IntegrationTest
53
56
  page.save!
54
57
  get '/render-explicit'
55
58
  assert_response :success
59
+ assert assigns(:cms_site)
60
+ assert assigns(:cms_layout)
61
+ assert assigns(:cms_page)
56
62
  end
57
63
 
58
64
  def test_get_with_explicit_cms_template_failure
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: comfortable_mexican_sofa
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.16
4
+ version: 1.4.17
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -15,7 +15,7 @@ default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rails
18
- requirement: &70098588879960 !ruby/object:Gem::Requirement
18
+ requirement: &70252456634400 !ruby/object:Gem::Requirement
19
19
  none: false
20
20
  requirements:
21
21
  - - ! '>='
@@ -23,10 +23,10 @@ dependencies:
23
23
  version: 3.0.0
24
24
  type: :runtime
25
25
  prerelease: false
26
- version_requirements: *70098588879960
26
+ version_requirements: *70252456634400
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: active_link_to
29
- requirement: &70098588879420 !ruby/object:Gem::Requirement
29
+ requirement: &70252456630840 !ruby/object:Gem::Requirement
30
30
  none: false
31
31
  requirements:
32
32
  - - ! '>='
@@ -34,10 +34,10 @@ dependencies:
34
34
  version: 1.0.0
35
35
  type: :runtime
36
36
  prerelease: false
37
- version_requirements: *70098588879420
37
+ version_requirements: *70252456630840
38
38
  - !ruby/object:Gem::Dependency
39
39
  name: paperclip
40
- requirement: &70098588878880 !ruby/object:Gem::Requirement
40
+ requirement: &70252456630360 !ruby/object:Gem::Requirement
41
41
  none: false
42
42
  requirements:
43
43
  - - ! '>='
@@ -45,7 +45,7 @@ dependencies:
45
45
  version: 2.3.14
46
46
  type: :runtime
47
47
  prerelease: false
48
- version_requirements: *70098588878880
48
+ version_requirements: *70252456630360
49
49
  description: ''
50
50
  email: oleg@theworkinggroup.ca
51
51
  executables: []
@@ -349,7 +349,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
349
349
  version: '0'
350
350
  segments:
351
351
  - 0
352
- hash: 3028671969758726451
352
+ hash: 1666253122703358863
353
353
  required_rubygems_version: !ruby/object:Gem::Requirement
354
354
  none: false
355
355
  requirements: