Skip to content

Commit f40eeab

Browse files
committed
closes 192
1 parent 45ae5be commit f40eeab

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

ruby/hyper-model/lib/reactive_record/active_record/reactive_record/dummy_value.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ def initialize(column_hash = nil)
2929
column_type = Base.column_type(@column_hash) || 'nil'
3030
default_value_method = "build_default_value_for_#{column_type}"
3131
@object = __send__ default_value_method
32-
rescue ::Exception
32+
rescue ::Exception => e
3333
end
3434

3535
def build_default_value_for_nil
36-
@column_hash[:default] || nil
36+
@column_hash.key?(:default) ? @column_hash[:default] : nil
3737
end
3838

3939
def build_default_value_for_datetime
@@ -56,23 +56,23 @@ def build_default_value_for_date
5656
end
5757

5858
def build_default_value_for_boolean
59-
@column_hash[:default] || false
59+
@column_hash.key?(:default) ? @column_hash[:default] : false
6060
end
6161

6262
def build_default_value_for_float
63-
@column_hash[:default] || Float(0.0)
63+
@column_hash.key?(:default) ? @column_hash[:default] : Float(0.0)
6464
end
6565

6666
alias build_default_value_for_decimal build_default_value_for_float
6767

6868
def build_default_value_for_integer
69-
@column_hash[:default] || Integer(0)
69+
@column_hash.key?(:default) ? @column_hash[:default] : Integer(0)
7070
end
7171

7272
alias build_default_value_for_bigint build_default_value_for_integer
7373

7474
def build_default_value_for_string
75-
@column_hash[:default] || ''
75+
@column_hash.key?(:default) ? @column_hash[:default] : ''
7676
end
7777

7878
alias build_default_value_for_text build_default_value_for_string

ruby/hyper-model/lib/reactive_record/active_record/reactive_record/isomorphic_base.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,6 @@ def get_columns_info_for_vector(vector)
135135
model.columns_hash[method_name] || model.server_methods[method_name]
136136
end
137137

138-
139138
class << self
140139

141140
attr_reader :pending_fetches

0 commit comments

Comments
 (0)