Hi all,

Ruby 1.8.6
Rails 2.1.1

I have a simple association that works fine under 1.2.6 but is failing
under 2.1.1.

require 'active_record'

ActiveRecord::Base.establish_connection(
   :adapter  => 'postgresql',
   :database => 'my_database,
   :username => 'postgres'
)

class Schedule < ActiveRecord::Base
   belongs_to :user
end

class User < ActiveRecord::Base
   has_many :schedules
end

# This works with AR 2.1.1
s = Schedule.find(:first)
p s.user_id
p s.user.cuid

# This does not with AR 2.1.1 => PGError: ERROR:  column "cuid" does
not exist
s = Schedule.find(
   :first,
   :include    => [:user],
   :conditions => ["cuid = ?", "foo"] # Also tried user.cuid
)

What obvious bit am I missing?

Thanks,

Dan
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to