I'm pretty novice to Ambition and have one frequent stumbling block.
Often at the console I want to do simple searches like this...
recent = Message.select{|m| m.created_on == Date.today}
But I get an error about "private method `select' called for
#<Class:0x37519dc>". Is there some reason doing this static query is
"wrong"?
Thanks,
Jeff
> recent = Message.select{|m| m.created_on == Date.today}
>
> But I get an error about "private method `select' called for
> #<Class:0x37519dc>". Is there some reason doing this static query is
> "wrong"?
This should work fine. Did you require the proper AR adapter?
>> require 'ambition/adapters/active_record'
=> []
>>
?> recent = Message.select{|m| m.created_on == Date.today}
=> (Query object: call #to_s or #to_hash to inspect, call an
Enumerable (such as #each or #first) to request data)
>> recent.to_s
=> "SELECT * FROM messages WHERE messages.`created_on` = '2008-02-23'"
- Chris