Module: RedisModel::Adapters::Paperclip::Override

Defined in:
lib/redis_model/adapters/paperclip.rb

Instance Method Summary collapse

Instance Method Details

#define_paperclip_attributes_for(attachment) ⇒ Object



42
43
44
45
46
47
# File 'lib/redis_model/adapters/paperclip.rb', line 42

def define_paperclip_attributes_for(attachment)
  redis_model_attribute :"#{attachment}_file_name", :string
  redis_model_attribute :"#{attachment}_file_size", :integer
  redis_model_attribute :"#{attachment}_content_type", :string
  redis_model_attribute :"#{attachment}_updated_at", :timestamp
end

#has_attached_file(*args) ⇒ Object



36
37
38
39
40
# File 'lib/redis_model/adapters/paperclip.rb', line 36

def has_attached_file(*args)
  define_paperclip_attributes_for(args.first)

  super(*args)
end