def self.find_for(options = {})
scope = scoped
scope = scope.where(:hook => options[:hook].to_s) if options[:hook]
...
Ruby ActiveRecord query construc...
by https://www.google.com/accounts/o8/id?id=AItOawmLF7gR3CIpZoZXbwO7fiD2QWYltD3lwpM,
December 23, 2010 15:27,
1 refactoring, tagged with rails, sql, activerecord, rails3, arel
# link_categories has_many links create_table "link_categories", :force => true do |t| t.string "name" ...
Ruby Find records according to r...
by https://www.google.com/accounts/o8/id?id=AItOawl_CInyr4p6Fw9fCXT3DYEGIiMyGOQDomw,
August 02, 2010 18:43,
1 refactoring, tagged with rails, sql, ruby, activerecord
I have a method (LinkCatego...
Clip.find_by_sql(["select * from clips where not exists
(select 'clip_id' from histories where histories.clip_id = clips.id
and histories.user_id = ?) ORDER BY clips.created_at DESC LIMIT 20", user.id])
Ruby ActiveRecord find_by_sql
How can I turn this into so...
class Item < ActiveRecord::Base ALL_VOTES = "all_votes" SCORE = "score" ...
Ruby Complex query in Ruby on Ra...
I have a method called rank...
#players = select distinct(player) from actions;
players = repository(:default).adapter.query('select distinct(player) from actions')
...
Ruby getting 20-100+ sums in one go
by feydr.myopenid.com,
February 10, 2009 19:13,
2 refactorings, tagged with sql, ruby, iteratate, sum
I have an actions table tha...
Rails 3.0.3
This method ...