diff options
Diffstat (limited to 'guides/source/active_record_postgresql.md')
-rw-r--r-- | guides/source/active_record_postgresql.md | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/guides/source/active_record_postgresql.md b/guides/source/active_record_postgresql.md index 14f7f4dccd..dfa488773e 100644 --- a/guides/source/active_record_postgresql.md +++ b/guides/source/active_record_postgresql.md @@ -3,13 +3,6 @@ Active Record and PostgreSQL This guide covers PostgreSQL specific usage of Active Record. -In order to use the PostgreSQL adapter you need to have at least version 8.2 -installed. Older versions are not supported. - -To get started with PostgreSQL have a look at the -[configuring Rails guide](configuring.html#configuring-a-postgresql-database). -It describes how to properly setup Active Record for PostgreSQL. - After reading this guide, you will know: * How to use PostgreSQL's datatypes. @@ -18,6 +11,13 @@ After reading this guide, you will know: -------------------------------------------------------------------------------- +In order to use the PostgreSQL adapter you need to have at least version 8.2 +installed. Older versions are not supported. + +To get started with PostgreSQL have a look at the +[configuring Rails guide](configuring.html#configuring-a-postgresql-database). +It describes how to properly setup Active Record for PostgreSQL. + Datatypes --------- @@ -98,7 +98,7 @@ Profile.create(settings: { "color" => "blue", "resolution" => "800x600" }) profile = Profile.first profile.settings # => {"color"=>"blue", "resolution"=>"800x600"} -profile.settings = {"color" => "yellow", "resulution" => "1280x1024"} +profile.settings = {"color" => "yellow", "resolution" => "1280x1024"} profile.save! ## you need to call _will_change! if you are editing the store in place @@ -171,7 +171,7 @@ event.ends_at # => Thu, 13 Feb 2014 * [type definition](http://www.postgresql.org/docs/9.3/static/rowtypes.html) -Currently there is no special support for composite types. They are mapped to as +Currently there is no special support for composite types. They are mapped to normal text columns: ```sql @@ -287,8 +287,9 @@ user.save! * [type definition](http://www.postgresql.org/docs/9.3/static/datatype-net-types.html) -The types `inet` and `cidr` are mapped to Ruby [`IPAddr`](http://www.ruby-doc.org/stdlib-2.1.1/libdoc/ipaddr/rdoc/IPAddr.html) objects. The -`macaddr` type is mapped to normal text. +The types `inet` and `cidr` are mapped to Ruby +[`IPAddr`](http://www.ruby-doc.org/stdlib-2.1.1/libdoc/ipaddr/rdoc/IPAddr.html) +objects. The `macaddr` type is mapped to normal text. ```ruby # db/migrate/20140508144913_create_devices.rb @@ -428,5 +429,5 @@ first.archive! p Article.count # => 2 ``` -Note: This application only cares about non-archived `Articles`. A view also +NOTE: This application only cares about non-archived `Articles`. A view also allows for conditions so we can exclude the archived `Articles` directly. |