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

Already on GitHub? Sign in to your account

Only use LOWER for mysql uniqueness check when column is case sensitive #561

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
5 participants

This addresses this two year old ticket:
https://rails.lighthouseapp.com/projects/8994/tickets/2503

I have one comment in the code looking for suggestions on how to reduce the number of arguments to the new method:
jpalermo/rails@47e6809#commitcomment-383890

Thanks for bringing this ticket back to life! I'll do my best to find time to look over your patch.

rheaton commented May 18, 2011

Merge this in!

jake3030 pushed a commit to jake3030/rails that referenced this pull request Jun 28, 2011

Added prompt options to date helpers [#561 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>

jake3030 pushed a commit to jake3030/rails that referenced this pull request Jun 28, 2011

Use I18n for date/time select helpers prompt text [#561 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>

jake3030 pushed a commit to jake3030/rails that referenced this pull request Jun 28, 2011

Stops date select helpers from defaulting the selected date to today …
…if :prompt option has been used

Signed-off-by: Michael Koziarski <michael@koziarski.com>
[#561 state:resolved]
Owner

jeremy commented Oct 9, 2011

Interesting. Thanks for the implementation and tests, @jpalermo. This would be a nice improvement for 3.2. Could you rebase against master?

jpalermo commented Oct 9, 2011

Rebase against master is done.

Owner

jeremy commented Oct 9, 2011

@jeremy jeremy closed this Oct 9, 2011

Contributor

kenn commented Jun 3, 2012

@jpalermo Thank you for this patch!

How do you define a collation on a column in migration, though? Maybe I'm missing something, but I've been doing this:

execute 'ALTER TABLE users MODIFY `token` VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_bin'

While what I'd really like to do instead is:

create_table :users do |t|
  t.string :token, limit: 32, collation: 'utf8_bin'
end

But it doesn't seem possible.

jpalermo commented Jun 3, 2012

Yeah, column definitions don't have an option for collation.
http://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/TableDefinition.html#method-i-column

It's in a totally unrelated part of the code compared to this patch.

You can see the column definition code in ActiveRecord::ConnectionAdapters::column

There is not a lot of code there, so it could be easily expanded. Of course, you might need to touch code in the individual connection adapters.

You'll probably want to search old issues and tickets to see if this has been attempted before. It could be that it was attempted and rejected previously.

Contributor

kenn commented Jun 4, 2012

Hmm okay, thanks for the info anyway! I'll try to write a patch myself and hopefully turn into a pull request.

hisas pushed a commit to hisas/rails that referenced this pull request May 9, 2017

Collapse adjacent =??B? words losslessly
Before this change the code assumed you could concatenate two Base64
strings, which is not true.

This fix relies on non-standard behaviour of our parser: RFC 2047 says
that encoded-words MUST be separated by at least a space, but we happily
parse two unseparated encoded-words.

Fixes: #560
Fixes: #561
Broken-since: 2.5.4 (cb81621)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment