diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-05-22 16:11:40 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-05-22 16:11:40 -0300 |
commit | 8e4d014a569fb7213ad5abde10ecd2c3fe97e573 (patch) | |
tree | a66d30617830c7315efecd1beedeeccf9d74c1e8 /activerecord/lib/active_record/connection_adapters/column.rb | |
parent | 73f1ab21855269eda57088ccf3f3fb8245d23426 (diff) | |
parent | 22c27ae31f1b7c3a4e3b5cbcb4571c6be5e527e8 (diff) | |
download | rails-8e4d014a569fb7213ad5abde10ecd2c3fe97e573.tar.gz rails-8e4d014a569fb7213ad5abde10ecd2c3fe97e573.tar.bz2 rails-8e4d014a569fb7213ad5abde10ecd2c3fe97e573.zip |
Merge pull request #15256 from sgrif/sg-push-precision-to-types
Push precision to type objects
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/column.rb')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/column.rb | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/column.rb b/activerecord/lib/active_record/connection_adapters/column.rb index c110f2ab54..10ea25748d 100644 --- a/activerecord/lib/active_record/connection_adapters/column.rb +++ b/activerecord/lib/active_record/connection_adapters/column.rb @@ -13,12 +13,12 @@ module ActiveRecord ISO_DATETIME = /\A(\d{4})-(\d\d)-(\d\d) (\d\d):(\d\d):(\d\d)(\.\d+)?\z/ end - attr_reader :name, :default, :cast_type, :limit, :null, :sql_type, :precision, :default_function + attr_reader :name, :default, :cast_type, :limit, :null, :sql_type, :default_function attr_accessor :primary, :coder alias :encoded? :coder - delegate :type, :scale, :klass, :text?, :number?, :binary?, :type_cast_for_write, to: :cast_type + delegate :type, :precision, :scale, :klass, :text?, :number?, :binary?, :type_cast_for_write, to: :cast_type # Instantiates a new column in the table. # @@ -35,7 +35,6 @@ module ActiveRecord @sql_type = sql_type @null = null @limit = extract_limit(sql_type) - @precision = extract_precision(sql_type) @default = extract_default(default) @default_function = nil @primary = nil @@ -68,8 +67,6 @@ module ActiveRecord end private - delegate :extract_precision, to: :cast_type - def extract_limit(sql_type) $1.to_i if sql_type =~ /\((.*)\)/ end |