lib/onsi/resource.rb in onsi-1.2.0 vs lib/onsi/resource.rb in onsi-1.2.1
- old
+ new
@@ -152,11 +152,11 @@
#
# @return [Hash]
def as_json(_opts = {})
{}.tap do |root|
root[TYPE_KEY] = type
- root[ID_KEY] = object_id
+ root[ID_KEY] = object_identifier
root[ATTRIBUTES_KEY] = generate_attributes
append_relationships(root)
append_meta(root)
append_includes(root)
end
@@ -187,10 +187,10 @@
if includes.present? && !includes.is_a?(Onsi::Includes)
raise InvalidResourceError, "Included resources in #{self} is not a Onsi::Includes"
end
end
- def object_id
+ def object_identifier
attr = object.class.api_renderer(version, nil, for_render: true).id_attr
object.send(attr).to_s
end
def type