You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 19, 2021. It is now read-only.
For an active record object with a field/column named 'method', horza returned
ArgumentError: wrong number of arguments (0 for 1)
from (irb):25:in `method'
Perhaps this should be documented?
The text was updated successfully, but these errors were encountered:
The problem here is that method is both a field name and a method inherited. Horza just sends the method to the AR object, so it's clearly defaulting to the method rather than the field name.
You should not define any method/A.R attribute as "method" unless you intend to override the default implementation, as it could lead to unexpected behaviour.
Regarding documenting it there are two points:
Documenting methods the are available on on every object (as is the method named "method"), doesn't make sense and but rather relies on your understanding of Ruby. It's analogous to you saying don't call a column name "puts".
The Rails documentation already has something on best practice for naming of fields/columns that maybe are not as obvious as the example above.
For an active record object with a field/column named 'method', horza returned
ArgumentError: wrong number of arguments (0 for 1)
from (irb):25:in `method'
Perhaps this should be documented?
The text was updated successfully, but these errors were encountered: