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

SAW - Another PermissibleValue method #1003

Merged
merged 4 commits into from Jul 14, 2017

Conversation

SamWord
Copy link
Contributor

@SamWord SamWord commented Jul 14, 2017

#147708807

This method gets a hash of PermissibleValue keys as the keys and values as the values (what you would expect)

@@ -10,8 +10,13 @@ def self.get_value_list(category)
PermissibleValue.where(category: category).pluck(:value)
end

# Get a hash of PermissibleValue keys as they keys and values as values
def self.get_hash(category)
Copy link
Collaborator

Choose a reason for hiding this comment

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

What is the difference between this method and the one below? They do the same thing

Copy link
Contributor

Choose a reason for hiding this comment

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

#get_hash uses the standard format { key => value } but #get_value_key_hash uses a { value => key } format

Copy link
Collaborator

Choose a reason for hiding this comment

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

yes, and I was confused because they looked so similar.

@Stuart-Johnson Stuart-Johnson merged commit af218c6 into os##3615063 Jul 14, 2017
@Stuart-Johnson Stuart-Johnson deleted the os#147708807-permissible-value-method branch July 14, 2017 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants