I have these classes:
class FilmTitle < ActiveRecord::Base
has_many :films_film_titles
has_many :films, :through => :films_film_titles
has_many :assets, :through => :films
end
class Film < ActiveRecord::Base
has_many :assets
end
class FilmsFilmTitle < ActiveRecord::Base
belongs_to :film
belongs_to :film_title
end
class Asset < ActiveRecord::Base
belongs_to :film
end
but this does not work:
ft = FilmTitle.find 13
ft.assets <- throws error:
ActiveRecord::StatementInvalid: Mysql::Error: Unknown column
‘films.film_title_id’ in ‘where clause’: SELECT assets
.* FROM
assets
INNER JOIN films ON assets.film_id = films.id WHERE
((films
.film_title_id = 13))
How can I get to these?