| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| |
| |
| |
| | |
Conflicts:
actionview/CHANGELOG.md
activerecord/CHANGELOG.md
|
| |
| |
| |
| |
| |
| | |
Thanks Godfrey Chan for reporting this!
Fixes: CVE-2014-0080
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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/
|
| |
| |
| |
| |
| | |
remove created state after test execution, not before the next test.
This prevents the leak of the `ex` table outside of a single test.
|
| |
| |
| |
| | |
This should make it harder to accidentally break this test.
|
| | |
|
| |
| |
| |
| |
| |
| | |
If the test is run in a timezone that is behind UTC it fails because
the time generated is ahead of 0000-01-01 00:00:00. Just increase the
time subtracted so that timezone has no effect.
|
|\ \
| | |
| | |
| | |
| | |
| | |
| | | |
PostgreSQL implementation of SchemaStatements#index_name_exists?
Conflicts:
activerecord/CHANGELOG.md
|
| | | |
|
| | | |
|
| | | |
|
|/ / |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
- 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
|
| |
| |
| |
| | |
user's system configuration
|
| |
| |
| |
| |
| | |
Always pass in the column for quote_bound_value and quote using it in
case it exists there.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Fixes #12261. Closes #12395.
Conflicts:
activerecord/CHANGELOG.md
activerecord/test/cases/adapters/postgresql/array_test.rb
activerecord/test/cases/adapters/postgresql/json_test.rb
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The code uses these checks in several places to know what to do with a
particular column, for instance AR attribute query methods has a branch
like this:
if column.number?
!value.zero?
end
This should never be true for array columns, since it would be the same
as running [].zero?, which results in a NoMethodError exception.
Fixing this by ensuring that array columns in PostgreSQL never return
true for number?/text? checks.
Since most of the array support was based on the postgres_ext lib, it's
worth noting it does the same thing for numeric array columns too:
https://github.com/dockyard/postgres_ext/blob/v1.0.0/lib/postgres_ext/active_record/connection_adapters/postgres_adapter.rb#L72
This extended the same logic for text columns to ensure consistency.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Currently if you attempt to use a database that does not exist you get an error:
```
PG::ConnectionBad FATAL: database "db_error" does not exist
```
The solution is easy, create and migrate your database however new developers may not know these commands by memory. Instead of requiring the developer to search for a solution, tell them how to fix the problem in the error message:
```
ActiveRecord::NoDatabase: FATAL: database "db_error" does not exist
Run `$ bin/rake db:create db:migrate` to create your database
```
Active Record should not know about `rake db:migrate` so this additional information needs to come from the railtie. Potential alternative implementation suggestions are welcome.
|
| |
| |
| |
| | |
Closes #13444
|
| |
| |
| |
| | |
[ci skip]
|
|\ \
| | |
| | | |
modified regex for finding table_name from a multiline sql query in postgresql
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Previously, executing an insert SQL in PostgreSQL with a command like this:
insert into articles(
number)
values(
5152
)
would not work because the adapter was unable to extract the correct articles table name.
|
|/
|
|
| |
The changes in c4044b2 meant the tests would error on a fresh DB.
|
| |
|
| |
|
|
|
|
|
|
|
| |
We can conditional define the tests depending on the adapter or
connection.
Lets keep the skip for fail tests that need to be fixed.
|
| |
|
|\
| |
| | |
cast json values on write to be consistent with reading from the db.
|
| |
| |
| |
| | |
See also commit 5ac2341fab689344991b2a4817bd2bc8b3edac9d
|
|\ \
| |/
|/| |
prevent global timezone state from leaking out of test cases.
|
| | |
|
| |
| |
| |
| |
| |
| | |
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.
|
|/ |
|
|
|
|
| |
Fixes #12489
|
| |
|
| |
|
| |
|
|\
| |
| | |
TypeError: superclass mismatch for class PostgreSQLAdapter
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
monkeypatching
Changing Inheritance section leads to following error on JRuby
TypeError: superclass mismatch for class PostgreSQLAdapter
After this change,
Jruby: The above error no longer appear. Tests are still failing but they do run. Progress!
MRI: No change, all green(tested by running take test_test_postgresql)
Thanks to Aditya Sanghi(@asanghi) for help
|
|\ \
| | |
| | |
| | |
| | |
| | |
| | | |
Dump UUID default functions to schema.rb [2nd version]. Fixes #10751.
Conflicts:
activerecord/CHANGELOG.md
|
| | | |
|
|\ \ \
| |_|/
|/| |
| | |
| | |
| | |
| | | |
Fixed a bug in when using has_many association with :inverse_of option and UUID primary key.
Conflicts:
activerecord/CHANGELOG.md
|
| | |
| | |
| | |
| | | |
UUID primary key.
|
| | | |
|
| | |
| | |
| | |
| | | |
Closes #11899.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
SQL doesn't have a string type, and interpreting 'string' as text is
contrary to at least SQLite3's behavior:
"Note that a declared type of 'STRING' has an affinity of NUMERIC, not TEXT."
http://www.sqlite.org/datatype3.html
|
|\ \ \
| | | |
| | | | |
Fix assign ip address with invalid values raise exception
|
| | | |
| | | |
| | | |
| | | | |
In order that set attribute should not be bang method
|
|/ / / |
|
| | | |
|