chicks / sugarcrm

A ruby based REST Client for SugarCRM
MIT License
90 stars 64 forks source link

Document Module #33

Closed frugardc closed 13 years ago

frugardc commented 13 years ago

Is there an example of how to use the gem to attach a file?

chicks commented 13 years ago

Yeah, take a look at this test: https://github.com/chicks/sugarcrm/blob/master/test/connection/test_set_note_attachment.rb

frugardc commented 13 years ago

Awesome! Thanks!

frugardc commented 13 years ago

Little confused about using this with Documents and DocumentRevisions. Do you call set_document_revision with the id from the Document or the DocumentRevision? A test on the set_document_revision methods would be really, really helpful. Let me know if I should create another ticket for this.

Thanks again!

chicks commented 13 years ago

Looks like you pass in the revision ID (check here: http://developers.sugarcrm.com/docs/OS/6.1/-docs-Developer_Guides-Sugar_Developer_Guide_6.1.0-Chapter%202%20Application%20Framework.html#9001033)

I can add tests for it tonight.

chicks commented 13 years ago

Okay I lied. The documentation is wrong... Looking at the source, it looks like we need to modify the API method to pass a JSON object with some values set.

This won't work until I make some changes - I'll try to get them in tonight.

chicks commented 13 years ago

Also worth noting... SugarCRM::Document.first.revisions doesn't work. This looks like a SugarCRM bug too...

chicks commented 13 years ago

If you check out head, there's a test now for set_document_revision. Enjoy!

chicks commented 13 years ago

Also, I submitted case #72214 under you guys account for the issue I found with get_relationships on the "revisions" link_field. I'm assigned to it, and I created a bug so nobody should be contacting you about it.

frugardc commented 13 years ago

I see that. Thanks! Taking a look at the new Document test today. You know of anyway to get Bundler to update to the Head version?