aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/test/cases/lint_test.rb
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2010-02-21 08:47:37 +0100
committerJosé Valim <jose.valim@gmail.com>2010-02-21 09:08:59 +0100
commit9dd67fce25d3993a0ee494506ba246a45d395e3f (patch)
tree4185a25a3be50de5fcd29d387782145d49cd1dcc /activemodel/test/cases/lint_test.rb
parentf81c6bc0404ba2a03eed0ec6c08bbac45661305f (diff)
downloadrails-9dd67fce25d3993a0ee494506ba246a45d395e3f.tar.gz
rails-9dd67fce25d3993a0ee494506ba246a45d395e3f.tar.bz2
rails-9dd67fce25d3993a0ee494506ba246a45d395e3f.zip
Add to_key and to_param methods to ActiveModel::Conversion.
Diffstat (limited to 'activemodel/test/cases/lint_test.rb')
-rw-r--r--activemodel/test/cases/lint_test.rb17
1 files changed, 2 insertions, 15 deletions
diff --git a/activemodel/test/cases/lint_test.rb b/activemodel/test/cases/lint_test.rb
index 99f8eff5d8..e4c069e1ab 100644
--- a/activemodel/test/cases/lint_test.rb
+++ b/activemodel/test/cases/lint_test.rb
@@ -1,24 +1,11 @@
-require "cases/helper"
+require 'cases/helper'
class LintTest < ActiveModel::TestCase
include ActiveModel::Lint::Tests
class CompliantModel
extend ActiveModel::Naming
-
- def to_model
- self
- end
-
- def to_key
- new_record? ? nil : [id]
- end
-
- def to_param
- return nil if to_key.nil?
- # some default for CPKs, real implementations will differ
- to_key.length > 1 ? to_key.join('-') : to_key.first.to_s
- end
+ include ActiveModel::Conversion
def valid?() true end
def new_record?() true end