has-attached 0.1.9 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.9
1
+ 0.2.2
data/has-attached.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "has-attached"
8
- s.version = "0.1.9"
8
+ s.version = "0.2.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["mcasimir"]
12
- s.date = "2012-08-22"
12
+ s.date = "2012-08-30"
13
13
  s.description = "ActiveRecordSchema attachments with Paperclip"
14
14
  s.email = "maurizio.cas@gmail.com"
15
15
  s.extra_rdoc_files = [
data/lib/has-attached.rb CHANGED
@@ -31,7 +31,7 @@ module HasAttached
31
31
  module ClassMethods
32
32
 
33
33
  def has_attached(name, options = {})
34
-
34
+
35
35
  options[:url] ||= "/attachments/:class/:id/:attachment/:style/:basename.:extension"
36
36
  options[:path] ||= ":rails_root/public/attachments/:class/:id/:attachment/:style/:basename.:extension"
37
37
 
@@ -60,6 +60,18 @@ module HasAttached
60
60
  false
61
61
  end
62
62
  end
63
+
64
+ attr_accessor :"#{name}_delete"
65
+
66
+ define_method :"#{name}_delete" do
67
+ false
68
+ end
69
+
70
+ define_method :"#{name}_delete=" do |val|
71
+ if val == "1"
72
+ send(name).clear
73
+ end
74
+ end
63
75
 
64
76
  end
65
77
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: has-attached
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.2.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-08-22 00:00:00.000000000 Z
12
+ date: 2012-08-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -122,7 +122,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
122
122
  version: '0'
123
123
  segments:
124
124
  - 0
125
- hash: 1127631206043382591
125
+ hash: 1513372807718818819
126
126
  required_rubygems_version: !ruby/object:Gem::Requirement
127
127
  none: false
128
128
  requirements: