demarches-normaliennes/app/lib/active_storage/fake_attachment.rb
2024-08-22 09:26:48 +02:00

26 lines
368 B
Ruby

# frozen_string_literal: true
class ActiveStorage::FakeAttachment < Hashie::Dash
property :filename
property :name
property :file
property :id
property :created_at
property :record_type, default: 'Fake'
def download
file.read
end
def read(*args)
file.read(*args)
end
def close
file.close
end
def attached?
true
end
end