archives: raise exception if not configured.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
class PostVersionsController < ApplicationController
|
||||
before_filter :member_only
|
||||
before_filter :check_availabililty
|
||||
respond_to :html, :xml, :json
|
||||
|
||||
def index
|
||||
@@ -25,4 +26,12 @@ class PostVersionsController < ApplicationController
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def check_availabililty
|
||||
if !PostArchive.enabled?
|
||||
raise NotImplementedError.new("Archive service is not configured. Post versions are not saved.")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user