lib/attachs/storages/base.rb in attachs-0.4.0 vs lib/attachs/storages/base.rb in attachs-0.4.1

- old
+ new

@@ -8,16 +8,12 @@ protected attr_reader :attachment - def resize(*args) - Attachs::Tools::Magick.resize(*args) - end - def template - @template = begin + @template ||= begin if attachment.exists? (attachment.options[:path] || Attachs.config.default_path).dup else attachment.options[:default_path].dup end.tap do |path| @@ -50,16 +46,16 @@ when :extension attachment.extension when :type attachment.content_type.split('/').first.parameterize when :timestamp - (attachment.updated_at.to_f * 10000000000).to_i + attachment.updated_at.to_i when :class attachment.record.class.name.parameterize when :id attachment.record.id - when :param - attachment.record.to_param + when :attribute + attachment.attribute.to_s.parameterize end.to_s end end end