csv_record 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -27,8 +27,6 @@ $ gem install csv_record
27
27
  ## Usage
28
28
 
29
29
  ```ruby
30
- requite 'csv_record'
31
-
32
30
  class Car
33
31
  include CsvRecord::Document
34
32
  end
@@ -1,3 +1,5 @@
1
+ require 'FileUtils'
2
+
1
3
  module CsvRecord
2
4
  module Connector
3
5
  def __initialize_db_directory__
@@ -1,3 +1,3 @@
1
1
  module CsvRecord
2
- VERSION = "1.0.1"
2
+ VERSION = "1.0.2"
3
3
  end
@@ -35,7 +35,7 @@ module CsvRecord
35
35
  def __destroy__
36
36
  self.class.parse_database_file do |row|
37
37
  new_row = row
38
- new_row = nil if self.id == row.field('id').to_i
38
+ new_row = nil if self.id.to_i == row.field('id').to_i
39
39
  new_row
40
40
  end
41
41
  empty_fields
@@ -58,7 +58,7 @@ module CsvRecord
58
58
  set_updated_at
59
59
  self.class.parse_database_file do |row|
60
60
  new_row = row
61
- new_row = self.values if self.id == row.field('id').to_i
61
+ new_row = self.values if self.id.to_i == row.field('id').to_i
62
62
  new_row
63
63
  end
64
64
  true
@@ -51,41 +51,24 @@ describe CsvRecord::Reader do
51
51
  Car.count.must_equal 2
52
52
  end
53
53
 
54
- describe 'simple query' do
55
- it 'querying by id' do
56
- cars = []
57
- 3.times do
58
- cars << car.clone
59
- cars.last.save
60
- end
61
- Car.find(cars.first.id).wont_be_nil
62
- Car.find(cars.first.id).must_be_instance_of Car
63
- end
64
-
65
- it 'querying by object' do
66
- cars = []
67
- 3.times do
68
- cars << car.clone
69
- cars.last.save
70
- end
71
- Car.find(cars.first).wont_be_nil
72
- Car.find(cars.first.id).must_be_instance_of Car
54
+ it 'querying by id' do
55
+ cars = []
56
+ 3.times do
57
+ cars << car.clone
58
+ cars.last.save
73
59
  end
60
+ Car.find(cars.first.id).wont_be_nil
61
+ Car.find(cars.first.id).must_be_instance_of Car
74
62
  end
75
63
 
76
- describe 'complex queries' do
77
- it 'with params' do
78
- car.save
79
- second_car.save
80
- Car.find(
81
- year: 1997,
82
- make: 'Ford'
83
- )
84
- end
85
-
86
- it 'dinamyc finders' do
87
-
64
+ it 'querying by object' do
65
+ cars = []
66
+ 3.times do
67
+ cars << car.clone
68
+ cars.last.save
88
69
  end
70
+ Car.find(cars.first).wont_be_nil
71
+ Car.find(cars.first.id).must_be_instance_of Car
89
72
  end
90
73
  end
91
74
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: csv_record
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: