diff options
author | Toon Claes <toon@gitlab.com> | 2018-09-24 14:13:11 +0200 |
---|---|---|
committer | Toon Claes <toon@gitlab.com> | 2018-09-25 11:49:57 +0200 |
commit | 6823e7defb45dfd86d5258b40d6f82482d1ef451 (patch) | |
tree | c6ce206ac1f2bb790774e602ff1cc14d63483df1 /spec/javascripts/diffs/components/commit_widget_spec.js | |
parent | b4c78a58f5c5faef8a485903e5053f767221935c (diff) | |
download | gitlab-ce-6823e7defb45dfd86d5258b40d6f82482d1ef451.tar.gz |
Work around a bug in Rails 5, where LIMIT causes troubletc-fix-rails5-subquery-selfjoin
The original code caused Rails to generate invalid SQL. The problem
lays in the `.arel` method in `ActiveRecord::Relation`. When there was
a `limit` on the relation, the `LIMIT` statement was taken over to
Arel, but the value wasn't.
```ruby
relation = Event.limit(2)
relation.to_sql
#=> "SELECT `events`.* FROM `events` LIMIT 2"
relation.arel.to_sql
#=> "SELECT `events`.* FROM `events` LIMIT ?"
```
Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/51729
Diffstat (limited to 'spec/javascripts/diffs/components/commit_widget_spec.js')
0 files changed, 0 insertions, 0 deletions