Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/attachinary/orm/file_mixin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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?
Expand Down