amatsuda/kaminari — Issue #178: problem in nested 3.1.1 engines
Author: fmorton
Created: 2011-11-05 21:29:43+00:00
State: open

I have a full 3.1.1 engine called Base2Cms. In the engine is a model named "Organization".

I have another engine that uses the Base2Cms engine that needs to extend the Organization model. The extension of the model looks like this:

require_dependency "#{Base2Cms::Engine.root}/app/models/organization"

class Organization < ActiveRecord::Base
has_one :consumer_organization, :dependent => :destroy
has_many :meetings
has_many :subscriptions, :as => :parent_object, :dependent => :destroy
has_one :supplier_organization, :dependent => :destroy
has_many :supplier_qualifications, :dependent => :destroy

accepts_nested_attributes_for :consumer_organization
accepts_nested_attributes_for :supplier_organization
end

Using the console to test with using "Organization.limit(10).page(1)", in the Base2Cms engine, works just fine. In the next engine, it generates the error:

undefined local variable or method `page' for #

Things like "Organization.first.subscriptions" works just fine in the second engine, so the model extension is working nicely. Just kaminari gets messed up somehow.

Any ideas? I've tried "require 'kaminari'" and other methods all over the place with the same results.

Kaminari version is 0.12.4