This commit is contained in:
Nicolas Bally 2014-09-08 15:16:24 +02:00
parent 031c8354f3
commit e96974fb50
2 changed files with 9 additions and 8 deletions

View File

@ -6,7 +6,7 @@ class Public::ArticlesController < ApplicationController
def index
@articles = Article.before(Date.today).recents
@articles = Article.before(Time.now).recents
@articles = @articles.page(params[:page]).per(10)
@ -19,7 +19,7 @@ class Public::ArticlesController < ApplicationController
@title = "Blog de Geneviève gagos"
# the news items
@articles = Article.before(Date.today).recents
@articles = Article.before(Time.now).recents
# this will be our Feed's update timestamp
@updated = @articles.first.updated_at unless @articles.empty?
@ -55,7 +55,7 @@ class Public::ArticlesController < ApplicationController
@category = Category.find_by_slug(params[:slug])
@articles = @category.articles.before(Date.today).recents
@articles = @category.articles.before(Time.now).recents
@articles = @articles.page(params[:page]).per(10)
@title = "Articles du blog"
@index_title = 'Articles de la catégorie "'+@category.name+'"'
@ -64,8 +64,8 @@ class Public::ArticlesController < ApplicationController
end
def archives
@month = Date.parse("#{params[:year]}/#{params[:month]}").beginning_of_month
@articles = Article.recents.where("enabled = ? and published_at >= ? and published_at <= ?", true, @month, @month.end_of_month ).before(Date.today)
@month = Time.parse("#{params[:year]}/#{params[:month]}").beginning_of_month
@articles = Article.recents.where("enabled = ? and published_at >= ? and published_at <= ?", true, @month, @month.end_of_month ).before(Time.now)
@articles = @articles.page(params[:page]).per(10)
@title = "Articles du blog"
if [4,8].include?(@month.month)

View File

@ -4,10 +4,11 @@
# Ensure the SQLite 3 gem is defined in your Gemfile
# gem 'sqlite3'
development:
adapter: sqlite3
database: db/development.sqlite3
adapter: mysql2
encoding: utf8
database: blog_eft_app
pool: 5
timeout: 5000
hostname: localhost
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".