Events: removendo campo date

This commit is contained in:
2008-03-05 04:34:41 -03:00
parent 56e7d7c374
commit ba4a6a20fe
7 changed files with 15 additions and 16 deletions

View File

@@ -113,8 +113,8 @@ class UsersController < ApplicationController
unless @current_user.courses.empty?
@news = News.find(:all, :conditions => [ 'receiver_id in (?)', @current_user.courses ],
:order => 'timestamp desc', :limit => 5)
@events = Event.find(:all, :conditions => [ 'course_id in (?) and (date > ?) and (date < ?)',
@current_user.courses, 1.day.ago, 21.days.from_now ], :order => 'date')
@events = Event.find(:all, :conditions => [ 'course_id in (?) and (time > ?) and (time < ?)',
@current_user.courses, 1.day.ago, 21.days.from_now ], :order => 'time')
end
end

View File

@@ -26,7 +26,7 @@ class Course < ActiveRecord::Base
:foreign_key => "receiver_id",
:order => 'id desc'
has_many :events, :order => "date asc, time asc"
has_many :events, :order => "time asc"
has_many :log_entries, :order => "created_at desc"