Displaying 2 results from an estimated 2 matches for "attachment_typ".
Did you mean:
attachment_type
2006 Feb 15
2
Polymorphic joins work one way, but not the other
...rtions, 0 failures, 1 errors
(path replaced with RAILS_ROOT since I''m secretive like that)
In other words - I can do stuff like @task.events << @event but NOT
@event.task = @task ! (or indeed @event.task.* ) @tasks.events <<
definitely works - I even checked the db and the attachment_type/id
fields are set exactly as expected.
It kind of makes sense - since I never actually mention :tasks anywhere
in Event''s model definition. But how exactly do I mention it?
I looked over the example in the wiki but it doesn''t seem to touch on
this problem at all (and it kind...
2008 May 28
1
Attachment_fu, polymorphism and customization
Hi,
I got Image model that has_attachment and belongs_to 2 other models
via polymorphic association.
The problem is that I''d like to customize has_attachment options
(resize image) depending on which model the Image is related to - i.e.
if Image belongs to Article it should be resized using different
settings than if it belongs to Header.
Is there a smart way to do it or do I have to