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.