diff options
author | Jamie Winsor <jamie@enmasse.com> | 2011-08-14 19:31:36 -0700 |
---|---|---|
committer | Jamie Winsor <jamie@enmasse.com> | 2011-08-14 19:32:25 -0700 |
commit | 13cafc094712787bf0e5ad0b1dc0e4eb764920d9 (patch) | |
tree | 45fe84815cf7a86451a87b934a46154eeeb9d974 | |
parent | 87bc12a1e47779fcfa90d24a2eb22862560ca646 (diff) | |
download | refinerycms-blog-13cafc094712787bf0e5ad0b1dc0e4eb764920d9.tar.gz refinerycms-blog-13cafc094712787bf0e5ad0b1dc0e4eb764920d9.tar.bz2 refinerycms-blog-13cafc094712787bf0e5ad0b1dc0e4eb764920d9.zip |
Syntax fixes for Ruby 1.8.7
-rw-r--r-- | Gemfile | 7 | ||||
-rw-r--r-- | app/controllers/refinery/admin/blog/posts_controller.rb | 4 | ||||
-rw-r--r-- | app/controllers/refinery/blog/categories_controller.rb | 5 | ||||
-rw-r--r-- | app/controllers/refinery/blog/posts_controller.rb | 15 | ||||
-rw-r--r-- | spec/dummy/config/application.rb | 7 | ||||
-rw-r--r-- | spec/dummy/config/initializers/session_store.rb | 2 | ||||
-rw-r--r-- | spec/dummy/config/initializers/wrap_parameters.rb | 2 |
7 files changed, 17 insertions, 25 deletions
@@ -1,10 +1,7 @@ source "http://rubygems.org" -gemspec - -## Uncomment the following lines to develop against a local clone of refinery +## Uncomment the following lines to develop against edge refinery gem 'refinerycms', :git => 'git://github.com/resolve/refinerycms.git' -gem 'refinerycms-generators', :git => 'git://github.com/resolve/refinerycms-generators.git' gem 'seo_meta', :git => 'git://github.com/parndt/seo_meta.git' gem 'jquery-rails' @@ -21,3 +18,5 @@ group :assets do end gem 'arel', '2.1.4' # 2.1.5 is broken. see https://github.com/rails/arel/issues/72 + +gemspec diff --git a/app/controllers/refinery/admin/blog/posts_controller.rb b/app/controllers/refinery/admin/blog/posts_controller.rb index e3b0f3b..c8c38b2 100644 --- a/app/controllers/refinery/admin/blog/posts_controller.rb +++ b/app/controllers/refinery/admin/blog/posts_controller.rb @@ -9,9 +9,7 @@ module Refinery :order => 'published_at DESC' def uncategorized - @blog_posts = Kaminari.paginate_array(Refinery::BlogPost.uncategorized) - .page(params[:page]) - .per(Refinery::BlogPost.per_page) + @blog_posts = Kaminari.paginate_array(Refinery::BlogPost.uncategorized).page(params[:page]).per(Refinery::BlogPost.per_page) end def tags diff --git a/app/controllers/refinery/blog/categories_controller.rb b/app/controllers/refinery/blog/categories_controller.rb index a363b8c..57196c3 100644 --- a/app/controllers/refinery/blog/categories_controller.rb +++ b/app/controllers/refinery/blog/categories_controller.rb @@ -4,10 +4,7 @@ module Refinery def show @category = Refinery::BlogCategory.find(params[:id]) - @blog_posts = @category.posts - .live - .includes(:comments, :categories) - .page(params[:page]) + @blog_posts = @category.posts.live.includes(:comments, :categories).page(params[:page]) end end diff --git a/app/controllers/refinery/blog/posts_controller.rb b/app/controllers/refinery/blog/posts_controller.rb index 408359f..167aef3 100644 --- a/app/controllers/refinery/blog/posts_controller.rb +++ b/app/controllers/refinery/blog/posts_controller.rb @@ -54,16 +54,12 @@ module Refinery date = "#{params[:month]}/#{params[:year]}" @archive_date = Time.parse(date) @date_title = @archive_date.strftime('%B %Y') - @blog_posts = Refinery::BlogPost.live - .by_archive(@archive_date) - .page(params[:page]) + @blog_posts = Refinery::BlogPost.live.by_archive(@archive_date).page(params[:page]) else date = "01/#{params[:year]}" @archive_date = Time.parse(date) @date_title = @archive_date.strftime('%Y') - @blog_posts = Refinery::BlogPost.live - .by_year(@archive_date) - .page(params[:page]) + @blog_posts = Refinery::BlogPost.live.by_year(@archive_date).page(params[:page]) end respond_with (@blog_posts) end @@ -71,8 +67,7 @@ module Refinery def tagged @tag = ActsAsTaggableOn::Tag.find(params[:tag_id]) @tag_name = @tag.name - @blog_posts = Refinery::BlogPost.tagged_with(@tag_name) - .page(params[:page]) + @blog_posts = Refinery::BlogPost.tagged_with(@tag_name).page(params[:page]) end protected @@ -88,9 +83,7 @@ module Refinery end def find_all_blog_posts - @blog_posts = Refinery::BlogPost.live - .includes(:comments, :categories) - .page(params[:page]) + @blog_posts = Refinery::BlogPost.live.includes(:comments, :categories).page(params[:page]) end def find_tags diff --git a/spec/dummy/config/application.rb b/spec/dummy/config/application.rb index 60df716..e67cf82 100644 --- a/spec/dummy/config/application.rb +++ b/spec/dummy/config/application.rb @@ -3,7 +3,12 @@ require File.expand_path('../boot', __FILE__) require 'rails/all' require 'bundler/setup' -Bundler.require + +# If you have a Gemfile, require the default gems, the ones in the +# current environment and also include :assets gems if in development +# or test environments. +Bundler.require *Rails.groups(:assets) if defined?(Bundler) + require 'refinerycms-blog' module Dummy diff --git a/spec/dummy/config/initializers/session_store.rb b/spec/dummy/config/initializers/session_store.rb index 952473f..aa2f512 100644 --- a/spec/dummy/config/initializers/session_store.rb +++ b/spec/dummy/config/initializers/session_store.rb @@ -1,6 +1,6 @@ # Be sure to restart your server when you modify this file. -Dummy::Application.config.session_store :cookie_store, key: '_dummy_session' +Dummy::Application.config.session_store :cookie_store, :key => '_dummy_session' # Use the database for sessions instead of the cookie-based default, # which shouldn't be used to store highly confidential information diff --git a/spec/dummy/config/initializers/wrap_parameters.rb b/spec/dummy/config/initializers/wrap_parameters.rb index 16c3243..71b88b0 100644 --- a/spec/dummy/config/initializers/wrap_parameters.rb +++ b/spec/dummy/config/initializers/wrap_parameters.rb @@ -4,7 +4,7 @@ # is enabled by default. # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. -ActionController::Base.wrap_parameters format: [:json] +ActionController::Base.wrap_parameters :format => [:json] # Disable root element in JSON by default. if defined?(ActiveRecord) |