lib/unit-ruby/util/api_resource.rb in unit-ruby-0.4.3 vs lib/unit-ruby/util/api_resource.rb in unit-ruby-0.5.0
- old
+ new
@@ -94,10 +94,10 @@
Kernel.const_get(class_name).find(relationship_id)
end
define_method("#{resource_name}=") do |resource|
relationships[resource_name] = {
- data: { type: resource_name, id: resource.id }
+ data: { type: resource_name.to_s.camelize(:lower).to_sym, id: resource.id }
}
end
end
def self.has_many(resource_name, class_name: nil)