Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def created_on_off_hours?
- return false unless self.created_at
- created_on_weekend = [0, 6].include?(self.created_at.wday)
- created_friday_night = self.created_at.wday == 5 && self.created_at.hour >= 19
- created_on_weekend || created_friday_night
- end
Add Comment
Please, Sign In to add comment