diff --git a/kaminari.gemspec b/kaminari.gemspec index 8ba529e..22e50fc 100644 --- a/kaminari.gemspec +++ b/kaminari.gemspec @@ -36,6 +36,7 @@ Gem::Specification.new do |s| s.add_development_dependency 'dm-migrations', ['>= 1.1.0'] s.add_development_dependency 'dm-aggregates', ['>= 1.1.0'] s.add_development_dependency 'dm-transactions', ['>= 1.1.0'] + s.add_development_dependency 'dm-active_model', ['>= 1.1.0'] s.add_development_dependency 'dm-sqlite-adapter', ['>= 1.1.0'] s.add_development_dependency 'rspec', ['>= 0'] s.add_development_dependency 'rspec-rails', ['>= 0'] diff --git a/lib/kaminari/helpers/action_view_extension.rb b/lib/kaminari/helpers/action_view_extension.rb index 6e731d9..60520a7 100644 --- a/lib/kaminari/helpers/action_view_extension.rb +++ b/lib/kaminari/helpers/action_view_extension.rb @@ -93,7 +93,11 @@ module Kaminari elsif options[:entry_name] options[:entry_name] else - collection.model_name.human.downcase + if collection.respond_to? :model # DataMapper + collection.model.model_name.human.downcase + else # AR + collection.model_name.human.downcase + end end entry_name = entry_name.pluralize unless collection.total_count == 1