trusty-clipped-extension 2.0.0.pre.beta → 2.0.1.pre.beta

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZDAyNjY1MmY3ZjRmMzYxNTEwOTVkM2I2NTIyZDcwNzMxNTBmNjJlZg==
4
+ ZGUwNGRlODI5NDc1YWI3YzI0YzgxN2NiNDY4YjE1MjBmYWJiNmM4MQ==
5
5
  data.tar.gz: !binary |-
6
- OGNkYTE2NjYwZjM2MjgxZGY0NGE1YmJkMWY3OWNiMDk4Y2JlMGYyZQ==
6
+ MmVhZDk0YWRlNmViYjZmNWFlODQ0MDNlYWZhY2MxYWU5YzNjOGI5YQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NjBlMGJmY2E2NjQ5MzBhY2E0ZDk1NWViYjA0NDE4NmFlNTIxZWU5NTU0ZTNl
10
- MWZmN2EyNWJlNzczZjRiNWQzNWE2ODUxZGJkOTcwMzE2MzAyYTRiNmI4MDRm
11
- YjRjNTRkMzczZTI0NWM0YjlhOTc3MmZhNDAyMmIwZGNjNzU4NWY=
9
+ NTA2ZThiZTMxNjk2MWExZjBhMmE2ZGQ1ODJiOTlkYjY5MjRhYzhjOWYyOWZk
10
+ OTczN2FhMWFhZmYwNGU0MTRiYjY3ZGRmODhlOTdjNjFhM2Q1ZGIxYjFhMTU2
11
+ Nzc4ZTU3MGViMmJhZjM3MjViNDY0MGIwMTI2ZWRjNDYyZGM4MTE=
12
12
  data.tar.gz: !binary |-
13
- ZGM4ZjczOTE3M2E1NjU4N2JiMGM2ZjNkYjUzZmU3Mjg2NzYyZGM4MDA0MzJm
14
- NzVlZDEyMDE4OWZkYWFhMmZiNWI2NWJkMzM2ZmQ5MTcwZDEzYjM5MGMxZmIx
15
- ZjQxNTcyYzQxNjdhODhkNDM4ZDIwZmU5YzA5ODE0MDM2YTI1OTc=
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 (1.1.1)
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.2)
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.0.pre.beta)
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)
@@ -3,7 +3,6 @@ class Admin::AssetsController < Admin::ResourceController
3
3
 
4
4
  def index
5
5
  assets = Asset.order("created_at DESC")
6
-
7
6
  @page = Page.find(params[:page_id]) if params[:page_id]
8
7
 
9
8
  @term = params[:search] || ''
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
- { :order => "created_at DESC", :limit => limit }
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
- { :conditions => ["asset_content_type IN (#{mimes.map{'?'}.join(',')})", *mimes] }
21
+ where(["asset_content_type IN (#{mimes.map{'?'}.join(',')})", *mimes])
20
22
  }
21
23
 
22
24
  scope :matching, lambda { |term|
23
- { :conditions => ["LOWER(assets.asset_file_name) LIKE (:term) OR LOWER(title) LIKE (:term) OR LOWER(caption) LIKE (:term)", {:term => "%#{term.downcase}%" }] }
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
- { :conditions => ["assets.id NOT IN(#{asset_ids.map{ '?' }.join(',')})", *asset_ids] }
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.0-beta"
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.0.pre.beta
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-07-21 00:00:00.000000000 Z
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