I have a rails (2.3.5) project that has two models that are not
ActiveRecord based - one is called Wiki and another is called WebApi.
I have been using this in the past, and it was working. However,
something I did is now causing ArgumentError to be raised when I call
a class method on WebApi from a Wiki class method. Here is the
def self.get_url phrase=''
response = WebApi.format_and_call(WIKIPEDIA_URL, phrase) #error
def self.format_and_call url_format_string, phrase)
Here is the error I get:
ArgumentError (wrong number of arguments (0 for 1)):
On debugging, i notice that the error is coming from a const_missing
triggered by the attempt to access the WebApi object (it has nothing
to do with the Wikipedia Url constant, which is fine). Here is the
if [Object, Kernel].include?(self) || parent == self
parent_name ? parent_name.constantize : Object
unless defined? @parent_name
@parent_name = name =~ /::[^:]+\Z/ ? $`.freeze : nil
#<ArgumentError: wrong number of arguments (0 for 1)>
I had initially named the WebApi class as Web, and thought the problem
may be due to a name collision, but I tried different names, and get
the same problem.
I am quite confused, since this seems fairly simple code, and I don't
know where to look.
I am using devise, and have delayed_job as well in the project, but
not really using it in this case.