Permalink
Browse files

Added related events, close in time

  • Loading branch information...
1 parent 0dc88d2 commit 1dc3a1a964cd3e5d4a886eb9c18694db88be45cd @ferblape ferblape committed Oct 5, 2010
Showing with 1 addition and 1 deletion.
  1. +1 −1 app/models/event.rb
View
@@ -11,7 +11,7 @@ def similar(options = {})
:limit => 10
}
options = default_options.merge(options)
- Event.limit(options[:limit]).where("id != #{self.id}").where("events.from >= '#{(self.from + options[:distance_in_days].days).to_s(:db)}'")
+ Event.limit(options[:limit]).where("id != #{self.id}").where("events.from >= '#{(self.from.at_beginning_of_day + options[:distance_in_days].days).to_s(:db)}'")
end
end

0 comments on commit 1dc3a1a

Please sign in to comment.