Module: ActiveRecord::Temporal::Querying::QueryMethods

Defined in:
lib/activerecord/temporal/querying/query_methods.rb

Instance Method Summary collapse

Instance Method Details

#rewhere_contains(conditions) ⇒ Object



27
28
29
30
31
32
33
34
# File 'lib/activerecord/temporal/querying/query_methods.rb', line 27

def rewhere_contains(conditions)
  scope = spawn

  scope.where_clause = where_clause.except_contains(conditions.keys)
  scope.where_clause += build_where_clause(conditions)

  scope
end

#time_tag_valuesObject



17
18
19
# File 'lib/activerecord/temporal/querying/query_methods.rb', line 17

def time_tag_values
  @values.fetch(:time_tags, ActiveRecord::QueryMethods::FROZEN_EMPTY_HASH)
end

#time_tag_values=(scope) ⇒ Object



21
22
23
24
25
# File 'lib/activerecord/temporal/querying/query_methods.rb', line 21

def time_tag_values=(scope)
  assert_modifiable! # TODO: write test

  @values[:time_tags] = scope
end

#time_tags(scope) ⇒ Object



8
9
10
# File 'lib/activerecord/temporal/querying/query_methods.rb', line 8

def time_tags(scope)
  spawn.time_tags!(scope)
end

#time_tags!(scope) ⇒ Object



12
13
14
15
# File 'lib/activerecord/temporal/querying/query_methods.rb', line 12

def time_tags!(scope)
  self.time_tag_values = time_tag_values.merge(scope)
  self
end