Class: LucidWorks::Jdbcdriver
- Defined in:
- lib/lucid_works/jdbcdriver.rb
Overview
This model is a strange beast. You can DELETE it, but that’s about it. GET on the plural resource name returns a list of strings, not hashes so we create these things by hand in Collection
Constant Summary
Constants included from Utils::BoolConverter
Utils::BoolConverter::FALSE_VALUES, Utils::BoolConverter::TRUE_VALUES
Instance Attribute Summary
Attributes inherited from Base
#attributes, #id, #parent, #persisted, #raw_response, #response_data
Instance Method Summary collapse
-
#save ⇒ Object
Dont’ let LucidWorks::Base do this as it will try to encode us as JSON In this case we need to let RestClient do it’s thing and figure out we should do a multipart post.
Methods inherited from Base
all, collection_url, #collection_url, create, #destroy, extract_parent_from_options, find, first, human_attribute_value, #human_attribute_value, #initialize, #inspect, last, #member_url, #persisted?, #read_attribute_for_validation, schema, singleton_name, to_select, #update_attributes
Methods included from SimpleNaming
Methods included from Utils::BoolConverter
Constructor Details
This class inherits a constructor from LucidWorks::Base
Instance Method Details
#save ⇒ Object
Dont’ let LucidWorks::Base do this as it will try to encode us as JSON In this case we need to let RestClient do it’s thing and figure out we should do a multipart post
20 21 22 23 24 25 26 27 28 |
# File 'lib/lucid_works/jdbcdriver.rb', line 20 def save return false unless valid? RestClient.post(collection_url, :file => file) @persisted = true rescue RestClient::Exception => e @persisted = false attach_errors_to_model(e.response) return false end |