| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Related the commit 8f8f8058e58dda20259c1caa61ec92542573643d.
|
|
|
|
| |
Move microseconds formatting to `AbstractAdapter`.
|
|
|
|
|
| |
Not sure how we missed this case when we moved everything else to the
`_quote` method.
|
| |
|
| |
|
|\
| |
| | |
Remove PG's definition of `type_cast`
|
| |
| |
| |
| |
| | |
All cases except for `nil` in an array have been removed. `nil` in an
array is handled by the Array type object.
|
|/ |
|
| |
|
|\
| |
| | |
Remove unneccessary special case for money in quoting
|
| | |
|
|\ \
| | |
| | | |
Do not rely on the column type when quoting infinity
|
| |/ |
|
|/ |
|
|
|
|
|
| |
The test case for CVE-2014-3483 doesn't actually send the generated SQL
to the database. The generated SQL is actually invalid for real inputs.
|
|
|
|
| |
Fix CVE-2014-3483 and protect against CVE-2014-3482.
|
|\
| |
| | |
Remove array workaround in PG quoting
|
| |
| |
| |
| |
| | |
We no longer need to do fancy legwork to make sure arrays use a type
object, now that schema methods use a real type object.
|
|/
|
|
|
| |
Hstore no longer needs additional quoting to be used in an array, the
array type handles it sufficiently.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Adding `# :nodoc:` to the parent `class` / `module` is not going
to ignore nested classes or modules.
There is a modifier `# :nodoc: all` but sadly the containing class
or module will continue to be in the docs.
/cc @sgrif
|
|
|
|
|
|
|
|
|
| |
We're never going to be able to use the attribute object here, however,
so let's just accept the ugly demeter violation here for now.
Remove test cases which were either redundant with other tests in the
file, or were actually testing the type objects (which are tested
elsewhere)
|
|
|
|
|
|
|
|
|
| |
The case where we have a column object, but don't have a type cast
method involves type casting the default value when changing the schema.
We get one of the column definition structs instead. That is a case that
I'm trying to remove overall, but in the short term, we can achieve the
same behavior without needing to pass the adapter to the array type by
creating a fake type that proxies to the adapter.
|
|
|
|
| |
BC era year is (astronomical year + 1) and starts from 1 BC.
|
| |
|
|
|
|
|
|
|
|
| |
This inlines casting for the most obvious types. The rest will
follow eventually. I need to put some tests in place, to make sure
that the inlining is not causing regressions.
/cc @sgrif
|
| |
|
|
|
|
| |
Partial revert of c0bfc3f412834ffe8327a15ae3a46602cc28e425
|
|
|
| |
... 'shared' OID, ArrayParser and Cast helpers, also re-arranged Column's dependencies
|
| |
|
|
|
|
| |
uuid_generate function was not being quoted.
|
|
|
|
|
|
|
|
|
|
| |
In our normal usage, it's rare for this to make a difference... but is
more technically correct.
As well as a spec that proves this is a good idea, let's also add a more
sane-looking one that just covers basic to_sql functionality. There
aren't many places where we actually use escape_bytea, but that's one
that won't be going away.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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/
|
| |
|
| |
|
|
|
|
| |
This will make the conditional and to code clear
|
| |
|
|
|
|
| |
- A string in an array of strings that has a quote char (') needs to have that quote char escaped if the array is getting wrapped in quote chars.
|
| |
|
|
|
|
|
|
|
| |
ActiveRecord::ConnectionAdapters::Column
See
https://github.com/rails/rails/blob/28b8ca766e3e7c6c43d3ae900c99f8377153c62/activerecord/lib/active_record/connection_adapters/column.rb#L16
|
| |
|
| |
|
| |
|
|
|
|
| |
fixes #9170
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
because of an ambiguous column name. This happened if the association
model had a default scope that referenced a third table, and the third
table also referenced the original table (with an identical
foreign_key).
Mysql requires that ambiguous columns are deambiguated by using the full
table.column syntax. Postgresql and Sqlite use a different syntax for
updates altogether (and don't tolerate table.name syntax), so the fix
requires always including the full table.column and discarding it later
for Sqlite and Postgresql.
|
| |
|
| |
|
| |
|
| |
|