attached 0.2.9 → 0.3.0

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.
data/README.rdoc CHANGED
@@ -4,7 +4,7 @@ Attached is a Ruby on Rails file attachment tool that lets users upload to the c
4
4
 
5
5
  == Requirements
6
6
 
7
- The gem has only been tested with Ruby 1.9.2 and Rails 3.0.3 but may well work with other versions of Ruby and Rails.
7
+ The gem is tested with Ruby 1.9.2 and Rails 3.0.5 but may well work with other versions of Ruby and Rails.
8
8
 
9
9
  == Installation
10
10
 
data/lib/attached.rb CHANGED
@@ -149,10 +149,12 @@ module Attached
149
149
  def validates_attached_extension(name, options = {})
150
150
 
151
151
  message = options[:message]
152
- message ||= "extension must be specified"
152
+ message ||= "extension is not valid"
153
153
 
154
- range = options[:in].map { |element| /element/ }
154
+ range = options[:in].map { |element| ".#{element}" }
155
155
 
156
+ validates_inclusion_of :"#{name}_extension", :message => message,
157
+ :if => options[:if], :unless => options[:unless]
156
158
  end
157
159
 
158
160
 
@@ -169,7 +171,8 @@ module Attached
169
171
 
170
172
  def validates_attached_presence(name, options = {})
171
173
 
172
- message = options[:message] || "must be attached"
174
+ message = options[:message]
175
+ message ||= "must be attached"
173
176
 
174
177
  validates_presence_of :"#{name}_identifier", :message => message,
175
178
  :if => options[:if], :unless => options[:unless]
@@ -1,3 +1,3 @@
1
1
  module Attached
2
- VERSION = "0.2.9"
2
+ VERSION = "0.3.0"
3
3
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: attached
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.2.9
5
+ version: 0.3.0
6
6
  platform: ruby
7
7
  authors:
8
8
  - Kevin Sylvestre
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-03-01 00:00:00 -05:00
13
+ date: 2011-03-03 00:00:00 -05:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -90,7 +90,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
90
90
  requirements: []
91
91
 
92
92
  rubyforge_project:
93
- rubygems_version: 1.5.3
93
+ rubygems_version: 1.6.0
94
94
  signing_key:
95
95
  specification_version: 3
96
96
  summary: An attachment library designed with cloud processors in mind