I have a UsersController and a Model called User with a "new" method,
class User < ActiveRecord::Base
return 1 #I can do anything and return any data, the
The problem is that I cannot access my "test" function from the
controller. It says that the method doesn't exists.
class UsersController < ApplicationController
render :text => User.test # Produces the error.
Additionally, I cannot access the mehod increase! and other methods of
the ActiveRecord::Base class, that is extended by the User class.
Shouldn't it be accessible?
The User.methods doesn't display the method I created and I cannot
access it. However, other very used methods, like "find" are not shown
by User.methods, but they are accessible.
Anyone can explain me how these things work?
Thank you very much.