Rails app demoing a limit in merging to a scope that includes a join.
Ruby JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
app
config
db
doc
lib/tasks
public
script
test
vendor/plugins
.gitignore
Gemfile
Gemfile.lock
README
Rakefile
config.ru

README

== Welcome to a simple multi-association scope merge join test

This app demos a limitation on merging a scope that includes a join across a
second association.

```
rake db:migrate
rails c
  Parent.test_scope.to_sql
```

Raises an exception:

  ActiveRecord::ConfigurationError: Association named 'grandchildren'
  was not found; perhaps you misspelled it?

I think this means that AR (or Squeel, I'm not sure), is trying to find the
'grandchildren' association on the Parent model.