4 ms·
that would be called .find(id) - accepts a single argument of an id. This is the canonical way to retrieve by id. find_by_id, find_by_name, etc. aren't really
by mattmcknight 14y ago
that would be called .find(id) - accepts a single argument of an id. This is the canonical way to retrieve by id.
find_by_id, find_by_name, etc. aren't really methods, they trigger calls to method_missing which interprets the code to generate SQL. It's a "neat" feature, but one which I've only used once or twice in 6 years of Rails development.