User class inferred by Authlogic loses respond_to?
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
en开发者_开发百科d
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? ?
Are you using method missing trickery anywhere? This url seems to be talking about a similar problem, perhaps it can help you.
精彩评论