aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/adapters/postgresql/hstore_test.rb
Commit message (Collapse)AuthorAgeFilesLines
...
* Resolve encoding issues with arrays of hstore (bug 11135).Josh Goodall2014-02-171-0/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | We didn't have enough encoding for the wire protocol to store an array of hstore types. So, further encode any hstore that is an array member. Whilst we're here, ensure it's an HashWithIndifferentAccess being returned, to be consistent with other serialized forms, and add testing for arrays of hstore. So now the following migration: enable_extension "hstore" create_table :servers do |t| t.string :name t.hstore :interfaces, array: true end produces a model that can used like this, to store an array of hashes: server = Server.create(name: "server01", interfaces: [ { name: "bge0", ipv4: "192.0.2.2", state: "up" }, { name: "de0", state: "disabled", by: "misha" }, { name: "fe0", state: "up" }, ]) More at http://inopinatus.org/2013/07/12/using-arrays-of-hstore-with-rails-4/
* Make change_table use object of current database adapterNishant Modak2014-01-071-0/+17
| | | | | | | | | - Earlier, change_table was creating database-agnostic object. - After this change, it will create correct object based on current database adapter. - This will ensure that create_table and change_table will get same objects. - This makes update_table_definition method public and nodoc. - Fixes #13577 and #13503
* Tidy up fix for PG extensions quotingCarlos Antonio da Silva2013-12-231-2/+6
| | | | | Always pass in the column for quote_bound_value and quote using it in case it exists there.
* Serialize postgres' hstore, json and array types correctly in AR update methods.Tadas Tamosauskas2013-12-231-0/+6
| | | | | | | | | Fixes #12261. Closes #12395. Conflicts: activerecord/CHANGELOG.md activerecord/test/cases/adapters/postgresql/array_test.rb activerecord/test/cases/adapters/postgresql/json_test.rb
* Don't skip tests if we don't need to.Rafael Mendonça França2013-11-081-151/+149
| | | | | | | We can conditional define the tests depending on the adapter or connection. Lets keep the skip for fail tests that need to be fixed.
* `ActiveRecord::Store` works together with PG `hstore` columns.Yves Senn2013-10-251-0/+21
| | | | | | This is necessary because as of 5ac2341 `hstore` columns are always stored as `Hash` with `String` keys. `ActiveRecord::Store` expected the attribute to be an instance of `HashWithIndifferentAccess`, which led to the bug.
* cast hstore values on write to be consistent with reading from the db.Yves Senn2013-08-081-0/+7
|
* Merge pull request #9876 from macksmind/restore_cols_dropped_by_hstore_testRafael Mendonça França2013-03-261-15/+5
|\ | | | | Restore columns dropped by hstore test
| * Combine tests and restore columns dropped by hstore testingMack Earnhardt2013-03-261-15/+5
| | | | | | | | | | Disabling the hstore extension during testing created order dependent test failures.
* | Fix regex to strip quotations from hstore valuesjlxw2013-03-231-0/+4
|/ | | | Previously regex did not strip quotation marks where hstore values were multi-line strings.
* Support PostgreSQL specific column types when using `change_table`.Yves Senn2013-02-281-0/+15
| | | | | | | | Closes #9480. We use `TableDefinition` for `#create_table` and `Table` for `#change_table`. The PostgreSQL sepcifc types were only defined on `TableDefinition` so I also added them to `Table`.
* improve tests to check for existence of extensions method, and skip testing ↵Justin George2013-02-061-0/+1
| | | | dumped extensions if they are unsupported by the database
* Add some tests to enumerate how extensions should be stored in the schema outputJustin George2013-02-061-0/+4
|
* Enable hstore extensions on tests if it is not enabled and database supports itRafael Mendonça França2013-02-051-1/+8
|
* add API to pg for enabling / disabling hstoreAaron Patterson2013-01-281-7/+29
|
* %s/find(:\(first\|last\|all\), \([^()]*\))/scoped(\2).\1/gcI amongst other ↵Jon Leighton2012-04-271-3/+3
| | | | things
* Always quote hstore keys and valuesRyan Fitzgerald2012-04-241-1/+9
| | | | | | | escape_hstore uses quotation marks around keys and values only if it seems necessary. However, it currently breaks in the presence of some non-ASCII characters. Instead of trying to guess exactly which characters are safe, it seems better to always use quotes.
* Also support writing the hstore back to the databaseJoel2012-02-081-0/+8
|
* string_to_hstore / hstore_to_string, serializingJoel2012-02-081-6/+6
|
* Additional hstore tests, supporting null values, better compliance with ↵Joel2012-02-081-7/+59
| | | | postgres docs
* skip hstore tests on PG databases that do not have hstoreAaron Patterson2011-12-201-2/+8
|
* making sure updates workAaron Patterson2011-12-201-7/+13
|
* hstores can cycleAaron Patterson2011-12-201-2/+26
|
* can create hstore records via AR APIAaron Patterson2011-12-201-0/+7
|
* multiple key / values workAaron Patterson2011-12-201-0/+6
|
* PostgreSQL hstore types are automatically deserialized from the database.Aaron Patterson2011-12-201-0/+16
|
* pg columns should understand the hstore typeAaron Patterson2011-12-201-0/+24