sga_paperclippolymorph 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/sga/acts_as_polymorphic_paperclip.rb +8 -1
- data/sga_paperclippolymorph.gemspec +2 -2
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.3
|
@@ -18,9 +18,11 @@ module LocusFocus
|
|
18
18
|
:counter_cache => options[:counter_cache],
|
19
19
|
:styles => options[:styles]
|
20
20
|
})
|
21
|
+
|
21
22
|
class_inheritable_reader :acts_as_polymorphic_paperclip_options
|
22
23
|
|
23
24
|
has_many :attachings, :as => :attachable, :dependent => :destroy
|
25
|
+
|
24
26
|
has_many :assets, :through => :attachings do
|
25
27
|
def attach(asset_id)
|
26
28
|
asset_id = extract_id(asset_id)
|
@@ -65,6 +67,10 @@ module LocusFocus
|
|
65
67
|
|
66
68
|
include LocusFocus::Acts::PolymorphicPaperclip::ExtentionMethods if options[:with_extention]
|
67
69
|
|
70
|
+
write_inheritable_attribute(:wuid_host, options[:wuid_host]) if options[:wuid_host]
|
71
|
+
|
72
|
+
class_inheritable_reader :wuid_host
|
73
|
+
|
68
74
|
end
|
69
75
|
|
70
76
|
end
|
@@ -80,7 +86,8 @@ module LocusFocus
|
|
80
86
|
def asset_path create_dir=false
|
81
87
|
assets_dir = File.join RAILS_ROOT, 'public', 'system', 'assets'
|
82
88
|
(FileUtils.mkdir_p assets_dir unless File.exists?(assets_dir)) if create_dir
|
83
|
-
|
89
|
+
sgf_file = "#{wuid_host ? self.send(wuid_host).wid : self.wid}.sgf"
|
90
|
+
File.join assets_dir, sgf_file
|
84
91
|
end
|
85
92
|
|
86
93
|
end
|
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{sga_paperclippolymorph}
|
8
|
-
s.version = "0.2.
|
8
|
+
s.version = "0.2.3"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["tim.teng"]
|
12
|
-
s.date = %q{2010-
|
12
|
+
s.date = %q{2010-09-23}
|
13
13
|
s.description = %q{gem version of paperclippolymorph for sga company}
|
14
14
|
s.email = %q{tim.rubist@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 2
|
8
|
-
-
|
9
|
-
version: 0.2.
|
8
|
+
- 3
|
9
|
+
version: 0.2.3
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- tim.teng
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-
|
17
|
+
date: 2010-09-23 00:00:00 +08:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|