Class: ActiveRecord::Relation
- Inherits:
-
Object
- Object
- ActiveRecord::Relation
- Defined in:
- lib/activerecord/cte/core_ext.rb
Defined Under Namespace
Classes: Merger
Instance Method Summary collapse
- #recursive_with=(value) ⇒ Object
- #recursive_with? ⇒ Boolean
- #with(opts, *rest) ⇒ Object
- #with!(opts, *rest) ⇒ Object
- #with_values ⇒ Object
- #with_values=(values) ⇒ Object
Instance Method Details
#recursive_with=(value) ⇒ Object
57 58 59 60 61 |
# File 'lib/activerecord/cte/core_ext.rb', line 57 def recursive_with=(value) raise ImmutableRelation if @loaded @values[:recursive_with] = value end |
#recursive_with? ⇒ Boolean
53 54 55 |
# File 'lib/activerecord/cte/core_ext.rb', line 53 def recursive_with? @values[:recursive_with] end |
#with(opts, *rest) ⇒ Object
29 30 31 |
# File 'lib/activerecord/cte/core_ext.rb', line 29 def with(opts, *rest) spawn.with!(opts, *rest) end |
#with!(opts, *rest) ⇒ Object
33 34 35 36 37 38 39 40 41 |
# File 'lib/activerecord/cte/core_ext.rb', line 33 def with!(opts, *rest) if opts == :recursive self.recursive_with = true self.with_values += rest else self.with_values += [opts] + rest end self end |
#with_values ⇒ Object
43 44 45 |
# File 'lib/activerecord/cte/core_ext.rb', line 43 def with_values @values[:with] || [] end |
#with_values=(values) ⇒ Object
47 48 49 50 51 |
# File 'lib/activerecord/cte/core_ext.rb', line 47 def with_values=(values) raise ImmutableRelation if @loaded @values[:with] = values end |