Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- to_update = self.all(
- :conditions => [
- 'status = ? AND handler IS NULL AND (dont_send_after IS NULL OR dont_send_after > ?) '+ \
- 'AND (dont_send_before IS NULL OR dont_send_before <= ?)',
- STATUS[:unsent], time_now, time_now
- ],
- :order => [:id], :limit => number
- )
- to_update.size
- to_update.update!(
- :status => STATUS[:locked_to_send],
- :handler => handler
- )
Add Comment
Please, Sign In to add comment