I have the following relationships that work in the rails console but not when I run the site what I am doing wrong? 

```
class C < ActiveRecord::Base
  belongs_to :b
end

class B < ActiveRecord::Base
  belongs_to :a
  has_many :c

  def title
    a.title
  end
end

```

Table C has a foreign key to B and B has a foreign key to A.

This works in the rails console.

```
c = C.find(12)
c.b.title

```

But it doesn't work when I run the site.

Here is the error I get

```
NoMethodError (undefined method `title' for #<ActiveRecord::Associations::BelongsToAssociation:0x104feb5a0>):

```