Models derived from ActiveRecord don't work

0 views
Skip to first unread message

Allan

unread,
Mar 7, 2008, 6:42:36 AM3/7/08
to ambition.rb
Hi,

given models:

class ResultBaseClass < ActiveRecord::Base
end

class SysvalResult < ResultBaseClass
end

class SysvalResultAR < ActiveRecord::Base
end

then I get this for the class not derived directly from ActiveRecord:

>> SysvalResult.select{|z| z.name == "fred"}
ArgumentError: wrong number of arguments (2 for 1)
from /usr/lib/ruby/gems/1.8/gems/ambition-0.5.2/lib/ambition/
processors/select.rb:27:in `=='
from /usr/lib/ruby/gems/1.8/gems/ambition-0.5.2/lib/ambition/
processors/select.rb:27:in `send'
from /usr/lib/ruby/gems/1.8/gems/ambition-0.5.2/lib/ambition/
processors/select.rb:27:in `process_call'
from /usr/lib/ruby/gems/1.8/gems/ambition-0.5.2/lib/ambition/
processors/base.rb:74:in `send'
from /usr/lib/ruby/gems/1.8/gems/ambition-0.5.2/lib/ambition/
processors/base.rb:74:in `process'
from /usr/lib/ruby/gems/1.8/gems/ambition-0.5.2/lib/ambition/
processors/base.rb:9:in `process_proc'
from /usr/lib/ruby/gems/1.8/gems/ambition-0.5.2/lib/ambition/
processors/base.rb:74:in `send'
from /usr/lib/ruby/gems/1.8/gems/ambition-0.5.2/lib/ambition/
processors/base.rb:74:in `process'
from /usr/lib/ruby/gems/1.8/gems/ambition-0.5.2/lib/ambition/
processors/base.rb:85:in `to_s'
from /usr/lib/ruby/gems/1.8/gems/ambition-0.5.2/lib/ambition/
context.rb:45:in `<<'
from /usr/lib/ruby/gems/1.8/gems/ambition-0.5.2/lib/ambition/
api.rb:13:in `select'
from (irb):2

But it works for the class derived directly from ActiveRecord

>> SysvalResultAR.select{|z| z.name == "fred"}
=> Query object: call


I have opened a bug for this.

Allan

Allan

unread,
Mar 26, 2008, 11:04:33 AM3/26/08
to ambition.rb
*bump*

Chris Wanstrath

unread,
May 2, 2008, 2:19:43 PM5/2/08
to ambit...@googlegroups.com
Try the most recent versions in GitHub:
http://github.com/defunkt/ambition/tree/master

On Wed, Mar 26, 2008 at 8:04 AM, Allan <Allan.C...@gmail.com> wrote:
>
> *bump*
>
>
> >
>

--
Chris Wanstrath
http://github.com/defunkt

Reply all
Reply to author
Forward
0 new messages