@@ -1472,6 +1472,12 @@ def dup
14721472 # is Json for the final object as it looked after the \save (which would include attributes like +created_at+
14731473 # that weren't part of the original submit).
14741474 #
1475+ # With <tt>save</tt> validations run by default. If any of them fail
1476+ # ActiveResource::ResourceInvalid gets raised, and nothing is POSTed to
1477+ # the remote system. To skip validations, pass <tt>validate: false</tt>. To
1478+ # validate withing a custom context, pass the <tt>:context</tt> option.
1479+ # See ActiveResource::Validations for more information.
1480+ #
14751481 # There's a series of callbacks associated with <tt>save</tt>. If any
14761482 # of the <tt>before_*</tt> callbacks throw +:abort+ the action is
14771483 # cancelled and <tt>save</tt> raises ActiveResource::ResourceInvalid.
@@ -1484,7 +1490,7 @@ def dup
14841490 # my_company.new? # => false
14851491 # my_company.size = 10
14861492 # my_company.save # sends PUT /companies/1 (update)
1487- def save
1493+ def save ( ** options )
14881494 run_callbacks :save do
14891495 new? ? create : _update
14901496 end
@@ -1495,16 +1501,17 @@ def save
14951501 # If the resource is new, it is created via +POST+, otherwise the
14961502 # existing resource is updated via +PUT+.
14971503 #
1498- # With <tt>save!</tt> validations always run. If any of them fail
1504+ # With <tt>save!</tt> validations run by default . If any of them fail
14991505 # ActiveResource::ResourceInvalid gets raised, and nothing is POSTed to
1500- # the remote system.
1506+ # the remote system. To skip validations, pass <tt>validate: false</tt>. To
1507+ # validate withing a custom context, pass the <tt>:context</tt> option.
15011508 # See ActiveResource::Validations for more information.
15021509 #
15031510 # There's a series of callbacks associated with <tt>save!</tt>. If any
15041511 # of the <tt>before_*</tt> callbacks throw +:abort+ the action is
15051512 # cancelled and <tt>save!</tt> raises ActiveResource::ResourceInvalid.
1506- def save!
1507- save || raise ( ResourceInvalid . new ( nil , self ) )
1513+ def save! ( ** options )
1514+ save ( ** options ) || raise ( ResourceInvalid . new ( nil , self ) )
15081515 end
15091516
15101517 ##
0 commit comments