diff options
Diffstat (limited to 'activestorage/lib')
-rw-r--r-- | activestorage/lib/active_storage/attached/one.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/activestorage/lib/active_storage/attached/one.rb b/activestorage/lib/active_storage/attached/one.rb index 0244232b2c..98477547c3 100644 --- a/activestorage/lib/active_storage/attached/one.rb +++ b/activestorage/lib/active_storage/attached/one.rb @@ -13,6 +13,10 @@ module ActiveStorage record.public_send("#{name}_attachment") end + def blank? + attachment.blank? + end + # Associates a given attachment with the current record, saving it to the database. # # person.avatar.attach(params[:avatar]) # ActionDispatch::Http::UploadedFile object |