poodle-rb 0.0.3 → 0.0.4
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.
- checksums.yaml +4 -4
- data/app/helpers/poodle/image_helper.rb +0 -25
- data/lib/poodle/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ad966d80727051aa1ec66cda0512b8ff140a4885
|
|
4
|
+
data.tar.gz: e689a93766d9f7035eaf8b416a48427a683e1836
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5d0a5fef71c59114fc9696b871916941a34902e0c685c560e296be0ea3cdb969cdbaace2377c3f14fc38a10f316e7ba8d45f04af8634cdadfac201854c49075b
|
|
7
|
+
data.tar.gz: eb67ab043e93d61d230b01cfb886c5f21d041ddf5b288e3dd5c69b918de5c8a5a09f27513636f02abf417e737883ab13fb3be00854bb41339ed427cfc283a1ad
|
|
@@ -41,30 +41,5 @@ module Poodle
|
|
|
41
41
|
img_url = image_url(object, eval_url, ph)
|
|
42
42
|
return image_tag img_url, class: hsh[:class], style: "width:#{hsh[:width]};height:#{hsh[:height]};#{hsh[:style]}"
|
|
43
43
|
end
|
|
44
|
-
|
|
45
|
-
## Returns new photo url or edit existing photo url based on
|
|
46
|
-
# object is associated with photo or not
|
|
47
|
-
# == Examples
|
|
48
|
-
# >>> upload_image_link(@user, admin_user_path(@user), :profile_picture)
|
|
49
|
-
# => "/admin/images/new" OR
|
|
50
|
-
# => "/admin/images/1/edit"
|
|
51
|
-
def upload_image_link(object, redirect_url, assoc_name=:photo)
|
|
52
|
-
photo_object = nil
|
|
53
|
-
photo_object = object.send(assoc_name) if object.respond_to?(assoc_name)
|
|
54
|
-
|
|
55
|
-
if photo_object.present? && photo_object.persisted?
|
|
56
|
-
edit_admin_image_path(photo_object,
|
|
57
|
-
:redirect_url => redirect_url,
|
|
58
|
-
:imageable_id => object.id,
|
|
59
|
-
:imageable_type => object.class.to_s,
|
|
60
|
-
:image_type => photo_object.class.name)
|
|
61
|
-
else
|
|
62
|
-
photo_object = object.send("build_#{assoc_name}")
|
|
63
|
-
new_admin_image_path(:redirect_url => redirect_url,
|
|
64
|
-
:imageable_id => object.id,
|
|
65
|
-
:imageable_type => object.class.to_s,
|
|
66
|
-
:image_type => photo_object.class.name)
|
|
67
|
-
end
|
|
68
|
-
end
|
|
69
44
|
end
|
|
70
45
|
end
|
data/lib/poodle/version.rb
CHANGED