trusty-clipped-extension 2.0.0.pre.beta → 2.0.1.pre.beta
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 +8 -8
- data/Gemfile.lock +3 -3
- data/app/controllers/admin/assets_controller.rb +0 -1
- data/app/models/asset.rb +6 -4
- data/lib/trusty-clipped-extension.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZGUwNGRlODI5NDc1YWI3YzI0YzgxN2NiNDY4YjE1MjBmYWJiNmM4MQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MmVhZDk0YWRlNmViYjZmNWFlODQ0MDNlYWZhY2MxYWU5YzNjOGI5YQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NTA2ZThiZTMxNjk2MWExZjBhMmE2ZGQ1ODJiOTlkYjY5MjRhYzhjOWYyOWZk
|
10
|
+
OTczN2FhMWFhZmYwNGU0MTRiYjY3ZGRmODhlOTdjNjFhM2Q1ZGIxYjFhMTU2
|
11
|
+
Nzc4ZTU3MGViMmJhZjM3MjViNDY0MGIwMTI2ZWRjNDYyZGM4MTE=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MDBiNjBhYmYzNjI1NjViMWVlNDdjYmEyNTQ0MWEyZDZlODhkMjU2MDM5MWEz
|
14
|
+
NmE1NjI5MzE0MTNkYjM5NWYxMWU0NjM1ZWYyMTlhYzNiZTdhN2YyMjMxYTBj
|
15
|
+
NTg4ZGIyZmM3ZDhmYmM2OWYzNDFiMmQ1OTZjZTRlMWViMmQzN2Q=
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
trusty-clipped-extension (
|
4
|
+
trusty-clipped-extension (2.0.1.pre.beta)
|
5
5
|
acts_as_list (= 0.4.0)
|
6
6
|
cocaine (~> 0.5)
|
7
7
|
paperclip (~> 4.2)
|
@@ -92,7 +92,7 @@ GEM
|
|
92
92
|
haml (>= 4.0.6, < 5.0)
|
93
93
|
html2haml (>= 1.0.1)
|
94
94
|
railties (>= 4.0.1)
|
95
|
-
highline (1.7.
|
95
|
+
highline (1.7.3)
|
96
96
|
hike (1.2.3)
|
97
97
|
html2haml (2.0.0)
|
98
98
|
erubis (~> 2.7.0)
|
@@ -189,7 +189,7 @@ GEM
|
|
189
189
|
thor (0.19.1)
|
190
190
|
thread_safe (0.3.5)
|
191
191
|
tilt (1.4.1)
|
192
|
-
trusty-cms (2.0.
|
192
|
+
trusty-cms (2.0.9.pre.beta)
|
193
193
|
RedCloth (~> 4.2)
|
194
194
|
acts_as_tree (~> 2.1)
|
195
195
|
bundler (~> 1.7)
|
data/app/models/asset.rb
CHANGED
@@ -10,24 +10,26 @@ class Asset < ActiveRecord::Base
|
|
10
10
|
|
11
11
|
default_scope {order("created_at DESC")}
|
12
12
|
|
13
|
+
attr_accessible :title, :asset, :caption
|
14
|
+
|
13
15
|
scope :latest, lambda { |limit|
|
14
|
-
|
16
|
+
order("created_at DESC").limit(limit)
|
15
17
|
}
|
16
18
|
|
17
19
|
scope :of_types, lambda { |types|
|
18
20
|
mimes = AssetType.slice(*types).map(&:mime_types).flatten
|
19
|
-
|
21
|
+
where(["asset_content_type IN (#{mimes.map{'?'}.join(',')})", *mimes])
|
20
22
|
}
|
21
23
|
|
22
24
|
scope :matching, lambda { |term|
|
23
|
-
|
25
|
+
where(["LOWER(assets.asset_file_name) LIKE (:term) OR LOWER(title) LIKE (:term) OR LOWER(caption) LIKE (:term)", {:term => "%#{term.downcase}%" }])
|
24
26
|
}
|
25
27
|
|
26
28
|
scope :excepting, lambda { |assets|
|
27
29
|
if assets.any?
|
28
30
|
assets = assets.split(',') if assets.is_a?(String)
|
29
31
|
asset_ids = assets.first.is_a?(Asset) ? assets.map(&:id) : assets
|
30
|
-
|
32
|
+
where(["assets.id NOT IN(#{asset_ids.map{ '?' }.join(',')})", *asset_ids])
|
31
33
|
else
|
32
34
|
{}
|
33
35
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
module TrustyCmsClippedExtension
|
2
|
-
VERSION = "2.0.
|
2
|
+
VERSION = "2.0.1-beta"
|
3
3
|
SUMMARY = %q{Assets for TrustyCms CMS}
|
4
4
|
DESCRIPTION = %q{Asset-management derived from Keith Bingman's Paperclipped extension.}
|
5
5
|
URL = "https://github.com/pgharts/trusty-clipped-extension"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trusty-clipped-extension
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1.pre.beta
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Keith Bingman
|
@@ -13,7 +13,7 @@ authors:
|
|
13
13
|
autorequire:
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
|
-
date: 2015-
|
16
|
+
date: 2015-08-03 00:00:00.000000000 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: acts_as_list
|