aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template/active_record_helper_test.rb
diff options
context:
space:
mode:
authorYehuda Katz <wycats@gmail.com>2009-07-20 00:27:04 +0900
committerYehuda Katz <wycats@gmail.com>2009-07-20 00:27:04 +0900
commit5ffaaa71d149c9807260c950c9a61d01fe734827 (patch)
treeb014dcbe7cc8efabebca38e9e75648905e85017e /actionpack/test/template/active_record_helper_test.rb
parent45d41d8012c605f21de51e7018fa31e1d07776eb (diff)
downloadrails-5ffaaa71d149c9807260c950c9a61d01fe734827.tar.gz
rails-5ffaaa71d149c9807260c950c9a61d01fe734827.tar.bz2
rails-5ffaaa71d149c9807260c950c9a61d01fe734827.zip
Define ActiveModel API Compliance
- Define to_model on AR - Define to_model on ActiveModel::APICompliant - Update test fixtures to be API Compliant - Start using to_model in AP
Diffstat (limited to 'actionpack/test/template/active_record_helper_test.rb')
-rw-r--r--actionpack/test/template/active_record_helper_test.rb16
1 files changed, 7 insertions, 9 deletions
diff --git a/actionpack/test/template/active_record_helper_test.rb b/actionpack/test/template/active_record_helper_test.rb
index e1be048838..950072e45b 100644
--- a/actionpack/test/template/active_record_helper_test.rb
+++ b/actionpack/test/template/active_record_helper_test.rb
@@ -4,19 +4,17 @@ class ActiveRecordHelperTest < ActionView::TestCase
tests ActionView::Helpers::ActiveRecordHelper
silence_warnings do
- 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)
+ class Post < Struct.new(:title, :author_name, :body, :secret, :written_on)
+ extend ActiveModel::APICompliant
end
- User = Struct.new("User", :email)
- User.class_eval do
- alias_method :email_before_type_cast, :email unless respond_to?(:email_before_type_cast)
+ class User < Struct.new(:email)
+ extend ActiveModel::APICompliant
end
- Column = Struct.new("Column", :type, :name, :human_name)
+ class Column < Struct.new(:type, :name, :human_name)
+ extend ActiveModel::APICompliant
+ end
end
class DirtyPost