Displaying 4 results from an estimated 4 matches for "disc_jockey".
Did you mean:
disc_jockeys
2006 Jan 29
9
Specify options with habtm
Hi all
I have the following models:
class member
has_and_belongs_to_many :disc_jockeys
end
class disc_jockey
has_and_belongs_to_many :members
end
The relation table is called disc_jockeys_members and has the following
fields:
disc_jockeys_members(disc_jockey_id, member_id, status)
So far, the field status can have values like valid, invalid, locked
etc., but it is not regard...
2006 Jan 31
2
Habtm: I can create the same relation more than 1x!
Hi all
I have a DiscJockey and a Member model, each of them reference each
other using habtm.
josh $ script/server
>> m=Member.find 1
>> dj=DiscJockey.find 1
>> m.disc_jockeys << dj
>> m.disc_jockeys << dj
>> m.disc_jockeys << dj
Now I have 3 relations in the DB! Is this normal? Shouldn''t there an
error occur, that I can only add the object a single time?
If it IS normal - how can I prevent it from adding it more than once?
Than...
2006 Feb 01
0
habtm and counter (xxx_count field in DB)
Hi all
I have the following models:
class Member < ActiveRecord::Base
# DJ Profiles the member is part of
has_and_belongs_to_many :disc_jockeys,
:join_table => ''members_are_disc_jockeys'',
:uniq => true
end
class DiscJockey < ActiveRecord::Base
# Members that are part of this DJ profile
has_and_belongs_to_many :members,
:join_table...
2006 Jan 31
2
How can I overwrite the parent.children.push(child) Method?
Hi all
I want to overwrite the push method (which is an alias of <<, the same
as concat) of collections, and there I want to test if :uniq is set to
true in the relationship. If so, the method should check if the passed
object is already related to the parent, or not (only then it will be
added).
But I just can''t find the original code of this method, so I could
overwrite