Class: WhereLower::ScopeSpawner::HashScopeSpawner

Inherits:
BasicScopeSpawner show all
Defined in:
lib/where_lower/scope_spawner.rb

Overview

:nodoc:

Instance Attribute Summary

Attributes inherited from WhereLower::ScopeSpawner

#column_or_table_name, #prefix, #scope, #value

Instance Method Summary collapse

Methods inherited from WhereLower::ScopeSpawner

#initialize, spawn

Constructor Details

This class inherits a constructor from WhereLower::ScopeSpawner

Instance Method Details

#spawnObject

If prefix already exists, that means we are in association table already, which cannot accept another hash This gem has no ability to handle deep nested associaiton reflection yet



126
127
128
129
130
131
132
# File 'lib/where_lower/scope_spawner.rb', line 126

def spawn
  fail TooDeepNestedConditions unless prefix.nil?

  value.inject(scope) do |new_scope, (column_name, column_value)|
    ScopeSpawner.spawn(new_scope, column_name, column_value, column_or_table_name)
  end
end