Class: LookupValue

Inherits:
ActiveRecord::Base
  • Object
show all
Includes:
Authorization
Defined in:
app/models/lookup_value.rb

Instance Method Summary collapse

Methods included from Authorization

#enforce_create_permissions, #enforce_destroy_permissions, #enforce_edit_permissions, included, #permission_failed?

Instance Method Details

#as_json(options = {}) ⇒ Object


28
29
30
31
# File 'app/models/lookup_value.rb', line 28

def as_json(options={})
  options ||= {}
  super({:only => [:value, :match, :lookup_key_id, :id]}.merge(options))
end

#nameObject


19
20
21
# File 'app/models/lookup_value.rb', line 19

def name
  value
end

#value_before_type_castObject


23
24
25
26
# File 'app/models/lookup_value.rb', line 23

def value_before_type_cast
  return self.value if lookup_key.nil?
  lookup_key.value_before_type_cast self.value
end