sequel_paperclip 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/sequel_paperclip/interpolations.rb +1 -1
- data/lib/sequel_paperclip.rb +16 -1
- data/sequel_paperclip.gemspec +1 -1
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.2.0
|
data/lib/sequel_paperclip.rb
CHANGED
@@ -36,7 +36,7 @@ module Sequel
|
|
36
36
|
filename = send("#{name}_filename")
|
37
37
|
filename ? File.basename(filename) : nil
|
38
38
|
end
|
39
|
-
|
39
|
+
|
40
40
|
define_method("#{name}_basename=") do |basename|
|
41
41
|
if basename
|
42
42
|
old_filename = send("#{name}_filename")
|
@@ -46,6 +46,21 @@ module Sequel
|
|
46
46
|
send("#{name}_filename=", nil)
|
47
47
|
end
|
48
48
|
end
|
49
|
+
|
50
|
+
define_method("#{name}_extname") do
|
51
|
+
filename = send("#{name}_filename")
|
52
|
+
filename ? File.extname(filename) : nil
|
53
|
+
end
|
54
|
+
|
55
|
+
define_method("#{name}_extname=") do |extname|
|
56
|
+
if extname
|
57
|
+
old_filename = send("#{name}_filename")
|
58
|
+
basename = old_filename ? File.basename(old_filename) : ""
|
59
|
+
send("#{name}_filename=", basename+extname)
|
60
|
+
else
|
61
|
+
send("#{name}_filename=", nil)
|
62
|
+
end
|
63
|
+
end
|
49
64
|
end
|
50
65
|
|
51
66
|
define_method("#{name}=") do |value|
|
data/sequel_paperclip.gemspec
CHANGED