Skip to content

Commit

Permalink
Bump version to 3.27.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyevans committed Sep 1, 2011
1 parent f04bb6d commit a756a05
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
=== HEAD
=== 3.27.0 (2011-09-01)

* Add support for native prepared statements to the tinytds adapter (jeremyevans)

Expand Down
82 changes: 82 additions & 0 deletions doc/release_notes/3.27.0.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
= New Features

* Model.dataset_module has been added for easily adding methods to
a model's dataset:

Album.dataset_module do
def with_name_like(x)
filter(:name.like(x))
end
def selling_at_least(x)
filter{copies_sold > x}
end
end
Album.with_name_like('Foo%').selling_at_least(100000).all

Previously, you could use def_dataset_method to accomplish the
same thing. dataset_module is generally cleaner, plus you are
using actual methods instead of blocks, so calling the methods
is faster on some ruby implementations.

* Sequel now uses a Sequel::SQLTime class (a subclass of Time) when
dealing with values for SQL time columns (which don't have a date
component). These values are handled correctly when used in
filters or insert/update statements (using only the time
component), so Sequel can now successfully round trip values for
time columns. Not all adapters support returning time column
values as SQLTime instances, but the most common ones do.

* You can now drop foreign key, primary key, and unique constraints
on MySQL by passing the :type=>(:foreign_key|:primary_key|:unique)
option to Database#drop_constraint.

* The ODBC adapter now has initial support for the DB2 database, use
the :db_type=>'db2' option to load the support.

= Other Improvements

* The mysql2 adapter now uses native prepared statements.

* The tinytds adapter now uses uses sp_executesql for prepared
statements.

* DateTime and Time objects are now converted to Date objects when
they are assigned to a date column in a Model instance.

* When converting a Date object to a DateTime object, the resulting
DateTime object now has no fractional day components. Previously,
depending on your timezone settings, it could have had fractional
day components.

* The mysql2 adapter now supports stored procedures, as long as they
don't return results.

* Mass assignment protection now handles including modules in model
classes and extending model instances with modules. Previously, if
you defined a setter method in a module, access to it may have been
restricted.

* The prepared_statements_safe plugin now works on classes without
datasets, so you can now do the following to load it for all models:

Sequel::Model.plugin :prepared_statements_safe

* Dataset#hash now works correctly when handling SQL::Expression
instances.

* Model#hash now correctly handles classes with no primary key or with
a composite primary key.

* Model#exists? now always returns false for new model objects.

= Backwards Compatibility

* If you were previously setting primary key values manually for new
model objects and then calling exists? to see if the instance is
already in the database, you need to change your code from:

model.exists?

to:

model.this.get(1).nil?
2 changes: 1 addition & 1 deletion lib/sequel/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module Sequel
MAJOR = 3
# The minor version of Sequel. Bumped for every non-patch level
# release, generally around once a month.
MINOR = 26
MINOR = 27
# The tiny version of Sequel. Usually 0, only bumped for bugfix
# releases that fix regressions from previous versions.
TINY = 0
Expand Down

0 comments on commit a756a05

Please sign in to comment.