mongoid / mongoid-grid_fs

A pure Mongoid/Moped implementation of the MongoDB GridFS specification.
Other
83 stars 50 forks source link

Support Mongoid 6/Rails 5 #60

Closed laCour closed 8 years ago

laCour commented 8 years ago

Mongoid seems to have small breaking changes that affect mongoid-grid_fs, if I have the time I'll make a PR for compatibility. Rails 5 doesn't seem to introduce any breaking changes here, but I may be wrong.

Changes in Mongoid 6: https://jira.mongodb.org/browse/MONGOID-4268


Update:

The only issue currently seems to be here: grid_fs.rb:154

Chunk/file associations are acting improperly, a validation error is raised upon saving chunks (i.e. "File can't be blank"). This can be hackishly fixed by forcing the association with chunk.file = file. I'll have to dig deeper, the issue might be caused by a breaking change but I've been unable to find any cause.

krazedkrish commented 8 years ago

@all, eagerly waiting for the solution.

gkunwar commented 8 years ago

@laCour Is there any progress on this issue? Anyone is working on this issue?

laCour commented 8 years ago

@gkunwar I haven't investigated the issue mentioned in my update further, I should have time tonight to look into it more. All I know currently is that there's an issue with the relation between the file model and the chunk model. This could be a bug with Mongoid, I'm not sure. When you call chunks#build on a file object it does not have a relation like it should.

krazedkrish commented 8 years ago

@laCour thanks for solving the issue. :+1:

gkunwar commented 8 years ago

@laCour Thank you. It works fine now. :)

rmm5t commented 8 years ago

Just merged #61. I'll work on getting a new release out soon.

rmm5t commented 8 years ago

A new 2.3.0 release was published this morning. Thanks all! 🍻