Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 45 lines (37 sloc) 1.594 kb
f099328 updating clipping image and hompage_feature to use filesystem backend as...
Bruno Bornsztein authored
1 # CommunityEngine
2 module CommunityEngine
3 module ActiveRecordExtensions
4 def prepare_options_for_attachment_fu(options)
ce36340 Bruno Bornsztein allow application.yml configuration of attachment_fu processor
authored
5 attachment_fu_options = options.symbolize_keys.merge(
6 {:storage => options['storage'].to_sym,
7 :max_size => options['max_size'].to_i.megabytes,
8 :processor => (options['processor'] && options['processor'].to_sym)
9 })
dc2c29c added a method to warn if community_engine migrations are not up to date...
Bruno Bornsztein authored
10 end
f099328 updating clipping image and hompage_feature to use filesystem backend as...
Bruno Bornsztein authored
11 end
dc2c29c added a method to warn if community_engine migrations are not up to date...
Bruno Bornsztein authored
12
13 class << self
f77b5a4 Bruno Bornsztein add clear cache link to admin dash
authored
14
dc2c29c added a method to warn if community_engine migrations are not up to date...
Bruno Bornsztein authored
15 def check_for_pending_migrations
52c3e30 Bruno Bornsztein more migration stuff
authored
16 newest_ce_migration = Desert::Manager.find_plugin('community_engine').latest_migration
17 current_ce_version = guess_current_ce_version
18
19 pending = newest_ce_migration - current_ce_version
20 if pending > 0
21 puts "---"
22 puts "[COMMUNITY ENGINE] You have #{pending} pending CommunityEngine migrations:"
23 puts "CE is at #{newest_ce_migration}, but you have only migrated it to #{current_ce_version}"
24 puts "Please run 'script/generate plugin_migration' AND 'rake db:migrate' before continuing, or you will experience errors."
25 puts "---"
26 end
27 end
28
29 def guess_current_ce_version
30 # DUMB: checks your db/migrate and parses out the last CE migration to find out which version you're at
31 last_version = Dir["#{RAILS_ROOT}/db/migrate/[0-9]*_community_engine_to*.rb"].sort.last
32 if last_version
33 last_version[/.*_community_engine_to_version_(\d+)/, 1].to_i
34 else
35 0
36 end
dc2c29c added a method to warn if community_engine migrations are not up to date...
Bruno Bornsztein authored
37 end
38
39 end
40
f099328 updating clipping image and hompage_feature to use filesystem backend as...
Bruno Bornsztein authored
41 end
42
72a9c69 Bruno Bornsztein initial changes for desert compatibility
authored
43 ActiveRecord::Base.send(:extend, CommunityEngine::ActiveRecordExtensions)
44
45 require 'rails_asset_extensions'
Something went wrong with that request. Please try again.