Question: I have a model with the following method 

```
 class Legacy::Retailer < ActiveRecord::Base
  belongs_to :retailers
  self.table_name = 'orim_retailers'

  def retailer_options
    retailers = Array.new
    self.display_name.each do |names|
      retailers << names
    end
  end

end

```

When I try to call this method from the controller as

```
@retailer_options = Legacy::Retailer.retailer_options

```

I get a method an undefined method error. I'm not sure what I'm doing wrong.

Answer: 
Because you defined an instance method, not a class method.

To be able to call 

```
Legacy::Retailer.retailer_options

```

you should define a class method:

```
  def self.retailer_options # note self here
    retailers = Array.new
    self.display_name.each do |names|
      retailers << names
    end
  end

```

And if you've meant to call this method on instances, not class itself, you should be able to do the following:

```
Legacy::Retailer.new.retailer_options

```
you've defined an instance method but you're calling it as a class method.

```
@retailer = Legacy::Retailer.new
@retailer.retailer_options

```

will work