blob: 9bbc249c2b81963a51c8566d25fa28172bb1020b (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
module ActiveRecord
module ConnectionAdapters
module Type
class Value # :nodoc:
attr_reader :precision, :scale, :limit
def initialize(options = {})
options.assert_valid_keys(:precision, :scale, :limit)
@precision = options[:precision]
@scale = options[:scale]
@limit = options[:limit]
end
def type; end
def type_cast(value)
cast_value(value) unless value.nil?
end
def type_cast_for_write(value)
value
end
def type_cast_for_database(value)
type_cast_for_write(value)
end
def text?
false
end
def number?
false
end
def binary?
false
end
def klass
::Object
end
private
def cast_value(value)
value
end
end
end
end
end
|