Module: Squeel

Extended by:
Configuration
Defined in:
lib/squeel.rb,
lib/squeel/dsl.rb,
lib/squeel/nodes.rb,
lib/squeel/version.rb,
lib/squeel/context.rb,
lib/squeel/nodes/or.rb,
lib/squeel/nodes/as.rb,
lib/squeel/constants.rb,
lib/squeel/nodes/and.rb,
lib/squeel/nodes/not.rb,
lib/squeel/nodes/join.rb,
lib/squeel/nodes/nary.rb,
lib/squeel/nodes/stub.rb,
lib/squeel/nodes/node.rb,
lib/squeel/nodes/unary.rb,
lib/squeel/nodes/order.rb,
lib/squeel/nodes/binary.rb,
lib/squeel/nodes/sifter.rb,
lib/squeel/nodes/literal.rb,
lib/squeel/configuration.rb,
lib/squeel/nodes/ordering.rb,
lib/squeel/nodes/grouping.rb,
lib/squeel/nodes/key_path.rb,
lib/squeel/nodes/aliasing.rb,
lib/squeel/nodes/function.rb,
lib/squeel/nodes/predicate.rb,
lib/squeel/nodes/operators.rb,
lib/squeel/nodes/operation.rb,
lib/squeel/visitors/visitor.rb,
lib/squeel/nodes/subquery_join.rb,
lib/squeel/visitors/from_visitor.rb,
lib/squeel/visitors/order_visitor.rb,
lib/squeel/visitors/where_visitor.rb,
lib/squeel/visitors/group_visitor.rb,
lib/squeel/visitors/having_visitor.rb,
lib/squeel/nodes/predicate_methods.rb,
lib/squeel/visitors/select_visitor.rb,
lib/squeel/visitors/preload_visitor.rb,
lib/squeel/nodes/predicate_operators.rb,
lib/squeel/visitors/predicate_visitor.rb,
lib/squeel/visitors/enumeration_visitor.rb,
lib/squeel/visitors/predicate_visitation.rb,
lib/squeel/adapters/active_record/context.rb,
lib/generators/squeel/initializer_generator.rb,
lib/squeel/adapters/active_record/3.0/context.rb,
lib/squeel/adapters/active_record/4.1/context.rb,
lib/squeel/adapters/active_record/base_extensions.rb,
lib/squeel/adapters/active_record/relation_extensions.rb,
lib/squeel/adapters/active_record/preloader_extensions.rb,
lib/squeel/adapters/active_record/3.1/relation_extensions.rb,
lib/squeel/adapters/active_record/3.2/relation_extensions.rb,
lib/squeel/adapters/active_record/4.1/relation_extensions.rb,
lib/squeel/adapters/active_record/4.2/relation_extensions.rb,
lib/squeel/adapters/active_record/4.0/relation_extensions.rb,
lib/squeel/adapters/active_record/3.0/relation_extensions.rb,
lib/squeel/adapters/active_record/4.1/preloader_extensions.rb,
lib/squeel/adapters/active_record/4.1/reflection_extensions.rb,
lib/squeel/adapters/active_record/join_dependency_extensions.rb,
lib/squeel/adapters/active_record/3.0/association_preload_extensions.rb

Defined Under Namespace

Modules: Adapters, Configuration, Constants, Generators, Nodes, Visitors Classes: Context, DSL

Constant Summary collapse

InnerJoin =
Arel::Nodes::InnerJoin
OuterJoin =
Arel::Nodes::OuterJoin
VERSION =
'1.2.3'

Class Method Summary collapse

Methods included from Configuration

alias_predicate, configure, load_core_extensions

Class Method Details

.deprecate(message) ⇒ Object


25
26
27
28
# File 'lib/squeel.rb', line 25

def self.deprecate(message)
  external_caller = caller.find {|s| !s.include?('/lib/squeel/')}
  warn "DEPRECATION WARNING: #{message} (called from #{external_caller})"
end

.evil_thingsObject

Prevent warnings on the console when doing things some might describe as “evil”


17
18
19
20
21
22
23
# File 'lib/squeel.rb', line 17

def self.evil_things
  original_verbosity = $VERBOSE
  $VERBOSE = nil
  yield
ensure
  $VERBOSE = original_verbosity
end

.sane_arity?Boolean

Ruby 1.9 has a zero arity on a Proc with no arity. Prior to that, it mimics Symbol#to_proc and returns -1.

Returns:

  • (Boolean)

32
33
34
# File 'lib/squeel.rb', line 32

def self.sane_arity?
  @sane_arity ||= Proc.new {}.arity == 0
end