#199 new
Allan Cochrane

Models derived from subclass of AR fail

Reported by Allan Cochrane | March 7th, 2008 @ 03:20 AM

Given:

class ResultBaseClass < ActiveRecord::Base
end

class SysvalResult < ResultBaseClass
end

class SysvalResultAR < ActiveRecord::Base
end

then I get:

>> 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 `<<' </p><p> from /usr/lib/ruby/gems/1.8/gems/ambition-0.5.2/lib/ambition/api.rb:13:in `select'

from (irb):2

>> SysvalResultAR.select{|z| z.name == "fred"}

=> Query object: call

It seems that the derivation from a base class breaks ambition.

The db is sqlite3 but it also fails for mysql.

Gems:

*** LOCAL GEMS ***

abstract (1.0.0)

actionmailer (2.0.2)

actionpack (2.0.2)

activerecord (2.0.2)

activeresource (2.0.2)

activesupport (2.0.2)

ambition (0.5.2)

ambitious-activerecord (0.1.1)

ar-extensions (0.7.0)

cgi_multipart_eof_fix (2.5.0)

daemons (1.0.9)

datamapper (0.2.5)

erubis (2.5.0)

fastercsv (1.2.3)

fastthread (1.0.1)

flexmock (0.8.0)

gem_plugin (0.2.3)

googlecharts (1.1.0)

gruff (0.2.9)

highline (1.4.0)

hoe (1.5.1, 1.5.0)

hpricot (0.6)

mocha (0.5.6)

mongrel (1.1.4, 1.1.3)

mongrel_cluster (1.0.5)

needle (1.3.0)

net-sftp (1.1.1, 1.1.0)

net-ssh (1.1.2)

open4 (0.9.6)

ParseTree (2.1.1, 2.0.1)

railroad (0.4.0)

rails (2.0.2)

rake (0.8.1)

rcov (0.8.1.2.0)

RedCloth (3.0.4)

rspec (1.1.3)

rubigen (1.2.4, 1.2.3, 1.2.0, 1.1.1)

ruby-net-ldap (0.0.4)

ruby-treemap (0.0.2)

ruby2ruby (1.1.8, 1.1.7)

rubyforge (0.4.4)

rubygems-update (1.0.1)

RubyInline (3.6.6)

sources (0.0.1)

sparklines (0.5.0)

sparklines_generator (0.2.2)

test-spec (0.4.0)

tidy (1.1.2)

wirble (0.1.2)

wxruby (1.9.4)

ZenTest (3.9.1)

I have patched the ambition.gemspec file so that the dependencies are:

  s.add_dependency(%q<ParseTree>, ["= 2.1.1"])
  s.add_dependency(%q<ruby2ruby>, ["= 1.1.7"])
  s.add_dependency(%q<rubigen>, ["= 1.1.1"])

in response to a Google groups post that suggested that the ParseTree version was the problem - but it doesn't help

Really hoping you can sort this one out, I like the look of ambition but this is a real show-stopper for me.

Allan

No comments found

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Shared Ticket Bins

People watching this ticket

Tags

Pages