ruby on rails - undefined method "arel_table" for Images:Module? -


I have the user: the following docs through the union.

I have 3 models

posted

  class posts  

image

  class image & lt; ActiveRecord :: Base has_many: image_posts has_many: Post, via = & gt; : Image_posts end  

and ImagePost

  class ImagePost & lt; ActiveRecord :: Base is_to: images is_to: posts end  

and when I try:

  post = post.last post.images  

I get "undefined method" for arel_table "for images: module" error .

What is arel_table and how to fix this mistake? Thank you.

There is a problem defining the relationship between SAP and it should always be singular

  class ImagePost & lt; ActiveRecord :: Base is_to: image is_to: post end  

Comments

Popular posts from this blog

c++ - C/pp Sockets, recv()/send() works only under gdb -

GO: Serve static pages -

objective c - How to open front/back camera at the same time in iOS developing? -