I
Igor Anic
I have two classes Album and Korisnik (think about that as user),
they are connected with album_korisnik table (I have pluralization
turned off).
Her is the declaration:
class Album < ActiveRecord::Base
...
has_and_belongs_to_many rijatelji, :class_name => 'Korisnik'
...
class Korisnik < ActiveRecord::Base
...
has_and_belongs_to_many :albumi_prijatelja, :class_name => 'Album'
...
I'm trying to add new korisnik to the album, and this is not working:
prijatelji << k
but this line is working ok
k.albumi_prijatelja << self
In the first case i don't get any error in the log, and don't get any
sql commands in transaction.
What I'm doing wrong?
Thanks,
Igor
they are connected with album_korisnik table (I have pluralization
turned off).
Her is the declaration:
class Album < ActiveRecord::Base
...
has_and_belongs_to_many rijatelji, :class_name => 'Korisnik'
...
class Korisnik < ActiveRecord::Base
...
has_and_belongs_to_many :albumi_prijatelja, :class_name => 'Album'
...
I'm trying to add new korisnik to the album, and this is not working:
prijatelji << k
but this line is working ok
k.albumi_prijatelja << self
In the first case i don't get any error in the log, and don't get any
sql commands in transaction.
What I'm doing wrong?
Thanks,
Igor