diff options
author | Jon Leighton <j@jonathanleighton.com> | 2011-10-05 01:09:43 +0100 |
---|---|---|
committer | Jon Leighton <j@jonathanleighton.com> | 2011-10-05 01:11:40 +0100 |
commit | ee2be435b1e5c0e94a4ee93a1a310e0471a77d07 (patch) | |
tree | d30036d8c7f8520df4c6cd4c47e0f7733abe3525 /activerecord/test/cases/attribute_methods | |
parent | 5711a35ad8faa3fb6d138b234cbe9acfad27a9a8 (diff) | |
download | rails-ee2be435b1e5c0e94a4ee93a1a310e0471a77d07.tar.gz rails-ee2be435b1e5c0e94a4ee93a1a310e0471a77d07.tar.bz2 rails-ee2be435b1e5c0e94a4ee93a1a310e0471a77d07.zip |
Raise error on unknown primary key.
If we don't have a primary key when we ask for it, it's better to fail
fast. Fixes GH #2307.
Diffstat (limited to 'activerecord/test/cases/attribute_methods')
-rw-r--r-- | activerecord/test/cases/attribute_methods/read_test.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/activerecord/test/cases/attribute_methods/read_test.rb b/activerecord/test/cases/attribute_methods/read_test.rb index e03ed33591..814476ce73 100644 --- a/activerecord/test/cases/attribute_methods/read_test.rb +++ b/activerecord/test/cases/attribute_methods/read_test.rb @@ -24,6 +24,10 @@ module ActiveRecord def self.primary_key end + def self.primary_key? + false + end + def self.columns column_names.map { FakeColumn.new(name) } end |