diff options
author | Yehuda Katz <wycats@gmail.com> | 2009-07-20 00:27:04 +0900 |
---|---|---|
committer | Yehuda Katz <wycats@gmail.com> | 2009-07-20 00:27:04 +0900 |
commit | 5ffaaa71d149c9807260c950c9a61d01fe734827 (patch) | |
tree | b014dcbe7cc8efabebca38e9e75648905e85017e /actionpack/test/template/prototype_helper_test.rb | |
parent | 45d41d8012c605f21de51e7018fa31e1d07776eb (diff) | |
download | rails-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/prototype_helper_test.rb')
-rw-r--r-- | actionpack/test/template/prototype_helper_test.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/actionpack/test/template/prototype_helper_test.rb b/actionpack/test/template/prototype_helper_test.rb index a7a1bc99f3..301a110076 100644 --- a/actionpack/test/template/prototype_helper_test.rb +++ b/actionpack/test/template/prototype_helper_test.rb @@ -1,10 +1,12 @@ require 'abstract_unit' +require 'active_model' Bunny = Struct.new(:Bunny, :id) -Bunny.extend ActiveModel::Naming +Bunny.extend ActiveModel::APICompliant class Author - extend ActiveModel::Naming + extend ActiveModel::APICompliant + attr_reader :id def save; @id = 1 end def new_record?; @id.nil? end @@ -14,7 +16,7 @@ class Author end class Article - extend ActiveModel::Naming + extend ActiveModel::APICompliant attr_reader :id attr_reader :author_id def save; @id = 1; @author_id = 1 end |