lib/bulldog/attachment/maybe.rb in bulldog-0.2.1 vs lib/bulldog/attachment/maybe.rb in bulldog-0.2.2
- old
+ new
@@ -10,9 +10,16 @@
@stream = stream
@value = stream && stream.target
@saved = @value.is_a?(SavedFile) || @value.is_a?(MissingFile)
end
+ #
+ # Return a copy of this attachment for the given record.
+ #
+ def copy_for(record)
+ self.class.new(record, name, stream)
+ end
+
attr_reader :record, :name, :stream, :value
#
# Return true if the original file for this attachment has been
# saved.