Class: Cardboard::Field::Integer

Inherits:
Cardboard::Field show all
Defined in:
app/models/cardboard/field/integer.rb

Instance Attribute Summary

Attributes inherited from Cardboard::Field

#seeding

Instance Method Summary collapse

Methods inherited from Cardboard::Field

new_with_castnew, #required?, #type, #type=

Instance Method Details

#defaultObject



15
16
17
# File 'app/models/cardboard/field/integer.rb', line 15

def default
  12321454
end

#valueObject



11
12
13
# File 'app/models/cardboard/field/integer.rb', line 11

def value
  self.value_uid.to_i
end

#value=(val) ⇒ Object



7
8
9
# File 'app/models/cardboard/field/integer.rb', line 7

def value=(val)
  self.value_uid = val == "" ? nil : val #bug in rails? should work with allow_blank
end