Module: Prato::Internal::JoinHelper
- Extended by:
- JoinHelper
- Included in:
- JoinHelper
- Defined in:
- lib/prato/internal/join_helper.rb,
lib/prato/internal/join_helper_legacy.rb
Instance Method Summary collapse
- #ensure_join(scope, column, left_outer: false) ⇒ Object
- #ensure_left_joins(scope, association_paths) ⇒ Object
Instance Method Details
#ensure_join(scope, column, left_outer: false) ⇒ Object
8 9 10 11 12 13 |
# File 'lib/prato/internal/join_helper.rb', line 8 def ensure_join(scope, column, left_outer: false) return scope unless column.is_a?(Types::AssociationColumn) join_hash = join_hash_for(column.association_path) left_outer ? scope.left_joins(join_hash) : scope.joins(join_hash) end |
#ensure_left_joins(scope, association_paths) ⇒ Object
15 16 17 18 19 |
# File 'lib/prato/internal/join_helper.rb', line 15 def ensure_left_joins(scope, association_paths) return scope if association_paths.empty? scope.left_joins(*join_hashes_for(association_paths)) end |