I have an issue re-creating my app DB from JSON backup file.
What I am trying to do now is to create all the records from rake task reading lines in the file and rendering json like:
new_record = key.camelize.constantize.new(hs['key'])
new_record.save
The problem is that I can not skip callbacks for all the models, to be sure I am not creating any dup stuff there. .camelize.constantize.skip_callback(:after_create)
is just not working giving me an error undefined method '_after_create_callbacks' for #<Class:
.
So two questions here:
1) Is there any way to skip AR callbacks other way? 2) Are there any other options for re-creating db from JSON except SQL queries?