From: Michael Schuerig Date: 2009-05-16T04:55:04+09:00 Subject: Re: obj.attr(qualifier) = value -- possible? Joel VanderWerf wrote: > I'm pretty sure that's impossible -- there is no #() method, or #()=. > But there is #[]=, and you can adapt your Proxy approach to use it: That's a good suggestion, but unfortunately, it doesn't fit in my case. I'm trying to do this stuff in an extension module for a Rails has_many :through association. It looks roughly like this class Role < ActiveRecord::Base validates_presence_of :type # actor, director, ... end class Movie < ActiveRecord::Base has_many :roles has_many :participants, :through => :roles do def as(role) self.scoped(...) # joins and conditions omitted end end end This allows me to write code like movie.participants.as('actor') On top of that, I'd like to be able to write movie.participants.as('actor') = params[:movie][:actors] and that's where I'm stuck. Michael -- Michael Schuerig mailto:michael@schuerig.de http://www.schuerig.de/michael/