trusty-clipped-extension 1.1.1 → 2.0.0.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
- NjE1MWFiNDUxYWY1NjU2MDUxMzE4MGJlODA0MWJiNzExMzUwZTY4ZQ==
4
+ ZDAyNjY1MmY3ZjRmMzYxNTEwOTVkM2I2NTIyZDcwNzMxNTBmNjJlZg==
5
5
  data.tar.gz: !binary |-
6
- NmFkNjg1ZDA1YzY4NWI3YzhjYTMzOThiYTliYjZhZTVmOGYxYTQ3ZQ==
6
+ OGNkYTE2NjYwZjM2MjgxZGY0NGE1YmJkMWY3OWNiMDk4Y2JlMGYyZQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MDA4ODU3NTQzZDViMDM3YzMxMTc5YjUxNjA5ZWQzMzM2MzU5OWZhYTZjZTk1
10
- OTJlZWQwZTI5Y2U4OWExMGM3NTI3NjYzMzBjODcxNzg0ZDhmZTM3ODQwNDE3
11
- MTg5ZjIyMWQxN2JmYjQwMmUzMjIyNTA3ZWJiY2VmOTU2OTJiMjY=
9
+ NjBlMGJmY2E2NjQ5MzBhY2E0ZDk1NWViYjA0NDE4NmFlNTIxZWU5NTU0ZTNl
10
+ MWZmN2EyNWJlNzczZjRiNWQzNWE2ODUxZGJkOTcwMzE2MzAyYTRiNmI4MDRm
11
+ YjRjNTRkMzczZTI0NWM0YjlhOTc3MmZhNDAyMmIwZGNjNzU4NWY=
12
12
  data.tar.gz: !binary |-
13
- NzBlNTdkYjg4MjhiMDhiYzhmNzE3YmM0YzJmMTUxNTBjMTQ4YTEzZDk5MTcx
14
- YjUzM2ZhNGU0ZmVlZDEzMjNmYmExZGQ1YzNhNGRjYjlhOWNhZTlmN2M3Mjhh
15
- Mjc4OWRhZWYyYjJkOTliMzA4MjFhYjQwNzg2Y2M2ZjY3ZjBkMjA=
13
+ ZGM4ZjczOTE3M2E1NjU4N2JiMGM2ZjNkYjUzZmU3Mjg2NzYyZGM4MDA0MzJm
14
+ NzVlZDEyMDE4OWZkYWFhMmZiNWI2NWJkMzM2ZmQ5MTcwZDEzYjM5MGMxZmIx
15
+ ZjQxNTcyYzQxNjdhODhkNDM4ZDIwZmU5YzA5ODE0MDM2YTI1OTc=
data/Gemfile ADDED
@@ -0,0 +1,5 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'trustygems', '~> 0.1.0'
4
+
5
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,231 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ trusty-clipped-extension (1.1.1)
5
+ acts_as_list (= 0.4.0)
6
+ cocaine (~> 0.5)
7
+ paperclip (~> 4.2)
8
+ trusty-cms (~> 2.0.0.pre.beta)
9
+ uuidtools (~> 2.1)
10
+
11
+ GEM
12
+ remote: https://rubygems.org/
13
+ specs:
14
+ RedCloth (4.2.9)
15
+ actionmailer (4.2.3)
16
+ actionpack (= 4.2.3)
17
+ actionview (= 4.2.3)
18
+ activejob (= 4.2.3)
19
+ mail (~> 2.5, >= 2.5.4)
20
+ rails-dom-testing (~> 1.0, >= 1.0.5)
21
+ actionpack (4.2.3)
22
+ actionview (= 4.2.3)
23
+ activesupport (= 4.2.3)
24
+ rack (~> 1.6)
25
+ rack-test (~> 0.6.2)
26
+ rails-dom-testing (~> 1.0, >= 1.0.5)
27
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
28
+ actionview (4.2.3)
29
+ activesupport (= 4.2.3)
30
+ builder (~> 3.1)
31
+ erubis (~> 2.7.0)
32
+ rails-dom-testing (~> 1.0, >= 1.0.5)
33
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
34
+ activejob (4.2.3)
35
+ activesupport (= 4.2.3)
36
+ globalid (>= 0.3.0)
37
+ activemodel (4.2.3)
38
+ activesupport (= 4.2.3)
39
+ builder (~> 3.1)
40
+ activerecord (4.2.3)
41
+ activemodel (= 4.2.3)
42
+ activesupport (= 4.2.3)
43
+ arel (~> 6.0)
44
+ activesupport (4.2.3)
45
+ i18n (~> 0.7)
46
+ json (~> 1.7, >= 1.7.7)
47
+ minitest (~> 5.1)
48
+ thread_safe (~> 0.3, >= 0.3.4)
49
+ tzinfo (~> 1.1)
50
+ acts_as_list (0.4.0)
51
+ activerecord (>= 3.0)
52
+ acts_as_tree (2.2.0)
53
+ activerecord (>= 3.0.0)
54
+ arel (6.0.2)
55
+ builder (3.2.2)
56
+ chunky_png (1.3.4)
57
+ ckeditor (4.1.2)
58
+ cocaine
59
+ orm_adapter (~> 0.5.0)
60
+ climate_control (0.0.3)
61
+ activesupport (>= 3.0)
62
+ cocaine (0.5.7)
63
+ climate_control (>= 0.0.3, < 1.0)
64
+ compass (1.0.3)
65
+ chunky_png (~> 1.2)
66
+ compass-core (~> 1.0.2)
67
+ compass-import-once (~> 1.0.5)
68
+ rb-fsevent (>= 0.9.3)
69
+ rb-inotify (>= 0.9)
70
+ sass (>= 3.3.13, < 3.5)
71
+ compass-core (1.0.3)
72
+ multi_json (~> 1.0)
73
+ sass (>= 3.3.0, < 3.5)
74
+ compass-import-once (1.0.5)
75
+ sass (>= 3.2, < 3.5)
76
+ compass-rails (2.0.3)
77
+ compass (~> 1.0.0)
78
+ sass-rails (<= 5.0.1)
79
+ sprockets (< 2.13)
80
+ delocalize (0.4.0)
81
+ rails (>= 3.0)
82
+ erubis (2.7.0)
83
+ execjs (2.5.2)
84
+ ffi (1.9.10)
85
+ globalid (0.3.5)
86
+ activesupport (>= 4.1.0)
87
+ haml (4.0.6)
88
+ tilt
89
+ haml-rails (0.9.0)
90
+ actionpack (>= 4.0.1)
91
+ activesupport (>= 4.0.1)
92
+ haml (>= 4.0.6, < 5.0)
93
+ html2haml (>= 1.0.1)
94
+ railties (>= 4.0.1)
95
+ highline (1.7.2)
96
+ hike (1.2.3)
97
+ html2haml (2.0.0)
98
+ erubis (~> 2.7.0)
99
+ haml (~> 4.0.0)
100
+ nokogiri (~> 1.6.0)
101
+ ruby_parser (~> 3.5)
102
+ i18n (0.7.0)
103
+ jquery-rails (3.1.3)
104
+ railties (>= 3.0, < 5.0)
105
+ thor (>= 0.14, < 2.0)
106
+ json (1.8.3)
107
+ libv8 (3.16.14.11)
108
+ loofah (2.0.2)
109
+ nokogiri (>= 1.5.9)
110
+ mail (2.6.3)
111
+ mime-types (>= 1.16, < 3)
112
+ mime-types (2.6.1)
113
+ mimemagic (0.3.0)
114
+ mini_portile (0.6.2)
115
+ minitest (5.7.0)
116
+ multi_json (1.11.2)
117
+ mysql (2.9.1)
118
+ nokogiri (1.6.6.2)
119
+ mini_portile (~> 0.6.0)
120
+ orm_adapter (0.5.0)
121
+ paperclip (4.3.0)
122
+ activemodel (>= 3.2.0)
123
+ activesupport (>= 3.2.0)
124
+ cocaine (~> 0.5.5)
125
+ mime-types
126
+ mimemagic (= 0.3.0)
127
+ protected_attributes (1.0.9)
128
+ activemodel (>= 4.0.1, < 5.0)
129
+ rack (1.6.4)
130
+ rack-cache (1.2)
131
+ rack (>= 0.4)
132
+ rack-test (0.6.3)
133
+ rack (>= 1.0)
134
+ radius (0.7.4)
135
+ rails (4.2.3)
136
+ actionmailer (= 4.2.3)
137
+ actionpack (= 4.2.3)
138
+ actionview (= 4.2.3)
139
+ activejob (= 4.2.3)
140
+ activemodel (= 4.2.3)
141
+ activerecord (= 4.2.3)
142
+ activesupport (= 4.2.3)
143
+ bundler (>= 1.3.0, < 2.0)
144
+ railties (= 4.2.3)
145
+ sprockets-rails
146
+ rails-deprecated_sanitizer (1.0.3)
147
+ activesupport (>= 4.2.0.alpha)
148
+ rails-dom-testing (1.0.6)
149
+ activesupport (>= 4.2.0.beta, < 5.0)
150
+ nokogiri (~> 1.6.0)
151
+ rails-deprecated_sanitizer (>= 1.0.1)
152
+ rails-html-sanitizer (1.0.2)
153
+ loofah (~> 2.0)
154
+ railties (4.2.3)
155
+ actionpack (= 4.2.3)
156
+ activesupport (= 4.2.3)
157
+ rake (>= 0.8.7)
158
+ thor (>= 0.18.1, < 2.0)
159
+ rake (10.4.2)
160
+ rb-fsevent (0.9.5)
161
+ rb-inotify (0.9.5)
162
+ ffi (>= 0.5.0)
163
+ rdoc (3.12.2)
164
+ json (~> 1.4)
165
+ ref (2.0.0)
166
+ ruby_parser (3.7.0)
167
+ sexp_processor (~> 4.1)
168
+ sass (3.4.16)
169
+ sass-rails (5.0.1)
170
+ railties (>= 4.0.0, < 5.0)
171
+ sass (~> 3.1)
172
+ sprockets (>= 2.8, < 4.0)
173
+ sprockets-rails (>= 2.0, < 4.0)
174
+ tilt (~> 1.1)
175
+ sexp_processor (4.6.0)
176
+ sprockets (2.12.4)
177
+ hike (~> 1.2)
178
+ multi_json (~> 1.0)
179
+ rack (~> 1.0)
180
+ tilt (~> 1.1, != 1.3.0)
181
+ sprockets-rails (2.3.2)
182
+ actionpack (>= 3.0)
183
+ activesupport (>= 3.0)
184
+ sprockets (>= 2.8, < 4.0)
185
+ stringex (1.5.1)
186
+ therubyracer (0.12.2)
187
+ libv8 (~> 3.16.14.0)
188
+ ref
189
+ thor (0.19.1)
190
+ thread_safe (0.3.5)
191
+ tilt (1.4.1)
192
+ trusty-cms (2.0.0.pre.beta)
193
+ RedCloth (~> 4.2)
194
+ acts_as_tree (~> 2.1)
195
+ bundler (~> 1.7)
196
+ ckeditor (~> 4.1)
197
+ compass-rails (~> 2.0)
198
+ delocalize (~> 0.2)
199
+ execjs (~> 2.2)
200
+ haml (~> 4.0)
201
+ haml-rails (~> 0.5)
202
+ highline (~> 1.6)
203
+ jquery-rails (~> 3.1)
204
+ mysql (~> 2.9)
205
+ protected_attributes (~> 1.0.9)
206
+ rack (~> 1.4)
207
+ rack-cache (~> 1.2)
208
+ radius (~> 0.7)
209
+ rails (~> 4.2)
210
+ rdoc (~> 3.9)
211
+ stringex (~> 1.3)
212
+ therubyracer (~> 0.12)
213
+ tzinfo (~> 1.2)
214
+ uglifier (~> 2.6)
215
+ will_paginate (~> 3.0)
216
+ trustygems (0.1.0)
217
+ rake
218
+ tzinfo (1.2.2)
219
+ thread_safe (~> 0.1)
220
+ uglifier (2.7.1)
221
+ execjs (>= 0.3.0)
222
+ json (>= 1.8.0)
223
+ uuidtools (2.1.5)
224
+ will_paginate (3.0.7)
225
+
226
+ PLATFORMS
227
+ ruby
228
+
229
+ DEPENDENCIES
230
+ trusty-clipped-extension!
231
+ trustygems (~> 0.1.0)
data/Rakefile CHANGED
@@ -1,109 +1,112 @@
1
- # Determine where the RSpec plugin is by loading the boot
2
- unless defined? RADIANT_ROOT
3
- ENV["RAILS_ENV"] = "test"
4
- case
5
- when ENV["RADIANT_ENV_FILE"]
6
- require File.dirname(ENV["RADIANT_ENV_FILE"]) + "/boot"
7
- when File.dirname(__FILE__) =~ %r{vendor/radiant/vendor/extensions}
8
- require "#{File.expand_path(File.dirname(__FILE__) + "/../../../../../")}/config/boot"
9
- else
10
- require "#{File.expand_path(File.dirname(__FILE__) + "/../../../")}/config/boot"
11
- end
12
- end
1
+ require 'trustygems'
13
2
 
14
- require 'rake'
15
- require 'rdoc/task'
16
- require 'rake/testtask'
17
-
18
- rspec_base = File.expand_path(RADIANT_ROOT + '/vendor/plugins/rspec/lib')
19
- $LOAD_PATH.unshift(rspec_base) if File.exist?(rspec_base)
20
- require 'spec/rake/spectask'
21
- require 'cucumber'
22
- require 'cucumber/rake/task'
23
-
24
- # Cleanup the RADIANT_ROOT constant so specs will load the environment
25
- Object.send(:remove_const, :RADIANT_ROOT)
26
-
27
- extension_root = File.expand_path(File.dirname(__FILE__))
28
-
29
- task :default => [:spec, :features]
30
- task :stats => "spec:statsetup"
31
-
32
- desc "Run all specs in spec directory"
33
- Spec::Rake::SpecTask.new(:spec) do |t|
34
- t.spec_opts = ['--options', "\"#{extension_root}/spec/spec.opts\""]
35
- t.spec_files = FileList['spec/**/*_spec.rb']
36
- end
37
-
38
- task :features => 'spec:integration'
39
-
40
- namespace :spec do
41
- desc "Run all specs in spec directory with RCov"
42
- Spec::Rake::SpecTask.new(:rcov) do |t|
43
- t.spec_opts = ['--options', "\"#{extension_root}/spec/spec.opts\""]
44
- t.spec_files = FileList['spec/**/*_spec.rb']
45
- t.rcov = true
46
- t.rcov_opts = ['--exclude', 'spec', '--rails']
47
- end
48
-
49
- desc "Print Specdoc for all specs"
50
- Spec::Rake::SpecTask.new(:doc) do |t|
51
- t.spec_opts = ["--format", "specdoc", "--dry-run"]
52
- t.spec_files = FileList['spec/**/*_spec.rb']
53
- end
54
-
55
- [:models, :controllers, :views, :helpers].each do |sub|
56
- desc "Run the specs under spec/#{sub}"
57
- Spec::Rake::SpecTask.new(sub) do |t|
58
- t.spec_opts = ['--options', "\"#{extension_root}/spec/spec.opts\""]
59
- t.spec_files = FileList["spec/#{sub}/**/*_spec.rb"]
60
- end
61
- end
62
-
63
- desc "Run the Cucumber features"
64
- Cucumber::Rake::Task.new(:integration) do |t|
65
- t.fork = true
66
- t.cucumber_opts = ['--format', (ENV['CUCUMBER_FORMAT'] || 'pretty')]
67
- # t.feature_pattern = "#{extension_root}/features/**/*.feature"
68
- t.profile = "default"
69
- end
70
-
71
- # Setup specs for stats
72
- task :statsetup do
73
- require 'code_statistics'
74
- ::STATS_DIRECTORIES << %w(Model\ specs spec/models)
75
- ::STATS_DIRECTORIES << %w(View\ specs spec/views)
76
- ::STATS_DIRECTORIES << %w(Controller\ specs spec/controllers)
77
- ::STATS_DIRECTORIES << %w(Helper\ specs spec/views)
78
- ::CodeStatistics::TEST_TYPES << "Model specs"
79
- ::CodeStatistics::TEST_TYPES << "View specs"
80
- ::CodeStatistics::TEST_TYPES << "Controller specs"
81
- ::CodeStatistics::TEST_TYPES << "Helper specs"
82
- ::STATS_DIRECTORIES.delete_if {|a| a[0] =~ /test/}
83
- end
84
-
85
- namespace :db do
86
- namespace :fixtures do
87
- desc "Load fixtures (from spec/fixtures) into the current environment's database. Load specific fixtures using FIXTURES=x,y"
88
- task :load => :environment do
89
- require 'active_record/fixtures'
90
- ActiveRecord::Base.establish_connection(Rails.env.to_sym)
91
- (ENV['FIXTURES'] ? ENV['FIXTURES'].split(/,/) : Dir.glob(File.join(Rails.root, 'spec', 'fixtures', '*.{yml,csv}'))).each do |fixture_file|
92
- Fixtures.create_fixtures('spec/fixtures', File.basename(fixture_file, '.*'))
93
- end
94
- end
95
- end
96
- end
97
- end
98
-
99
- desc 'Generate documentation for the clipped extension.'
100
- RDoc::Task.new(:rdoc) do |rdoc|
101
- rdoc.rdoc_dir = 'rdoc'
102
- rdoc.title = 'ClippedExtension'
103
- rdoc.options << '--line-numbers' << '--inline-source'
104
- rdoc.rdoc_files.include('README')
105
- rdoc.rdoc_files.include('lib/**/*.rb')
106
- end
107
-
108
- # Load any custom rakefiles for extension
109
- Dir[File.dirname(__FILE__) + '/tasks/*.rake'].sort.each { |f| require f }
3
+ # # Determine where the RSpec plugin is by loading the boot
4
+ # unless defined? TRUSTY_CMS_ROOT
5
+ # ENV["RAILS_ENV"] = "test"
6
+ # case
7
+ # when ENV["RADIANT_ENV_FILE"]
8
+ # require File.dirname(ENV["RADIANT_ENV_FILE"]) + "/boot"
9
+ # when File.dirname(__FILE__) =~ %r{vendor/radiant/vendor/extensions}
10
+ # require "#{File.expand_path(File.dirname(__FILE__) + "/../../../../../")}/config/boot"
11
+ # else
12
+ # require "#{File.expand_path(File.dirname(__FILE__) + "/../../../")}/config/boot"
13
+ # end
14
+ # end
15
+ #
16
+ # require 'rake'
17
+ # require 'rdoc/task'
18
+ # require 'rake/testtask'
19
+ # require 'trustygems'
20
+ #
21
+ # rspec_base = File.expand_path(TRUSTY_CMS_ROOT + '/vendor/plugins/rspec/lib')
22
+ # $LOAD_PATH.unshift(rspec_base) if File.exist?(rspec_base)
23
+ # require 'spec/rake/spectask'
24
+ # require 'cucumber'
25
+ # require 'cucumber/rake/task'
26
+ #
27
+ # # Cleanup the RADIANT_ROOT constant so specs will load the environment
28
+ # Object.send(:remove_const, :TRUSTY_CMS_ROOT)
29
+ #
30
+ # extension_root = File.expand_path(File.dirname(__FILE__))
31
+ #
32
+ # task :default => [:spec, :features]
33
+ # task :stats => "spec:statsetup"
34
+ #
35
+ # desc "Run all specs in spec directory"
36
+ # Spec::Rake::SpecTask.new(:spec) do |t|
37
+ # t.spec_opts = ['--options', "\"#{extension_root}/spec/spec.opts\""]
38
+ # t.spec_files = FileList['spec/**/*_spec.rb']
39
+ # end
40
+ #
41
+ # task :features => 'spec:integration'
42
+ #
43
+ # namespace :spec do
44
+ # desc "Run all specs in spec directory with RCov"
45
+ # Spec::Rake::SpecTask.new(:rcov) do |t|
46
+ # t.spec_opts = ['--options', "\"#{extension_root}/spec/spec.opts\""]
47
+ # t.spec_files = FileList['spec/**/*_spec.rb']
48
+ # t.rcov = true
49
+ # t.rcov_opts = ['--exclude', 'spec', '--rails']
50
+ # end
51
+ #
52
+ # desc "Print Specdoc for all specs"
53
+ # Spec::Rake::SpecTask.new(:doc) do |t|
54
+ # t.spec_opts = ["--format", "specdoc", "--dry-run"]
55
+ # t.spec_files = FileList['spec/**/*_spec.rb']
56
+ # end
57
+ #
58
+ # [:models, :controllers, :views, :helpers].each do |sub|
59
+ # desc "Run the specs under spec/#{sub}"
60
+ # Spec::Rake::SpecTask.new(sub) do |t|
61
+ # t.spec_opts = ['--options', "\"#{extension_root}/spec/spec.opts\""]
62
+ # t.spec_files = FileList["spec/#{sub}/**/*_spec.rb"]
63
+ # end
64
+ # end
65
+ #
66
+ # desc "Run the Cucumber features"
67
+ # Cucumber::Rake::Task.new(:integration) do |t|
68
+ # t.fork = true
69
+ # t.cucumber_opts = ['--format', (ENV['CUCUMBER_FORMAT'] || 'pretty')]
70
+ # # t.feature_pattern = "#{extension_root}/features/**/*.feature"
71
+ # t.profile = "default"
72
+ # end
73
+ #
74
+ # # Setup specs for stats
75
+ # task :statsetup do
76
+ # require 'code_statistics'
77
+ # ::STATS_DIRECTORIES << %w(Model\ specs spec/models)
78
+ # ::STATS_DIRECTORIES << %w(View\ specs spec/views)
79
+ # ::STATS_DIRECTORIES << %w(Controller\ specs spec/controllers)
80
+ # ::STATS_DIRECTORIES << %w(Helper\ specs spec/views)
81
+ # ::CodeStatistics::TEST_TYPES << "Model specs"
82
+ # ::CodeStatistics::TEST_TYPES << "View specs"
83
+ # ::CodeStatistics::TEST_TYPES << "Controller specs"
84
+ # ::CodeStatistics::TEST_TYPES << "Helper specs"
85
+ # ::STATS_DIRECTORIES.delete_if {|a| a[0] =~ /test/}
86
+ # end
87
+ #
88
+ # namespace :db do
89
+ # namespace :fixtures do
90
+ # desc "Load fixtures (from spec/fixtures) into the current environment's database. Load specific fixtures using FIXTURES=x,y"
91
+ # task :load => :environment do
92
+ # require 'active_record/fixtures'
93
+ # ActiveRecord::Base.establish_connection(Rails.env.to_sym)
94
+ # (ENV['FIXTURES'] ? ENV['FIXTURES'].split(/,/) : Dir.glob(File.join(Rails.root, 'spec', 'fixtures', '*.{yml,csv}'))).each do |fixture_file|
95
+ # Fixtures.create_fixtures('spec/fixtures', File.basename(fixture_file, '.*'))
96
+ # end
97
+ # end
98
+ # end
99
+ # end
100
+ # end
101
+ #
102
+ # desc 'Generate documentation for the clipped extension.'
103
+ # RDoc::Task.new(:rdoc) do |rdoc|
104
+ # rdoc.rdoc_dir = 'rdoc'
105
+ # rdoc.title = 'ClippedExtension'
106
+ # rdoc.options << '--line-numbers' << '--inline-source'
107
+ # rdoc.rdoc_files.include('README')
108
+ # rdoc.rdoc_files.include('lib/**/*.rb')
109
+ # end
110
+ #
111
+ # # Load any custom rakefiles for extension
112
+ # Dir[File.dirname(__FILE__) + '/tasks/*.rake'].sort.each { |f| require f }
@@ -2,7 +2,7 @@ class Admin::AssetsController < Admin::ResourceController
2
2
  paginate_models(:per_page => 50)
3
3
 
4
4
  def index
5
- assets = Asset.scoped({:order => "created_at DESC"})
5
+ assets = Asset.order("created_at DESC")
6
6
 
7
7
  @page = Page.find(params[:page_id]) if params[:page_id]
8
8
 
data/app/models/asset.rb CHANGED
@@ -8,7 +8,7 @@ class Asset < ActiveRecord::Base
8
8
  belongs_to :created_by, :class_name => 'User'
9
9
  belongs_to :updated_by, :class_name => 'User'
10
10
 
11
- default_scope :order => "created_at DESC"
11
+ default_scope {order("created_at DESC")}
12
12
 
13
13
  scope :latest, lambda { |limit|
14
14
  { :order => "created_at DESC", :limit => limit }
@@ -23,7 +23,7 @@ class Asset < ActiveRecord::Base
23
23
  { :conditions => ["LOWER(assets.asset_file_name) LIKE (:term) OR LOWER(title) LIKE (:term) OR LOWER(caption) LIKE (:term)", {:term => "%#{term.downcase}%" }] }
24
24
  }
25
25
 
26
- scope :except, lambda { |assets|
26
+ scope :excepting, lambda { |assets|
27
27
  if assets.any?
28
28
  assets = assets.split(',') if assets.is_a?(String)
29
29
  asset_ids = assets.first.is_a?(Asset) ? assets.map(&:id) : assets
@@ -34,8 +34,8 @@ class AssetType
34
34
  Asset.send :define_method, "#{name}?".intern do this.mime_types.include?(asset_content_type) end
35
35
  Asset.send :define_class_method, "#{name}_condition".intern do this.condition; end
36
36
  Asset.send :define_class_method, "not_#{name}_condition".intern do this.non_condition; end
37
- Asset.send :scope, plural.to_sym, :conditions => condition
38
- Asset.send :scope, "not_#{plural}".to_sym, :conditions => non_condition
37
+ Asset.send :scope, plural.to_sym, -> {where(:conditions => condition)}
38
+ Asset.send :scope, "not_#{plural}".to_sym, -> {where(:conditions => non_condition)}
39
39
 
40
40
  self.define_radius_tags
41
41
  @@types.push self
@@ -47,7 +47,7 @@
47
47
  = render :partial => 'admin/assets/search'
48
48
 
49
49
  #assets_table.assets.viewport{:style=>"height: 320px; width: 610px"}
50
- - assets = Asset.all.paginate(:per_page => 20)
50
+ - assets = Asset.all.paginate(:per_page => 20, page: params[:p])
51
51
  = render :partial => 'admin/assets/asset_table', :locals => {:assets => assets, :with_pagination => true}
52
52
 
53
53
  .busy{:style => "display: none"}= image('spinner.gif', :alt => "")
@@ -0,0 +1,3 @@
1
+ gemspec: trusty-clipped-extension.gemspec
2
+ # If using a private server, change this to the necessary command, i.e. gem inabox
3
+ deploy_command: gem push
@@ -4,8 +4,8 @@ module PageAssetAssociations
4
4
 
5
5
  def self.included(base)
6
6
  base.class_eval {
7
- has_many :page_attachments, :order => "position ASC"
8
- has_many :assets, :through => :page_attachments, :order => "page_attachments.position ASC"
7
+ has_many :page_attachments, -> { order 'position desc' }
8
+ has_many :assets,{ :through => :page_attachments}, -> { order 'page_attachments.position ASC' }
9
9
  accepts_nested_attributes_for :page_attachments, :allow_destroy => true
10
10
  }
11
11
  end
@@ -1,5 +1,5 @@
1
1
  module TrustyCmsClippedExtension
2
- VERSION = "1.1.1"
2
+ VERSION = "2.0.0-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"
@@ -16,7 +16,7 @@ Gem::Specification.new do |s|
16
16
  s.add_dependency "paperclip", "~> 4.2"
17
17
  s.add_dependency "uuidtools", "~> 2.1"
18
18
  s.add_dependency "cocaine", "~> 0.5"
19
- s.add_dependency "trusty-cms", "~> 1.2"
19
+ s.add_dependency "trusty-cms", "~> 2.0.0.pre.beta"
20
20
 
21
21
  ignores = if File.exist?('.gitignore')
22
22
  File.read('.gitignore').split("\n").inject([]) {|a,p| a + Dir[p] }
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: 1.1.1
4
+ version: 2.0.0.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-04-30 00:00:00.000000000 Z
16
+ date: 2015-07-21 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: acts_as_list
@@ -77,14 +77,14 @@ dependencies:
77
77
  requirements:
78
78
  - - ~>
79
79
  - !ruby/object:Gem::Version
80
- version: '1.2'
80
+ version: 2.0.0.pre.beta
81
81
  type: :runtime
82
82
  prerelease: false
83
83
  version_requirements: !ruby/object:Gem::Requirement
84
84
  requirements:
85
85
  - - ~>
86
86
  - !ruby/object:Gem::Version
87
- version: '1.2'
87
+ version: 2.0.0.pre.beta
88
88
  description: Asset-management derived from Keith Bingman's Paperclipped extension.
89
89
  email:
90
90
  - webfeedback@trustarts.org
@@ -92,6 +92,8 @@ executables: []
92
92
  extensions: []
93
93
  extra_rdoc_files: []
94
94
  files:
95
+ - Gemfile
96
+ - Gemfile.lock
95
97
  - LICENSE
96
98
  - README.md
97
99
  - Rakefile
@@ -183,6 +185,7 @@ files:
183
185
  - config/locales/nl.yml
184
186
  - config/locales/ru.yml
185
187
  - config/routes.rb
188
+ - config/trustygems.yml
186
189
  - cucumber.yml
187
190
  - db/migrate/001_create_assets.rb
188
191
  - db/migrate/002_create_paperclip_attributes.rb
@@ -243,9 +246,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
243
246
  version: '0'
244
247
  required_rubygems_version: !ruby/object:Gem::Requirement
245
248
  requirements:
246
- - - ! '>='
249
+ - - ! '>'
247
250
  - !ruby/object:Gem::Version
248
- version: '0'
251
+ version: 1.3.1
249
252
  requirements: []
250
253
  rubyforge_project:
251
254
  rubygems_version: 2.4.5