diff --git a/app/controllers/public/articles_controller.rb b/app/controllers/public/articles_controller.rb index 34244c1..49f9b7a 100644 --- a/app/controllers/public/articles_controller.rb +++ b/app/controllers/public/articles_controller.rb @@ -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) diff --git a/config/database.yml b/config/database.yml index 374c2ca..1e419ca 100644 --- a/config/database.yml +++ b/config/database.yml @@ -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".