instance method
extract_precision
Ruby on Rails 4.1.16
Since v3.0.20 Last seen in v4.1.16 PrivateSignature
extract_precision(sql_type)
Extracts the precision from PostgreSQL-specific data types.
Parameters
-
sql_typereq
Source
# File activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb, line 185
def extract_precision(sql_type)
if sql_type == 'money'
self.class.money_precision
elsif sql_type =~ /timestamp/i
$1.to_i if sql_type =~ /\((\d+)\)/
else
super
end
end
Defined in activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb line 185
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::ConnectionAdapters::PostgreSQLColumn