sequel 4.1.0 → 4.1.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a449facae4b3dcc14c19ce0f524ca2025db4c74e
4
- data.tar.gz: 19e4bbb80143055d03da8134f6308363ff8e2406
3
+ metadata.gz: 0e97437793fba5f6d584ca832d9188c5779809da
4
+ data.tar.gz: bf8b6218bf26ea9dc03387724dc904951e0f81d9
5
5
  SHA512:
6
- metadata.gz: 68c5cbe1672f325a040584b37b78188c34322b6505b7b267d61d7103ee8a3f2364e335324f330a4c63e239eb21896c66242c9c62de91b2052d6bc2ad03289dcf
7
- data.tar.gz: 0ee8a1dbc5118fa916c90f112142b3580b2dbbfb4a5eca8f3f5924b510043e488cfbc2d1f1335db587a30b8dfe3a3b02754b46586ce770a38b6bc76ddb004fd0
6
+ metadata.gz: 8fd114ba94ddf1c53718cbf10b8454dac4ad8cceec47414dca2fbd4a21527f7bfd2f2f3811d18f2bf7035631701c7fa54f352af593517f283e09f8f991cc17da
7
+ data.tar.gz: b171c79c198bd268e1aee3ff16a26369bfcb0eac4abf5787fc47bf0a1cd16dfa95919ded5455fac1dd4d7290bc3066d58df38cd128c1183a7ca593dff531c12c
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ === 4.1.1 (2013-08-01)
2
+
3
+ * Fix select_map, select_order_map, and single_value methods on eager_graphed datasets (jeremyevans)
4
+
1
5
  === 4.1.0 (2013-08-01)
2
6
 
3
7
  * Support :inherits option in Database#create_table on PostgreSQL, for table inheritance (jeremyevans)
@@ -589,7 +589,7 @@ module Sequel
589
589
  # Returns nil if dataset is empty. Users should generally use
590
590
  # +get+ instead of this method.
591
591
  def single_value
592
- if r = naked.ungraphed.single_record
592
+ if r = ungraphed.naked.single_record
593
593
  r.values.first
594
594
  end
595
595
  end
@@ -761,7 +761,7 @@ module Sequel
761
761
 
762
762
  # Internals of +select_map+ and +select_order_map+
763
763
  def _select_map(column, order, &block)
764
- ds = naked.ungraphed
764
+ ds = ungraphed.naked
765
765
  columns = Array(column)
766
766
  virtual_row_columns(columns, block)
767
767
  select_cols = order ? columns.map{|c| c.is_a?(SQL::OrderedExpression) ? c.expression : c} : columns
@@ -6,7 +6,7 @@ module Sequel
6
6
  MINOR = 1
7
7
  # The tiny version of Sequel. Usually 0, only bumped for bugfix
8
8
  # releases that fix regressions from previous versions.
9
- TINY = 0
9
+ TINY = 1
10
10
 
11
11
  # The version of Sequel you are using, as a string (e.g. "2.11.0")
12
12
  VERSION = [MAJOR, MINOR, TINY].join('.')
@@ -839,6 +839,23 @@ describe Sequel::Model, "#eager_graph" do
839
839
  proc{GraphAlbum.eager_graph(Object.new)}.should raise_error(Sequel::Error)
840
840
  end
841
841
 
842
+ it "should work correctly with select_map" do
843
+ ds = GraphAlbum.eager_graph(:band)
844
+ ds._fetch = [{:id=>1}, {:id=>2}]
845
+ ds.select_map(:albums__id).should == [1, 2]
846
+ DB.sqls.should == ['SELECT albums.id FROM albums LEFT OUTER JOIN bands AS band ON (band.id = albums.band_id)']
847
+ ds._fetch = [{:id=>1}, {:id=>2}]
848
+ ds.select_map([:albums__id, :albums__id]).should == [[1, 1], [2, 2]]
849
+ DB.sqls.should == ['SELECT albums.id, albums.id FROM albums LEFT OUTER JOIN bands AS band ON (band.id = albums.band_id)']
850
+ end
851
+
852
+ it "should work correctly with single_value" do
853
+ ds = GraphAlbum.eager_graph(:band).select(:albums__id)
854
+ ds._fetch = [{:id=>1}]
855
+ ds.single_value.should == 1
856
+ DB.sqls.should == ['SELECT albums.id FROM albums LEFT OUTER JOIN bands AS band ON (band.id = albums.band_id) LIMIT 1']
857
+ end
858
+
842
859
  it "should not split results and assign associations if ungraphed is called" do
843
860
  ds = GraphAlbum.eager_graph(:band).ungraphed
844
861
  ds.sql.should == 'SELECT albums.id, albums.band_id, band.id AS band_id_0, band.vocalist_id FROM albums LEFT OUTER JOIN bands AS band ON (band.id = albums.band_id)'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sequel
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.0
4
+ version: 4.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Evans