Method: Paperclip::Interpolations#timestamp

Defined in:
lib/paperclip/interpolations.rb

#timestamp(attachment, style_name) ⇒ Object

Returns the timestamp as defined by the <attachment>_updated_at field in the server default time zone unless :use_global_time_zone is set to false. Note that a Rails.config.time_zone change will still invalidate any path or URL that uses :timestamp. For a time_zone-agnostic timestamp, use #updated_at.



55
56
57
# File 'lib/paperclip/interpolations.rb', line 55

def timestamp attachment, style_name
  attachment.instance_read(:updated_at).in_time_zone(attachment.time_zone).to_s
end