Permalink
Browse files

Use will paginate

  • Loading branch information...
1 parent 59382c7 commit aa9bebf26a6ed2de6c145a860b44b7ab17107b05 @drogus committed Apr 26, 2012
Showing with 6 additions and 11 deletions.
  1. +3 −7 Gemfile
  2. +1 −1 app/models/tolk/locale.rb
  3. +1 −1 app/views/tolk/locales/show.html.erb
  4. +0 −1 lib/tolk.rb
  5. +1 −1 tolk.gemspec
View
10 Gemfile
@@ -1,17 +1,13 @@
source "http://rubygems.org"
#gem "rails", "3.1.0.beta1"
-gem 'rails', :git => 'git://github.com/rails/rails.git'
+gem 'rails', '~> 3.2.0'
-gem "kaminari"
+gem "will_paginate", "~> 3.0"
gem "ya2yaml"
gem "capybara", :git => "https://github.com/jnicklas/capybara.git"
gem "factory_girl_rails"
gem "sqlite3-ruby", :require => "sqlite3"
gem "mocha"
-
-if RUBY_VERSION < '1.9'
- gem "ruby-debug", ">= 0.10.3"
-end
-
+gem "debugger"
View
2 app/models/tolk/locale.rb
@@ -134,7 +134,7 @@ def phrases_without_translation(page = nil, options = {})
existing_ids = self.translations.all(:select => 'tolk_translations.phrase_id').map(&:phrase_id).uniq
phrases = phrases.scoped(:conditions => ['tolk_phrases.id NOT IN (?)', existing_ids]) if existing_ids.present?
- result = phrases.page(page).per(Tolk::Phrase.per_page)
+ result = phrases.paginate :page => page, :per_page => Tolk::Phrase.per_page
result
end
View
2 app/views/tolk/locales/show.html.erb
@@ -49,7 +49,7 @@
</div>
<% end %>
<div class="paginate">
- <%= paginate @phrases %>
+ <%= will_paginate @phrases %>
</div>
<% else %>
<p style="text-align: left">There aren't any missing or updated phrases that need translation.</p>
View
1 lib/tolk.rb
@@ -1,4 +1,3 @@
-require 'kaminari'
require 'ya2yaml'
require 'tolk/engine'
require 'tolk/sync'
View
2 tolk.gemspec
@@ -9,7 +9,7 @@ Gem::Specification.new do |s|
s.homepage = 'http://www.rubyonrails.org'
s.platform = Gem::Platform::RUBY
- s.add_dependency('kaminari')
+ s.add_dependency('will_paginate', '~> 3.0')
s.add_dependency('ya2yaml', '~> 0.26')
s.files = Dir['README', 'MIT-LICENSE', 'config/routes.rb', 'init.rb', 'lib/**/*', 'app/**/*', 'public/tolk/**/*']

0 comments on commit aa9bebf

Please sign in to comment.