Skip to content

Commit

Permalink
Merge pull request #1 from thaiduchyk/feat-rails5-compatibility
Browse files Browse the repository at this point in the history
fix rails5 compatibility issues
  • Loading branch information
srosa committed Jan 16, 2018
2 parents a0d9207 + e527e36 commit 7c15f4a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions lib/neat_pages/implants/action_controller_implant.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module NeatPages::Implants::ActionControllerImplant
extend ActiveSupport::Concern

included do
append_after_filter :set_pagination_header
append_after_action :set_pagination_header

helper_method :pagination

Expand All @@ -15,15 +15,15 @@ module NeatPages::Implants::ActionControllerImplant
def paginate(options={})
options.reverse_merge! per_page: 20

@_env['neat_pages'] = NeatPages::Base.new(params[:page], options)
@_request.env['neat_pages'] = NeatPages::Base.new(params[:page], options)
end

def pagination
@_env['neat_pages']
@_request.env['neat_pages']
end

def render_out_of_bound
render text: "out_of_bound", status: 404
render body: "out_of_bound", status: 404
end

def set_pagination_header
Expand Down
2 changes: 1 addition & 1 deletion spec/dummy/config/environments/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

# Configure static asset server for tests with Cache-Control for performance.
config.serve_static_assets = true
config.static_cache_control = "public, max-age=3600"
config.public_file_server.headers = { 'Cache-Control' => 'public, max-age=3600' }

# Show full error reports and disable caching.
config.consider_all_requests_local = true
Expand Down
4 changes: 2 additions & 2 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
require 'simplecov-rcov-text'
require 'coveralls'

SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new([
SimpleCov::Formatter::HTMLFormatter,
SimpleCov::Formatter::RcovTextFormatter,
Coveralls::SimpleCov::Formatter
]
])

SimpleCov.start do
add_filter "spec/dummy"
Expand Down

0 comments on commit 7c15f4a

Please sign in to comment.