Class: Zlookup

Inherits:
Object
  • Object
show all
Defined in:
app/models/zlookup.rb

Overview

Zlookup pattern copied from ERA to allow easy integration of Engine with ERA

Direct Known Subclasses

ZlookupCached, Zprovider

Class Method Summary collapse

Class Method Details

.valid_value?(key, strict = false) ⇒ Boolean

Returns:

  • (Boolean)


4
5
6
7
8
# File 'app/models/zlookup.rb', line 4

def self.valid_value?(key, strict = false)
  return true if key.blank?
  scope = strict ? current : self
  scope.where(primary_key => key).count == 1
end