Forum: Ruby on Rails Rails-0.14.3 Error?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
67b6389be42524fbd776e44fd35c3d7e?d=identicon&s=25 peter.j.donald (Guest)
on 2005-11-12 12:49
(Received via mailing list)
Hi,

I upgraded to 0.14.3 from 0.14.2 and started receiving an error for
the following code;

class Project < ActiveRecord::Base
...
  has_many :versions, :order => 'position ASC'
...
  def unarchived_versions
    versions.select {|v| ! v.archived }
  end
...

The error is the following

undefined method `sanitize_sql' for ActiveRecord::Version:Module

c:/applications/ruby/lib/ruby/gems/1.8/gems/activerecord-1.13.0/lib/active_record/associations/association_proxy.rb:64:in
`send'
c:/applications/ruby/lib/ruby/gems/1.8/gems/activerecord-1.13.0/lib/active_record/associations/association_proxy.rb:64:in
`sanitize_sql'
c:/applications/ruby/lib/ruby/gems/1.8/gems/activerecord-1.13.0/lib/active_record/associations/has_many_association.rb:6:in
`initialize'
c:/applications/ruby/lib/ruby/gems/1.8/gems/activerecord-1.13.0/lib/active_record/associations.rb:735:in
`new'
c:/applications/ruby/lib/ruby/gems/1.8/gems/activerecord-1.13.0/lib/active_record/associations.rb:735:in
`issue_versions'
c:/applications/ruby/lib/ruby/gems/1.8/gems/activerecord-1.13.0/lib/active_record/associations.rb:731:in
`issue_versions'
#{RAILS_ROOT}/app/models/project.rb:13:in `unarchived_versions'

I am not sure whether it is something I am doing wrong or not. Version
may be new to 0.14.3 (Added on 10/09/05 21:15:45) so it may be that
there is some sort of name collision.

My question is whether this is the case and if it is - is there anyway
to insulate ourselves from changes to the core of rails or do we just
change everytime a new release comes out. It seems fairly problematic
if generic names like "Version" stop being able to be used as model
names.

Cheers,

Peter Donald
6edd67c92a1dab5eb23fed79f3c18564?d=identicon&s=25 david.heinemeier (Guest)
on 2005-11-12 12:49
(Received via mailing list)
> I upgraded to 0.14.3 from 0.14.2 and started receiving an error for
> the following code;
>
> class Project < ActiveRecord::Base

Please do post bug reports like this as a ticket on dev.rubyonrails.org.
Thanks!
--
David Heinemeier Hansson
http://www.loudthinking.com -- Broadcasting Brain
http://www.basecamphq.com   -- Online project management
http://www.backpackit.com   -- Personal information manager
http://www.rubyonrails.com  -- Web-application framework
This topic is locked and can not be replied to.