Class: ActiveRecord::Relation
- Inherits:
-
Object
- Object
- ActiveRecord::Relation
- Defined in:
- lib/ahoy_captain/active_record.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
55 56 57 58 59 |
# File 'lib/ahoy_captain/active_record.rb', line 55 def recursive_with=(value) raise ImmutableRelation if @loaded @values[:recursive_with] = value end |
#recursive_with? ⇒ Boolean
51 52 53 |
# File 'lib/ahoy_captain/active_record.rb', line 51 def recursive_with? @values[:recursive_with] end |
#with(opts, *rest) ⇒ Object
27 28 29 |
# File 'lib/ahoy_captain/active_record.rb', line 27 def with(opts, *rest) spawn.with!(opts, *rest) end |
#with!(opts, *rest) ⇒ Object
31 32 33 34 35 36 37 38 39 |
# File 'lib/ahoy_captain/active_record.rb', line 31 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
41 42 43 |
# File 'lib/ahoy_captain/active_record.rb', line 41 def with_values @values[:with] || [] end |
#with_values=(values) ⇒ Object
45 46 47 48 49 |
# File 'lib/ahoy_captain/active_record.rb', line 45 def with_values=(values) raise ImmutableRelation if @loaded @values[:with] = values end |