activeadmin-selleo-cms 0.0.5 → 0.0.6

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.
@@ -1,12 +1,12 @@
1
1
  module ActiveadminSelleoCms
2
2
  class PagesController < ActiveadminSelleoCms::ApplicationController
3
3
  def show
4
- if @page = Page.published.find_by_slug(params[:id])
4
+ if params[:id] and @page = Page.published.find_by_slug(params[:id])
5
5
  render action: :show, layout: @page.layout
6
6
  elsif params[:id]
7
7
  redirect_to "/#{I18n.locale}"
8
8
  else
9
- @page = Page.roots.first
9
+ @page = Page.roots.reorder("id ASC").first
10
10
  render action: :show, layout: @page.layout
11
11
  end
12
12
  @page.increment!(:views) if @page
@@ -32,7 +32,7 @@ module ActiveadminSelleoCms
32
32
  end
33
33
 
34
34
  after_initialize do
35
- self.layout = Layout.all.first if new_record? and layout.blank?
35
+ self.layout = Layout.all.first if new_record?
36
36
  end
37
37
 
38
38
  def initialize_missing_sections
@@ -1,3 +1,3 @@
1
1
  module ActiveadminSelleoCms
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activeadmin-selleo-cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-12-30 00:00:00.000000000 Z
12
+ date: 2012-12-31 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails