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
This makes `select` to behave better based on the kind of the attribute.
When `select` is not overridden, we don't call it anymore.
We check the arity of `select` at the definition step, so there
should be no performance penalty other than calling cost.
Copy file name to clipboardExpand all lines: README.md
+4-1
Original file line number
Diff line number
Diff line change
@@ -840,7 +840,7 @@ To filter attributes, you can use `select` instance method. Using `attributes` i
840
840
841
841
#### Filtering attributes with `select`
842
842
843
-
`select` takes two parameters, the name of an attribute and the value of an attribute. If it returns false that attribute is rejected.
843
+
`select` takes two or three parameters, the name of an attribute, the value of an attribute and the attribute object (`Alba::Association`, for example). If it returns false that attribute is rejected.
844
844
845
845
```ruby
846
846
classFoo
@@ -863,6 +863,9 @@ class RestrictedFooResource < GenericFooResource
0 commit comments