simple_record 1.1.61 → 1.1.62

Sign up to get free protection for your applications and to get access to all the features.
data/lib/simple_record.rb CHANGED
@@ -237,7 +237,8 @@ module SimpleRecord
237
237
  def set_created
238
238
  # puts 'SETTING CREATED'
239
239
  # @created = DateTime.now
240
- self[:created] = Time.now
240
+ set(:created, Time.now)
241
+ # self[:created] = Time.now
241
242
  # @tester = 'some test value'
242
243
  # self[:tester] = 'some test value'
243
244
  end
@@ -245,7 +246,8 @@ module SimpleRecord
245
246
  def set_updated
246
247
  #puts 'SETTING UPDATED'
247
248
  # @updated = DateTime.now
248
- self[:updated] = Time.now
249
+ set(:updated, Time.now)
250
+ # self[:updated] = Time.now
249
251
  # @tester = 'some test value updated'
250
252
  end
251
253
 
@@ -509,4 +509,19 @@ class TestSimpleRecord < TestBase
509
509
  assert mm3.x.id == mm.id
510
510
  end
511
511
 
512
+ def test_storage_format
513
+
514
+ mm = MyModel.new({:name=>"myname"})
515
+ mm.date1 = Time.now
516
+ mm.date2 = DateTime.now
517
+ mm.save
518
+
519
+ raw = @@sdb.get_attributes(MyModel.domain, mm.id)
520
+ puts "raw=" + raw.inspect
521
+ assert raw[:attributes]["updated"][0].size == "2010-01-06T16:04:23".size
522
+ assert raw[:attributes]["date1"][0].size == "2010-01-06T16:04:23".size
523
+ assert raw[:attributes]["date2"][0].size == "2010-01-06T16:04:23".size
524
+
525
+ end
526
+
512
527
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_record
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.61
4
+ version: 1.1.62
5
5
  platform: ruby
6
6
  authors:
7
7
  - Travis Reeder
@@ -11,7 +11,7 @@ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
13
 
14
- date: 2010-01-05 00:00:00 -08:00
14
+ date: 2010-01-06 00:00:00 -08:00
15
15
  default_executable:
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency