Module: UnnestedInFilters::Dsl::Relation

Defined in:
lib/unnested_in_filters/dsl.rb

Instance Method Summary collapse

Instance Method Details

#exists?Boolean

Returns:

  • (Boolean)


70
71
72
73
74
# File 'lib/unnested_in_filters/dsl.rb', line 70

def exists?(*)
  return super unless rewrite_query?

  unnested_filter_rewriter.rewrite.exists?
end

#loadObject



61
62
63
64
65
66
67
68
# File 'lib/unnested_in_filters/dsl.rb', line 61

def load(*)
  return super if loaded? || !rewrite_query?

  @records = unnested_filter_rewriter.rewrite.to_a
  @loaded = true

  self
end

#use_unnested_filtersObject



46
47
48
# File 'lib/unnested_in_filters/dsl.rb', line 46

def use_unnested_filters
  spawn.use_unnested_filters!
end

#use_unnested_filters!Object



50
51
52
53
54
55
# File 'lib/unnested_in_filters/dsl.rb', line 50

def use_unnested_filters!
  assert_mutability!
  @values[:unnested_filters] = true

  self
end

#use_unnested_filters?Boolean

Returns:

  • (Boolean)


57
58
59
# File 'lib/unnested_in_filters/dsl.rb', line 57

def use_unnested_filters?
  @values.fetch(:unnested_filters, false)
end