Created
April 19, 2010 15:56
-
-
Save anathematic/371203 to your computer and use it in GitHub Desktop.
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
@contracts = Contract.find(:all,:joins =>'inner join sites on sites.id = contracts.site_id inner join cities on cities.id = sites.city_id inner join states st on st.id = cities.state_id inner join countries c on c.id = st.country_id', :conditions => ['deleted = 0 and sites.site_status_id <>3 and (contracts.end_date - current_date)< 240 and (contracts.end_date - current_date) > 0 and contracts.end_date is not null and c.id in (%s)', current_user.contact.country_ids_by_rights("sites","edit").join(",")], :order=>'contracts.end_date asc') | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment