0

I have a model Account located under /app/models/account.rb:

class Account < ActiveRecord::Base
end

when I now request the controller I get undefined method all for Account:Module:

class AccountsController < ApplicationController
  def index
    @accounts = Account.all
  end
end

I tried renaming the model to Accounte which does work. However I see a lot of rails tutorials working with Account models and it is really hard to find other names.

How do I locate and disable the Account module to clear this naming conflict?

I can access the bad Account through rails console.

bodokaiser
  • 15,122
  • 22
  • 97
  • 140

1 Answers1

1

Problem was that I used rails new account which creates a module Account in config/application.rb. This caused the naming trouble.

bodokaiser
  • 15,122
  • 22
  • 97
  • 140