Last active
August 29, 2015 14:03
-
-
Save sclinede/24b304b89dccbce58057 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
def reload_companies_products(*ids) | |
Company.find(ids).each do |company| | |
company.products.find_each { |prod| prod.transmitter_update } | |
CompaniesSweeper.expire(company) | |
end | |
end |
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
select id, ABS((id - 3)/7 - sphinx_internal_id) > 16 as cid from product_rt where company_id = 12690030 order by cid asc limit 307; |
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
Company.find(<id>).tap { |c| c.products.find_each { |prod| prod.transmitter_update }; CompaniesSweeper.expire(c); } |
folklore
commented
Apr 16, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment