site_logic 1.9.7 → 1.9.8

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.9.7
1
+ 1.9.8
@@ -1,11 +1,12 @@
1
1
  class PagesController < ApplicationController
2
2
  def show
3
3
  @site = Site.where(:domain => request.host).first || Site.first
4
+ slug = params[:path].blank? ? '/' : params[:path]
4
5
 
5
- if @page = @site.pages.published.by_slug(params[:path] || '/').first
6
+ if @page = @site.pages.published.by_slug(slug).first
6
7
  render :layout => @site.layout
7
8
  else
8
- raise Mongoid::Errors::DocumentNotFound.new Page, params[:path]
9
+ raise Mongoid::Errors::DocumentNotFound.new Page, slug
9
10
  end
10
11
  end
11
12
  end
data/app/models/page.rb CHANGED
@@ -9,12 +9,12 @@ class Page
9
9
 
10
10
  # Scopes =========================================================================================
11
11
  scope :by_slug, lambda{ |slug| {:where => {:slug => slug}} }
12
- scope :drafts, :where => {:state => 'draft'}
12
+ scope :drafts, :where => {:state => /draft/i}
13
13
  scope :for_sitemap, :where => {:sitemap => true}
14
14
  scope :indexed, :where => {:noindex => false}
15
15
  scope :leading_slash, :where => {:slug => %r{^\/}}
16
16
  scope :noindex, :where => {:noindex => true}
17
- scope :published, :where => {:state => 'published'}
17
+ scope :published, :where => {:state => /published/i}
18
18
  scope :trailing_slash, :where => {:slug => %r{\/$}}
19
19
 
20
20
  # Mongoid ========================================================================================
data/site_logic.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "site_logic"
8
- s.version = "1.9.7"
8
+ s.version = "1.9.8"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Bantik"]
12
- s.date = "2011-11-30"
12
+ s.date = "2012-01-05"
13
13
  s.description = "An engine for search-engine-optimized content management."
14
14
  s.email = "corey@seologic.com"
15
15
  s.files = [
@@ -157,7 +157,7 @@ Gem::Specification.new do |s|
157
157
  ]
158
158
  s.homepage = "http://github.com/ivanoblomov/site_logic"
159
159
  s.require_paths = ["lib"]
160
- s.rubygems_version = "1.8.10"
160
+ s.rubygems_version = "1.8.11"
161
161
  s.summary = "An engine for search-engine-optimized content management."
162
162
 
163
163
  if s.respond_to? :specification_version then
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: site_logic
3
3
  version: !ruby/object:Gem::Version
4
- hash: 61
4
+ hash: 35
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 9
9
- - 7
10
- version: 1.9.7
9
+ - 8
10
+ version: 1.9.8
11
11
  platform: ruby
12
12
  authors:
13
13
  - Bantik
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-11-30 00:00:00 Z
18
+ date: 2012-01-05 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: bson_ext
@@ -372,7 +372,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
372
372
  requirements: []
373
373
 
374
374
  rubyforge_project:
375
- rubygems_version: 1.8.10
375
+ rubygems_version: 1.8.11
376
376
  signing_key:
377
377
  specification_version: 3
378
378
  summary: An engine for search-engine-optimized content management.