aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/adapters
Commit message (Collapse)AuthorAgeFilesLines
...
| * | Fixes bugs for using indexes in CREATE TABLE by adding checks for table ↵Steve Rice2014-03-252-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | existence Also: - updates tests by stubbing table_exists? method - adds entry for creating indexes in CREATE TABLE to changelog
| * | create indexes inline in CREATE TABLE for MySQLCody Cutrer2014-03-252-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | This is important, because adding an index on a temporary table after it has been created would commit the transaction Conflicts: activerecord/CHANGELOG.md
* | | Merge branch 'master' into adequaterecordAaron Patterson2014-03-2523-117/+196
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master: (96 commits) clarify CHANGELOG [ci skip]. Fix Generation of proper migration when ActiveRecord::Base.pluralize_table_names = false. update comments to reflect that options support is not available synchronize changelogs and 4.1 release notes. [ci skip] do not rely on method_missing hitting arel use ARel factory methods for building AST nodes Fix date_select option overwriting html classes - Rename `increment_or_decrement` to an apt `set_cache_value` since it actually doesn't increment/decrement in localstore. Check if any sqlite files are not included in the gitignore Remove sqlite3 lines from .gitignore if the application is not using sqlite3. Adding active_model in Rails::Info Clean up tables after each test. Swapped parameters of assert_equal in assert_select Update test helper to use latest Digestor API Digestor should just rely on the finder to know about the format and the variant -- trying to pass it back in makes a mess of things (oh, and doesnt work) Log the full path, including variant, that the digestor is trying to find Fix for digestor to consider variants for partials -- this still needs more testing!! fix log_tags request object grammar Extract with_example_table into helper method. test for structure:dump without schema information table. refs eafec46 ... Conflicts: activerecord/test/cases/relation/where_chain_test.rb
| * | Clean up tables after each test.Guo Xiang Tan2014-03-222-92/+96
| | | | | | | | | | | | | | | | | | | | | Follow-Up to https://github.com/rails/rails/pull/14400 This ensures that all tables are removed after each test and thereby allowing us to run the tests in a random order.
| * | Extract with_example_table into helper method.Guo Xiang Tan2014-03-201-6/+5
| | | | | | | | | | | | This setups the helper method which other tests can benefit from.
| * | Postgres schema: Constrain sequence search classidJosh Williams2014-03-201-0/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The pk_an_sequence_for query previously joined against pg_class's oid for rows in pg_depend, but pg_depend's objid may point to other system tables, such as pg_attrdef. If a row in one of those other tables coincidentally has the same oid as an (unrelated) sequence, that sequence name may be returned instead of the real one. This ensures that only the pg_depend entries pointing to pg_class are considered.
| * | Teach PostgreSQLAdapter#reset! to actually resetMatthew Draper2014-03-181-0/+31
| | | | | | | | | | | | It wasn't doing anything beyond clearing the statement cache.
| * | Use teardown helper method.Guo Xiang Tan2014-03-1419-19/+19
| | | | | | | | | | | | | | | | | | | | | | | | Follow-Up to https://github.com/rails/rails/pull/14348 Ensure that SQLCounter.clear_log is called after each test. This is a step to prevent side effects when running tests. This will allow us to run them in random order.
* | | Merge branch 'master' into adequaterecordAaron Patterson2014-03-136-5/+155
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master: (108 commits) make tests pass on Ruby 2.2 Use Sqlite3 adapter in examples use the body proxy to freeze headers just ask the response for the commit status, we do not need to ask the jar only write the jar if the response isn't committed Fix a grammatical error in the i18n guide [ci skip] use method_defined? to check whether or not a method is defined Enhance docs for update_attribute [ci-skip] Change usec to 0 on tests that compare seconds Unit test for mysql quote time usec Changelog entry for mysql56 microseconds Test microsecond on mysql 5.6 MySQL 5.6 and later supports microsecond precision in datetime. [ci skip] Add documentation for original_fullpath. Remove mocking on save, when not necessary comment why we are modifying global state. [ci skip] `change_table` supports `citext`. Follow up to #12523. Removed unnecessary command "application" register OID for PostgreSQL citex datatype [Troy Kruthoff & Lachlan Sylvester] Fixes STI when 2+ levels deep. ...
| * | Unit test for mysql quote time usecArthur Neves2014-03-121-0/+7
| | |
| * | Merge pull request #13040 from kamipo/case_sensitive_comparisonRafael Mendonça França2014-03-122-4/+44
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | Only use BINARY for mysql case sensitive uniqueness check when column has a case insensitive collation. Conflicts: activerecord/CHANGELOG.md
| | * | Only use BINARY for mysql case sensitive uniqueness check when column has a ↵Ryuta Kamizono2013-11-262-4/+44
| | | | | | | | | | | | | | | | case insensitive collation.
| * | | `change_table` supports `citext`. Follow up to #12523.Yves Senn2014-03-111-8/+27
| | | |
| * | | register OID for PostgreSQL citex datatype [Troy Kruthoff & Lachlan Sylvester]lsylvester2014-03-111-0/+58
| | | | | | | | | | | | | | | | citext makes it possible to use AR Hash finders for case-insensitive matching as sql UPPER/LOWER functions are not needed.
| * | | Inline block to fix indent [ci skip]Carlos Antonio da Silva2014-03-041-3/+1
| | | |
| * | | Fix enum test unused variable warning.Vipul A M2014-03-041-1/+1
| | | | | | | | | | | | | | | | Related - https://github.com/rails/rails/commit/5c55aafd38f45ac019573f98438ffdbdc8c580f9
| * | | Add Enum type to postgresql adapter's oids to prevent unknown OID warnings.Dieter Komendera2014-03-041-0/+28
| | | |
| * | | Fix warnings due to:Vipul A M2014-03-031-1/+1
| | | | | | | | | | | | | | | | | | | | - unused variable in PG Adapter. - Ambiguous argument warning from range_test for use - to + Infinity range without brackets.
* | | | Merge branch 'master' into adequaterecordAaron Patterson2014-02-264-90/+206
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master: (55 commits) [ci skip] Move association class method notes extract common code in `uuid_test.rb`. move PostgreSQL UUID tests from `datatype_test.rb` to `uuid_test.rb`. [ci skip] remove guide section on models in migrations test case for custom PostgreSQL enum type. Remove inclusion of rubysl gem for rbx on generated Gemfile let `insert_record` actuall save the object. [skip ci] Fix test name typo in app generator tests. travis s/2.1.0/2.1.1 Bump version of bcrypt gem Skip test_migrate_revert_add_index_with_name if databases do not allow to create duplicate indexes on the same columns Optimize getting started guide images, and use png instead of jpg :scissors: [ci skip] Point master changelogs to 4-1-stable branch Add missing parantheses in index_exists? `ActionDispatch::Head` was replaced by `Rack::Head`. Closes #14191. [skip ci] Standardized punctuation. [skip ci] Fix typo in link_to :method option description refactor, with_locale is not needed because I18n is mocked. Fix ActionView label translation for more than 10 nested elements ...
| * | | extract common code in `uuid_test.rb`.Yves Senn2014-02-261-60/+57
| | | |
| * | | move PostgreSQL UUID tests from `datatype_test.rb` to `uuid_test.rb`.Yves Senn2014-02-262-16/+36
| | | |
| * | | test case for custom PostgreSQL enum type.Yves Senn2014-02-261-0/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This test currently outputs the following warning: ``` unknown OID: current_mood(3567879) (SELECT "postgresql_enums".* FROM "postgresql_enums" ORDER BY "postgresql_enums"."id" ASC LIMIT 1) unknown OID: current_mood(3567879) (SELECT "postgresql_enums".* FROM "postgresql_enums" WHERE "postgresql_enums"."id" = $1 LIMIT 1) ``` We have an open PR to deal with this issue. It will dynamically register the OID for enum columns. This test case is merely to exhibit the current behavior of PostgreSQL enum columns.
| * | | deprecate support for pg ranges with excluding beginnings.Yves Senn2014-02-231-23/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Ruby Range object does not support excluding beginnings. We currently support excluding beginnings for some subtypes using manually by incrementing them (now using the `#succ` method). This is approach is flawed as it's not equal to an excluding beginning. This commit deprecates the current support for excluding beginnings. It also raises an `ArgumentError` for subtypes that do not implement the `succ` method. This is a temporary solution to get rid of the broken state. We might still add complete support for excluding beginnings afterwards. (Probably with a new `PGRange` object, which acts like a `Range` but has excluding beginnings.
| * | | dynamically define PostgreSQL OID range types.Yves Senn2014-02-231-11/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This gets AR working with custom defined range types. It also removes the need for subtype specific branches in `OID::Range`. This expands the interface of all `OID` types with the `infinity` method. It's responsible to provide a value for positive and negative infinity.
* | | | Merge branch 'master' into adequaterecordAaron Patterson2014-02-181-0/+8
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master: (32 commits) Typo fix for unscope Use the reference for the mime type to get the format Preparing for 4.1.0.beta2 release Correctly escape PostgreSQL arrays. Escape format, negative_format and units options of number helpers Sync 4.1 release notes with changes since 7f648bc7 [ci skip] Update upgrading guide regarding `render :text` Add `#no_content_type` attribute to `AD::Response` Add missing CHANGELOG entry to Action View Update guides for new rendering options Cleanup `ActionController::Rendering` Fix a fragile test on `action_view/render` Introduce `render :html` for render HTML string Introduce `render :plain` for render plain text Update hash format for render_text_test Introduce `render :body` for render raw content Don't use `# =>` when it is not the expression values Fix the column name [ci skip] Document the default scopes change on the release notes, CHANGELOG and upgrating guides Move changelog entry to the top, fix examples indent [ci skip] ...
| * | | Merge branch '4-1-0-beta2'Rafael Mendonça França2014-02-181-0/+8
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: actionview/CHANGELOG.md activerecord/CHANGELOG.md
| | * | | Correctly escape PostgreSQL arrays.Aaron Patterson2014-02-181-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Thanks Godfrey Chan for reporting this! Fixes: CVE-2014-0080
* | | | | Merge branch 'master' into adequaterecordAaron Patterson2014-02-172-7/+42
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master: Revert "Merge pull request #13344 from ccutrer/fix-from-default-select" No need to use symbols Don't skip tests if they are not broken. Just don't define they Fix typo [ci skip] Resolve encoding issues with arrays of hstore (bug 11135). Fix coffeescript sample [ci skip]
| * | | | Don't skip tests if they are not broken. Just don't define theyRafael Mendonça França2014-02-161-7/+3
| | | | |
| * | | | 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/
* | | | | Merge branch 'master' into adequaterecordAaron Patterson2014-02-177-103/+211
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master: (311 commits) Add a missing changelog entry for #13981 and #14035 Revert "Fixed plugin_generator test" implements new option :month_format_string for date select helpers [Closes #13618] add factory methods for empty alias trackers guarantee a list in the alias tracker so we can remove a conditional stop exposing table_joins make most parameters to the AliasTracker required make a singleton for AssociationScope pass the association and connection to the scope method pass the tracker down the stack and construct it in the scope method clean up add_constraints signature remove the reflection delegate remove klass delegator remove railties changes. fixes #14054 remove chain delegate remove scope_chain delegate Add verb to sanitization note fix path shown in mailer's templates updated Travis build status image url fix guide active_support_core_extensions. add Note to String#indent [ci skip] ... Conflicts: activerecord/lib/active_record/associations/join_dependency.rb activerecord/test/cases/associations/association_scope_test.rb
| * | | | remove unused fixtures from sqlite3 test casesRajarshi Das2014-02-141-1/+1
| | | | |
| * | | | tests are responsible to clean up afterwards.Yves Senn2014-02-131-82/+114
| | | | | | | | | | | | | | | | | | | | | | | | | remove created state after test execution, not before the next test. This prevents the leak of the `ex` table outside of a single test.
| * | | | Terminate the backend ourselves on PG 9.2+Matthew Draper2014-02-121-19/+29
| | | | | | | | | | | | | | | | | | | | This should make it harder to accidentally break this test.
| * | | | test case to illustrate current PostgreSQL composite behavior.Yves Senn2014-02-111-0/+42
| | | | |
| * | | | Adjust test value so that timezone has no effectAndrew White2014-02-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | | | Merge pull request #13688 from jbaudanza/psql-index-existsRafael Mendonça França2014-02-011-0/+12
| |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PostgreSQL implementation of SchemaStatements#index_name_exists? Conflicts: activerecord/CHANGELOG.md
| | * | | | psql implementation of #index_name_exists?Jonathan Baudanza2014-01-161-0/+12
| | | | | |
| * | | | | Fixes issue with parsing whitespace content back from database - fixes #13907Mauricio Linhares2014-02-011-0/+12
| | | | | |
* | | | | | Merge branch 'master' into adequaterecordAaron Patterson2014-01-171-0/+6
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master: fix exception translation translate exceptions on prepared statement failure test to ensure bad prepared statements raise a StatementInvalid exception
| * | | | | test to ensure bad prepared statements raise a StatementInvalid exceptionAaron Patterson2014-01-171-0/+6
| | | | | |
* | | | | | fixing explain tests for sqlite3Aaron Patterson2014-01-171-13/+13
| | | | | |
* | | | | | Merge branch 'master' into adequaterecordAaron Patterson2014-01-163-3/+3
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master: Make AR::Base#touch fire the after_commit and after_rollback callbacks Fix test for cache_key + touched Revert "methods are defined right after the module_eval, so we don't need to do" Revert "Don't remove trailing slash from PATH_INFO for mounted apps" Add failing test for #13369 reset column information after fiddling with `Encoding.default_internal` we have `with_env_tz` as global test helper. Remove duplicate. isolate class attribute assignment in `migration_test.rb` use `teardown` for cleanup, not `setup`. tests without transactional fixtures need to cleanup afterwards. no need to `return skip` in tests. `skip` is enough. methods are defined right after the module_eval, so we don't need to do any line number maths Get rid of unused TransactionError constant Avoid converting :on option to array twice when defining commit/rollback callbacks Unify changelog entries about single quotes [ci skip] Use single quotes in generated files
| * | | | | no need to `return skip` in tests. `skip` is enough.Yves Senn2014-01-163-3/+3
| | |_|_|/ | |/| | |
| * | | | "string" isn't a valid column type for ActiveRecordAaron Patterson2014-01-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: activerecord/test/cases/adapters/sqlite3/sqlite3_adapter_test.rb
* | | | | match against bind valuesAaron Patterson2014-01-141-2/+2
| | | | |
* | | | | drop the dual encodings tableAaron Patterson2014-01-141-2/+2
| | | | |
* | | | | Merge branch 'master' into set_bindsAaron Patterson2014-01-141-15/+21
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master: don't establish a new connection when testing with `sqlite3_mem`. sqlite >= 3.8.0 supports partial indexes Don't try to get the subclass if the inheritance column doesn't exist Enum mappings are now exposed via class methods instead of constants. Fix fields_for documentation with index option [ci skip] quick pass through Active Record CHANGELOG. [ci skip] [ci skip] Grammar correction single quotes for controller generated routes [ci skip] Added alias to CSRF Set NameError#name
| * | | | don't establish a new connection when testing with `sqlite3_mem`.Yves Senn2014-01-141-15/+21
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | This fixes broken `rake test_sqlite3_mem` suite for Active Record. The problem is that that the old database with the schema is lost when establishing a new connection. Upon reconnting we are left with a blank database and tests down the line start failing.
* | | | Merge branch 'master' into set_bindsAaron Patterson2014-01-1132-884/+1119
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master: (2794 commits) doc, API example on how to use `Model#exists?` with multiple IDs. [ci skip] Restore DATABASE_URL even if it's nil in connection_handler test [ci skip] - error_messages_for has been deprecated since 2.3.8 - lets reduce any confusion for users Ensure Active Record connection consistency Revert "ask the fixture set for the sql statements" Check `respond_to` before delegation due to: https://github.com/ruby/ruby/commit/d781caaf313b8649948c107bba277e5ad7307314 Adding Hash#compact and Hash#compact! methods MySQL version 4.1 was EOL on December 31, 2009 We should at least recommend modern versions of MySQL to users. clear cache on body close so that cache remains during rendering add a more restricted codepath for templates fixes #13390 refactor generator tests to use block form of Tempfile Fix typo [ci skip] Move finish_template as the last public method in the generator Minor typos fix [ci skip] make `change_column_null` reversible. Closes #13576. create/drop test and development databases only if RAILS_ENV is nil Revert "Speedup String#to" typo fix in test name. [ci skip]. `core_ext/string/access.rb` test what we are documenting. Fix typo in image_tag documentation ... Conflicts: activerecord/lib/active_record/associations/join_dependency/join_association.rb activerecord/lib/active_record/relation/query_methods.rb