I am making a plugin which extends ActiveRecord::Base
I have the plugin working in my models in other aspects. I would like
to pass in some data to the plugin, but I can’t get the data I would
like.
so if I have:
class Stuff < ActiveRecord::Base
belongs_to :thing
my_plugin :id => self.thing.other_id
end
it chokes on figuring out what to do with self.thing.other_id.
I checked, and self isn’t recognized at the point that I am calling
my_plugin
so if i do :
class Stuff < ActiveRecord::Base
belongs_to :thing
my_plugin :id => self.class.to_s
end
when I print out :id the class result comes back as blank.
Is there a way to do this?
The closest I can get is I can sort of do self.send(:thing).send
(:other_id)
It didn’t 100% work, but it was starting to get clunky, and I didn’t
pursue the error I was creating.
There has to be something obvious I am missing.
thanks,
Charles