sequel 3.34.0 → 3.34.1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ === 3.34.1 (2012-04-02)
2
+
3
+ * Fix bug in optimization of primary key lookup (jeremyevans) (#460)
4
+
1
5
  === 3.34.0 (2012-04-02)
2
6
 
3
7
  * Fix connection failures when connecting to PostgreSQL with newer versions of swift (jeremyevans)
@@ -790,8 +790,9 @@ module Sequel
790
790
  def primary_key_lookup(pk)
791
791
  if sql = @fast_pk_lookup_sql
792
792
  sql = sql.dup
793
- dataset.literal_append(sql, pk)
794
- dataset.fetch_rows(sql){|r| return call(r)}
793
+ ds = dataset
794
+ ds.literal_append(sql, pk)
795
+ ds.fetch_rows(sql){|r| return ds.row_proc.call(r)}
795
796
  nil
796
797
  else
797
798
  dataset[primary_key_hash(pk)]
@@ -6,7 +6,7 @@ module Sequel
6
6
  MINOR = 34
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('.')
@@ -42,6 +42,11 @@ describe Sequel::Model, "#sti_key" do
42
42
  StiTest.all.collect{|x| x.class}.should == [StiTest, StiTestSub1, StiTestSub2]
43
43
  end
44
44
 
45
+ it "should return rows with the correct class based on the polymorphic_key value when retreiving by primary key" do
46
+ @ds._fetch = [{:kind=>'StiTestSub1'}]
47
+ StiTest[1].class.should == StiTestSub1
48
+ end
49
+
45
50
  it "should return rows with the correct class for subclasses based on the polymorphic_key value" do
46
51
  class ::StiTestSub1Sub < StiTestSub1; end
47
52
  StiTestSub1.dataset._fetch = [{:kind=>'StiTestSub1'}, {:kind=>'StiTestSub1Sub'}]
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: 3.34.0
4
+ version: 3.34.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: