Class: ReferentValue

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/referent_value.rb

Class Method Summary (collapse)

Class Method Details

+ (Object) normalize(input)

Class method to normalize a string for normalized_value attribute. Right now normalization is just downcasing. Only metadata values should be normalized (ie, not 'identifier' or 'format'). identifier and format shoudl be stored in normalized_value unchanged.



8
9
10
11
12
# File 'app/models/referent_value.rb', line 8

def self.normalize(input)
    # 'chars' is neccesary for unicode.
    # normalized_value column only holds 254 bytes.. 
    return input.chars.downcase.to_s[0..254]
end