aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/lib/active_model
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2009-12-29 15:46:12 -0800
committerJeremy Kemper <jeremy@bitsweat.net>2009-12-29 15:46:12 -0800
commitb27a3e8da39484d8a02d3b9c1e4dc3cb60ddcce7 (patch)
tree372a4af6df43eb8bed19c11e55b2f70907d60507 /activemodel/lib/active_model
parentada895e8cac855a2f248aafdb92457365f062d07 (diff)
parentb354496bda901cb0af499d6f3dff17a96a834a67 (diff)
downloadrails-b27a3e8da39484d8a02d3b9c1e4dc3cb60ddcce7.tar.gz
rails-b27a3e8da39484d8a02d3b9c1e4dc3cb60ddcce7.tar.bz2
rails-b27a3e8da39484d8a02d3b9c1e4dc3cb60ddcce7.zip
Merge branch 'master' of git://github.com/mikel/rails into mail
Conflicts: actionmailer/lib/action_mailer.rb
Diffstat (limited to 'activemodel/lib/active_model')
-rw-r--r--activemodel/lib/active_model/attribute_methods.rb4
-rw-r--r--activemodel/lib/active_model/validations.rb1
2 files changed, 5 insertions, 0 deletions
diff --git a/activemodel/lib/active_model/attribute_methods.rb b/activemodel/lib/active_model/attribute_methods.rb
index 977a101277..8f855958c6 100644
--- a/activemodel/lib/active_model/attribute_methods.rb
+++ b/activemodel/lib/active_model/attribute_methods.rb
@@ -235,6 +235,10 @@ module ActiveModel
# It's also possible to instantiate related objects, so a Client class belonging to the clients
# table with a +master_id+ foreign key can instantiate master through Client#master.
def method_missing(method_id, *args, &block)
+ if method_id == :to_ary || method_id == :to_str
+ raise NoMethodError, "undefined method `#{method_id}' for #{inspect}:#{self.class}"
+ end
+
method_name = method_id.to_s
if match = match_attribute_method?(method_name)
guard_private_attribute_method!(method_name, args)
diff --git a/activemodel/lib/active_model/validations.rb b/activemodel/lib/active_model/validations.rb
index 064ec98f3a..a0d64507f9 100644
--- a/activemodel/lib/active_model/validations.rb
+++ b/activemodel/lib/active_model/validations.rb
@@ -1,5 +1,6 @@
require 'active_support/core_ext/array/extract_options'
require 'active_support/core_ext/hash/keys'
+require 'active_model/errors'
module ActiveModel
module Validations