polygallery 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 40b6058f68d72353fc34e17997936f3b1096063f
|
4
|
+
data.tar.gz: df9ed80c23c5ef9ef3bde7a272485e91c4390ca8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1cfb242774808827303b01187ab2daab6cc620f3d3b20ff5482a22729a2486f60412ef60a1a45d85212724791e58d533ab35ec833c8bb3dfcebe0f5538a7b735
|
7
|
+
data.tar.gz: 659c46c8f5bd5e817da3c11439b15afbf4e9a251670e0ecb7ae0529309ef3ed5c8b79e98d4cb820912a2309f30c41d280cda77a3002f7b08c971e00878d5b950
|
@@ -21,7 +21,22 @@ module Polygallery
|
|
21
21
|
has_polyphotos
|
22
22
|
|
23
23
|
def settings
|
24
|
-
|
24
|
+
if galleryable.present?
|
25
|
+
galleryable.send("#{title}_settings".to_sym)
|
26
|
+
elsif galleryable_id.present? && galleryable_type.present?
|
27
|
+
puts 'Galleryable can\'t be loaded'
|
28
|
+
klass = Object.const_get(galleryable_type)
|
29
|
+
if klass.exists? :id => galleryable_id
|
30
|
+
puts 'Galleryable found! Attempting to load now.'
|
31
|
+
klass.find(galleryable_id).send("#{title}_settings".to_sym)
|
32
|
+
else
|
33
|
+
puts 'Galleryable still not found.'
|
34
|
+
DEFAULTS
|
35
|
+
end
|
36
|
+
else
|
37
|
+
puts 'WARNING: Galleryable not found! Using default paperclip settings...'
|
38
|
+
DEFAULTS
|
39
|
+
end
|
25
40
|
end
|
26
41
|
|
27
42
|
end
|
@@ -8,6 +8,10 @@ module Polygallery
|
|
8
8
|
|
9
9
|
module ClassMethods
|
10
10
|
def has_polygallery(title='gallery', options={})
|
11
|
+
if title.is_a? Hash
|
12
|
+
options = title
|
13
|
+
title = 'gallery'
|
14
|
+
end
|
11
15
|
defaults = Gallery::DEFAULTS
|
12
16
|
settings = defaults.deep_merge(options)
|
13
17
|
has_one title.to_sym, -> { where(:title => title.to_s) }, settings[:association]
|
data/lib/polygallery/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: polygallery
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- MacKinley Smith
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-09-
|
11
|
+
date: 2014-09-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|