module SexyScopes

Constants

VERSION

Public Class Methods

arel_6?() click to toggle source
# File lib/sexy_scopes.rb, line 16
def arel_6?
  @arel_6 ||= ::Arel::VERSION >= '6.0.0'
end
extend_expression(expression) click to toggle source
# File lib/sexy_scopes.rb, line 8
def extend_expression(expression)
  expression.extend(Arel::ExpressionMethods)
end
extend_predicate(predicate) click to toggle source
# File lib/sexy_scopes.rb, line 12
def extend_predicate(predicate)
  predicate.extend(Arel::PredicateMethods)
end
quote(node, attribute = nil) click to toggle source
# File lib/sexy_scopes.rb, line 20
def quote(node, attribute = nil)
  if arel_6?
    ::Arel::Nodes.build_quoted(node, attribute)
  else
    node
  end
end
Also aliased as: type_cast
type_cast(node, attribute = nil)
Alias for: quote