Sha256: 9549d9b9d8ddb7bc9b042f5da173d96e0f44f3cc7fccaed426e6b27680d9f06d

Contents?: true

Size: 563 Bytes

Versions: 30

Compression:

Stored size: 563 Bytes

Contents

class ReferentValue < ActiveRecord::Base
  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

30 entries across 30 versions & 1 rubygems

Version Path
umlaut-3.0.0alpha10 app/models/referent_value.rb
umlaut-3.0.0alpha9 app/models/referent_value.rb
umlaut-3.0.0alpha8 app/models/referent_value.rb
umlaut-3.0.0alpha7 app/models/referent_value.rb
umlaut-3.0.0alpha6 app/models/referent_value.rb
umlaut-3.0.0alpha5 app/models/referent_value.rb
umlaut-3.0.0alpha4 app/models/referent_value.rb
umlaut-3.0.0alpha3 app/models/referent_value.rb
umlaut-3.0.0alpha2 app/models/referent_value.rb
umlaut-3.0.0alpha1 app/models/referent_value.rb