Skip to content
This repository has been archived by the owner on Aug 6, 2023. It is now read-only.

Commit

Permalink
fix(rename-object_id): Method name object_id shouldn't be overriden
Browse files Browse the repository at this point in the history
  • Loading branch information
maddiesch committed Feb 24, 2019
1 parent 861d943 commit 577f825
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
# Version 1.2.1

## Released February 23, 2019

###

- Feat: Allow setting a different primary id attribute.

- Fix: Rename method named `#object_id`

---

# Version 1.2.0

## Released February 23, 2019
Expand Down
4 changes: 2 additions & 2 deletions lib/onsi/resource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def initialize(object, version = nil, includes: nil)
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)
Expand Down Expand Up @@ -189,7 +189,7 @@ def validate!
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
Expand Down
2 changes: 1 addition & 1 deletion lib/onsi/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Onsi
##
# The current version of Onsi
VERSION = '1.2.0'.freeze
VERSION = '1.2.1'.freeze
end

0 comments on commit 577f825

Please sign in to comment.