Skip to content

Commit

Permalink
Removed redundant exception raising in controllers since they're hand…
Browse files Browse the repository at this point in the history
…led in BaseController anyway.
  • Loading branch information
clemens committed Sep 24, 2008
1 parent 9fdd7bf commit ee5c846
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 25 deletions.
5 changes: 1 addition & 4 deletions vendor/engines/adva_blog/app/controllers/blog_controller.rb
Expand Up @@ -26,10 +26,7 @@ def show

protected

def set_section
super
raise SectionRoutingError.new("Section must be a Blog: #{@section.inspect}") unless @section.is_a? Blog
end
def set_section; super(Blog); end

def set_articles
options = { :page => current_page, :tags => @tags }
Expand Down
Expand Up @@ -15,10 +15,7 @@ def show

protected

def set_section
@section = params[:section_id].blank? ? @site.sections.root : @site.sections.find(params[:section_id])
raise SectionRoutingError.new("Section must be a Section: #{@section.inspect}") unless @section.is_a? Section
end
def set_section; super(Section); end

def set_article
if params[:permalink].blank?
Expand Down
Expand Up @@ -60,9 +60,7 @@ def next

protected

def set_section
super Forum
end
def set_section; super(Forum); end

def set_board
@board = @section.boards.find params[:id]
Expand Down
Expand Up @@ -15,10 +15,7 @@ def show

protected

def set_section
super
raise SectionRoutingError.new("Section must be a Forum: #{@section.inspect}") unless @section.is_a? Forum
end
def set_section; super(Forum); end

def set_board
@board = @section.boards.find params[:board_id] if params[:board_id]
Expand Down
Expand Up @@ -39,9 +39,7 @@ def destroy
end

protected
def set_section
super Forum
end
def set_section; super(Forum); end

def set_topic
@topic = @section.topics.find params[:topic_id]
Expand Down
Expand Up @@ -70,9 +70,7 @@ def next

protected

def set_section
super Forum
end
def set_section; super(Forum); end

def set_board
@board = @section.boards.find params[:board_id] if params[:board_id]
Expand Down
5 changes: 1 addition & 4 deletions vendor/engines/adva_wiki/app/controllers/wiki_controller.rb
Expand Up @@ -86,10 +86,7 @@ def destroy

private

def set_section
super
raise SectionRoutingError.new("Section must be a Wiki: #{@section.inspect}") unless @section.is_a? Wiki
end
def set_section; super(Wiki); end

def set_wikipage
# TODO do not initialize a new wikipage on :edit and :update actions
Expand Down

0 comments on commit ee5c846

Please sign in to comment.