Z
Z
Zaur Ashurbekov2017-08-02 02:01:11
Ruby on Rails
Zaur Ashurbekov, 2017-08-02 02:01:11

How to cache changes in HABTM links?

Hello toaster!
There are two user and file models linked by HABTM. There is a code:
user.files << file
Now, when user.files is called, our new file will be in the list, but file.users will not give us anything without calling reload. Is there a way to fix this by the type of inverse_of option, when nothing needs to be reloaded?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
vsuhachev, 2017-08-11
@zaurius

There is no such way. You need to write code with this feature in mind.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question