Skip to content

peterjm/rails-activerecord-bug-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This demonstrates a bug with ActiveRecord in Rails 3.1

After downloading the application, run `rake db:create db:migrate test` to view the failing test case.

See `test/units/person_test.rb` for the tests that show how to recreate the error.

The problem occurs when performing a search query with a word that's at least two characters and ends in a period. In these cases, the eager loading `includes()` command gets expanding inline into the SQL query, and the original `select` clause is ignored. This results in a crash when other parts of the SQL statement rely on the provided SQL statement.

About

Demonstrating a crashing bug in Rails

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published