This project is archived and is in readonly mode.
Add find_last_by dynamic finder
-
Chris Lloyd
+1
-
Matt Darby
+1
-
Clemens Kofler
Shouldn't findby be renamed to findfirst_by then? I don't know, perhaps it's just my general dislike of dynamic finders, but I'm kinda -1 on this. Sure, it doesn't do any damage but I don't think it adds real value either.
-
Emilio Tagua
Clemens,
It's not about damage, it's about consistency.
I don't think find_by should be renamed necessarily, i think that it is not bad at all to have a default, as find first is at the moment.
There are 3 finders: first, all and last. And whether you use the 3 of them or not, or if you like using dynamic finders or not, the framework should treat equally and provide this shortcut for the 3 of them.
-
Clemens Kofler
I don't see the point in find(:last) either. After all, it doesn't make a difference if I say find(:first, :order => "something DESC") or find(:last, :order => "something ASC"). I think, just by itself, the naming of :first is the "weird" thing - it should rather be :single or :one.
-
Emilio Tagua
Patch rebased to master.
-
DHH
- State changed from new to committed
