Skip to content

Take advantage of Arel::Table objects for complex queries in Rails 3.0.x

Notifications You must be signed in to change notification settings

innovatis/referrable_joins

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is sparse. I will write more later once I know it works properly.

> source = ReferrableJoin.new(:languages, :source_language)
> target = ReferrableJoin.new(:languages, :target_language)
> Translation.joins(source, target).where(source.relation[:id].lt(2)).size
=> 3 
> Translation.joins(source, target).where(target.relation[:id].lt(2)).size
=> 0

About

Take advantage of Arel::Table objects for complex queries in Rails 3.0.x

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages