lib/scrivito/basic_obj.rb in scrivito_sdk-1.0.0.rc1 vs lib/scrivito/basic_obj.rb in scrivito_sdk-1.0.0.rc2
- old
+ new
@@ -388,12 +388,13 @@
# blog_post = Obj.find_by_path('/blog/first_post')
# blog_post.copy(_path: '/blog/second_post')
def copy(options={})
options = options.stringify_keys.assert_valid_keys('_path', '_id', '_permalink')
attributes_for_copy = self.class.with_default_id_attribute(copyable_attributes)
+ attributes_for_copy = attributes_for_copy.with_indifferent_access.merge(options)
attributes_for_copy = copy_binaries(attributes_for_copy)
- json = workspace.api_request(:post, '/objs', obj: attributes_for_copy.merge(options))
+ json = workspace.api_request(:post, '/objs', obj: attributes_for_copy)
self.class.find(json['_id'])
end
# Destroys the {Scrivito::BasicObj Obj} in the current {Scrivito::Workspace}.
# @api public