diff options
author | Jon Leighton <j@jonathanleighton.com> | 2012-08-17 16:38:55 +0100 |
---|---|---|
committer | Jon Leighton <j@jonathanleighton.com> | 2012-08-17 18:22:29 +0100 |
commit | 8fcd9b6e86274cc36820bfbf55a9d2967177339a (patch) | |
tree | 7b428b8052d702bafadbc63c9be7fa399802a793 /activerecord/lib/active_record/model_schema.rb | |
parent | f396c01db25e45d1c2defc7dbb6f330f33453d04 (diff) | |
download | rails-8fcd9b6e86274cc36820bfbf55a9d2967177339a.tar.gz rails-8fcd9b6e86274cc36820bfbf55a9d2967177339a.tar.bz2 rails-8fcd9b6e86274cc36820bfbf55a9d2967177339a.zip |
The default value can be set once in #column_defaults
Rather than doing it every time an instance is instantiated.
Diffstat (limited to 'activerecord/lib/active_record/model_schema.rb')
-rw-r--r-- | activerecord/lib/active_record/model_schema.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/model_schema.rb b/activerecord/lib/active_record/model_schema.rb index def48c03bf..ff7c996648 100644 --- a/activerecord/lib/active_record/model_schema.rb +++ b/activerecord/lib/active_record/model_schema.rb @@ -312,6 +312,13 @@ module ActiveRecord @relation = nil end + # This is a hook for use by modules that need to do extra stuff to + # attributes when they are initialized. (e.g. attribute + # serialization) + def initialize_attributes(attributes, options = {}) #:nodoc: + attributes + end + private # Guesses the table name, but does not decorate it with prefix and suffix information. |