[#398788] Constructor or a Method — Rubyist Rohit <lists@...>

Take for instance this code:

13 messages 2012/09/01

[#398896] how to sum element of array — Edward QU <lists@...>

dear all

19 messages 2012/09/04

[#398936] best coding for limiting a value — Regis d'Aubarede <lists@...>

A) result=value<min ? min : (value > max ? max : value)

17 messages 2012/09/04

[#398962] Long calculation & time limit — toto tartemolle <lists@...>

Hello,

17 messages 2012/09/05

[#398964] Compiling ruby from source on windows — GPad <peterpan105105@...>

Hi to all,=0AI'm trying to compile ruby on my windows 7. I have already a r=

10 messages 2012/09/05

[#398997] OpenURI open method problem — "Derek T." <lists@...>

The code I am referring to looks like this:

12 messages 2012/09/05

[#399002] Parsing through downloaded html — Sybren Kooistra <lists@...>

Hi all,

28 messages 2012/09/06

[#399012] "Hiding" pictures(and source code if it's possible) — "Damián M. González" <lists@...>

Ey guys, how are you?

11 messages 2012/09/06

[#399083] regix in grep or something like this — Ferdous ara <lists@...>

Hi

12 messages 2012/09/07

[#399206] please help me with making script — Charmaine Willemsen <lists@...>

In this example i like to parse birthday and sexe

11 messages 2012/09/11

[#399218] Pathname#to_str withdrawn in 1.9? — matt@... (Matt Neuburg)

Just getting started experimenting with Ruby 1.9 (1.9.3) and my scripts

13 messages 2012/09/12

[#399227] Breaking Down the Block — incag neato <lists@...>

Can someone please explain in plain english how this block treats the

20 messages 2012/09/13

[#399244] ruby Range to array that acts like time objects? — "Jermaine O." <lists@...>

Hello everybody,

15 messages 2012/09/13

[#399293] Ruby on Ubuntu 12.04 LST — Bojan Jordanovski <lists@...>

Hello everybody,

13 messages 2012/09/14

[#399298] wow, YAML / Psych in 1.9.3 is *slow*! — matt@... (Matt Neuburg)

I just started trying Ruby 1.9.3, coming from Ruby 1.8.7, and was

12 messages 2012/09/14

[#399304] Ruby 1.9.3 and OS X Mountain Lion — sto.mar@...

Hi all,

16 messages 2012/09/14

[#399343] Class variables or Class singleton variables? — "Damián M. González" <lists@...>

Guys, how are you?

18 messages 2012/09/15

[#399386] Ruby - is it worth the effort? — neomex <neomex@...>

Hello,

19 messages 2012/09/17
[#399406] Re: Ruby - is it worth the effort? — Roger Pack <lists@...> 2012/09/17

Unfortunately with Ruby for me it's typically "fun and fast development"

[#399409] Re: Ruby - is it worth the effort? — Peter Zotov <whitequark@...> 2012/09/17

Roger Pack писал 17.09.2012 22:06:

[#399491] Re: Ruby - is it worth the effort? — Robert Klemme <shortcutter@...> 2012/09/19

On Mon, Sep 17, 2012 at 8:20 PM, Peter Zotov <whitequark@whitequark.org> wr=

[#399421] Encoding question — Thomas Bednarz <lists@...>

I am new to ruby and play around with it a little bit at the moment. I

17 messages 2012/09/17

[#399441] Bug or feature — Damjan Rems <lists@...>

There has probably been some discussion about this problem so sorry if I

13 messages 2012/09/18

[#399451] Class variables — Aleksander Ciesielski <neomex@...>

Is it obligatory to use instance variables in classes? Can't we just

17 messages 2012/09/18

[#399479] Ruby SQL Select Sum 2 Columns? — Courtney Fay <lists@...>

I have the following definition which is looking at an apache database,

12 messages 2012/09/18

[#399556] still learning by doing - connecting rooms in a game — "Sebastjan H." <lists@...>

Hi,

28 messages 2012/09/20
[#399570] Re: still learning by doing - connecting rooms in a game — Henry Maddocks <hmaddocks@...> 2012/09/20

[#399574] Re: still learning by doing - connecting rooms in a game — "Sebastjan H." <lists@...> 2012/09/21

Henry Maddocks wrote in post #1076876:

[#399575] Re: still learning by doing - connecting rooms in a game — Henry Maddocks <hmaddocks@...> 2012/09/21

[#399576] Re: still learning by doing - connecting rooms in a game — "Sebastjan H." <lists@...> 2012/09/21

Could you be so kind as to suggest another book? I mean there are many

[#399585] Re: still learning by doing - connecting rooms in a game — "Sebastjan H." <lists@...> 2012/09/21

Sebastjan H. wrote in post #1076909:

[#399572] How would you allow variable from specific list of Fixnum? — Eliezer Croitoru <eliezer@...>

I have:

11 messages 2012/09/21

[#399623] Very important question - survey — Marc Heiler <lists@...>

Is matz more like a ninja or more like a samurai?

11 messages 2012/09/22

[#399695] inject problem — Roelof Wobben <rwobben@...>

26 messages 2012/09/25

[#399714] could initialize return an existing object instead of a new instance? — Gary Weaver <lists@...>

Is it possible for initialize to return an existing object instead of a

9 messages 2012/09/25

[#399811] Good book for getting started with Ruby? [I code Python!] — Alec Taylor <alec.taylor6@...>

I've learned programming in C++, Python and PHP at University. (also

12 messages 2012/09/28

[#399815] calcaulation with unknown numbers of numbers and options fail — Roelof Wobben <rwobben@...>

11 messages 2012/09/28

Re: ANN: Sequel 3.39.0 Released

From: Florian Aßmann <florian.assmann@...>
Date: 2012-09-07 07:09:48 UTC
List: ruby-talk #399048
Awesome, thanks! I espacially like the constraint_validations extension. :)

best
Florian

Jeremy Evans wrote:
> Sequel is a lightweight database access toolkit for Ruby.
> 
> * Sequel provides thread safety, connection pooling and a concise
>   DSL for constructing SQL queries and table schemas.
> * Sequel includes a comprehensive ORM layer for mapping records to
>   Ruby objects and handling associated records.
> * Sequel supports advanced database features such as prepared
>   statements, bound variables, stored procedures, savepoints,
>   two-phase commit, transaction isolation, master/slave
>   configurations, and database sharding.
> * Sequel currently has adapters for ADO, Amalgalite, DataObjects,
>   DB2, DBI, Firebird, IBM_DB, Informix, JDBC, MySQL, Mysql2, ODBC,
>   OpenBase, Oracle, PostgreSQL, SQLite3, Swift, and TinyTDS.
> 
> Sequel 3.39.0 has been released and should be available on the gem
> mirrors.
> 
> 
> = New Features
> 
> * A constraint_validations extension and plugin have been added,
>   which allow you to define validations when creating tables,
>   which are enforced by database constraints, and have those
>   validations be automatically discovered and used by your
>   Sequel::Model classes.
> 
>   The extension is designed to be used in your migrations/schema
>   modification code:
> 
>     DB.extension(:constraint_validations)
>     DB.create_constraint_validations_table
>     DB.create_table(:foos) do
>       primary_key :id
>       String :name
> 
>       validate do
>         min_length 5, :name
>       end
>     end
> 
>   This creates a database CHECK constraint that ensures that the
>   minimum length for the column is 5 characters.  It also adds
>   metadata about the validation to the
>   sequel_constraint_validations table.
> 
>   To have the model class automatically create validations, just
>   include the plugin in the model:
> 
>     class Foo < Sequel::Model
>       plugin :constraint_validations
>     end
> 
>   Note that MySQL does not enforce CHECK constraints (it parses
>   but ignores them), so using the extension on MySQL does not
>   actually enforce constraints at the database level, though it
>   still does support the automatic model validations if the plugin
>   is used.
> 
> * Dataset#count now takes an argument or a virtual row block,
>   allowing you to do:
> 
>     DB[:table].count(:column_name)
>     DB[:table].count{function_name(column1, column2)}
> 
>   When count is given an argument, instead of returning the total
>   number of rows, it returns the number of rows where the
>   argument has a non-NULL value.
> 
> * Database#copy_into has been added to the postgres adapter when
>   the pg driver is being used, and can be used for very fast
>   inserts into tables if you already have the input preformatted
>   in PostgreSQL text or CSV format.
> 
> * set_table_not_null has been added to the alter table generator,
>   for a nicer API:
> 
>     alter_table(:t){set_column_not_null :col}
>     # instead of
>     alter_table(:t){set_column_allow_null :col, false}
> 
>   Additionally, set_column_allow_null now defaults the second
>   argument to true for a nicer API:
> 
>     alter_table(:t){set_column_allow_null :col}
>     # instead of
>     alter_table(:t){set_column_allow_null :col, true}
> 
> * Database#supports_regexp? has been added for checking if the
>   database supports Regexp in filters.  Currently, only MySQL and
>   PostgreSQL support Regexps.
> 
>   Attempting to use a Regexp on a database that doesn't support it
>   now raises an error when attempting to generate the SQL, instead
>   of sending invalid SQL to the database.
> 
> * Sequel.char_length has been added for a cross platform
>   char_length function (emulated when char_length is not supported
>   natively by the database).
> 
> * Sequel.trim has been added for a cross platform trim function
>   (emulated when trim is not supported natively by the database).
> 
> * ValidationFailed and HookFailed exceptions now have a model method
>   that returns the model instance related to the exception.  This
>   makes it possible to use Model.create inside a begin/rescue block
>   and get access to the underlying instance if there is a validation
>   or before/around hook error.
> 
> * The subclasses plugin now accepts a block, which is called with
>   each model class created.  This is useful if you want to apply
>   changes to classes created in the future instead of just existing
>   classes.
> 
> * The validates_unique validation in the validation_helpers plugin
>   now accepts a :where option for a custom uniqueness filter.  Among
>   other things this makes it easy to implement a case insensitive
>   uniqueness validation on a case sensitive column.
> 
> * The threaded connection pools now support a
>   :connection_handling=>:disconnect option, which makes them disconnect
>   connections after use instead of returning them to the pool.  This
>   makes it possible to completely control connection lifetime using
>   Database#synchronize.
> 
> * The pg_row_op extension now has support for PGRowOp#*, for referencing
>   the members of the composite type as separate columns.
> 
> * MySQL's set type and default value are now recognized.
> 
> * bin/sequel now accepts a -c argument for running an arbitrary
>   code string instead of using an IRB prompt.
> 
> = Other Improvements
> 
> * Sequel now parses current date/timestamp column defaults when
>   parsing the schema for a table.  The values will be returned
>   as Sequel::CURRENT_DATE for date columns and
>   Sequel::CURRENT_TIMESTAMP for timestamp columns.
> 
>   The schema_dumper extension will work with these defaults, so
>   if you dump the schema for a table with a column that uses
>   a current timestamp default, the dumped schema will include
>   the default.
> 
>   The defaults setter plugin also works with these changes, so
>   that when new model objects are instantiated, they get the
>   current Date/Time/DateTime values set.
> 
> * On MySQL and PostgreSQL, Sequel will now by default attempt
>   to combine multiple alter_table operations into a single
>   query where it believes it can do so correctly.  This can
>   potentially improve performance ~N times, where N is the number
>   of alter table operations.
> 
>   This can change the SQL used for old migrations (though it
>   shouldn't change the result), and is a potentially risky
>   change.  This may be disabled by default in future versions
>   if it causes problems.
> 
> * The defaults_setter plugin now correctly sets false default
>   values.
> 
> * The schema_dumper plugin now preserves fractional seconds
>   in timestamp column defaults when dumping.
> 
> * Time->DateTime and DateTime->Time typecasts now retain
>   fractional seconds on ruby 1.8.
> 
> * Array arguments passed to most PGArrayOp methods are now
>   automatically wrapped in a PGArray.  If you want to use this
>   support, you need to make sure to load both the pg_array
>   and pg_array_op extensions.
> 
> * Sequel now does a better job of finding the sequence for a
>   given table on PostgreSQL, handling more corner cases.  A small
>   side effect of this is sometimes sequence names will be quoted.
> 
> * Some potential thread-safety issues when using Sequel with
>   PostgreSQL on a non-GVL ruby implementation have been fixed.
> 
> * Sequel now correctly caches the server version query on MySQL.
> 
> * Sets of alter_table operations on MySQL and Microsoft SQL Server
>   that require parsing the current database schema, where later
>   alter_table operations depend on earlier ones, should now work
>   correctly.
> 
> * You can now drop check constraints on tables on SQLite, though
>   doing so drops all check constraints on the table, not only the
>   specific check constraint given.
> 
> * The identity_map plugin no longer breaks if used with a model
>   without a primary key.
> 
> * Sequel::SQL::NegativeBooleanConstant now inherits from Constant
>   instead of BooleanConstant.  This means that
> 
>     Sequel::NULL == Sequel::NOTNULL
> 
>   is now false instead of true.
> 
> * You can now override the convert_tinyint_to_bool settings on a
>   per-Dataset basis in the mysql and mysql2 adapters, though
>   the overriding is different depending on the adapter.  Check the
>   commit log for details.
> 
> * timestamp(N) types are now recognized as datetime, which should
>   fix certain cases on Oracle.
> 
> * Dataset#insert now handles a single model instance argument
>   as a single value if the model uses the pg_row plugin.
> 
> * When joining a model dataset using a model class as the table
>   argument, a subselect is used unless the model is a simple select
>   from the underlying table.
> 
> * The specs now cleanup after themselves, dropping the tables that
>   they create for testing.
> 
> = Backwards Compatibility
> 
> * The defaults_setter plugin's behavior changed due to the
>   current date/timestamp support.  Previously, it would not set
>   a value for the column, since the default wasn't recognized.
>   Therefore, the database would use the default value on insert,
>   which would be the database's current timestamp.
> 
>   Now, the value is set to the current Date/Time/DateTime on
>   model object instantiation, so the database wouldn't use the
>   column default.  Instead of the database's current timestamp
>   on insert, the column value will be the application's
>   current timestamp on model instantiation.
> 
>   Users who don't want this behavior can remove the default values
>   in the model:
> 
>     Model.default_values.delete(:column_name)
> 
> * Plain (non-model) datasets no longer allow insert to accept
>   a single model instance argument.  Also, they no longer call
>   values on a single argument if the object responds to it.
> 
> * Plain (non-model) datasets no longer accept model classes as
>   tables in the join/graph methods.  Also, they no longer call
>   table_name on the argument if the object responds to it.
> 
> * The schema_dumper extension now requires the eval_inspect
>   extension, which changes inspect output for
>   Sequel::SQL::Expression objects.
> 
> * Custom adapters that override Database#alter_table_sql_list now
>   need to make sure it returns an already flattened array.
> 
> * The identity_map_key method in the identity_map plugin now returns
>   nil instead of a random string if the given pk is nil.
> 
> Thanks,
> Jeremy
> 
> * {Website}[http://sequel.rubyforge.org]
> * {Source code}[http://github.com/jeremyevans/sequel]
> * {Blog}[http://sequel.heroku.com]
> * {Bug tracking}[http://github.com/jeremyevans/sequel/issues]
> * {Google group}[http://groups.google.com/group/sequel-talk]
> * {RDoc}[http://sequel.rubyforge.org/rdoc]
> 

In This Thread

Prev Next