Forum: Ruby on Rails Re: 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.
Marc.Love (Guest)
on 2005-11-18 19:22
(Received via mailing list)
I'm having the same issue on upgrade from 0.13.1.  Did anyone ever find
a resolution to your problem Peter?

>>> removed_email_address@domain.invalid 11/09/05 04:00AM >>>
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 D.
_______________________________________________
Rails mailing list
removed_email_address@domain.invalid
http://lists.rubyonrails.org/mailman/listinfo/rails
==================DISCLAIMER================================
This email may contain confidential and privileged material for the sole
use of the intended recipient.
Any review or distribution by others is strictly prohibited. If you are
not the intended recipient, please contact the sender and delete all
copies of it from your system.
The sender accepts no responsibility for viruses and it is your
responsibility to scan attachments (if any).
No contracts may be concluded on behalf of the sender by means of email
communications unless expressly stated to the contrary.
==================DISCLAIMER================================
jeremy (Guest)
on 2005-11-18 22:30
(Received via mailing list)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Nov 18, 2005, at 9:19 AM, Marc L. wrote:
> class Project < ActiveRecord::Base
> ...
>   has_many :versions, :order => 'position ASC'
> ...


This is fixed in the next release.

It's hard (perhaps impossible) to get namespacing and autoloading
working together.  We're looking at ways to better-insulate app code.

jeremy
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (Darwin)

iD8DBQFDfjktAQHALep9HFYRAjpKAJ9vcNy4oxqIdKrkmxiqqKwyrGqedgCdG97I
a4a4dhgE35DjWNX2opG1tuw=
=Jm/1
-----END PGP SIGNATURE-----
This topic is locked and can not be replied to.