Skip to content

Commit b2776fb

Browse files
committed
spec added and passing #124
1 parent 72bf44b commit b2776fb

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

ruby/hyper-component/lib/hyper-component.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
require 'hyperstack/internal/callbacks'
1313
require 'hyperstack/internal/auto_unmount'
1414
require 'native'
15+
require 'json'
1516
require 'hyperstack/state/observer'
1617
require 'hyperstack/internal/component/validator'
1718
require 'hyperstack/component/element'
@@ -27,6 +28,7 @@
2728
require 'hyperstack/ext/component/boolean'
2829
require 'hyperstack/ext/component/array'
2930
require 'hyperstack/ext/component/enumerable'
31+
require 'hyperstack/ext/component/time'
3032
require 'hyperstack/component/isomorphic_helpers'
3133
require 'hyperstack/component/react_api'
3234
require 'hyperstack/internal/component/top_level_rails_component'

ruby/hyper-component/lib/hyperstack/component/isomorphic_helpers.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,6 @@ def isomorphic_method(name, &block)
225225
end
226226
end
227227
else
228-
require 'json'
229-
230228
def isomorphic_method(name, &block)
231229
self.class.send(:define_method, name) do | *args |
232230
IsomorphicHelpers::IsomorphicProcCall.new(name, block, self, *args).result

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
require 'json'
2-
31
module ReactiveRecord
42

53
class Base

ruby/hyper-model/spec/batch1/column_types/column_type_spec.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,4 +359,9 @@ class TypeTest < ActiveRecord::Base
359359
end.to eq(r.text)
360360
end
361361

362+
it "will update time values with millisecond accuracy" do
363+
sample_time = 12_345.123
364+
evaluate_ruby { TypeTest.create(datetime: Time.at(sample_time)) }
365+
expect(TypeTest.last.datetime.to_f).to eq sample_time
366+
end
362367
end

0 commit comments

Comments
 (0)