Condition on join table on a has_many :through isn't created


i have a Permissions table with rank_id:integer, group_id:integer and
a key:string
a group model and a rank model.

The group has_many “virtual permissions” through the join table. Each
permission type
is identified by the key in the permissions table with a :condition on
the has_many association.

But when i add a association through the has_many association it
doesn’t create the
permissions entry with the right key. It just puts NULL into the
permissions.key field.

This is my code (the important parts of the models) with a example
which operation fails.

any ideas?

i wonder if this is a bug or a feature.
does anyone know if this behaviour is wanted?
ActiveRecord:Associations has_many tells me:

:conditions - Specify the conditions that the associated object must
meet in order to be included as a WHERE SQL fragment, such as
authorized = 1. ** Record creations from the association are scoped if
a hash is used. has_many :posts, :conditions => {:published => true}
will create published posts with @blog.posts.create or **

this only works for the joined table not for the join table?