jnunemaker / joint Goto Github PK
View Code? Open in Web Editor NEW[DEAD AND UNMAINTAINED] MongoMapper and GridFS joined in file upload love.
License: MIT License
[DEAD AND UNMAINTAINED] MongoMapper and GridFS joined in file upload love.
License: MIT License
Hi John, got uploads working with Joint (thanks for the pointers on twitter, btw), but I'm having trouble getting the tests right. I've posted the issue on StackOverflow, not sure it's on Joint's side or Rails's (or my own, of course ;):
Testing this at the controller level since it's an api call with no view...
I just spent no less than two hours trying to figure out why the file i saved in gridfs had size 0, only to realize out of nowhere that read continues from where the file pointer is. Hence, it was trying to read from the end of my freshly written and still open Tempfile.
Anyway, just doing a simple tmp_file.rewind before passing the instance of to Joint did the trick.
I would presume this rewind is something Joint should do in Joint#save_attachments, and hence I'm classifying this as a bug.
I've recently upgraded to Rails 3.0.3 from Rails 3.0.1 and Joint no longer works in production mode. This is because the UploadedFile class has been changed in ActionDispatch. A good explanation can be found here - http://marklunds.com/articles/one/433
The actual error I get in production mode when doing a file upload is
TypeError (can't convert ActionDispatch::Http::UploadedFile into String):
For the moment I've rolled back to Rails 3.0.1. Have you got any pointers for making Joint work with the recent ActionDispatch updates?
Upgrading an app to Rails 3/MM 0.9.2 and using Bundler, got an error for Joint 0.5.5 which has a dependency on MM 0.8.6. Can you push a new tag of Joint to rubygems with the MM 0.9.X dependency?
Add
require 'active_support/concern'
in joint.rb could solve this problem.
Mongo::Grid reads IOs chunkwise to avoid unnecessary memory usage. Is there a particular reason why save_attachments
rewinds and reads the io
into memory?
See: https://github.com/jnunemaker/joint/blob/master/lib/joint/instance_methods.rb#L22
Noting this here (without a fix, sorry) mainly so others don't fall down the trap.
I was using Joint on an embedded doc (in another embedded doc) and it looked like it was saving, all the metadata was there, but I couldn't get the files out.
More info here: https://groups.google.com/forum/#!searchin/mongomapper/joint/mongomapper/CN4OAL4S-Jw/HDbFPfyjcasJ
LICENSE file seems to be missing. I would like to use this for a project but can't before you clear out which license it's using. Thanks man :)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.