polypaperclip 0.1.1 → 0.1.2
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/VERSION +1 -1
- data/lib/polypaperclip/attachment.rb +1 -1
- data/polypaperclip.gemspec +2 -2
- data/spec/page_spec.rb +8 -1
- metadata +4 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.2
|
@@ -21,7 +21,7 @@ module Polypaperclip
|
|
21
21
|
protected
|
22
22
|
def build_instance
|
23
23
|
@instance ||= @poly_instance.send("build_#{@poly_name}_attachment")
|
24
|
-
@instance.attachment_type =
|
24
|
+
@instance.attachment_type = @poly_name.to_s
|
25
25
|
@instance.attachable = @poly_instance
|
26
26
|
@instance
|
27
27
|
end
|
data/polypaperclip.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{polypaperclip}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Dan Pickett"]
|
12
|
-
s.date = %q{2011-06-
|
12
|
+
s.date = %q{2011-06-07}
|
13
13
|
s.description = %q{hacks paperclip to have a single repo of attachments}
|
14
14
|
s.email = %q{dpickett@enlightsolutions.com}
|
15
15
|
s.extra_rdoc_files = [
|
data/spec/page_spec.rb
CHANGED
@@ -43,7 +43,7 @@ describe "Page" do
|
|
43
43
|
subject.primary_image_attachment.attachment_updated_at.should_not be_nil
|
44
44
|
end
|
45
45
|
|
46
|
-
it "
|
46
|
+
it "sets the appropriate id for the image" do
|
47
47
|
attach_primary_image
|
48
48
|
subject.save!
|
49
49
|
subject.primary_image_attachment.id.should_not be_nil
|
@@ -51,6 +51,13 @@ describe "Page" do
|
|
51
51
|
subject.primary_image.path.should =~ /#{subject.primary_image_attachment.id}/
|
52
52
|
end
|
53
53
|
|
54
|
+
it "sets primary_image for the attachment_type" do
|
55
|
+
attach_primary_image
|
56
|
+
subject.save!
|
57
|
+
subject.primary_image.url.should_not be_nil
|
58
|
+
subject.primary_image_attachment.attachment_type.should eql("primary_image")
|
59
|
+
end
|
60
|
+
|
54
61
|
PRIMARY_IMAGE_PATH = File.dirname(__FILE__) + "/fixtures/rails.png"
|
55
62
|
def attach_primary_image
|
56
63
|
subject.primary_image = File.open(PRIMARY_IMAGE_PATH)
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: polypaperclip
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 31
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 2
|
10
|
+
version: 0.1.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Dan Pickett
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-06-
|
18
|
+
date: 2011-06-07 00:00:00 -04:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|