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

Fix enums with hashes #932

Closed
wants to merge 1 commit into from

Conversation

guilhermearaujo
Copy link

@guilhermearaujo guilhermearaujo commented Jun 9, 2016

Because if you are using a hash instead of a list, you probably should not be using integers as values.

Fixes issue #912

Because if you are using a hash instead of a list,
you probably should not be using integers as values.
@@ -126,7 +126,7 @@ def self.statuses; end
end

it "rejects a record where the attribute is not defined as an enum" do
message = %{Expected #{record_with_hash_values.class} to define :record_with_hash_values as an enum with {:active=>5, :archived=>10} and store the value in a column with an integer type}
message = %{Expected #{record_with_hash_values.class} to define :record_with_hash_values as an enum with {:active=>5, :archived=>10}}

Choose a reason for hiding this comment

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

Line is too long. [143/80]

@guilhermearaujo guilhermearaujo changed the title Fix enums with hashes from #912 Fix enums with hashes Jun 9, 2016
@brust
Copy link

brust commented Jul 12, 2016

Any response about this PR?

@guilhermearaujo
Copy link
Author

@mcmire any update on this?

Copy link

@dukex dukex left a comment

Choose a reason for hiding this comment

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

Nice catch

@mcmire
Copy link
Collaborator

mcmire commented Nov 21, 2016

This is good, but in order to complete this PR, we need to add a test to confirm that when you have a column that isn't an integer but a string, the matcher won't fail. Do you think you could add that?

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.

5 participants