From 2c7d0b644310fbc6db2ea57df7ce5950a73208c4 Mon Sep 17 00:00:00 2001 From: Alex Wheeler Date: Wed, 19 Oct 2016 14:22:03 -0400 Subject: [PATCH] default FileMixin#as_json options argument to nil * active_support expects a method that optionally accepts options --- lib/attachinary/orm/file_mixin.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/attachinary/orm/file_mixin.rb b/lib/attachinary/orm/file_mixin.rb index e7628a37..6c68467f 100644 --- a/lib/attachinary/orm/file_mixin.rb +++ b/lib/attachinary/orm/file_mixin.rb @@ -9,7 +9,7 @@ def self.included(base) base.after_create :remove_temporary_tag end - def as_json(options) + def as_json(options = nil) super(only: [:id, :public_id, :format, :version, :resource_type], methods: [:path]) end @@ -26,12 +26,12 @@ def fullpath(options={}) format = options.delete(:format) Cloudinary::Utils.cloudinary_url(path(format), options.reverse_merge(:resource_type => resource_type)) end - + protected def keep_remote? Cloudinary.config.attachinary_keep_remote == true end - + private def destroy_file Cloudinary::Uploader.destroy(public_id) if public_id && !keep_remote?