Skip to content

oceanshq/join_dependency

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 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

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 97.9%
  • Shell 2.1%