Skip to content

Commit a3d8391

Browse files
committed
Merge branch 'develop'
2 parents ec8d79b + 3b4276b commit a3d8391

File tree

4 files changed

+14
-4
lines changed

4 files changed

+14
-4
lines changed

app/models/media.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ class Media < ActiveRecord::Base
3434
},
3535
:processors => [:thumbnail, :paperclip_optimizer],
3636
:preserve_files => 'true',
37-
:path => ':class/:attachment/:style-:id.:extension'
37+
# :path => ':class/:attachment/:style-:id.:extension'
38+
:path => ':class/:attachment/careerbuilder-:style-:id.:extension'
3839

3940
validates_attachment :attachment,
4041
:presence => true,

bower.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
{
23
"name": "cortex",
34
"authors": [
@@ -47,3 +48,4 @@
4748
"angular": "1.2.29"
4849
}
4950
}
51+

lib/tasks/cortex.rake

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ namespace :cortex do
8585
next
8686
end
8787

88+
8889
# Replace text in Snippets and in Posts
8990
puts "Searching for Snippets with the text '#{find}' in tenant #{tenant}"
9091
matching_snippets = Snippet.find_by_tenant_id(tenant).find_by_body_text(find)
@@ -232,11 +233,16 @@ namespace :cortex do
232233
namespace :media do
233234
desc 'Manage Cortex media'
234235
task :update_url => :environment do
236+
237+
old_url = ENV['OLD_PATH']
238+
unless old_url
239+
puts 'OLD_PATH must be set'
240+
end
241+
242+
235243
Media.find_each do |media|
236244
unless media.attachment_file_name.blank?
237-
object_id = "%05d" % media.id
238-
object_key = "media/attachments/00#{object_id.first}/00#{object_id[1]}/#{object_id[2..4]}/original/#{media.attachment_file_name}"
239-
puts object_key
245+
object_key = media.attachment.arbitrary_url_for old_url
240246

241247
s3 = Aws::S3::Client.new
242248

semaphore_ci/threads/javascript.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
bundle exec rake spec:javascript

0 commit comments

Comments
 (0)