adacosta-labilerecord 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. data/History.txt +3 -1
  2. data/README.rdoc +2 -1
  3. data/lib/labilerecord.rb +1 -5
  4. metadata +1 -1
@@ -7,4 +7,6 @@
7
7
  * 3 :
8
8
  * Changed Query.data to Query.rows
9
9
  * 4 :
10
- * Access Model[x] instea of Model.rows[x]
10
+ * Access Model[x] instea of Model.rows[x]
11
+ * 5 :
12
+ * Fixed bug introduced in 0.0.4 always referencing row[0]
@@ -1,6 +1,6 @@
1
1
  = labilerecord
2
2
 
3
- * git://github.com/adacosta/labilerecord.git
3
+ * http://github.com/adacosta/labilerecord
4
4
 
5
5
  == DESCRIPTION:
6
6
 
@@ -12,6 +12,7 @@
12
12
  * Access field types
13
13
  * Access types which ActiveRecord won't (e.g. _int4)
14
14
  * Easy to use on tables, views, and functions
15
+ * Fast - no ruby type conversion on values from connection adapter.
15
16
 
16
17
  == SYNOPSIS:
17
18
 
@@ -18,7 +18,6 @@ module LabileRecord
18
18
  end
19
19
 
20
20
  class Query < Array
21
- # attr_reader :rows
22
21
  attr_reader :result
23
22
  attr_reader :fields
24
23
  attr_reader :string
@@ -31,23 +30,20 @@ module LabileRecord
31
30
  @result = connection.exec(@string)
32
31
  parse_fields
33
32
  parse_result_data
34
- push @rows[0]
35
33
  end
36
34
 
37
35
  def parse_result_data
38
36
  columns = @result.fields
39
37
  row_count = @result.num_tuples
40
38
  field_names = @fields.map {|field| field.name}
41
- rows = []
42
39
  # iterate rows
43
40
  (0..(row_count-1)).each do |row_index|
44
41
  row = Row.new(field_names)
45
42
  columns.each do |column_name|
46
43
  row << @result[row_index][column_name]
47
44
  end
48
- rows << row
45
+ push row
49
46
  end
50
- @rows = rows
51
47
  end
52
48
 
53
49
  def parse_fields
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: adacosta-labilerecord
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alan Da Costa