views:

9

answers:

1

I'm trying to move the authlogic (and other common plugin) configuration from one of my Ruby on Rails applications to a plugin so that I don't have to duplicate the common permissions and authentication features in each application.

The user session class is defined in app/model/user_session.rb for the main application:

class UserSession < Authlogic::Session::Base
  include Limbic::UserSession::Model
end

Limbic::UserSession::Model is defined in the plugin I'm writing at vendor/plugins/limbic/lib/limbic/user_session/model.rb.

The user class is defined in app/model/user.rb for the main application:

class User < ActiveRecord::Base
  include Limbic::User::Model
end

When logging in using:

  # Logs in User.
  def create
    debugger
    @user_session = user_session_class.new(params[:user_session])

    respond_to do |format|
      if @user_session.save
  ...

I get the following error: undefined method 'respond_to?' for #User:0x7f736477c7f0.

How is it possible for a class instance to even lose respond_to? ?

A: 

Are you using method missing trickery anywhere? This url seems to be talking about a similar problem, perhaps it can help you.

Maran
Yes, I am, but the trickery is still in the main app and it worked. When I first developed the trickery to bridge ActiveScaffold and Declarative Authorization, I used that url.
Luke Imhoff