Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Defining Classes #105

tomrossi7 opened this Issue · 0 comments

1 participant


I am working on upgrading my ActiveResource and integration with the latest Basecamp API. The association stuff looks great, but I noticed a problem where the class has to be defined before it is referenced in an association. Here is an example of what I mean.

class BasecampNext
  class Todolist < Resource

  class Project < Resource
    has_many :todolists, class_name: 'basecamp_next/todolist'

If I define the BasecampNext::Todolist class before the BasecampNext::Project class, everything works fine. If I definite it after, I get the following error when the file is loaded:

NameError: uninitialized constant BasecampNext::Todolist

This would create problems then if I tried to define a belongs_to :project association on BasecampNext::Todolist. I could define them all first and then define the associations, but I don't think that was intended.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.