Navigation Menu

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 #11339 - ensure unique parameters before adding uniq index #2600

Closed
wants to merge 1 commit into from

Conversation

jlsherrill
Copy link
Contributor

No description provided.

@domcleal
Copy link
Contributor

Please note that tests are failing.

@jlsherrill
Copy link
Contributor Author

Doh! Last minute change, updated!

@dLobatog
Copy link
Member

Works well. However it worries me that the following code:

2.times do 
   foo = Parameter.new(:name => 'foo', :reference_id => 2)
   foo.type = 'DomainParameter'
   foo.save
end

Parameter.where(:name => 'foo') # this will return 2 values

still produces duplicates despite the unique index. Validations do actually run if you create the parameter using DomainParameter, etc... instead of setting the type manually.

update - I try to fix this on #2604

@dLobatog
Copy link
Member

Merged as aabf3c2, thanks @jlsherrill!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants