Skip to content

Commit 5aaf22c

Browse files
committed
Merge pull request #266 from Garage-mca/feature-attributes-options
Allow passing options to attributes the same way as to attribute
2 parents 4b504b6 + a61f3a6 commit 5aaf22c

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

lib/jsonapi/resource.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,8 +278,9 @@ def routing_resource_options
278278

279279
# Methods used in defining a resource class
280280
def attributes(*attrs)
281+
options = attrs.extract_options!.dup
281282
attrs.each do |attr|
282-
attribute(attr)
283+
attribute(attr, options)
283284
end
284285
end
285286

0 commit comments

Comments
 (0)