From 75869195725a816822f4403f1eb084162e3eb54b Mon Sep 17 00:00:00 2001 From: Yauheni Dakuka Date: Fri, 9 Jun 2017 14:45:08 +0300 Subject: Fix link in active_record_postgresql.md --- guides/source/active_record_postgresql.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'guides/source/active_record_postgresql.md') diff --git a/guides/source/active_record_postgresql.md b/guides/source/active_record_postgresql.md index 6d07291b07..54f6be006e 100644 --- a/guides/source/active_record_postgresql.md +++ b/guides/source/active_record_postgresql.md @@ -84,7 +84,7 @@ Book.where("array_length(ratings, 1) >= 3") ### Hstore * [type definition](http://www.postgresql.org/docs/current/static/hstore.html) -* [functions and operators](http://www.postgresql.org/docs/current/static/hstore.html#AEN167712) +* [functions and operators](http://www.postgresql.org/docs/current/static/hstore.html#AEN179902) NOTE: You need to enable the `hstore` extension to use hstore. -- cgit v1.2.3 From da783d95711655e4bd29c887b7202a12a0c1d65e Mon Sep 17 00:00:00 2001 From: Yauheni Dakuka Date: Fri, 9 Jun 2017 15:32:42 +0300 Subject: [ci skip] Fix link in active_record_postgresql.md --- guides/source/active_record_postgresql.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'guides/source/active_record_postgresql.md') diff --git a/guides/source/active_record_postgresql.md b/guides/source/active_record_postgresql.md index 54f6be006e..041fdacbab 100644 --- a/guides/source/active_record_postgresql.md +++ b/guides/source/active_record_postgresql.md @@ -285,7 +285,7 @@ SELECT n.nspname AS enum_schema, ### UUID * [type definition](http://www.postgresql.org/docs/current/static/datatype-uuid.html) -* [pgcrypto generator function](http://www.postgresql.org/docs/current/static/pgcrypto.html#AEN159361) +* [pgcrypto generator function](http://www.postgresql.org/docs/current/static/pgcrypto.html#AEN182570) * [uuid-ossp generator functions](http://www.postgresql.org/docs/current/static/uuid-ossp.html) NOTE: You need to enable the `pgcrypto` (only PostgreSQL >= 9.4) or `uuid-ossp` -- cgit v1.2.3 From 927e98621983d33795a99434492c3bb8ee7cd764 Mon Sep 17 00:00:00 2001 From: Marc Rendl Ignacio Date: Tue, 27 Jun 2017 17:10:26 +0800 Subject: Document ActiveRecord's PostgreSQL-specific support for JSONB datatype in RailsGuides [ci skip] --- guides/source/active_record_postgresql.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'guides/source/active_record_postgresql.md') diff --git a/guides/source/active_record_postgresql.md b/guides/source/active_record_postgresql.md index 041fdacbab..8543fcd20f 100644 --- a/guides/source/active_record_postgresql.md +++ b/guides/source/active_record_postgresql.md @@ -114,16 +114,21 @@ Profile.where("settings->'color' = ?", "yellow") # => #"yellow", "resolution"=>"1280x1024"}>]> ``` -### JSON +### JSON and JSONB * [type definition](http://www.postgresql.org/docs/current/static/datatype-json.html) * [functions and operators](http://www.postgresql.org/docs/current/static/functions-json.html) ```ruby # db/migrate/20131220144913_create_events.rb +# ... for json datatype: create_table :events do |t| t.json 'payload' end +# ... or for jsonb datatype: +create_table :events do |t| + t.jsonb 'payload' +end # app/models/event.rb class Event < ApplicationRecord -- cgit v1.2.3