massive_record 0.2.0 → 0.2.1.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (68) hide show
  1. data/CHANGELOG.md +43 -4
  2. data/Gemfile.lock +3 -1
  3. data/README.md +5 -0
  4. data/lib/massive_record/adapters/thrift/connection.rb +23 -16
  5. data/lib/massive_record/adapters/thrift/row.rb +13 -33
  6. data/lib/massive_record/adapters/thrift/table.rb +24 -10
  7. data/lib/massive_record/orm/attribute_methods.rb +27 -1
  8. data/lib/massive_record/orm/attribute_methods/dirty.rb +2 -2
  9. data/lib/massive_record/orm/attribute_methods/read.rb +36 -1
  10. data/lib/massive_record/orm/attribute_methods/time_zone_conversion.rb +81 -0
  11. data/lib/massive_record/orm/attribute_methods/write.rb +18 -0
  12. data/lib/massive_record/orm/base.rb +52 -10
  13. data/lib/massive_record/orm/callbacks.rb +1 -1
  14. data/lib/massive_record/orm/default_id.rb +20 -0
  15. data/lib/massive_record/orm/errors.rb +4 -0
  16. data/lib/massive_record/orm/finders.rb +102 -57
  17. data/lib/massive_record/orm/finders/rescue_missing_table_on_find.rb +45 -0
  18. data/lib/massive_record/orm/id_factory.rb +1 -1
  19. data/lib/massive_record/orm/log_subscriber.rb +85 -0
  20. data/lib/massive_record/orm/persistence.rb +82 -37
  21. data/lib/massive_record/orm/query_instrumentation.rb +64 -0
  22. data/lib/massive_record/orm/relations/interface.rb +10 -0
  23. data/lib/massive_record/orm/relations/metadata.rb +2 -0
  24. data/lib/massive_record/orm/relations/proxy/references_one_polymorphic.rb +1 -1
  25. data/lib/massive_record/orm/schema/field.rb +33 -6
  26. data/lib/massive_record/orm/timestamps.rb +1 -1
  27. data/lib/massive_record/orm/validations.rb +2 -2
  28. data/lib/massive_record/rails/controller_runtime.rb +55 -0
  29. data/lib/massive_record/rails/railtie.rb +16 -0
  30. data/lib/massive_record/version.rb +1 -1
  31. data/lib/massive_record/wrapper/cell.rb +32 -3
  32. data/massive_record.gemspec +1 -0
  33. data/spec/{wrapper/cases → adapter/thrift}/adapter_spec.rb +0 -0
  34. data/spec/adapter/thrift/atomic_increment_spec.rb +55 -0
  35. data/spec/{wrapper/cases → adapter/thrift}/connection_spec.rb +0 -10
  36. data/spec/adapter/thrift/table_find_spec.rb +40 -0
  37. data/spec/{wrapper/cases → adapter/thrift}/table_spec.rb +55 -13
  38. data/spec/orm/cases/attribute_methods_spec.rb +6 -1
  39. data/spec/orm/cases/base_spec.rb +18 -4
  40. data/spec/orm/cases/callbacks_spec.rb +1 -1
  41. data/spec/orm/cases/default_id_spec.rb +38 -0
  42. data/spec/orm/cases/default_values_spec.rb +37 -0
  43. data/spec/orm/cases/dirty_spec.rb +25 -1
  44. data/spec/orm/cases/encoding_spec.rb +3 -3
  45. data/spec/orm/cases/finder_default_scope.rb +8 -1
  46. data/spec/orm/cases/finder_scope_spec.rb +2 -2
  47. data/spec/orm/cases/finders_spec.rb +8 -18
  48. data/spec/orm/cases/id_factory_spec.rb +38 -21
  49. data/spec/orm/cases/log_subscriber_spec.rb +133 -0
  50. data/spec/orm/cases/mass_assignment_security_spec.rb +97 -0
  51. data/spec/orm/cases/persistence_spec.rb +132 -27
  52. data/spec/orm/cases/single_table_inheritance_spec.rb +2 -2
  53. data/spec/orm/cases/time_zone_awareness_spec.rb +157 -0
  54. data/spec/orm/cases/timestamps_spec.rb +15 -0
  55. data/spec/orm/cases/validation_spec.rb +2 -2
  56. data/spec/orm/models/model_without_default_id.rb +5 -0
  57. data/spec/orm/models/person.rb +1 -0
  58. data/spec/orm/models/test_class.rb +1 -0
  59. data/spec/orm/relations/interface_spec.rb +2 -2
  60. data/spec/orm/relations/metadata_spec.rb +1 -1
  61. data/spec/orm/relations/proxy/references_many_spec.rb +21 -15
  62. data/spec/orm/relations/proxy/references_one_polymorphic_spec.rb +7 -1
  63. data/spec/orm/relations/proxy/references_one_spec.rb +7 -0
  64. data/spec/orm/schema/field_spec.rb +61 -5
  65. data/spec/support/connection_helpers.rb +2 -1
  66. data/spec/support/mock_massive_record_connection.rb +7 -0
  67. data/spec/support/time_zone_helper.rb +25 -0
  68. metadata +51 -14
@@ -3,6 +3,7 @@ require 'orm/models/person'
3
3
  require 'orm/models/person_with_timestamp'
4
4
 
5
5
  describe "timestamps" do
6
+ include TimeZoneHelper
6
7
  include CreatePersonBeforeEach
7
8
 
8
9
  before do
@@ -52,6 +53,20 @@ describe "timestamps" do
52
53
 
53
54
  @person.updated_at.should == updated_at_was
54
55
  end
56
+
57
+ context "with time zone awarenesswith zone enabled" do
58
+ it "should return time with zone" do
59
+ in_time_zone "Europe/Stockholm" do
60
+ @person.updated_at.should be_instance_of ActiveSupport::TimeWithZone
61
+ end
62
+ end
63
+
64
+ it "should be nil on new records" do
65
+ in_time_zone "Europe/Stockholm" do
66
+ Person.new.updated_at.should be_nil
67
+ end
68
+ end
69
+ end
55
70
  end
56
71
 
57
72
  describe "#created_at" do
@@ -66,7 +66,7 @@ describe "MassiveRecord::Base::Table" do
66
66
  include MockMassiveRecordConnection
67
67
 
68
68
  before do
69
- @model = Person.new :id => "1", :name => "Alice", :email => "alice@gmail.com", :age => 20
69
+ @model = Person.new "1", :name => "Alice", :email => "alice@gmail.com", :age => 20
70
70
  @invalidate_model = Proc.new { |p| p.name = nil }
71
71
  end
72
72
 
@@ -84,7 +84,7 @@ end
84
84
  #include MockMassiveRecordConnection
85
85
 
86
86
  #before do
87
- #@model = Address.new :id => "1", :street => "Henrik Ibsens gate 1"
87
+ #@model = Address.new "1", :street => "Henrik Ibsens gate 1"
88
88
  #@invalidate_model = Proc.new { |a| a.street = nil }
89
89
  #end
90
90
 
@@ -0,0 +1,5 @@
1
+ class ModelWithoutDefaultId < MassiveRecord::ORM::Table
2
+ column_family :info do
3
+ field :description, :default => "I don't have any ID", :allow_nil => false
4
+ end
5
+ end
@@ -11,6 +11,7 @@ class Person < MassiveRecord::ORM::Table
11
11
  column_family :base do
12
12
  field :points, :integer, :default => 1, :column => :pts
13
13
  field :status, :boolean, :default => false
14
+ field :phone_numbers, :array, :allow_nil => false
14
15
  end
15
16
 
16
17
 
@@ -5,5 +5,6 @@ class TestClass < MassiveRecord::ORM::Table
5
5
  column_family :test_family do
6
6
  field :foo, :string
7
7
  field :hash_not_allow_nil, :hash, :allow_nil => false
8
+ field :tested_at, :time
8
9
  end
9
10
  end
@@ -146,14 +146,14 @@ describe MassiveRecord::ORM::Relations::Interface do
146
146
 
147
147
  it "should set the type in proxy_owner when proxy_target is set" do
148
148
  subject.attachable = attachable
149
- subject.attachable_type.should == attachable.class.to_s.underscore
149
+ subject.attachable_type.should == attachable.class.to_s
150
150
  end
151
151
 
152
152
 
153
153
 
154
154
  [Person, PersonWithTimestamp].each do |polymorphic_class|
155
155
  describe "polymorphic association to class #{polymorphic_class}" do
156
- let (:attachable) { polymorphic_class.new :id => "ID1" }
156
+ let (:attachable) { polymorphic_class.new "ID1" }
157
157
 
158
158
  before do
159
159
  subject.attachable_id = attachable.id
@@ -181,7 +181,7 @@ describe MassiveRecord::ORM::Relations::Metadata do
181
181
  end
182
182
 
183
183
  describe "proc" do
184
- let(:proxy_owner) { Person.new :id => "person-1" }
184
+ let(:proxy_owner) { Person.new "person-1" }
185
185
  let(:find_with_proc) { subject.records_starts_from = :friends_records_starts_from_id; subject.find_with }
186
186
 
187
187
  before do
@@ -6,10 +6,10 @@ describe TestReferencesManyProxy do
6
6
  include SetUpHbaseConnectionBeforeAll
7
7
  include SetTableNamesToTestTable
8
8
 
9
- let(:proxy_owner) { Person.new :id => "person-id-1", :name => "Test", :age => 29 }
10
- let(:proxy_target) { TestClass.new :id => "test-class-id-1" }
11
- let(:proxy_target_2) { TestClass.new :id => "test-class-id-2" }
12
- let(:proxy_target_3) { TestClass.new :id => "test-class-id-3" }
9
+ let(:proxy_owner) { Person.new "person-id-1", :name => "Test", :age => 29 }
10
+ let(:proxy_target) { TestClass.new "test-class-id-1" }
11
+ let(:proxy_target_2) { TestClass.new "test-class-id-2" }
12
+ let(:proxy_target_3) { TestClass.new "test-class-id-3" }
13
13
  let(:metadata) { subject.metadata }
14
14
 
15
15
  subject { proxy_owner.send(:relation_proxy, 'test_classes') }
@@ -43,9 +43,9 @@ describe TestReferencesManyProxy do
43
43
  end
44
44
 
45
45
  describe "with start from" do
46
- let(:proxy_target) { Person.new :id => proxy_owner.id+"-friend-1", :name => "T", :age => 2 }
47
- let(:proxy_target_2) { Person.new :id => proxy_owner.id+"-friend-2", :name => "H", :age => 9 }
48
- let(:not_proxy_target) { Person.new :id => "foo"+"-friend-2", :name => "H", :age => 1 }
46
+ let(:proxy_target) { Person.new proxy_owner.id+"-friend-1", :name => "T", :age => 2 }
47
+ let(:proxy_target_2) { Person.new proxy_owner.id+"-friend-2", :name => "H", :age => 9 }
48
+ let(:not_proxy_target) { Person.new "foo"+"-friend-2", :name => "H", :age => 1 }
49
49
  let(:metadata) { subject.metadata }
50
50
 
51
51
  subject { proxy_owner.send(:relation_proxy, 'friends') }
@@ -429,8 +429,8 @@ describe TestReferencesManyProxy do
429
429
  end
430
430
 
431
431
  describe "with records_starts_from (proc)" do
432
- let(:proxy_target) { Person.new :id => proxy_owner.id+"-friend-1", :name => "T", :age => 2 }
433
- let(:proxy_target_2) { Person.new :id => proxy_owner.id+"-friend-2", :name => "H", :age => 9 }
432
+ let(:proxy_target) { Person.new proxy_owner.id+"-friend-1", :name => "T", :age => 2 }
433
+ let(:proxy_target_2) { Person.new proxy_owner.id+"-friend-2", :name => "H", :age => 9 }
434
434
  let(:metadata) { subject.metadata }
435
435
 
436
436
  subject { proxy_owner.send(:relation_proxy, 'friends') }
@@ -497,9 +497,9 @@ describe TestReferencesManyProxy do
497
497
 
498
498
 
499
499
  describe "with records_starts_from (proc)" do
500
- let(:proxy_target) { Person.new :id => proxy_owner.id+"-friend-1", :name => "T", :age => 2 }
501
- let(:proxy_target_2) { Person.new :id => proxy_owner.id+"-friend-2", :name => "H", :age => 9 }
502
- let(:not_among_targets) { Person.new :id => "NOT-friend-1", :name => "H", :age => 9 }
500
+ let(:proxy_target) { Person.new proxy_owner.id+"-friend-1", :name => "T", :age => 2 }
501
+ let(:proxy_target_2) { Person.new proxy_owner.id+"-friend-2", :name => "H", :age => 9 }
502
+ let(:not_among_targets) { Person.new "NOT-friend-1", :name => "H", :age => 9 }
503
503
  let(:metadata) { subject.metadata }
504
504
 
505
505
  subject { proxy_owner.send(:relation_proxy, 'friends') }
@@ -579,9 +579,9 @@ describe TestReferencesManyProxy do
579
579
 
580
580
 
581
581
  describe "with records_starts_from (proc)" do
582
- let(:proxy_target) { Person.new :id => proxy_owner.id+"-friend-1", :name => "T", :age => 2 }
583
- let(:proxy_target_2) { Person.new :id => proxy_owner.id+"-friend-2", :name => "H", :age => 9 }
584
- let(:not_among_targets) { Person.new :id => "NOT-friend-1", :name => "H", :age => 9 }
582
+ let(:proxy_target) { Person.new proxy_owner.id+"-friend-1", :name => "T", :age => 2 }
583
+ let(:proxy_target_2) { Person.new proxy_owner.id+"-friend-2", :name => "H", :age => 9 }
584
+ let(:not_among_targets) { Person.new "NOT-friend-1", :name => "H", :age => 9 }
585
585
  let(:metadata) { subject.metadata }
586
586
 
587
587
  subject { proxy_owner.send(:relation_proxy, 'friends') }
@@ -621,4 +621,10 @@ describe TestReferencesManyProxy do
621
621
  end
622
622
  end
623
623
  end
624
+
625
+ it "resets when the proxy owner is asked to reload" do
626
+ subject.loaded!
627
+ proxy_owner.reload
628
+ should_not be_loaded
629
+ end
624
630
  end
@@ -56,7 +56,7 @@ describe TestReferencesOnePolymorphicProxy do
56
56
  it "should set the proxy_target's type in proxy_owner" do
57
57
  proxy_owner.attachable_type = nil
58
58
  proxy_owner.attachable = proxy_target
59
- proxy_owner.attachable_type.should == proxy_target.class.to_s.underscore
59
+ proxy_owner.attachable_type.should == proxy_target.class.to_s
60
60
  end
61
61
 
62
62
  it "should reset the proxy_targets foreign key if proxy_target is nil" do
@@ -103,4 +103,10 @@ describe TestReferencesOnePolymorphicProxy do
103
103
  proxy_owner.attachable_id.should == proxy_target.id
104
104
  end
105
105
  end
106
+
107
+ it "resets when the proxy owner is asked to reload" do
108
+ subject.loaded!
109
+ proxy_owner.reload
110
+ should_not be_loaded
111
+ end
106
112
  end
@@ -108,4 +108,11 @@ describe TestReferencesOneProxy do
108
108
  lambda { subject.send :raise_if_type_mismatch, person_with_timestamp }.should raise_error MassiveRecord::ORM::RelationTypeMismatch
109
109
  end
110
110
  end
111
+
112
+
113
+ it "resets when the proxy owner is asked to reload" do
114
+ subject.loaded!
115
+ proxy_owner.reload
116
+ should_not be_loaded
117
+ end
111
118
  end
@@ -115,6 +115,7 @@ describe MassiveRecord::ORM::Schema::Field do
115
115
  @subject.decode("0").should be_false
116
116
  @subject.decode("").should be_nil
117
117
  @subject.decode(nil).should be_nil
118
+ @subject.decode("null").should be_nil
118
119
  end
119
120
 
120
121
  it "should decode a string value" do
@@ -122,6 +123,7 @@ describe MassiveRecord::ORM::Schema::Field do
122
123
  @subject.decode("value").should == "value"
123
124
  @subject.decode("").should == ""
124
125
  @subject.decode(nil).should be_nil
126
+ @subject.decode("frozen".freeze).should eq "frozen"
125
127
  end
126
128
 
127
129
  it "should cast symbols to strings" do
@@ -131,20 +133,33 @@ describe MassiveRecord::ORM::Schema::Field do
131
133
 
132
134
  it "should decode string null correctly" do
133
135
  @subject = MassiveRecord::ORM::Schema::Field.new(:name => :status, :type => :string)
134
- @subject.decode(@subject.encode("null")).should == "null"
136
+ @subject.decode(@subject.coder.dump("null")).should == "null"
135
137
  end
136
138
 
137
139
  it "should decode string with value nil correctly" do
138
140
  @subject = MassiveRecord::ORM::Schema::Field.new(:name => :status, :type => :string)
139
- @subject.decode(@subject.encode(nil)).should == nil
141
+ @subject.decode(nil).should == nil
140
142
  end
141
143
 
142
144
  it "should decode an integer value" do
145
+ old_combatibility = MassiveRecord::ORM::Base.backward_compatibility_integers_might_be_persisted_as_strings
146
+ MassiveRecord::ORM::Base.backward_compatibility_integers_might_be_persisted_as_strings = true
147
+
143
148
  @subject = MassiveRecord::ORM::Schema::Field.new(:name => :status, :type => :integer)
144
149
  @subject.decode("1").should == 1
145
150
  @subject.decode(1).should == 1
146
151
  @subject.decode("").should be_nil
147
152
  @subject.decode(nil).should be_nil
153
+
154
+ MassiveRecord::ORM::Base.backward_compatibility_integers_might_be_persisted_as_strings = old_combatibility
155
+ end
156
+
157
+ it "decodes an integer value is represented as a binary string" do
158
+ @subject = MassiveRecord::ORM::Schema::Field.new(:name => :status, :type => :integer)
159
+ @subject.decode(nil).should be_nil
160
+ @subject.decode("\x00\x00\x00\x00\x00\x00\x00\x01").should eq 1
161
+ @subject.decode("\x00\x00\x00\x00\x00\x00\x00\x1C").should eq 28
162
+ @subject.decode("\x00\x00\x00\x00\x00\x00\x00\x1E").should eq 30
148
163
  end
149
164
 
150
165
  it "should decode an float value" do
@@ -176,6 +191,12 @@ describe MassiveRecord::ORM::Schema::Field do
176
191
  @subject.decode(nil).should be_nil
177
192
  end
178
193
 
194
+ it "should decode time when value is ActiveSupport::TimeWithZone" do
195
+ today = Time.now.in_time_zone('Europe/Stockholm')
196
+ @subject = MassiveRecord::ORM::Schema::Field.new(:name => :created_at, :type => :time)
197
+ @subject.decode(today).to_i.should == today.to_i
198
+ end
199
+
179
200
  it "should set time to nil if date could not be parsed" do
180
201
  today = "foobar"
181
202
  @subject = MassiveRecord::ORM::Schema::Field.new(:name => :created_at, :type => :time)
@@ -232,21 +253,43 @@ describe MassiveRecord::ORM::Schema::Field do
232
253
 
233
254
  it "should encode string if value is null" do
234
255
  @subject.type = :string
235
- @subject.encode("null").should == @subject.coder.dump("null")
256
+ @subject.encode("null").should == "null"
236
257
  end
237
258
 
238
259
  it "should encode string if value is nil" do
239
260
  @subject.type = :string
240
- @subject.encode(nil).should == "null"
261
+ @subject.encode(nil).should == nil
241
262
  end
242
263
 
243
- (MassiveRecord::ORM::Schema::Field::TYPES - [:string]).each do |type|
264
+ it "should encode fixnum to fixnum" do
265
+ @subject.type = :integer
266
+ @subject.encode(1).should == 1
267
+ end
268
+
269
+ (MassiveRecord::ORM::Schema::Field::TYPES - [:integer, :string]).each do |type|
244
270
  it "should ask coder to dump value when type is #{type}" do
245
271
  @subject.type = type
246
272
  @subject.coder.should_receive(:dump)
247
273
  @subject.encode("{}")
248
274
  end
249
275
  end
276
+
277
+ context "time_zone_aware_attributes" do
278
+ before do
279
+ @old_time_zone_aware_attributes = MassiveRecord::ORM::Base.time_zone_aware_attributes
280
+ MassiveRecord::ORM::Base.time_zone_aware_attributes = true
281
+ end
282
+
283
+ after do
284
+ MassiveRecord::ORM::Base.time_zone_aware_attributes = @old_time_zone_aware_attributes
285
+ end
286
+
287
+ it "should encode times in UTC" do
288
+ europe_time = Time.now.in_time_zone('Europe/Stockholm')
289
+ @subject = MassiveRecord::ORM::Schema::Field.new(:name => :created_at, :type => :time)
290
+ @subject.encode(europe_time).should == subject.coder.dump(europe_time.utc)
291
+ end
292
+ end
250
293
  end
251
294
 
252
295
  describe "#unique_name" do
@@ -351,4 +394,17 @@ describe MassiveRecord::ORM::Schema::Field do
351
394
  end
352
395
  end
353
396
  end
397
+
398
+
399
+
400
+ describe "#hex_string_to_integer" do
401
+ subject { MassiveRecord::ORM::Schema::Field.new(:name => :status, :type => :integer) }
402
+
403
+ ((-2..2).to_a + [4611686018427387903]).each do |integer|
404
+ it "decodes signed integer '#{integer}' correctly" do
405
+ int_representation_in_hbase = [integer].pack('q').reverse
406
+ subject.send(:hex_string_to_integer, int_representation_in_hbase).should eq integer
407
+ end
408
+ end
409
+ end
354
410
  end
@@ -39,11 +39,12 @@ module CreatePersonBeforeEach
39
39
  before do
40
40
  @table = MassiveRecord::Wrapper::Table.new(@connection, Person.table_name)
41
41
  @table.column_families.create(:info)
42
+ @table.column_families.create(:base)
42
43
  @table.save
43
44
 
44
45
  @row = MassiveRecord::Wrapper::Row.new
45
46
  @row.id = "ID1"
46
- @row.values = {:info => {:name => "John Doe", :email => "john@base.com", :age => "20", :test_class_ids => [].to_json}}
47
+ @row.values = {:info => {:name => "John Doe", :email => "john@base.com", :age => "20", :test_class_ids => [].to_json}, :base => {:phone_numbers => [].to_json}}
47
48
  @row.table = @table
48
49
  @row.save
49
50
  end
@@ -38,6 +38,13 @@ module MockMassiveRecordConnection
38
38
  row.values = {}
39
39
  row
40
40
  end
41
+
42
+ def table.all(*args)
43
+ row = MassiveRecord::Wrapper::Row.new
44
+ row.id = args[0]
45
+ row.values = {}
46
+ [row]
47
+ end
41
48
 
42
49
  # Simply returning all known column families across all tables to make the need
43
50
  # for creating new one on create disappear.
@@ -0,0 +1,25 @@
1
+ module TimeZoneHelper
2
+ #
3
+ # Helper method which enables and disables time zone awareness and sets the
4
+ # incomming time zone to the current one.
5
+ #
6
+ # Method will ensure that everything is put back into
7
+ # the state it was before the method was called.
8
+ #
9
+ def in_time_zone(zone)
10
+ old_zone = Time.zone
11
+ old_awareness = MassiveRecord::ORM::Base.time_zone_aware_attributes
12
+ MassiveRecord::ORM::Base.descendants.each { |klass| klass.undefine_attribute_methods } # If time zone awareness has changed we need to re-generate methods
13
+
14
+
15
+ Time.zone = zone ? ActiveSupport::TimeZone[zone] : nil
16
+ MassiveRecord::ORM::Base.time_zone_aware_attributes = !zone.nil?
17
+
18
+ yield
19
+
20
+ ensure
21
+ Time.zone = old_zone
22
+ MassiveRecord::ORM::Base.time_zone_aware_attributes = old_awareness
23
+ MassiveRecord::ORM::Base.descendants.each { |klass| klass.undefine_attribute_methods } # If time zone awareness has changed we need to re-generate methods
24
+ end
25
+ end
metadata CHANGED
@@ -1,8 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: massive_record
3
3
  version: !ruby/object:Gem::Version
4
- prerelease:
5
- version: 0.2.0
4
+ prerelease: 6
5
+ version: 0.2.1.rc1
6
6
  platform: ruby
7
7
  authors:
8
8
  - Companybook
@@ -10,7 +10,8 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-05-11 00:00:00 Z
13
+ date: 2011-06-16 00:00:00 +02:00
14
+ default_executable:
14
15
  dependencies:
15
16
  - !ruby/object:Gem::Dependency
16
17
  name: thrift
@@ -46,16 +47,27 @@ dependencies:
46
47
  type: :runtime
47
48
  version_requirements: *id003
48
49
  - !ruby/object:Gem::Dependency
49
- name: rspec
50
+ name: tzinfo
50
51
  prerelease: false
51
52
  requirement: &id004 !ruby/object:Gem::Requirement
53
+ none: false
54
+ requirements:
55
+ - - ">="
56
+ - !ruby/object:Gem::Version
57
+ version: "0"
58
+ type: :runtime
59
+ version_requirements: *id004
60
+ - !ruby/object:Gem::Dependency
61
+ name: rspec
62
+ prerelease: false
63
+ requirement: &id005 !ruby/object:Gem::Requirement
52
64
  none: false
53
65
  requirements:
54
66
  - - ">="
55
67
  - !ruby/object:Gem::Version
56
68
  version: 2.1.0
57
69
  type: :development
58
- version_requirements: *id004
70
+ version_requirements: *id005
59
71
  description: HBase Ruby client API
60
72
  email: geeks@companybook.no
61
73
  executables: []
@@ -89,6 +101,7 @@ files:
89
101
  - lib/massive_record/orm/attribute_methods.rb
90
102
  - lib/massive_record/orm/attribute_methods/dirty.rb
91
103
  - lib/massive_record/orm/attribute_methods/read.rb
104
+ - lib/massive_record/orm/attribute_methods/time_zone_conversion.rb
92
105
  - lib/massive_record/orm/attribute_methods/write.rb
93
106
  - lib/massive_record/orm/base.rb
94
107
  - lib/massive_record/orm/callbacks.rb
@@ -98,11 +111,15 @@ files:
98
111
  - lib/massive_record/orm/coders/yaml.rb
99
112
  - lib/massive_record/orm/column.rb
100
113
  - lib/massive_record/orm/config.rb
114
+ - lib/massive_record/orm/default_id.rb
101
115
  - lib/massive_record/orm/errors.rb
102
116
  - lib/massive_record/orm/finders.rb
117
+ - lib/massive_record/orm/finders/rescue_missing_table_on_find.rb
103
118
  - lib/massive_record/orm/finders/scope.rb
104
119
  - lib/massive_record/orm/id_factory.rb
120
+ - lib/massive_record/orm/log_subscriber.rb
105
121
  - lib/massive_record/orm/persistence.rb
122
+ - lib/massive_record/orm/query_instrumentation.rb
106
123
  - lib/massive_record/orm/relations.rb
107
124
  - lib/massive_record/orm/relations/interface.rb
108
125
  - lib/massive_record/orm/relations/metadata.rb
@@ -122,6 +139,7 @@ files:
122
139
  - lib/massive_record/orm/table.rb
123
140
  - lib/massive_record/orm/timestamps.rb
124
141
  - lib/massive_record/orm/validations.rb
142
+ - lib/massive_record/rails/controller_runtime.rb
125
143
  - lib/massive_record/rails/railtie.rb
126
144
  - lib/massive_record/spec/support/simple_database_cleaner.rb
127
145
  - lib/massive_record/version.rb
@@ -132,6 +150,11 @@ files:
132
150
  - lib/massive_record/wrapper/errors.rb
133
151
  - lib/massive_record/wrapper/tables_collection.rb
134
152
  - massive_record.gemspec
153
+ - spec/adapter/thrift/adapter_spec.rb
154
+ - spec/adapter/thrift/atomic_increment_spec.rb
155
+ - spec/adapter/thrift/connection_spec.rb
156
+ - spec/adapter/thrift/table_find_spec.rb
157
+ - spec/adapter/thrift/table_spec.rb
135
158
  - spec/config.yml.example
136
159
  - spec/orm/cases/attribute_methods_spec.rb
137
160
  - spec/orm/cases/auto_generate_id_spec.rb
@@ -139,6 +162,8 @@ files:
139
162
  - spec/orm/cases/callbacks_spec.rb
140
163
  - spec/orm/cases/column_spec.rb
141
164
  - spec/orm/cases/config_spec.rb
165
+ - spec/orm/cases/default_id_spec.rb
166
+ - spec/orm/cases/default_values_spec.rb
142
167
  - spec/orm/cases/dirty_spec.rb
143
168
  - spec/orm/cases/encoding_spec.rb
144
169
  - spec/orm/cases/finder_default_scope.rb
@@ -146,9 +171,12 @@ files:
146
171
  - spec/orm/cases/finders_spec.rb
147
172
  - spec/orm/cases/i18n_spec.rb
148
173
  - spec/orm/cases/id_factory_spec.rb
174
+ - spec/orm/cases/log_subscriber_spec.rb
175
+ - spec/orm/cases/mass_assignment_security_spec.rb
149
176
  - spec/orm/cases/persistence_spec.rb
150
177
  - spec/orm/cases/single_table_inheritance_spec.rb
151
178
  - spec/orm/cases/table_spec.rb
179
+ - spec/orm/cases/time_zone_awareness_spec.rb
152
180
  - spec/orm/cases/timestamps_spec.rb
153
181
  - spec/orm/cases/validation_spec.rb
154
182
  - spec/orm/coders/chained_spec.rb
@@ -157,6 +185,7 @@ files:
157
185
  - spec/orm/models/address.rb
158
186
  - spec/orm/models/best_friend.rb
159
187
  - spec/orm/models/friend.rb
188
+ - spec/orm/models/model_without_default_id.rb
160
189
  - spec/orm/models/person.rb
161
190
  - spec/orm/models/person_with_timestamp.rb
162
191
  - spec/orm/models/test_class.rb
@@ -178,10 +207,9 @@ files:
178
207
  - spec/spec_helper.rb
179
208
  - spec/support/connection_helpers.rb
180
209
  - spec/support/mock_massive_record_connection.rb
210
+ - spec/support/time_zone_helper.rb
181
211
  - spec/thrift/cases/encoding_spec.rb
182
- - spec/wrapper/cases/adapter_spec.rb
183
- - spec/wrapper/cases/connection_spec.rb
184
- - spec/wrapper/cases/table_spec.rb
212
+ has_rdoc: true
185
213
  homepage: http://github.com/CompanyBook/massive_record
186
214
  licenses: []
187
215
 
@@ -199,17 +227,22 @@ required_ruby_version: !ruby/object:Gem::Requirement
199
227
  required_rubygems_version: !ruby/object:Gem::Requirement
200
228
  none: false
201
229
  requirements:
202
- - - ">="
230
+ - - ">"
203
231
  - !ruby/object:Gem::Version
204
- version: "0"
232
+ version: 1.3.1
205
233
  requirements: []
206
234
 
207
235
  rubyforge_project: massive_record
208
- rubygems_version: 1.7.2
236
+ rubygems_version: 1.6.2
209
237
  signing_key:
210
238
  specification_version: 3
211
239
  summary: HBase Ruby client API
212
240
  test_files:
241
+ - spec/adapter/thrift/adapter_spec.rb
242
+ - spec/adapter/thrift/atomic_increment_spec.rb
243
+ - spec/adapter/thrift/connection_spec.rb
244
+ - spec/adapter/thrift/table_find_spec.rb
245
+ - spec/adapter/thrift/table_spec.rb
213
246
  - spec/config.yml.example
214
247
  - spec/orm/cases/attribute_methods_spec.rb
215
248
  - spec/orm/cases/auto_generate_id_spec.rb
@@ -217,6 +250,8 @@ test_files:
217
250
  - spec/orm/cases/callbacks_spec.rb
218
251
  - spec/orm/cases/column_spec.rb
219
252
  - spec/orm/cases/config_spec.rb
253
+ - spec/orm/cases/default_id_spec.rb
254
+ - spec/orm/cases/default_values_spec.rb
220
255
  - spec/orm/cases/dirty_spec.rb
221
256
  - spec/orm/cases/encoding_spec.rb
222
257
  - spec/orm/cases/finder_default_scope.rb
@@ -224,9 +259,12 @@ test_files:
224
259
  - spec/orm/cases/finders_spec.rb
225
260
  - spec/orm/cases/i18n_spec.rb
226
261
  - spec/orm/cases/id_factory_spec.rb
262
+ - spec/orm/cases/log_subscriber_spec.rb
263
+ - spec/orm/cases/mass_assignment_security_spec.rb
227
264
  - spec/orm/cases/persistence_spec.rb
228
265
  - spec/orm/cases/single_table_inheritance_spec.rb
229
266
  - spec/orm/cases/table_spec.rb
267
+ - spec/orm/cases/time_zone_awareness_spec.rb
230
268
  - spec/orm/cases/timestamps_spec.rb
231
269
  - spec/orm/cases/validation_spec.rb
232
270
  - spec/orm/coders/chained_spec.rb
@@ -235,6 +273,7 @@ test_files:
235
273
  - spec/orm/models/address.rb
236
274
  - spec/orm/models/best_friend.rb
237
275
  - spec/orm/models/friend.rb
276
+ - spec/orm/models/model_without_default_id.rb
238
277
  - spec/orm/models/person.rb
239
278
  - spec/orm/models/person_with_timestamp.rb
240
279
  - spec/orm/models/test_class.rb
@@ -256,7 +295,5 @@ test_files:
256
295
  - spec/spec_helper.rb
257
296
  - spec/support/connection_helpers.rb
258
297
  - spec/support/mock_massive_record_connection.rb
298
+ - spec/support/time_zone_helper.rb
259
299
  - spec/thrift/cases/encoding_spec.rb
260
- - spec/wrapper/cases/adapter_spec.rb
261
- - spec/wrapper/cases/connection_spec.rb
262
- - spec/wrapper/cases/table_spec.rb