From 87fbcaa6229e9073095fb8d77c7a536c9466fbce Mon Sep 17 00:00:00 2001 From: David Lowenfels Date: Sat, 28 Jun 2008 17:41:12 -0700 Subject: Add :tokenizer option to validates_length_of. [#507 state:resolved] Signed-off-by: Pratik Naik --- activerecord/CHANGELOG | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'activerecord/CHANGELOG') diff --git a/activerecord/CHANGELOG b/activerecord/CHANGELOG index d6cc589381..d92b89cfe0 100644 --- a/activerecord/CHANGELOG +++ b/activerecord/CHANGELOG @@ -1,5 +1,10 @@ *Edge* +* Add :tokenizer option to validates_length_of to specify how to split up the attribute string. #507. [David Lowenfels] Example : + + # Ensure essay contains at least 100 words. + validates_length_of :essay, :minimum => 100, :too_short => "Your essay must be at least %d words."), :tokenizer => lambda {|str| str.scan(/\w+/) } + * Allow conditions on multiple tables to be specified using hash. [Pratik Naik]. Example: User.all :joins => :items, :conditions => { :age => 10, :items => { :color => 'black' } } -- cgit v1.2.3 From e0750d6a5c7f621e4ca12205137c0b135cab444a Mon Sep 17 00:00:00 2001 From: David Dollar Date: Sun, 13 Jul 2008 21:13:50 -0400 Subject: Add :accessible option to Associations for allowing mass assignments using hash. [#474 state:resolved] Allows nested Hashes (i.e. from nested forms) to hydrate the appropriate ActiveRecord models. class Post < ActiveRecord::Base belongs_to :author, :accessible => true has_many :comments, :accessible => true end post = Post.create({ :title => 'Accessible Attributes', :author => { :name => 'David Dollar' }, :comments => [ { :body => 'First Post!' }, { :body => 'Nested Hashes are great!' } ] }) post.comments << { :body => 'Another Comment' } Signed-off-by: Pratik Naik --- activerecord/CHANGELOG | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'activerecord/CHANGELOG') diff --git a/activerecord/CHANGELOG b/activerecord/CHANGELOG index d92b89cfe0..56b1781537 100644 --- a/activerecord/CHANGELOG +++ b/activerecord/CHANGELOG @@ -1,5 +1,23 @@ *Edge* +* Add :accessible option to associations for allowing (opt-in) mass assignment. #474. [David Dollar] Example : + + class Post < ActiveRecord::Base + belongs_to :author, :accessible => true + has_many :comments, :accessible => true + end + + post = Post.create({ + :title => 'Accessible Attributes', + :author => { :name => 'David Dollar' }, + :comments => [ + { :body => 'First Post!' }, + { :body => 'Nested Hashes are great!' } + ] + }) + + post.comments << { :body => 'Another Comment' } + * Add :tokenizer option to validates_length_of to specify how to split up the attribute string. #507. [David Lowenfels] Example : # Ensure essay contains at least 100 words. -- cgit v1.2.3 From 30370227890dc950f1544b7b1040aa75e505f877 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Mon, 14 Jul 2008 10:12:54 -0500 Subject: Fixed that create database statements would always include "DEFAULT NULL" (Nick Sieger) [#334 status:committed] --- activerecord/CHANGELOG | 2 ++ 1 file changed, 2 insertions(+) (limited to 'activerecord/CHANGELOG') diff --git a/activerecord/CHANGELOG b/activerecord/CHANGELOG index 56b1781537..17430ba0b7 100644 --- a/activerecord/CHANGELOG +++ b/activerecord/CHANGELOG @@ -1,5 +1,7 @@ *Edge* +* Fixed that create database statements would always include "DEFAULT NULL" (Nick Sieger) [#334] + * Add :accessible option to associations for allowing (opt-in) mass assignment. #474. [David Dollar] Example : class Post < ActiveRecord::Base -- cgit v1.2.3 From 07578ac85585d3c64d4d38d4892fd31582c7c473 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tarmo=20T=C3=A4nav?= Date: Mon, 14 Jul 2008 09:42:20 +0300 Subject: Fixed mysql change_column_default to not make the column always nullable. Also added change_column_null to both mysql and sqlite to keep the api features closer to postgresql. [#617 state:resolved] --- activerecord/CHANGELOG | 2 ++ 1 file changed, 2 insertions(+) (limited to 'activerecord/CHANGELOG') diff --git a/activerecord/CHANGELOG b/activerecord/CHANGELOG index 17430ba0b7..95fdd93f65 100644 --- a/activerecord/CHANGELOG +++ b/activerecord/CHANGELOG @@ -1,5 +1,7 @@ *Edge* +* change_column_default preserves the not-null constraint. #617 [Tarmo Tänav] + * Fixed that create database statements would always include "DEFAULT NULL" (Nick Sieger) [#334] * Add :accessible option to associations for allowing (opt-in) mass assignment. #474. [David Dollar] Example : -- cgit v1.2.3