What is the difference between active record object reload and send(:reload!) .
active record
object
reload
send(:reload!)
self.reload # fetches object attributes from db and modifies current self.send(:reload!) # doing same ?
How to get db object without actually changing the current instance using reload?
I can do it using
self.class.find self.id
Is there another way?
from the document:
reload!(print=true) reloads the environment reload() Forces reloading of relation.
I think restart! is a global feature for ribs to reload the environment, not sure what will happen in non-interactive Rails VM ...
Source: https://habr.com/ru/post/1402211/More articles:How to save ctypes objects containing pointers - pythoncheck collision between specific divs? - javascriptHow to set A4 size in WPF user management? - .nethttps://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1402209/xslt-concat-fields-together&usg=ALkJrhjYVoKwWftcuZZ6jBRhL1GILdPEZQNo additional ListView controls - vbaWhat actually happens when I compact the CouchDB database? - couchdbjquery collision detection for divs - javascriptWhy doesn't this work if the test works? - ruby | fooobar.comCreating a function in php that checks that the value gets in the order dd / mm / yyy - phpHow to prevent ostringstream (or the like) from outputting scientific notation WITHOUT precision settings - c ++All Articles