ruby on rails - Extend ActiveRecord -


my first foray modules!

lib/model_extension/say_hello

module firstmodule end  class activerecord::base   include firstmodule end 

the code in example raises error:

lib/model_extension/say_hello.rb:5:in `<top (required)>': uninitialized constant activerecord (nameerror) 

so mean? need include activerecord::base before telling include modules? putting module in wrong place?

and how should include module in model?

include firstmodule 

would trick, properway it? when install gem alters models, include this:

has_secure_password  

how should set can include module that?


Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -