Commit ce9ee130 by Prem Sichanugrist

Remove dots from validation errors

Closes #133, Closes 288
parent dcdcb83b
...@@ -302,7 +302,7 @@ module Paperclip ...@@ -302,7 +302,7 @@ module Paperclip
min = options[:greater_than] || (options[:in] && options[:in].first) || 0 min = options[:greater_than] || (options[:in] && options[:in].first) || 0
max = options[:less_than] || (options[:in] && options[:in].last) || (1.0/0) max = options[:less_than] || (options[:in] && options[:in].last) || (1.0/0)
range = (min..max) range = (min..max)
message = options[:message] || "file size must be between :min and :max bytes." message = options[:message] || "file size must be between :min and :max bytes"
message = message.call if message.respond_to?(:call) message = message.call if message.respond_to?(:call)
message = message.gsub(/:min/, min.to_s).gsub(/:max/, max.to_s) message = message.gsub(/:min/, min.to_s).gsub(/:max/, max.to_s)
...@@ -328,7 +328,7 @@ module Paperclip ...@@ -328,7 +328,7 @@ module Paperclip
# be run is this lambda or method returns true. # be run is this lambda or method returns true.
# * +unless+: Same as +if+ but validates if lambda or method returns false. # * +unless+: Same as +if+ but validates if lambda or method returns false.
def validates_attachment_presence name, options = {} def validates_attachment_presence name, options = {}
message = options[:message] || "must be set." message = options[:message] || "must be set"
validates_presence_of :"#{name}_file_name", validates_presence_of :"#{name}_file_name",
:message => message, :message => message,
:if => options[:if], :if => options[:if],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment