Class: ActiveRecord::Like::ScopeSpawners::LikeScopeSpawners::Rails72Spawner

Inherits:
AbstractSpawner
  • Object
show all
Includes:
Shared::Rails7AndBelowSpawner
Defined in:
lib/active_record/like/scope_spawner.rb

Overview

:nodoc:

Instance Attribute Summary

Attributes inherited from AbstractSpawner

#opts, #rest, #scope

Instance Method Summary collapse

Methods inherited from AbstractSpawner

#initialize, spawn

Constructor Details

This class inherits a constructor from ActiveRecord::Like::ScopeSpawners::LikeScopeSpawners::AbstractSpawner

Instance Method Details

#spawnObject

:nodoc:



126
127
128
129
130
131
132
133
134
135
136
# File 'lib/active_record/like/scope_spawner.rb', line 126

def spawn
  opts.each do |k,v|
    if v.is_a?(Array) && v.empty?
      opts[k] = ''
    end
  end

  chain_node(Arel::Nodes::Matches) do |nodes|
    Arel::Nodes::Or.new(nodes)
  end
end