aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/adapters
Commit message (Collapse)AuthorAgeFilesLines
* Remove `Column#primary`Sean Griffin2014-05-231-1/+0
| | | | | | | | It appears to have been used at some point in the past, but is no longer used in any meaningful way. Whether a column is considered primary is a property of the model, not the schema/column. This also removes the need for yet another layer of caching of the model's schema, and we can leave that to the schema cache.
* Merge pull request #15249 from sgrif/sg-register-types-in-adapterRafael Mendonça França2014-05-221-9/+1
|\ | | | | Use the generic type map for all PG type registrations
| * Use the generic type map for all PG type registrationsSean Griffin2014-05-221-9/+1
| | | | | | | | | | | | | | We're going to want all of the benefits of the type map object for registrations, including block registration and real aliasing. Moves type name registrations to the adapter, and aliases the OIDs to the named types
* | pg test, extract tsvector tests into `postgresql/full_text_test.rb`Yves Senn2014-05-222-27/+31
| |
* | pg test, move timestamp tests over to `postgresql/timestamp_test.rb`.Yves Senn2014-05-222-43/+53
| |
* | pg test, extract network address type tests into separate file.Yves Senn2014-05-223-51/+79
| |
* | pg test, remove unused code.Yves Senn2014-05-221-3/+0
|/
* Rename `oid_type` to `cast_type` to make PG columns consistentSean Griffin2014-05-211-10/+1
|
* pg, extract money tests into separate file.Yves Senn2014-05-212-35/+55
| | | | | - Added assertions about the column. Specifically scale. - Move record insertion from setup into test method.
* Delegate predicate methods to injected type object on ColumnSean Griffin2014-05-201-1/+1
|
* Have Postgres OID types inherit from general typesSean Griffin2014-05-201-4/+4
| | | | | Using general types where possible. Several more can go away once infinity gets figured out.
* Fixed the inferred table name for HABTM within a schemaEric Chahin2014-05-201-0/+26
| | | | Fixes #14824.
* Fixing test order issuesRafael Mendonça França2014-05-191-2/+8
|
* Merge pull request #10798 from ↵Rafael Mendonça França2014-05-191-0/+59
|\ | | | | | | | | | | | | | | | | | | jcxplorer/fix-enable_extension-with-table_name_prefix Fix migrations that use enable_extension with table_name_prefix/suffix Conflicts: activerecord/CHANGELOG.md activerecord/lib/active_record/migration.rb
| * Fix migrations with enable_extensionJoao Carlos2013-05-291-0/+59
| | | | | | | | | | | | | | When using ActiveRecord::Base.table_name_prefix and/or table_name_suffix, extension names got the same treatment as table names when running migrations. This led to migrations that tried to call, for example, enable_extension("prefix_hstore") on the connection.
* | Delegate `Column#type` to the injected type objectSean Griffin2014-05-193-9/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The decision to wrap type registrations in a proc was made for two reasons. 1. Some cases need to make an additional decision based on the type (e.g. a `Decimal` with a 0 scale) 2. Aliased types are automatically updated if they type they point to is updated later. If a user or another adapter decides to change the object used for `decimal` columns, `numeric`, and `number` will automatically point to the new type, without having to track what types are aliased explicitly. Everything else here should be pretty straightforward. PostgreSQL ranges had to change slightly, since the `simplified_type` method is gone.
* | pg, re-introduce `PostgreSQL::Utils` to unify schema/table extraction.Yves Senn2014-05-192-15/+20
| | | | | | | | Partial revert of c0bfc3f412834ffe8327a15ae3a46602cc28e425
* | Add a type object to Column constructorSean Griffin2014-05-172-8/+8
| | | | | | | | | | | | Part of #15134. In order to perform typecasting polymorphically, we need to add another argument to the constructor. The order was chosen to match the `oid_type` on `PostgreSQLColumn`.
* | Changed extract_limit in class Column to return correct mysql float and ↵Aaron Nelson2014-05-161-0/+38
| | | | | | | | double limits
* | Merge pull request #15088 from kares/shareable-modulesRafael Mendonça França2014-05-142-20/+15
|\ \ | | | | | | | | | [postgres] remove (outer) sub-class declarations with nested modules/classes
| * | PostgreSQLAdapter::Utils seems to be only used from a single spot - quite ↵kares2014-05-142-20/+15
| | | | | | | | | | | | redundant
* | | remove warning `ambiguous first argument; put parentheses or even spaces`Kuldeep Aggarwal2014-05-151-1/+1
|/ /
* | pg, clarify default behavior for composite types.Yves Senn2014-05-131-7/+94
| | | | | | | | | | | | | | | | | | | | | | | | * by default composite types are mapped as `OID::Identity` and issue a warning * the user is advised to register his own `OID::Type` to make use of composite types Registering a new `OID::Type` does currently not allow to specify the type casting behavior when writing to the database. In order for it to work we need to use the values within `@attributes`. They are already being type casted and are ready to be written to the DB. See https://github.com/rails/rails/blob/57643c961feb24b662620d330e71103a830003e8/activerecord/lib/active_record/attribute_methods.rb#L460-L462
* | test, move all pg array tests into `postgresql/array_test.rb`.Yves Senn2014-05-132-51/+29
| |
* | test, use `columns_hash[]` in place of `columns.find {}`.Yves Senn2014-05-128-12/+12
| |
* | pg, `change_column_default` accepts `[]`. Closes #11586.Yves Senn2014-05-121-1/+9
| |
* | pg, map `char` and `name` types as string. [dark-panda & Yves Senn]Yves Senn2014-05-121-0/+23
| | | | | | | | Closes #10802.
* | pg, fix Infinity and NaN values conversion.Innokenty Mihailov2014-05-121-0/+7
| | | | | | | | Before this patch `Infinity`, `-Infinity` and `Nan` were read as `0`.
* | test, regression test for unparsable PostgreSQL defaults.Yves Senn2014-05-081-0/+17
| | | | | | | | | | This test was inspired by #14866. That PR would break this functionality and we should make sure we notice that in the future.
* | test, reset changed state in PG's uuid tests.Yves Senn2014-05-081-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | This resulted in some unrelated errors on Traivs: 1) Error: PostgresqlUUIDTest#test_treat_blank_uuid_as_nil: ActiveRecord::StatementInvalid: PG::UndefinedColumn: ERROR: column "thingy" of relation "uuid_data_type" does not exist LINE 1: INSERT INTO "uuid_data_type" ("thingy") VALUES ($1) RETURNIN... ^ : INSERT INTO "uuid_data_type" ("thingy") VALUES ($1) RETURNING "id" /cc @zuhao
* | Test typecasting on instance rather than class itselfAkshay Vishnoi2014-05-031-1/+1
| |
* | Merge pull request #14896 from jetthoughts/14895_overide_strict_by_sql_modeRafael Mendonça França2014-05-012-0/+16
|\ \ | | | | | | | | | | | | | | | | | | Symbolize variables of mysql/mysql2 connection configuration Conflicts: activerecord/CHANGELOG.md
| * | Stringify variables names for mysql connectionsPaul Nikitochkin2014-04-302-0/+16
| | | | | | | | | | | | | | | | | | | | | For mysql2/mysql adapters, `sql_mode` variable name set in `database.yml` as string, was ignored and `sql_mode` was set to use strict mode. Fixes #14895
* | | Merge pull request #13640 from maginatics/fix_sqlite3_ensure_masterRafael Mendonça França2014-05-011-0/+15
|\ \ \ | |/ / |/| | | | | | | | | | | | | | SQLite3: Always close statements. Conflicts: activerecord/CHANGELOG.md
| * | SQLite3: Always close statements.Timur Alperovich2014-01-151-0/+15
| | | | | | | | | | | | | | | | | | SQLite3 adapter must make sure to close statements after queries. Fixes: #13631
* | | Merge branch 'master' into adequaterecordAaron Patterson2014-04-201-0/+13
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master: (74 commits) [ci skip] builtin -> built-in Fix code indentation and improve formatting Grammar fix in Getting Started Guide Make URL escaping more consistent Optimize URI escaping Always escape string passed to url helper. Remove statement assuming coffee shop/public space wifi is inherently insecure Don't rely on Arel master in bug report template [ci skip] wrap methods in backticks [ci skip] "subhash" --> "sub-hash" multibyte_conformance.rb --> multibyte_conformance_test.rb Fix inconsistent behavior from String#first/#last `@destroyed` should always be set to `false` when an object is duped. remove warning `warning: ambiguous first argument; put parentheses or even spaces` :uglify -> :uglifier Regression test for irregular inflection on has_many Singularize association names before camelization Fix spelling and proper nouns Optimize select_value, select_values, select_rows and dry up checking whether to exec with cache for Postgresql adapter Include default rails protect_from_forgery with: :exception ... Conflicts: activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb
| * | | Changed change_column in PG schema_statements.rb to make sure that the ↵Eric Chahin2014-04-151-0/+13
| | | | | | | | | | | | | | | | uuid_generate function was not being quoted.
* | | | Merge branch 'master' into adequaterecordAaron Patterson2014-04-145-7/+40
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master: (70 commits) [ci skip] Added link to ruby-lang.org installation. Use the index on hidden field `collection_check_boxes` respects `:index` option for the hidden filed name. docs, double meaning of `serialize` argument. Closes #14284. Just call read_attribute, no need to use `send`. - Fix lingering reference to `:text` instead of the newer `:plain` - Section references `form_tag` instead of the `form_for` used in the example again, read_attribute is public, so just call it read_attribute is public, so we should just call it Disable assest cache store in docs [ci skip] Make counter cache decrementation on destroy idempotent Write the failing test case for concurrent counter cache [ci skip] Use plain underscore instead of "\_". Update documentation to use Rails.application instead Add a changelog entry for #14546 [ci skip] Move tests for deep_dup and duplicable to object directory Missing 'are' in note - [ci skip] CollectionHelpers now accepts a readonly option Fix a few typos [ci skip] Bundle tzinfo-data on :x64_mingw (64-bit Ruby on Windows). don't bother with an offset if the offset is zero ...
| * | | PostgreSQL, warn once per connection per missing OID. Closes #14275.Yves Senn2014-04-111-0/+11
| | | | | | | | | | | | | | | | [Yves Senn & Matthew Draper]
| * | | PostgreSQL, adapter automatically reloads it's type map. Closes #14678.Yves Senn2014-04-114-6/+28
| | | | | | | | | | | | | | | | [Yves Senn & Matthew Draper]
| * | | Remove warning of unused variableRafael Mendonça França2014-04-101-1/+1
| | | |
* | | | remove the bind visitor since the collector handles substituting bind valuesAaron Patterson2014-04-091-3/+3
| | | |
* | | | all tests passing on mysql2Aaron Patterson2014-04-091-3/+3
| | | |
* | | | working against arel/collector branchAaron Patterson2014-04-091-3/+3
| | | |
* | | | Merge branch 'master' into adequaterecordAaron Patterson2014-04-0720-320/+548
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master: (122 commits) Rails.application should be set inside before_configuration hook remove check for present? from delete_all Remove useless begin..end Build the reverse_order on its proper method. Use connection-specific bytea escaping Ignore order when doing count. make enums distinct per class Remove unused `subclass_controller_with_flash_type_bar` var from flash test. fix CollectionProxy delete_all documentation Added OS X specific commands to installation guide [ci skip] Recommended using homebrew for installing MySQL and PostgreSQL Fix setup of adding _flash_types test. Use SVG version of travis build status badge [skip ci] W3C CSP document moved to gihub.io URL [ci skip] sprockets-rails was released Fix the test defining the models in the right place Add CHANGELOG entry for #11650 [ci skip] Declare the assets dependency Use sass-rails 4.0.3 Make possible to use sprockets-rails 2.1 add missing parentheses to validates_with documentation [skip ci] ...
| * | | Use connection-specific bytea escapingMatthew Draper2014-04-081-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | | Merge pull request #14579 from senny/pg/remove_string_limitRafael Mendonça França2014-04-041-1/+1
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PostgreSQL, remove varchar limit. Conflicts: activerecord/CHANGELOG.md
| | * | | PostgreSQL and SQLite, remove varchar limit. [Vladimir Sazhin & Toms Mikoss ↵Yves Senn2014-04-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | & Yves Senn] There is no reason for the PG adapter to have a default limit of 255 on :string columns. See this snippet from the PG docs: Tip: There is no performance difference among these three types, apart from increased storage space when using the blank-padded type, and a few extra CPU cycles to check the length when storing into a length-constrained column. While character(n) has performance advantages in some other database systems, there is no such advantage in PostgreSQL; in fact character(n) is usually the slowest of the three because of its additional storage costs. In most situations text or character varying should be used instead.
| * | | | Prevent state leak in test.Guo Xiang Tan2014-04-031-17/+16
| |/ / / | | | | | | | | | | | | This will allow us to run the tests in random order.
| * | | Merge pull request #14569 from matthewd/sqlite_relative_deprecatedRafael Mendonça França2014-04-031-2/+2
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Revise 'sqlite3:' URL handling for smoother upgrades Conflicts: activerecord/CHANGELOG.md