This project is archived and is in readonly mode.

#3940 ✓committed
bterkuile

Active record dynamic finder symbol gets converted to yaml

Reported by bterkuile | February 12th, 2010 @ 12:22 PM | in 3.0.2

When playing with aasm I was trying selectors like:
MyModel.find_all_by_state :active
This returns an empty result while:
MyModel.find_all_by_state 'active'
Returned the expected results.

SQL:
SELECT * FROM "my_models" WHERE ("my_models"."state" = '--- :active')

This is for me unexpected behavior. I tracked the logic back to the file:
activerecord/lib/active_record/connection_adapters/abstract/quoting.rb

I cannot oversee the implications of doing stuff like:
class Symbol; alias to_yaml to_s; end

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Attachments

Pages