Skip to content

Commit a61f3a6

Browse files
committed
Allow passing options to attributes the same way as to attribute
1 parent 4b504b6 commit a61f3a6

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)