#rubyonrails - Thu 22 Feb 2007 between 00:00 and 00:07



samsmBucWheat: When you have a through=> :associationX there has to also be a has_many :associationX
leehBucWheat: go ahead, I'll try - but it is 4am
BucWheatLeeH, samsm see my pastie http://pastie.caboo.se/42102
i have has_many :clients, through => :appointments
samsmBucWheat: Get what I'm saying?
Where's the has_many :appointments?
BucWheatin appointments i have has_many :clients
leehyou haven't set the relationship the other way
...
BucWheaterr in clients i mean
leehdoctor has_many :appointments
you need that
ziki18hello
leehwith a :through, if you wanna use a nonstandard appointment
sup ziki18
ziki18I gots a problem (go figure)
someoneouttherehi guys
BucWheatLeeH so doctor has_many :appointments, :through => :clients ?
ziki18I emailed all my project files home, even instantrails and radrails directories
leehi would think just "has_many :appointments" would do
BucWheatLeeH then in appointments model do belongs_to :doctor ?
samsmBucWheat: Find a has many through example somewhere and examine how yours is different.
leehyes
if an appointment has a doctor_id column, it does indeed
ziki18and i go to run my app, and open up admin panel, which has before_filter :login_required. When i go to that admin view, i get redirected to account/login/:id.:format, which should actually just be account/login and show a login screen....
Using AAA
samsmBucWheat: I'm a big fan of: http://svn.techno-weenie.net/projects/
BucWheatLeeH yea i have doctor_id in appointments table
someoneouttherecan anyone tell me, if constants can be changed in ruby, then y do we need them?
leehBucWheat: try it, and get back to us
BucWheatLeeH i already put it in :)
leehziki18: don't know mate, mine worked fine, and I just installed A_A_A
BucWheatLeeH so is my controller code proper to pull from apointment table? i did not get any errors this time but that doesn't really mean anything
LeeH let me hack up some view code and i'll get back with you
leehBuc, what you are trying to do should be a HABTM relationship, with the middle table having it's own key, and being it's own associative instance
ziki18LeeH: it works great on my work computer, but bugged up when i went to transfer it
leehI'm trying to find the wiki page where it's discussed
ziki18: rails version mismatch ?
ziki18LeeH: its the same exact files...
BucWheatLeeH HABTM doesn't have primary key. has_many through does though

Page: 2 9 16 23 30 37 44 51 58 65 72 79 86 93 100 107 114 

IrcArchive