diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2004-12-19 11:25:55 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2004-12-19 11:25:55 +0000 |
commit | 7b5ed66122873eebb773a6418f3a94d946cc4f8c (patch) | |
tree | 63c77291a6c78c7446bb5041b062bc8485a0fb5f /actionpack/test/template | |
parent | 61960e7b37767140e9af68bd5373e06dce08492d (diff) | |
download | rails-7b5ed66122873eebb773a6418f3a94d946cc4f8c.tar.gz rails-7b5ed66122873eebb773a6418f3a94d946cc4f8c.tar.bz2 rails-7b5ed66122873eebb773a6418f3a94d946cc4f8c.zip |
Added respondence to *_before_type_cast for all attributes to return their string-state before they were type casted by the column type. Added use of *_before_type_cast for all input and text fields.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@215 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test/template')
-rw-r--r-- | actionpack/test/template/active_record_helper_test.rb | 5 | ||||
-rw-r--r-- | actionpack/test/template/form_helper_test.rb | 7 |
2 files changed, 11 insertions, 1 deletions
diff --git a/actionpack/test/template/active_record_helper_test.rb b/actionpack/test/template/active_record_helper_test.rb index f9a2727067..e650b4f0b8 100644 --- a/actionpack/test/template/active_record_helper_test.rb +++ b/actionpack/test/template/active_record_helper_test.rb @@ -14,6 +14,11 @@ class ActiveRecordHelperTest < Test::Unit::TestCase include ActionView::Helpers::UrlHelper Post = Struct.new("Post", :title, :author_name, :body, :secret, :written_on) + Post.class_eval do + alias_method :title_before_type_cast, :title unless respond_to?(:title_before_type_cast) + alias_method :body_before_type_cast, :body unless respond_to?(:body_before_type_cast) + alias_method :author_name_before_type_cast, :author_name unless respond_to?(:author_name_before_type_cast) + end Column = Struct.new("Column", :type, :name, :human_name) def setup diff --git a/actionpack/test/template/form_helper_test.rb b/actionpack/test/template/form_helper_test.rb index d81e2ac270..c6128a9337 100644 --- a/actionpack/test/template/form_helper_test.rb +++ b/actionpack/test/template/form_helper_test.rb @@ -6,7 +6,12 @@ class FormHelperTest < Test::Unit::TestCase include ActionView::Helpers::FormHelper old_verbose, $VERBOSE = $VERBOSE, nil - Post = Struct.new("Post", :title, :author_name, :body, :secret, :written_on) + Post = Struct.new("Post", :title, :author_name, :body, :secret, :written_on, :cost) + Post.class_eval do + alias_method :title_before_type_cast, :title unless respond_to?(:title_before_type_cast) + alias_method :body_before_type_cast, :body unless respond_to?(:body_before_type_cast) + alias_method :author_name_before_type_cast, :author_name unless respond_to?(:author_name_before_type_cast) + end $VERBOSE = old_verbose def setup |