Permalink
Browse files

created_at field may be a Time object again

  • Loading branch information...
1 parent 721fccc commit be3be3c6b1c8ed7769ef1251eb24a4d5ce716690 @johnny committed Mar 5, 2012
Showing with 1 addition and 0 deletions.
  1. +1 −0 lib/dm-paperclip/attachment.rb
@@ -413,6 +413,7 @@ def flush_errors #:nodoc:
end
def seconds_since_unix_epoch(date)
+ return date.to_i if date.respond_to?(:to_i)
seconds_per_day = 86_400
((date - ::DateTime.civil(1970)) * seconds_per_day).to_i
end

0 comments on commit be3be3c

Please sign in to comment.