Created
December 3, 2010 18:19
-
-
Save nathany/727315 to your computer and use it in GitHub Desktop.
Sometimes my Ruby code has enough parens, it might as well be Lisp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# find admin users assigned to a given set of sites | |
named_scope :assigned_to_sites, lambda { |site_ids| | |
{ | |
:joins => :admin_user_site_assignments, | |
:conditions => { | |
:admin_user_site_assignments => {:site_id => site_ids} | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def in_booking_window? | |
(begin_booking_at.nil? or Time.now.utc >= begin_booking_at) and (end_booking_at.nil? or Time.now.utc <= end_booking_at) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment