couchrest_model 2.0.0.beta2 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. data/.travis.yml +8 -0
  2. data/Gemfile +1 -1
  3. data/README.md +1 -1
  4. data/Rakefile +9 -24
  5. data/VERSION +1 -1
  6. data/couchrest_model.gemspec +7 -5
  7. data/history.md +17 -1
  8. data/lib/couchrest/model/associations.rb +16 -11
  9. data/lib/couchrest/model/base.rb +17 -15
  10. data/lib/couchrest/model/casted_array.rb +7 -1
  11. data/lib/couchrest/model/core_extensions/time_parsing.rb +0 -23
  12. data/lib/couchrest/model/design.rb +282 -0
  13. data/lib/couchrest/model/designs/design_mapper.rb +79 -0
  14. data/lib/couchrest/model/designs/view.rb +9 -6
  15. data/lib/couchrest/model/designs.rb +37 -70
  16. data/lib/couchrest/model/persistence.rb +5 -5
  17. data/lib/couchrest/model/properties.rb +5 -16
  18. data/lib/couchrest/model/property.rb +34 -16
  19. data/lib/couchrest/model/translation.rb +22 -0
  20. data/lib/couchrest/model/typecast.rb +54 -43
  21. data/lib/couchrest/model/utils/migrate.rb +106 -0
  22. data/lib/couchrest_model.rb +4 -2
  23. data/lib/tasks/migrations.rake +5 -5
  24. data/spec/fixtures/models/course.rb +1 -0
  25. data/spec/fixtures/models/designs.rb +22 -0
  26. data/spec/spec_helper.rb +1 -0
  27. data/spec/unit/assocations_spec.rb +7 -0
  28. data/spec/unit/base_spec.rb +3 -1
  29. data/spec/unit/{designs/design_spec.rb → design_spec.rb} +6 -6
  30. data/spec/unit/designs/design_mapper_spec.rb +124 -0
  31. data/spec/unit/designs/view_spec.rb +30 -4
  32. data/spec/unit/designs_spec.rb +5 -140
  33. data/spec/unit/dirty_spec.rb +15 -1
  34. data/spec/unit/embeddable_spec.rb +2 -2
  35. data/spec/unit/property_spec.rb +70 -28
  36. data/spec/unit/translations_spec.rb +31 -0
  37. data/spec/unit/typecast_spec.rb +99 -19
  38. data/spec/unit/utils/migrate_spec.rb +25 -0
  39. metadata +43 -19
  40. data/lib/couchrest/model/designs/design.rb +0 -284
  41. data/lib/couchrest/model/migrate.rb +0 -92
@@ -381,75 +381,111 @@ describe "nested models (not casted)" do
381
381
  @cat.siblings.first.name.should eql("Feather")
382
382
  @cat.siblings.last.casted_by.should eql(@cat)
383
383
  end
384
-
385
384
  end
386
385
 
387
386
  describe "Property Class" do
388
387
 
388
+ let :klass do
389
+ CouchRest::Model::Property
390
+ end
391
+
389
392
  it "should provide name as string" do
390
- property = CouchRest::Model::Property.new(:test, String)
393
+ property = CouchRest::Model::Property.new(:test, :type => String)
391
394
  property.name.should eql('test')
392
395
  property.to_s.should eql('test')
393
396
  end
394
397
 
398
+ it "should provide name as a symbol" do
399
+ property = CouchRest::Model::Property.new(:test, :type => String)
400
+ property.name.to_sym.should eql(:test)
401
+ property.to_sym.should eql(:test)
402
+ end
403
+
395
404
  it "should provide class from type" do
396
- property = CouchRest::Model::Property.new(:test, String)
397
- property.type_class.should eql(String)
405
+ property = CouchRest::Model::Property.new(:test, :type => String)
406
+ property.type.should eql(String)
407
+ property.array.should be_false
398
408
  end
399
409
 
400
410
  it "should provide base class from type in array" do
401
- property = CouchRest::Model::Property.new(:test, [String])
402
- property.type_class.should eql(String)
411
+ property = CouchRest::Model::Property.new(:test, :type => [String])
412
+ property.type.should eql(String)
413
+ property.array.should be_true
414
+ end
415
+
416
+ it "should provide base class and set array type" do
417
+ property = CouchRest::Model::Property.new(:test, :type => String, :array => true)
418
+ property.type.should eql(String)
419
+ property.array.should be_true
403
420
  end
404
421
 
405
422
  it "should raise error if type as string requested" do
406
423
  lambda {
407
- property = CouchRest::Model::Property.new(:test, 'String')
424
+ property = CouchRest::Model::Property.new(:test, :type => 'String')
408
425
  }.should raise_error
409
426
  end
410
427
 
411
428
  it "should leave type nil and return class as nil also" do
412
- property = CouchRest::Model::Property.new(:test, nil)
429
+ property = CouchRest::Model::Property.new(:test, :type => nil)
413
430
  property.type.should be_nil
414
- property.type_class.should be_nil
415
431
  end
416
432
 
417
433
  it "should convert empty type array to [Object]" do
418
- property = CouchRest::Model::Property.new(:test, [])
419
- property.type_class.should eql(Object)
434
+ property = CouchRest::Model::Property.new(:test, :type => [])
435
+ property.type.should eql(Object)
420
436
  end
421
437
 
422
438
  it "should set init method option or leave as 'new'" do
423
439
  # (bad example! Time already typecast)
424
- property = CouchRest::Model::Property.new(:test, Time)
440
+ property = CouchRest::Model::Property.new(:test, :type => Time)
425
441
  property.init_method.should eql('new')
426
- property = CouchRest::Model::Property.new(:test, Time, :init_method => 'parse')
442
+ property = CouchRest::Model::Property.new(:test, :type => Time, :init_method => 'parse')
427
443
  property.init_method.should eql('parse')
428
444
  end
429
445
 
430
446
  it "should set the allow_blank option to true by default" do
431
- property = CouchRest::Model::Property.new(:test, String)
447
+ property = CouchRest::Model::Property.new(:test, :type => String)
432
448
  property.allow_blank.should be_true
433
449
  end
434
450
 
435
451
  it "should allow setting of the allow_blank option to false" do
436
- property = CouchRest::Model::Property.new(:test, String, :allow_blank => false)
452
+ property = CouchRest::Model::Property.new(:test, :type => String, :allow_blank => false)
437
453
  property.allow_blank.should be_false
438
454
  end
439
455
 
456
+ it "should convert block to type" do
457
+ prop = klass.new(:test) do
458
+ property :testing
459
+ end
460
+ prop.array.should be_false
461
+ prop.type.should_not be_nil
462
+ prop.type.class.should eql(Class)
463
+ obj = prop.type.new
464
+ obj.should respond_to(:testing)
465
+ end
466
+
467
+ it "should convert block to type with array" do
468
+ prop = klass.new(:test, :array => true) do
469
+ property :testing
470
+ end
471
+ prop.type.should_not be_nil
472
+ prop.type.class.should eql(Class)
473
+ prop.array.should be_true
474
+ end
475
+
440
476
  describe "#build" do
441
477
  it "should allow instantiation of new object" do
442
- property = CouchRest::Model::Property.new(:test, Date)
478
+ property = CouchRest::Model::Property.new(:test, :type => Date)
443
479
  obj = property.build(2011, 05, 21)
444
480
  obj.should eql(Date.new(2011, 05, 21))
445
481
  end
446
482
  it "should use init_method if provided" do
447
- property = CouchRest::Model::Property.new(:test, Date, :init_method => 'parse')
483
+ property = CouchRest::Model::Property.new(:test, :type => Date, :init_method => 'parse')
448
484
  obj = property.build("2011-05-21")
449
485
  obj.should eql(Date.new(2011, 05, 21))
450
486
  end
451
487
  it "should use init_method Proc if provided" do
452
- property = CouchRest::Model::Property.new(:test, Date, :init_method => Proc.new{|v| Date.parse(v)})
488
+ property = CouchRest::Model::Property.new(:test, :type => Date, :init_method => Proc.new{|v| Date.parse(v)})
453
489
  obj = property.build("2011-05-21")
454
490
  obj.should eql(Date.new(2011, 05, 21))
455
491
  end
@@ -463,14 +499,20 @@ describe "Property Class" do
463
499
 
464
500
  describe "casting" do
465
501
  it "should cast a value" do
466
- property = CouchRest::Model::Property.new(:test, Date)
502
+ property = CouchRest::Model::Property.new(:test, :type => Date)
467
503
  parent = mock("FooObject")
468
504
  property.cast(parent, "2010-06-16").should eql(Date.new(2010, 6, 16))
469
505
  property.cast_value(parent, "2010-06-16").should eql(Date.new(2010, 6, 16))
470
506
  end
471
507
 
472
508
  it "should cast an array of values" do
473
- property = CouchRest::Model::Property.new(:test, [Date])
509
+ property = CouchRest::Model::Property.new(:test, :type => [Date])
510
+ parent = mock("FooObject")
511
+ property.cast(parent, ["2010-06-01", "2010-06-02"]).should eql([Date.new(2010, 6, 1), Date.new(2010, 6, 2)])
512
+ end
513
+
514
+ it "should cast an array of values with array option" do
515
+ property = CouchRest::Model::Property.new(:test, :type => Date, :array => true)
474
516
  parent = mock("FooObject")
475
517
  property.cast(parent, ["2010-06-01", "2010-06-02"]).should eql([Date.new(2010, 6, 1), Date.new(2010, 6, 2)])
476
518
  end
@@ -481,30 +523,30 @@ describe "Property Class" do
481
523
  end
482
524
 
483
525
  it "should convert blank to nil" do
484
- property = CouchRest::Model::Property.new(:test, String, :allow_blank => false)
526
+ property = CouchRest::Model::Property.new(:test, :type => String, :allow_blank => false)
485
527
  property.cast(parent, "").should be_nil
486
528
  end
487
529
 
488
530
  it "should remove blank array entries" do
489
- property = CouchRest::Model::Property.new(:test, [String], :allow_blank => false)
531
+ property = CouchRest::Model::Property.new(:test, :type => [String], :allow_blank => false)
490
532
  property.cast(parent, ["", "foo"]).should eql(["foo"])
491
533
  end
492
534
  end
493
535
 
494
536
  it "should set a CastedArray on array of Objects" do
495
- property = CouchRest::Model::Property.new(:test, [Object])
537
+ property = CouchRest::Model::Property.new(:test, :type => [Object])
496
538
  parent = mock("FooObject")
497
539
  property.cast(parent, ["2010-06-01", "2010-06-02"]).class.should eql(CouchRest::Model::CastedArray)
498
540
  end
499
541
 
500
542
  it "should set a CastedArray on array of Strings" do
501
- property = CouchRest::Model::Property.new(:test, [String])
543
+ property = CouchRest::Model::Property.new(:test, :type => [String])
502
544
  parent = mock("FooObject")
503
545
  property.cast(parent, ["2010-06-01", "2010-06-02"]).class.should eql(CouchRest::Model::CastedArray)
504
546
  end
505
547
 
506
548
  it "should allow instantion of model via CastedArray#build" do
507
- property = CouchRest::Model::Property.new(:dates, [Date])
549
+ property = CouchRest::Model::Property.new(:dates, :type => [Date])
508
550
  parent = Article.new
509
551
  ary = property.cast(parent, [])
510
552
  obj = ary.build(2011, 05, 21)
@@ -521,20 +563,20 @@ describe "Property Class" do
521
563
  def initialize(val); self.ary = val; end
522
564
  def as_json; ary; end
523
565
  end
524
- property = CouchRest::Model::Property.new(:test, prop)
566
+ property = CouchRest::Model::Property.new(:test, :type => prop)
525
567
  parent = mock("FooClass")
526
568
  cast = property.cast(parent, [1, 2])
527
569
  cast.ary.should eql([1, 2])
528
570
  end
529
571
 
530
572
  it "should set parent as casted_by object in CastedArray" do
531
- property = CouchRest::Model::Property.new(:test, [Object])
573
+ property = CouchRest::Model::Property.new(:test, :type => [Object])
532
574
  parent = mock("FooObject")
533
575
  property.cast(parent, ["2010-06-01", "2010-06-02"]).casted_by.should eql(parent)
534
576
  end
535
577
 
536
578
  it "should set casted_by on new value" do
537
- property = CouchRest::Model::Property.new(:test, CatToy)
579
+ property = CouchRest::Model::Property.new(:test, :type => CatToy)
538
580
  parent = mock("CatObject")
539
581
  cast = property.cast(parent, {:name => 'catnip'})
540
582
  cast.casted_by.should eql(parent)
@@ -0,0 +1,31 @@
1
+ # encoding: utf-8
2
+ require "spec_helper"
3
+
4
+ describe "ActiveModel Translations" do
5
+
6
+ describe ".human_attribute_name" do
7
+ it "should provide translation" do
8
+ Card.human_attribute_name(:first_name).should eql("First name")
9
+ end
10
+ end
11
+
12
+ describe ".i18n_scope" do
13
+ it "should provide activemodel default" do
14
+ Card.i18n_scope.should eql(:couchrest)
15
+ end
16
+ end
17
+
18
+ describe ".lookup_ancestors" do
19
+ it "should provide basic lookup" do
20
+ Cat.lookup_ancestors.should eql([Cat])
21
+ end
22
+
23
+ it "should provide lookup with ancestors" do
24
+ ChildCat.lookup_ancestors.should eql([ChildCat, Cat])
25
+ end
26
+
27
+ it "should provide Base if request directly" do
28
+ CouchRest::Model::Base.lookup_ancestors.should eql([CouchRest::Model::Base])
29
+ end
30
+ end
31
+ end
@@ -69,6 +69,20 @@ describe "Type Casting" do
69
69
  end
70
70
  end
71
71
 
72
+ describe "when type primitive is a Symbol" do
73
+ it "keeps symbol value unchanged" do
74
+ value = :a_symbol
75
+ @course.symbol = value
76
+ @course['symbol'].should equal(:a_symbol)
77
+ end
78
+
79
+ it "it casts to symbol representation of the value" do
80
+ @course.symbol = "a_symbol"
81
+ @course['symbol'].should equal(:a_symbol)
82
+ end
83
+ end
84
+
85
+
72
86
  describe 'when type primitive is a Float' do
73
87
  it 'returns same value if a float' do
74
88
  value = 24.0
@@ -166,10 +180,29 @@ describe "Type Casting" do
166
180
  @course.estimate.should eql(24.35)
167
181
  end
168
182
 
169
- [ Object.new, true, '00.0', '0.', '-.0', 'string' ].each do |value|
170
- it "does not typecast non-numeric value #{value.inspect}" do
183
+ it "should handle numbers with unit strings" do
184
+ @course.estimate = "23.21 points"
185
+ @course['estimate'].should eql(23.21)
186
+ end
187
+
188
+ [ '', 'string', ' foo ' ].each do |value|
189
+ it "should typecast string without a number to nil (#{value.inspect})" do
190
+ @course.estimate = value
191
+ @course['estimate'].should be_nil
192
+ end
193
+ end
194
+
195
+ [ '00.0', '0.', '-.0' ].each do |value|
196
+ it "should typecast strings with strange numbers to zero (#{value.inspect})" do
197
+ @course.estimate = value
198
+ @course['estimate'].should eql(0.0)
199
+ end
200
+ end
201
+
202
+ [ Object.new, true ].each do |value|
203
+ it "should not typecast non-numeric value that won't respond to #to_f (#{value.inspect})" do
171
204
  @course.estimate = value
172
- @course['estimate'].should equal(value)
205
+ @course['estimate'].should equal(nil)
173
206
  end
174
207
  end
175
208
 
@@ -257,12 +290,37 @@ describe "Type Casting" do
257
290
  @course['hours'].should eql(24)
258
291
  end
259
292
 
260
- [ Object.new, true, '00.0', '0.', '-.0', 'string' ].each do |value|
261
- it "does not typecast non-numeric value #{value.inspect}" do
293
+ it "should handle numbers with string units" do
294
+ @course.hours = "23 hours"
295
+ @course['hours'].should eql(23)
296
+ end
297
+
298
+ it "should typecast an empty string to nil" do
299
+ @course.hours = ""
300
+ @course['hours'].should be_nil
301
+ end
302
+
303
+ [ '', 'string', ' foo ' ].each do |value|
304
+ it "should typecast string without a number to nil (#{value.inspect})" do
262
305
  @course.hours = value
263
- @course['hours'].should equal(value)
306
+ @course['hours'].should be_nil
264
307
  end
265
308
  end
309
+
310
+ [ '00.0', '0.', '-.0' ].each do |value|
311
+ it "should typecast strings with strange numbers to zero (#{value.inspect})" do
312
+ @course.hours = value
313
+ @course['hours'].should eql(0)
314
+ end
315
+ end
316
+
317
+ [ Object.new, true ].each do |value|
318
+ it "should not typecast non-numeric value that won't respond to #to_i (#{value.inspect})" do
319
+ @course.hours = value
320
+ @course['hours'].should equal(nil)
321
+ end
322
+ end
323
+
266
324
  end
267
325
 
268
326
  describe 'when type primitive is a BigDecimal' do
@@ -347,12 +405,37 @@ describe "Type Casting" do
347
405
  @course['profit'].should eql(BigDecimal('24.35'))
348
406
  end
349
407
 
350
- [ Object.new, true, '00.0', '0.', '-.0', 'string' ].each do |value|
351
- it "does not typecast non-numeric value #{value.inspect}" do
408
+ it "should handle numbers with strings" do
409
+ @course.profit = "22.23 euros"
410
+ @course['profit'].should eql(BigDecimal('22.23'))
411
+ end
412
+
413
+ it "should typecast an empty string to nil" do
414
+ @course.profit = ""
415
+ @course['profit'].should be_nil
416
+ end
417
+
418
+ [ '', 'string', ' foo ' ].each do |value|
419
+ it "should typecast string without a number to nil (#{value.inspect})" do
352
420
  @course.profit = value
353
- @course['profit'].should equal(value)
421
+ @course['profit'].should be_nil
354
422
  end
355
423
  end
424
+
425
+ [ '00.0', '0.', '-.0' ].each do |value|
426
+ it "should typecast strings with strange numbers to zero (#{value.inspect})" do
427
+ @course.profit = value
428
+ @course['profit'].should eql(0.0)
429
+ end
430
+ end
431
+
432
+ [ Object.new, true ].each do |value|
433
+ it "should typecast non-numeric value that won't respond to to_d (#{value.inspect}) as nil" do
434
+ @course.profit = value
435
+ @course['profit'].should equal(nil)
436
+ end
437
+ end
438
+
356
439
  end
357
440
 
358
441
  describe 'when type primitive is a DateTime' do
@@ -387,7 +470,7 @@ describe "Type Casting" do
387
470
 
388
471
  it 'does not typecast non-datetime values' do
389
472
  @course.updated_at = 'not-datetime'
390
- @course['updated_at'].should eql('not-datetime')
473
+ @course['updated_at'].should be_nil
391
474
  end
392
475
  end
393
476
 
@@ -419,7 +502,7 @@ describe "Type Casting" do
419
502
 
420
503
  it 'does not typecast non-date values' do
421
504
  @course.started_on = 'not-date'
422
- @course['started_on'].should eql('not-date')
505
+ @course['started_on'].should be_nil
423
506
  end
424
507
  end
425
508
 
@@ -477,12 +560,9 @@ describe "Type Casting" do
477
560
  @course.ends_at.to_i.should eql(Time.utc(2011, 4, 1, 16, 50, 32).to_i)
478
561
  end
479
562
 
480
- if RUBY_VERSION >= "1.9.1"
481
- # In ruby 1.8.7 Time.parse will always return a value. D'OH
482
- it 'does not typecast non-time values' do
483
- @course.ends_at = 'not-time'
484
- @course['ends_at'].should eql('not-time')
485
- end
563
+ it 'does not typecast non-time values' do
564
+ @course.ends_at = 'not-time'
565
+ @course['ends_at'].should be_nil
486
566
  end
487
567
  end
488
568
 
@@ -500,7 +580,7 @@ describe "Type Casting" do
500
580
 
501
581
  it 'does not typecast non-class values' do
502
582
  @course.klass = 'NoClass'
503
- @course['klass'].should eql('NoClass')
583
+ @course['klass'].should be_nil
504
584
  end
505
585
  end
506
586
 
@@ -523,7 +603,7 @@ describe "Type Casting" do
523
603
  [ 'string', 2, 1.0, BigDecimal('1.0'), DateTime.now, Time.now, Date.today, Class, Object.new, ].each do |value|
524
604
  it "does not typecast value #{value.inspect}" do
525
605
  @course.active = value
526
- @course['active'].should equal(value)
606
+ @course['active'].should be_nil
527
607
  end
528
608
  end
529
609
 
@@ -0,0 +1,25 @@
1
+
2
+ require 'spec_helper'
3
+
4
+ describe CouchRest::Model::Utils::Migrate do
5
+
6
+ before :each do
7
+ @module = CouchRest::Model::Utils::Migrate
8
+ end
9
+
10
+ describe "#load_all_models" do
11
+ it "should not do anything if Rails is not available" do
12
+ @module.load_all_models
13
+ end
14
+ it "should detect if Rails is available and require models" do
15
+ Rails = mock()
16
+ Rails.stub!(:root).and_return("")
17
+ Dir.should_receive(:[]).with("app/models/**/*.rb").and_return(['failed_require'])
18
+ # we can't mock require, so just expect an error
19
+ expect {
20
+ @module.load_all_models
21
+ }.to raise_error(LoadError)
22
+ end
23
+ end
24
+
25
+ end
metadata CHANGED
@@ -1,8 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: couchrest_model
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.beta2
5
- prerelease: 6
4
+ version: 2.0.0
5
+ prerelease:
6
6
  platform: ruby
7
7
  authors:
8
8
  - J. Chris Anderson
@@ -13,7 +13,7 @@ authors:
13
13
  autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2012-08-02 00:00:00.000000000 Z
16
+ date: 2013-10-04 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: couchrest
@@ -36,7 +36,7 @@ dependencies:
36
36
  requirement: !ruby/object:Gem::Requirement
37
37
  none: false
38
38
  requirements:
39
- - - ~>
39
+ - - ! '>='
40
40
  - !ruby/object:Gem::Version
41
41
  version: '1.15'
42
42
  type: :runtime
@@ -44,7 +44,7 @@ dependencies:
44
44
  version_requirements: !ruby/object:Gem::Requirement
45
45
  none: false
46
46
  requirements:
47
- - - ~>
47
+ - - ! '>='
48
48
  - !ruby/object:Gem::Version
49
49
  version: '1.15'
50
50
  - !ruby/object:Gem::Dependency
@@ -52,7 +52,7 @@ dependencies:
52
52
  requirement: !ruby/object:Gem::Requirement
53
53
  none: false
54
54
  requirements:
55
- - - ~>
55
+ - - ! '>='
56
56
  - !ruby/object:Gem::Version
57
57
  version: '3.0'
58
58
  type: :runtime
@@ -60,7 +60,7 @@ dependencies:
60
60
  version_requirements: !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
- - - ~>
63
+ - - ! '>='
64
64
  - !ruby/object:Gem::Version
65
65
  version: '3.0'
66
66
  - !ruby/object:Gem::Dependency
@@ -68,7 +68,7 @@ dependencies:
68
68
  requirement: !ruby/object:Gem::Requirement
69
69
  none: false
70
70
  requirements:
71
- - - ~>
71
+ - - ! '>='
72
72
  - !ruby/object:Gem::Version
73
73
  version: 0.3.22
74
74
  type: :runtime
@@ -76,7 +76,7 @@ dependencies:
76
76
  version_requirements: !ruby/object:Gem::Requirement
77
77
  none: false
78
78
  requirements:
79
- - - ~>
79
+ - - ! '>='
80
80
  - !ruby/object:Gem::Version
81
81
  version: 0.3.22
82
82
  - !ruby/object:Gem::Dependency
@@ -144,13 +144,29 @@ dependencies:
144
144
  - !ruby/object:Gem::Version
145
145
  version: 0.8.0
146
146
  - !ruby/object:Gem::Dependency
147
- name: debugger
147
+ name: activemodel
148
+ requirement: !ruby/object:Gem::Requirement
149
+ none: false
150
+ requirements:
151
+ - - ! '>='
152
+ - !ruby/object:Gem::Version
153
+ version: '4.0'
154
+ type: :development
155
+ prerelease: false
156
+ version_requirements: !ruby/object:Gem::Requirement
157
+ none: false
158
+ requirements:
159
+ - - ! '>='
160
+ - !ruby/object:Gem::Version
161
+ version: '4.0'
162
+ - !ruby/object:Gem::Dependency
163
+ name: kaminari
148
164
  requirement: !ruby/object:Gem::Requirement
149
165
  none: false
150
166
  requirements:
151
167
  - - ~>
152
168
  - !ruby/object:Gem::Version
153
- version: 1.2.0
169
+ version: 0.14.1
154
170
  type: :development
155
171
  prerelease: false
156
172
  version_requirements: !ruby/object:Gem::Requirement
@@ -158,7 +174,7 @@ dependencies:
158
174
  requirements:
159
175
  - - ~>
160
176
  - !ruby/object:Gem::Version
161
- version: 1.2.0
177
+ version: 0.14.1
162
178
  description: CouchRest Model provides aditional features to the standard CouchRest
163
179
  Document class such as properties, view designs, associations, callbacks, typecasting
164
180
  and validations.
@@ -172,6 +188,7 @@ extra_rdoc_files:
172
188
  files:
173
189
  - .gitignore
174
190
  - .rspec
191
+ - .travis.yml
175
192
  - Gemfile
176
193
  - LICENSE
177
194
  - README.md
@@ -193,22 +210,24 @@ files:
193
210
  - lib/couchrest/model/connection.rb
194
211
  - lib/couchrest/model/core_extensions/hash.rb
195
212
  - lib/couchrest/model/core_extensions/time_parsing.rb
213
+ - lib/couchrest/model/design.rb
196
214
  - lib/couchrest/model/designs.rb
197
- - lib/couchrest/model/designs/design.rb
215
+ - lib/couchrest/model/designs/design_mapper.rb
198
216
  - lib/couchrest/model/designs/view.rb
199
217
  - lib/couchrest/model/dirty.rb
200
218
  - lib/couchrest/model/document_queries.rb
201
219
  - lib/couchrest/model/embeddable.rb
202
220
  - lib/couchrest/model/errors.rb
203
221
  - lib/couchrest/model/extended_attachments.rb
204
- - lib/couchrest/model/migrate.rb
205
222
  - lib/couchrest/model/persistence.rb
206
223
  - lib/couchrest/model/properties.rb
207
224
  - lib/couchrest/model/property.rb
208
225
  - lib/couchrest/model/property_protection.rb
209
226
  - lib/couchrest/model/proxyable.rb
210
227
  - lib/couchrest/model/support/couchrest_database.rb
228
+ - lib/couchrest/model/translation.rb
211
229
  - lib/couchrest/model/typecast.rb
230
+ - lib/couchrest/model/utils/migrate.rb
212
231
  - lib/couchrest/model/validations.rb
213
232
  - lib/couchrest/model/validations/casted_model.rb
214
233
  - lib/couchrest/model/validations/locale/en.yml
@@ -232,6 +251,7 @@ files:
232
251
  - spec/fixtures/models/cat.rb
233
252
  - spec/fixtures/models/client.rb
234
253
  - spec/fixtures/models/course.rb
254
+ - spec/fixtures/models/designs.rb
235
255
  - spec/fixtures/models/event.rb
236
256
  - spec/fixtures/models/invoice.rb
237
257
  - spec/fixtures/models/key_chain.rb
@@ -259,7 +279,8 @@ files:
259
279
  - spec/unit/configuration_spec.rb
260
280
  - spec/unit/connection_spec.rb
261
281
  - spec/unit/core_extensions/time_parsing.rb
262
- - spec/unit/designs/design_spec.rb
282
+ - spec/unit/design_spec.rb
283
+ - spec/unit/designs/design_mapper_spec.rb
263
284
  - spec/unit/designs/view_spec.rb
264
285
  - spec/unit/designs_spec.rb
265
286
  - spec/unit/dirty_spec.rb
@@ -270,7 +291,9 @@ files:
270
291
  - spec/unit/property_spec.rb
271
292
  - spec/unit/proxyable_spec.rb
272
293
  - spec/unit/subclass_spec.rb
294
+ - spec/unit/translations_spec.rb
273
295
  - spec/unit/typecast_spec.rb
296
+ - spec/unit/utils/migrate_spec.rb
274
297
  - spec/unit/validations_spec.rb
275
298
  homepage: http://github.com/couchrest/couchrest_model
276
299
  licenses: []
@@ -284,9 +307,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
284
307
  - - ! '>='
285
308
  - !ruby/object:Gem::Version
286
309
  version: '0'
287
- segments:
288
- - 0
289
- hash: 2665370531854453498
290
310
  required_rubygems_version: !ruby/object:Gem::Requirement
291
311
  none: false
292
312
  requirements:
@@ -310,6 +330,7 @@ test_files:
310
330
  - spec/fixtures/models/cat.rb
311
331
  - spec/fixtures/models/client.rb
312
332
  - spec/fixtures/models/course.rb
333
+ - spec/fixtures/models/designs.rb
313
334
  - spec/fixtures/models/event.rb
314
335
  - spec/fixtures/models/invoice.rb
315
336
  - spec/fixtures/models/key_chain.rb
@@ -337,7 +358,8 @@ test_files:
337
358
  - spec/unit/configuration_spec.rb
338
359
  - spec/unit/connection_spec.rb
339
360
  - spec/unit/core_extensions/time_parsing.rb
340
- - spec/unit/designs/design_spec.rb
361
+ - spec/unit/design_spec.rb
362
+ - spec/unit/designs/design_mapper_spec.rb
341
363
  - spec/unit/designs/view_spec.rb
342
364
  - spec/unit/designs_spec.rb
343
365
  - spec/unit/dirty_spec.rb
@@ -348,5 +370,7 @@ test_files:
348
370
  - spec/unit/property_spec.rb
349
371
  - spec/unit/proxyable_spec.rb
350
372
  - spec/unit/subclass_spec.rb
373
+ - spec/unit/translations_spec.rb
351
374
  - spec/unit/typecast_spec.rb
375
+ - spec/unit/utils/migrate_spec.rb
352
376
  - spec/unit/validations_spec.rb