4 ms·
Do you have an example of such code that does something off label or tricky to intuit?
by weaksauce 5y ago
Do you have an example of such code that does something off label or tricky to intuit?
- zrail 5y agoActive record hooks. Observers especially are a spooky action at a distance factory.
- thih9 5y agoAltering expected framework functionality. E.g. a custom getter method for an ActiveRecord attribute. Technically this isn't a Rails-only thing; but since Rails relies so much on convention, there are many opportunities to break it (and possibly bring suffering to other devs).
- emodendroket 5y agoBesides the other examples already given, monkey patching is another offender, as are proxy tricks with methods like send or respond_to (technically not Rails-specific but I associate this style with Rails).