end
def update
- attrs_to_update = resource_attrs.reject { |k,v| [:kind,:etag].index k }
+ attrs_to_update = resource_attrs.reject { |k,v|
+ [:kind, :etag, :href].index k
+ }
if @object.update_attributes attrs_to_update
show
else
end
def thread_with_auth_info
+ Thread.current[:api_url_base] = root_url.sub(/\/$/,'') + '/arvados/v1'
begin
user = nil
api_client = nil
kind.match(/^arvados\#(.+?)(_list|List)?$/)[1].pluralize.classify.constantize rescue nil
end
+ def href
+ "#{current_api_base}/#{self.class.to_s.pluralize.underscore}/#{self.uuid}"
+ end
+
def eager_load_associations
self.class.columns.each do |col|
re = col.name.match /^(.*)_kind$/
base.extend(ClassMethods)
base.acts_as_api
base.api_accessible :common do |t|
+ t.add :href
t.add :kind
t.add :etag
t.add :uuid
Thread.current[:api_client_authorization]
end
+ def current_api_base
+ Thread.current[:api_url_base]
+ end
+
def current_default_owner
# owner_uuid for newly created objects
((current_api_client_authorization &&