#1145·kaminari

private method `themes' called for class Kaminari::Generators::ViewsGenerator

Author: damisulCreated Dec 5, 2025Updated Dec 5, 2025

I'm trying to run rails g kaminari:views bootstrap4 with HEAD version of kaminari, Ruby 3.3.9 and Rails 8.0.2.

but it fails with an error:

.../kaminari-core/lib/generators/kaminari/views_generator.rb:42:in `copy_or_fetch': private method `themes' called for class Kaminari::Generators::ViewsGenerator (NoMethodError)

        if (theme = self.class.themes.detect {|t| t.name == file_name})
                              ^^^^^^^

it clearly looks like an error, as private methods cannot be called with explicit receiver.

I see themes method was touched in 73162156d85889c3458ba09b9ea45704ab86bcae for the last time. But it was private even before...

I guess self.class.send(:themes) would work but maybe we can make it non-private? (Don't know reasons causing this design).