Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #6842 - system uuid as id bz1122938 #4504

Merged
merged 1 commit into from Aug 5, 2014

Conversation

dustints
Copy link
Member

Presents the uuid as the id in both the system show and index actions.

@ehelms
Copy link
Member

ehelms commented Jul 31, 2014

@dustint-rh I think the commit needs the # in front of the issue number.

module Katello
module Api
module V2
module Presenter
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation.

@dustints
Copy link
Member Author

dustints commented Aug 1, 2014

@ehelms, @daviddavis updated the summary and indentation.

#
# rubocop:disable TrivialAccessors
module Katello
module Api
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dustint-rh the indentation still looks off I'm afraid. I know the old files do this but they aren't correct (they need to be fixed) and we typically indent the new files inside the Katello module.

Also, we typically put a blank line after the copyright at the top.

@dustints
Copy link
Member Author

dustints commented Aug 4, 2014

@daviddavis updated the indentation

@@ -0,0 +1,18 @@
#
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the module is presenters, should the directory also be named presenters ?

@ehelms
Copy link
Member

ehelms commented Aug 4, 2014

Why wouldn't we just do this in the Rabl?

@daviddavis
Copy link
Contributor

+1 to rabl. this change would still return the old system id for places using the rabl file and I think we don't want that.

@dustints
Copy link
Member Author

dustints commented Aug 4, 2014

@ehelms, @daviddavis updated, using rabl instead

attributes :name, :description
node :id do |r|
r.uuid
end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can just do:

attributes :uuid => :id

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@daviddavis not sure why, but that didn't seem to work.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really? It seems to work for me.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think it's because :uuid has to also be listed as an attribute.

attributes :uuid => id, :uuid

this shows just {uuid: xyx }

attributes :uuid => id

this shows {id: xyz}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah ok, that's weird. One thing you could do is make this one line:

node :id { |system| system.uuid }

@daviddavis
Copy link
Contributor

APJ

In the Api, display uuid as the id in both the system show and index actions.
@dustints
Copy link
Member Author

dustints commented Aug 4, 2014

[TEST]

@dustints
Copy link
Member Author

dustints commented Aug 4, 2014

this is just a temporary fix, the api should only accept the db id and display the id as the database id
http://projects.theforeman.org/issues/6917

@dustints
Copy link
Member Author

dustints commented Aug 4, 2014

[TEST]

@dustints
Copy link
Member Author

dustints commented Aug 5, 2014

[test]

@dustints dustints changed the title Fixes 6842 - sys shw/idx prsnt uuid 4 id bz1122938 Fixes #6842 - system uuid as id bz1122938 Aug 5, 2014
dustints pushed a commit that referenced this pull request Aug 5, 2014
@dustints dustints merged commit 167b2f6 into Katello:master Aug 5, 2014
@dustints dustints deleted the system_present_uuid_as_id branch August 5, 2014 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants