Sha256: 2cc37be8902801e2d0e00f72510923b41ee2943003ffad5a5baf68612a7388d4
Contents?: true
Size: 644 Bytes
Versions: 9
Compression:
Stored size: 644 Bytes
Contents
class ReferentValue < ActiveRecord::Base attr_accessible :key_name, :value, :normalized_value, :metadata, :private_data belongs_to :referent, :include => :referent_values # 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. 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 end
Version data entries
9 entries across 9 versions & 1 rubygems