diff options
author | Amanda Wagener <amanda@resolvedigital.co.nz> | 2010-12-01 11:43:26 +1300 |
---|---|---|
committer | Amanda Wagener <amanda@resolvedigital.co.nz> | 2010-12-01 11:43:26 +1300 |
commit | c38d9c3da5b9b21df07c4c7ebc8617413977c7fb (patch) | |
tree | 6feb6b3557630c5243eead5307320660a8201f2a /app/controllers/blog/posts_controller.rb | |
parent | a1f7ea061ea2c9694a383c8d20137628a178d979 (diff) | |
download | refinerycms-blog-c38d9c3da5b9b21df07c4c7ebc8617413977c7fb.tar.gz refinerycms-blog-c38d9c3da5b9b21df07c4c7ebc8617413977c7fb.tar.bz2 refinerycms-blog-c38d9c3da5b9b21df07c4c7ebc8617413977c7fb.zip |
Remove all Rails2/Rails3 checks as master is now Rails3 only
Diffstat (limited to 'app/controllers/blog/posts_controller.rb')
-rw-r--r-- | app/controllers/blog/posts_controller.rb | 34 |
1 files changed, 9 insertions, 25 deletions
diff --git a/app/controllers/blog/posts_controller.rb b/app/controllers/blog/posts_controller.rb index 5de6984..f489039 100644 --- a/app/controllers/blog/posts_controller.rb +++ b/app/controllers/blog/posts_controller.rb @@ -3,29 +3,21 @@ class Blog::PostsController < BlogController before_filter :find_all_blog_posts, :except => [:archive] before_filter :find_blog_post, :only => [:show, :comment, :update_nav] - respond_to :html, :js, :rss if Rails.version >= '3.0.0' + respond_to :html, :js, :rss def index - if Rails.version < '3.0.0' - # TODO: respond_to block - else - respond_with (@blog_posts) do |format| - format.html - format.rss - end + respond_with (@blog_posts) do |format| + format.html + format.rss end end def show @blog_comment = BlogComment.new - if Rails.version < '3.0.0' - # TODO: respond_to block - else - respond_with (@blog_post) do |format| - format.html { present(@page) } - format.js { render :partial => 'post', :layout => false } - end + respond_with (@blog_post) do |format| + format.html { present(@page) } + format.js { render :partial => 'post', :layout => false } end end @@ -33,11 +25,7 @@ class Blog::PostsController < BlogController if (@blog_comment = @blog_post.comments.create(params[:blog_comment])).valid? if BlogComment::Moderation.enabled? or @blog_comment.ham? begin - if Rails.version < '3.0.0' - Blog::CommentMailer.deliver_notification(@blog_comment, request) - else - Blog::CommentMailer.notification(@blog_comment, request).deliver - end + Blog::CommentMailer.notification(@blog_comment, request).deliver rescue logger.warn "There was an error delivering a blog comment notification.\n#{$!}\n" end @@ -63,11 +51,7 @@ class Blog::PostsController < BlogController :page => params[:page], :per_page => RefinerySetting.find_or_set(:blog_posts_per_page, 10) }) - if Rails.version < '3.0.0' - # TODO: respond_to block - else - respond_with (@blog_posts) - end + respond_with (@blog_posts) end protected |