i am trying to do a query that will be compare the time stored in the database to the current time, and if it is greater than today to display those records.
below is query i am currently using that isnt displaying any records
@schedules = Schedule.where(:team_id => current_user[:team_id], :event => '1', :time => ">= Time.now.zone")
how do i go back query against a timestamp? so that these records will be displayed?
have also tried the following
@schedules = Schedule.find_all_by_team_id_and_event_and_time(current_user[:team_id],"1", :time)
The string is used directly in the SQL query so you need to make sure the column names are correct and unambiguous (if you joined on another table that also has a
team_id
colum, you would need to doschedules.team_id = ? and ...
)