This project is archived and is in readonly mode.
Anonymous extension modules for all associations
-
tsailipu
+1 here.
It took me quite some time to find out what is happening and track down why there is such inconsistency between belongs_to and, say, has_many, proxy extension design. It’s quite annoying (and quite abstraction- and documentation-defeating) that one has to look this deep into the source code to see what’s going on....
Thanks for the patch!
-
Antonio Salazar Cardozo
+1
Seems like unifying the API here is a Good Thing (tm).
-
Michael Schuerig
+1
I just found this ticket while researching why the anonymous extension didn't work as I was expecting.
-
Michael Schuerig
I have a has_one :through association through an ordinary has_many association. If the has_one :through does not match any object, either because there aren't any or they don't match its condition, the extension method is not called on a proxy, but on nil.
I haven't applied the patch yet, but I'd expect to see the same behavior for
posts(:welcome).last_tag.what_are_youif there are no tags at all. -
Claudio Poli
Any news about this?
-
rails
- State changed from new to open
This issue has been automatically marked as stale because it has not been commented on for at least three months.
The resources of the Rails core team are limited, and so we are asking for your help. If you can still reproduce this error on the 3-0-stable branch or on master, please reply with all of the information you have about it and add "[state:open]" to your comment. This will reopen the ticket for review. Likewise, if you feel that this is a very important feature for Rails to include, please reply with your explanation so we can consider it.
Thank you for all your contributions, and we hope you will understand this step to focus our efforts where they are most helpful.
-
rails
- State changed from open to stale
