Class: ReferentValue

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

Class Method Summary collapse

Class Method Details

.normalize(input) ⇒ Object

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.



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

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