lib/active_model/form/attributes.rb in activemodel-form-0.0.3 vs lib/active_model/form/attributes.rb in activemodel-form-1.0.0
- old
+ new
@@ -101,7 +101,22 @@
def self.number?
false
end
end
+
+ module FileAttribute
+ def self.parse(v)
+ raise "Couldn't parse file attribute value: '#{v}'" unless v.is_a?(ActionDispatch::Http::UploadedFile)
+ v
+ end
+
+ def self.type
+ :file
+ end
+
+ def self.number?
+ false
+ end
+ end
end
end