0.03
Repository is archived
No commit activity in last 3 years
No release in over 3 years
If only this were easier...
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.16
~> 10.0
~> 3.0

Runtime

>= 4.2.0
 Project Readme

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.