You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed that when the attachinary_file_field_options fetches existing attachinary_files associated with my model it serializes the files: [<Attachinary::File ...>] like files: [{ file: { id: 123 ...} }, {file: { id: 456 ...} } ] instead of the correct files: [ {id: 123 ...}, {id: 456, ...} ].
And this makes it go wrong is many ways (remove button doesn't work, posting this option and assigning it to the attachment association makes it delete all associations and recreate them all again, etc.
And I add it to the config/initializers/attachinary.rb file. Sounds like it is working properly but I am not sure if this is a bug or if it is something I am doing wrong. All the rest of the configuration is default to what the README instructs.
The text was updated successfully, but these errors were encountered:
akitaonrails
changed the title
The JS side files options may be serialized in the wrong way
The attachment files options may be serialized in the wrong way
Sep 7, 2016
I noticed that when the
attachinary_file_field_options
fetches existing attachinary_files associated with my model it serializes thefiles: [<Attachinary::File ...>]
likefiles: [{ file: { id: 123 ...} }, {file: { id: 456 ...} } ]
instead of the correctfiles: [ {id: 123 ...}, {id: 456, ...} ]
.And this makes it go wrong is many ways (remove button doesn't work, posting this option and assigning it to the attachment association makes it delete all associations and recreate them all again, etc.
I was finally able to figure out a fix like this:
And I add it to the
config/initializers/attachinary.rb
file. Sounds like it is working properly but I am not sure if this is a bug or if it is something I am doing wrong. All the rest of the configuration is default to what the README instructs.The text was updated successfully, but these errors were encountered: