Upgrade Rails Admin to latest gem
This gives us a clean fix for the Kaminari vs. Will Paginate issues and fixes a few other little bugs in Rails Admin. fixes #3210
This commit is contained in:
parent
f820e37838
commit
b16f309aca
3 changed files with 15 additions and 22 deletions
2
Gemfile
2
Gemfile
|
|
@ -35,7 +35,7 @@ gem 'newrelic_rpm'
|
|||
gem "rpm_contrib", "~> 2.1.7"
|
||||
|
||||
group :production do # we don't install these on travis to speed up test runs
|
||||
gem 'rails_admin'
|
||||
gem 'rails_admin', '~> 0.0.2'
|
||||
gem 'rack-ssl', :require => 'rack/ssl'
|
||||
gem 'rack-rewrite', '~> 1.2.1', :require => false
|
||||
gem 'rack-piwik', :require => 'rack/piwik'
|
||||
|
|
|
|||
16
Gemfile.lock
16
Gemfile.lock
|
|
@ -161,7 +161,7 @@ GEM
|
|||
erubis (2.7.0)
|
||||
eventmachine (1.0.0.beta.4)
|
||||
excon (0.13.2)
|
||||
execjs (1.3.0)
|
||||
execjs (1.3.2)
|
||||
multi_json (~> 1.0)
|
||||
factory_girl (2.6.4)
|
||||
activesupport (>= 2.3.9)
|
||||
|
|
@ -216,7 +216,7 @@ GEM
|
|||
guard-spork (0.5.2)
|
||||
guard (>= 0.10.0)
|
||||
spork (>= 0.8.4)
|
||||
haml (3.1.4)
|
||||
haml (3.1.5)
|
||||
handlebars_assets (0.4.1)
|
||||
execjs (>= 1.2.9)
|
||||
sprockets (>= 2.0.3)
|
||||
|
|
@ -250,7 +250,7 @@ GEM
|
|||
jquery-ui-rails (0.2.2)
|
||||
jquery-rails
|
||||
railties (>= 3.1.0)
|
||||
json (1.6.6)
|
||||
json (1.7.1)
|
||||
jwt (0.1.4)
|
||||
json (>= 1.2.4)
|
||||
kaminari (0.13.0)
|
||||
|
|
@ -357,13 +357,13 @@ GEM
|
|||
railties (= 3.1.4)
|
||||
rails-i18n (0.6.3)
|
||||
i18n (~> 0.5)
|
||||
rails_admin (0.0.1)
|
||||
rails_admin (0.0.2)
|
||||
bbenezech-nested_form (~> 0.0.6)
|
||||
bootstrap-sass (~> 2.0)
|
||||
builder (~> 3.0)
|
||||
coffee-rails (~> 3.1)
|
||||
haml (~> 3.1)
|
||||
jquery-rails (>= 1.0)
|
||||
jquery-rails (>= 1.0.17)
|
||||
jquery-ui-rails (~> 0.2.2)
|
||||
kaminari (~> 0.12)
|
||||
rack-pjax (~> 0.5)
|
||||
|
|
@ -424,7 +424,7 @@ GEM
|
|||
ruby-oembed (0.8.7)
|
||||
ruby-progressbar (0.0.10)
|
||||
rubyzip (0.9.8)
|
||||
sass (3.1.15)
|
||||
sass (3.1.17)
|
||||
sass-rails (3.1.4)
|
||||
actionpack (~> 3.1.0)
|
||||
railties (~> 3.1.0)
|
||||
|
|
@ -443,7 +443,7 @@ GEM
|
|||
rack-protection (~> 1.2)
|
||||
tilt (~> 1.3, >= 1.3.3)
|
||||
spork (1.0.0rc2)
|
||||
sprockets (2.0.3)
|
||||
sprockets (2.0.4)
|
||||
hike (~> 1.2)
|
||||
rack (~> 1.0)
|
||||
tilt (~> 1.1, != 1.3.0)
|
||||
|
|
@ -563,7 +563,7 @@ DEPENDENCIES
|
|||
rack-ssl
|
||||
rails (= 3.1.4)
|
||||
rails-i18n
|
||||
rails_admin
|
||||
rails_admin (~> 0.0.2)
|
||||
rails_autolink
|
||||
redcarpet (= 2.0.1)
|
||||
remotipart (~> 1.0)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,12 @@
|
|||
# RailsAdmin config file. Generated on March 24, 2012 15:34
|
||||
# See github.com/sferik/rails_admin for more informations
|
||||
if Rails.env.production?
|
||||
# Recommended way to deal with Kaminari vs. WillPaginate issues
|
||||
if defined?(WillPaginate)
|
||||
Kaminari.configure do |config|
|
||||
config.page_method_name = :per_page_kaminari
|
||||
end
|
||||
end
|
||||
RailsAdmin.config do |config|
|
||||
config.authorize_with do
|
||||
redirect_to main_app.root_path unless current_user.try(:admin?)
|
||||
|
|
@ -1128,17 +1134,4 @@ RailsAdmin.config do |config|
|
|||
# update do; end
|
||||
# end
|
||||
end
|
||||
if defined?(WillPaginate)
|
||||
module WillPaginate
|
||||
module ActiveRecord
|
||||
module RelationMethods
|
||||
def per(value = nil) per_page(value) end
|
||||
def total_count() count end
|
||||
end
|
||||
end
|
||||
module CollectionMethods
|
||||
alias_method :num_pages, :total_pages
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
Reference in a new issue