Re:How to Build a Web App with and Without Rails Libraries
by flippinburgers on Wednesday March 31, 2021 @07:23AM
(#26645856)
Yes and it makes moving through any non-trivial rails codebase a total drag.
Re:How to Build a Web App with and Without Rails Libraries
by blacktriangle on Wednesday March 31, 2021 @02:02PM
(#26650714)
In fairness they've been moving away from a lot of those methods. For example the whole find_by_<attr_name> dynamic methods have been replaced with find_by(attr_name: value).
And while you can't find the method code itself, for example the generated code to access a has_many relationship, you can pretty easily find the meta programming that will generate it by following the class method name.
Re:How to Build a Web App with and Without Rails Libraries
by pantulis on Wednesday March 31, 2021 @07:13AM
(#26645785)
Yes, but it just implies that you cannot rely on grepping the source code. You know the relevant "method_missing" implementation is somewhere, and you can make an educated guess as where to look for it.
Re:How to Build a Web App with and Without Rails Libraries
by chrisseaton on Wednesday March 31, 2021 @07:21AM
(#26645838)
I think I’m pretty well informed about Ruby metaprogramming but I still really struggle to read through the magic sometimes. I can appreciate it’s somewhat impenetrable to beginners.
Re:How to Build a Web App with and Without Rails Libraries
by toomanybeersies on Wednesday March 31, 2021 @11:47AM
(#26648744)
Yea, but the documentation of said metaprogramming is generally quite comprehensive (with some exceptions).
Doesn't Rail's use of metaprogramming mean that often there isn't a simple static implementation of a method in the source code that you can go and find?