Skip to content
This repository has been archived by the owner on Apr 22, 2021. It is now read-only.

rzane/join_dependency

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JoinDependency Build Status

This is a module with a singular purpose. It creates an ActiveRecord::Associations::JoinDependency from an ActiveRecord::Relation. That's it.

require 'join_dependency'

relation = Post.joins(:author)
JoinDependency.from_relation(relation)

And, in case you're trying to bend Active Record to your will, you can choose how certain joins get categorized:

JoinDependency.from_relation(relation) do |join|
  case join
  when Polyamorous::InnerJoin, Polyamorous::OuterJoin
    :stashed_association_join
  end
end

This library isn't meant for people. It's a library for libraries on top of other libraries that interact with libraries.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •