Class: Sibu::Image

Inherits:
ApplicationRecord show all
Extended by:
UserConcern
Defined in:
app/models/sibu/image.rb

Class Method Summary collapse

Methods included from UserConcern

for_user, shared

Class Method Details

.emptyObject



10
11
12
13
14
15
16
17
# File 'app/models/sibu/image.rb', line 10

def self.empty
  empty_img = where("metadata ILIKE '%default_empty_image%'").first
  if empty_img.nil?
    empty_img = new(reference: 'default_empty_image', file: File.new('app/assets/images/empty.png'))
    empty_img.save
  end
  empty_img
end