Module: StrictLoading::QueryMethods

Defined in:
lib/strict-loading/query_methods.rb

Instance Method Summary collapse

Instance Method Details

#__check_relationObject



25
26
27
# File 'lib/strict-loading/query_methods.rb', line 25

def __check_relation
  assert_mutability!
end

#strict_loadingObject



5
6
7
# File 'lib/strict-loading/query_methods.rb', line 5

def strict_loading
  spawn.strict_loading!
end

#strict_loading!Object



9
10
11
12
# File 'lib/strict-loading/query_methods.rb', line 9

def strict_loading!
  self.strict_loading_value = true
  self
end

#strict_loading_valueObject



14
15
16
# File 'lib/strict-loading/query_methods.rb', line 14

def strict_loading_value
  @values.fetch(:strict_loading, nil)
end

#strict_loading_value=(value) ⇒ Object

Raises:

  • (ImmutableRelation)


18
19
20
21
22
# File 'lib/strict-loading/query_methods.rb', line 18

def strict_loading_value=(value)
  raise ImmutableRelation if @loaded
  __check_relation
  @values[:strict_loading] = value
end