Created
November 15, 2012 05:35
-
-
Save jimhj/4076825 to your computer and use it in GitHub Desktop.
Uncache query in ActiveRecord
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 self.get_responded_inquiry(mobile_no, company_id) | |
uncached do | |
self.find(:last, :conditions => ["mobile_no = ? and company_id = ? and response_status = 1", mobile_no, company_id]) | |
# self.find_all_by_mobile_no_and_company_id_and_response_status(mobile_no, company_id, 1).last | |
end | |
end | |
def self.last_req(mobile_no, company_id) | |
uncached do | |
self.find(:last, :conditions => ["mobile_no = ? and company_id = ?", mobile_no, company_id]) | |
# self.find_all_by_mobile_no_and_company_id(mobile_no, company_id).last | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment