attached 0.0.6 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. data/lib/attached.rb +3 -3
  2. metadata +2 -2
data/lib/attached.rb CHANGED
@@ -104,15 +104,15 @@ module Attached
104
104
 
105
105
  def validates_attached_size(name, options = {})
106
106
 
107
- message = options[:message] || "size must be between :minimum and :maximum bytes"
107
+ message = options[:message] || "size must be between :minimum and :maximum"
108
108
 
109
109
  minimum = options[:minimum] || options[:in] && options[:in].first || (0.0 / 1.0)
110
110
  maximum = options[:maximum] || options[:in] && options[:in].last || (1.0 / 0.0)
111
111
 
112
112
  range = minimum..maximum
113
113
 
114
- message.gsub!(/:minimum/, minimum.to_s)
115
- message.gsub!(/:maximum/, maximum.to_s)
114
+ message.gsub!(/:minimum/, number_to_human_size(minimum))
115
+ message.gsub!(/:maximum/, number_to_human_size(maximum))
116
116
 
117
117
  validates_inclusion_of :"#{name}_size", :in => range, :message => message,
118
118
  :if => options[:if], :unless => options[:unless]
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 6
9
- version: 0.0.6
8
+ - 7
9
+ version: 0.0.7
10
10
  platform: ruby
11
11
  authors:
12
12
  - Kevin Sylvestre