Approximate ascii on blog slugs. For: GH-60
This commit is contained in:
parent
4cb096d256
commit
2d37cbf479
2 changed files with 8 additions and 2 deletions
|
@ -7,7 +7,10 @@ class BlogCategory < ActiveRecord::Base
|
|||
|
||||
validates :title, :presence => true, :uniqueness => true
|
||||
|
||||
has_friendly_id :title, :use_slug => true
|
||||
has_friendly_id :title, :use_slug => true,
|
||||
:default_locale => (::Refinery::I18n.default_frontend_locale rescue :en),
|
||||
:approximate_ascii => RefinerySetting.find_or_set(:approximate_ascii, true, :scoping => 'blog'),
|
||||
:strip_non_ascii => RefinerySetting.find_or_set(:strip_non_ascii, true, :scoping => 'blog')
|
||||
|
||||
def post_count
|
||||
posts.select(&:live?).count
|
||||
|
|
|
@ -21,7 +21,10 @@ class BlogPost < ActiveRecord::Base
|
|||
validates :title, :presence => true, :uniqueness => true
|
||||
validates :body, :presence => true
|
||||
|
||||
has_friendly_id :title, :use_slug => true
|
||||
has_friendly_id :title, :use_slug => true,
|
||||
:default_locale => (::Refinery::I18n.default_frontend_locale rescue :en),
|
||||
:approximate_ascii => RefinerySetting.find_or_set(:approximate_ascii, true, :scoping => 'blog'),
|
||||
:strip_non_ascii => RefinerySetting.find_or_set(:strip_non_ascii, true, :scoping => 'blog')
|
||||
|
||||
scope :by_archive, lambda { |archive_date|
|
||||
where(['published_at between ? and ?', archive_date.beginning_of_month, archive_date.end_of_month])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue