bug date
This commit is contained in:
parent
031c8354f3
commit
e96974fb50
@ -6,7 +6,7 @@ class Public::ArticlesController < ApplicationController
|
|||||||
|
|
||||||
def index
|
def index
|
||||||
|
|
||||||
@articles = Article.before(Date.today).recents
|
@articles = Article.before(Time.now).recents
|
||||||
|
|
||||||
@articles = @articles.page(params[:page]).per(10)
|
@articles = @articles.page(params[:page]).per(10)
|
||||||
|
|
||||||
@ -19,7 +19,7 @@ class Public::ArticlesController < ApplicationController
|
|||||||
@title = "Blog de Geneviève gagos"
|
@title = "Blog de Geneviève gagos"
|
||||||
|
|
||||||
# the news items
|
# the news items
|
||||||
@articles = Article.before(Date.today).recents
|
@articles = Article.before(Time.now).recents
|
||||||
|
|
||||||
# this will be our Feed's update timestamp
|
# this will be our Feed's update timestamp
|
||||||
@updated = @articles.first.updated_at unless @articles.empty?
|
@updated = @articles.first.updated_at unless @articles.empty?
|
||||||
@ -55,7 +55,7 @@ class Public::ArticlesController < ApplicationController
|
|||||||
|
|
||||||
|
|
||||||
@category = Category.find_by_slug(params[:slug])
|
@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)
|
@articles = @articles.page(params[:page]).per(10)
|
||||||
@title = "Articles du blog"
|
@title = "Articles du blog"
|
||||||
@index_title = 'Articles de la catégorie "'+@category.name+'"'
|
@index_title = 'Articles de la catégorie "'+@category.name+'"'
|
||||||
@ -64,8 +64,8 @@ class Public::ArticlesController < ApplicationController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def archives
|
def archives
|
||||||
@month = Date.parse("#{params[:year]}/#{params[:month]}").beginning_of_month
|
@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(Date.today)
|
@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)
|
@articles = @articles.page(params[:page]).per(10)
|
||||||
@title = "Articles du blog"
|
@title = "Articles du blog"
|
||||||
if [4,8].include?(@month.month)
|
if [4,8].include?(@month.month)
|
||||||
|
@ -4,10 +4,11 @@
|
|||||||
# Ensure the SQLite 3 gem is defined in your Gemfile
|
# Ensure the SQLite 3 gem is defined in your Gemfile
|
||||||
# gem 'sqlite3'
|
# gem 'sqlite3'
|
||||||
development:
|
development:
|
||||||
adapter: sqlite3
|
adapter: mysql2
|
||||||
database: db/development.sqlite3
|
encoding: utf8
|
||||||
|
database: blog_eft_app
|
||||||
pool: 5
|
pool: 5
|
||||||
timeout: 5000
|
hostname: localhost
|
||||||
|
|
||||||
# Warning: The database defined as "test" will be erased and
|
# Warning: The database defined as "test" will be erased and
|
||||||
# re-generated from your development database when you run "rake".
|
# re-generated from your development database when you run "rake".
|
||||||
|
Loading…
x
Reference in New Issue
Block a user