How to fetch LOBS?

13 views
Skip to first unread message

Brad

unread,
May 12, 2011, 1:36:57 PM5/12/11
to SimpleRecord
I have a model:

class Faq < SimpleRecord::Base
has_strings :question
has_clobs :answer

#sr_config :single_clob=>true
end

@faqs = Faq.find(:all)

@faqs.first.answer # This gives me "lobs/2f45cf06-7cbb-11e0-
bf9e-70cd60fffe52_answer"

I would expect the return value of @faqs.first.answer to be the actual
string value; not the key to where it is in S3. Looking at the code,
this it what it looks like it is attempting to do as well. Any idea
what I am doing wrong?

Here is my connection string:
SimpleRecord.establish_connection(id, key, :connection_mode
=> :per_thread, :s3_bucket => :new)

As you can see from the commented out sr_config line, I have tried it
with this as well. When I used this, I saved new model data before
attempting to fetch. When this option is enabled, I get:

can't convert Aws::S3::Key into String

I have manually verified that the file exists on S3 and has the
correct data. It looks like saving is working correctly.

Travis Reeder

unread,
May 12, 2011, 4:02:45 PM5/12/11
to simple...@googlegroups.com
That should definitely work as you state, I wonder if this is a newly introduced bug. What version of aws gem are you using?  There was a new 'aws' release in the past few days.


--
You received this message because you are subscribed to the Google Groups "SimpleRecord" group.
To post to this group, send email to simple...@googlegroups.com.
To unsubscribe from this group, send email to simple-recor...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/simple-record?hl=en.


Brad

unread,
May 13, 2011, 6:19:18 PM5/13/11
to SimpleRecord
aws 2.5.2. Is there a specific version you know it to work with?

Travis Reeder

unread,
May 16, 2011, 9:36:54 PM5/16/11
to simple...@googlegroups.com
I just tried the latest and you are correct. I'll try to fix.

Travis Reeder

unread,
May 18, 2011, 2:32:49 PM5/18/11
to simple...@googlegroups.com
should be fixed with aws 2.5.3. 
Reply all
Reply to author
Forward
0 new messages