Created
February 15, 2010 06:17
-
-
Save AndyMoreland/304451 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| NoMethodError in Blog postsController#index | |
| undefined method `devise' for User:Class |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| All of the configuration is by the book. Nothing special, just defaults. | |
| Everything in the app works except for the user model -- other models are just fine. | |
| The mongoid.rb file is being loaded by devise correctly. It seems that the Devise::Models module is never being included into Mongoid::Document::ClassMethods | |
| I have not defined any field on the user model, just trying to get Devise to load first. | |
| Using bundler to manage gems, rails 2.3.5. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module Devise | |
| module Orm | |
| module Mongoid | |
| def self.included_modules_hook(klass, modules) | |
| klass.send :extend, self | |
| yield | |
| modules.each do |mod| | |
| klass.send(mod) if klass.respond_to?(mod) | |
| end | |
| end | |
| include Devise::Schema | |
| # Tell how to apply schema methods. This automatically converts DateTime | |
| # to Time, since MongoMapper does not recognize the former. | |
| def apply_schema(name, type, options={}) | |
| return unless Devise.apply_schema | |
| type = Time if type == DateTime | |
| field name, {:type => type}.merge(options) | |
| end | |
| end | |
| end | |
| end | |
| Mongoid::Document::ClassMethods.send(:include, Devise::Models) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class User | |
| include Mongoid::Document | |
| devise :authenticatable | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment