aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/adapters/sqlite3/sqlite3_adapter_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Extract `data_source_sql` to refactor data source statementsRyuta Kamizono2017-02-201-4/+2
|
* Deprecate passing `name` to `indexes` like `tables`Ryuta Kamizono2017-01-041-1/+1
| | | | | Passing `name` to `tables` is already deprecated at #21601. Passing `name` to `indexes` is also unused.
* `#tables` and `#table_exists?` and returns only tables and not viewsRafael Mendonça França2016-12-291-7/+5
|
* Remove deprecated `name` argument from `#tables`Rafael Mendonça França2016-12-291-3/+1
|
* Add more rubocop rules about whitespacesRafael Mendonça França2016-10-291-1/+1
|
* Fix broken heredoc indentation caused by rubocop auto-correctRyuta Kamizono2016-09-031-3/+3
| | | | | | All indentation was normalized by rubocop auto-correct at 80e66cc4d90bf8c15d1a5f6e3152e90147f00772. But heredocs was still kept absolute position. This commit aligns heredocs indentation for consistency.
* Add three new rubocop rulesRafael Mendonça França2016-08-161-1/+1
| | | | | | | | Style/SpaceBeforeBlockBraces Style/SpaceInsideBlockBraces Style/SpaceInsideHashLiteralBraces Fix all violations in the repository.
* applies remaining conventions across the projectXavier Noria2016-08-061-1/+1
|
* normalizes indentation and whitespace across the projectXavier Noria2016-08-061-12/+12
|
* applies new string literal convention in activerecord/testXavier Noria2016-08-061-78/+78
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Deprecate `{insert|update|delete}_sql` in `DatabaseStatements`Ryuta Kamizono2016-03-021-15/+3
| | | | | Originally, `{insert|update|delete}_sql` is protected methods. We can use the `{insert|update|delete}` public methods instead.
* Remove duplicated composite primary key testsRyuta Kamizono2016-02-011-8/+0
|
* :speak_no_evil: :warning:Akira Matsuda2016-02-011-1/+3
|
* `substitute_at` is no longer usedRyuta Kamizono2016-01-141-5/+0
| | | | Arel handles substitution for bind parameters by now.
* Deprecate `#table_exists?`, `#tables` and passing arguments to `#talbes`yui-knk2015-11-091-4/+8
| | | | | | | | | | Reported on #21509, how views is treated by `#tables` are differ by each adapters. To fix this different behavior, after Rails 5.0 is released, deprecate `#tables`. And `#table_exists?` would check both tables and views. To make their behavior consistent with `#tables`, after Rails 5.0 is released, deprecate `#table_exists?`.
* Remove `#tables` extra args againRyuta Kamizono2015-10-221-3/+2
| | | | | | This issue was resolved by #21687 already. But re-add args by #18856. `#tables` extra args was only using by `#table_exists?`. This is for internal API. This commit will remove these extra args again.
* Removed mocha from Active Record Part 1Ronak Jangir2015-08-251-7/+10
|
* make it possible to run AR tests with bin/testYves Senn2015-06-111-1/+1
|
* Add collation support for string and text columns in SQLite3Akshay Vishnoi2015-05-281-4/+4
|
* Closes rails/rails#18864: Renaming transactional fixtures to transactional testsBrandon Weiss2015-03-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | I’m renaming all instances of `use_transcational_fixtures` to `use_transactional_tests` and “transactional fixtures” to “transactional tests”. I’m deprecating `use_transactional_fixtures=`. So anyone who is explicitly setting this will get a warning telling them to use `use_transactional_tests=` instead. I’m maintaining backwards compatibility—both forms will work. `use_transactional_tests` will check to see if `use_transactional_fixtures` is set and use that, otherwise it will use itself. But because `use_transactional_tests` is a class attribute (created with `class_attribute`) this requires a little bit of hoop jumping. The writer method that `class_attribute` generates defines a new reader method that return the value being set. Which means we can’t set the default of `true` using `use_transactional_tests=` as was done previously because that won’t take into account anyone using `use_transactional_fixtures`. Instead I defined the reader method manually and it checks `use_transactional_fixtures`. If it was set then it should be used, otherwise it should return the default, which is `true`. If someone uses `use_transactional_tests=` then it will overwrite the backwards-compatible method with whatever they set.
* Prefer `drop_table if_exists: true` over raw SQLRyuta Kamizono2015-02-181-1/+1
| | | | | Lowercase raw SQL has been replaced by 07b659c already. This commit replaces everything else of raw SQL.
* prefer `drop_table if_exists: true` over raw SQL.Yves Senn2015-02-181-1/+1
| | | | | | | /cc @yahonda This makes it easier for third party adapters to run our tests, even if that database does not support IF EXISTS.
* Removed magic comments # encoding: utf-8 , since its default from ruby 2.0 ↵Vipul A M2015-02-031-1/+0
| | | | onwards.
* Remove Relation#bind_paramsSean Griffin2015-01-271-5/+3
| | | | | | | | `bound_attributes` is now used universally across the board, removing the need for the conversion layer. These changes are mostly mechanical, with the exception of the log subscriber. Additional, we had to implement `hash` on the attribute objects, so they could be used as a key for query caching.
* Ensures that primary_key method will return nil when multi-pkArthur Neves2014-12-301-0/+6
| | | | | | | When table has a composite primary key, the `primary_key` method for sqlite3 and postgresql was only returning the first field of the key. Ensures that it will return nil instead, as AR dont support composite pks.
* Pass symbol as an argument instead of a blockErik Michaels-Ober2014-11-291-4/+4
|
* Remove the unused second argument to `substitute_at`Sean Griffin2014-11-171-1/+1
| | | | Oh hey, we got to remove some code because of that!
* rm `reorder_bind_params`Sean Griffin2014-11-171-1/+1
| | | | | | Arel handles this for us automatically. Updated tests, as BindParam is no longer a subclass of SqlLiteral. We should remove the second argument to substitute_at entirely, as it's no longer used
* Merge pull request #14056 from girishso/14041Yves Senn2014-09-091-2/+2
|\ | | | | | | | | | | | | SQLite3Adapter now checks for views in table_exists? fixes: 14041 Conflicts: activerecord/CHANGELOG.md
| * SQLite3Adapter now checks for views in table_exists? fixes: 14041Girish S2014-02-141-0/+10
| |
* | Change back occurrences of SQLite(3) to sqlite3 when referring to theZachary Scott2014-07-061-5/+6
| | | | | | | | adapter, fixed from #16057 [ci skip]
* | [ci skip] /sqlite/i --> SQLiteAkshay Vishnoi2014-07-061-2/+2
| |
* | Don't type cast the default on the columnSean Griffin2014-06-171-1/+1
| | | | | | | | | | | | | | If we want to have type decorators mess with the attribute, but not the column, we need to stop type casting on the column. Where possible, we changed the tests to test the value of `column_defaults`, which is public API. `Column#default` is not.
* | 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-071-168/+199
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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] ...
| * | Revise 'sqlite3:' URL handling for smoother upgradesMatthew Draper2014-04-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Restore the 4.0 behaviour for 'sqlite3:///', but deprecate it. We'll change to the absolute-path interpretation in 4.2. The current "correct" spellings for in-memory, relative, and absolute URLs, respectively, are: sqlite3::memory: sqlite3:relative/path sqlite3:/full/path Substantially reverses/defers fbb79b517f3127ba620fedd01849f9628b78d6ce. Uncovered by @guilleiguaran while investigating #14495, though that sounds like a different issue.
| * | Refactor test to use DdlHelper.Guo Xiang Tan2014-03-291-166/+197
| | | | | | | | | | | | | | | | | | | | | 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.
| * | Fix tests not unsubscribing from Notifications.Guo Xiang Tan2014-03-281-2/+2
| | | | | | | | | | | | See https://github.com/rails/rails/blob/master/activesupport/lib/active_support/notifications.rb#L131
* | | Merge branch 'master' into adequaterecordAaron Patterson2014-02-171-7/+3
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
| |/
| * "string" isn't a valid column type for ActiveRecordAaron Patterson2014-01-141-1/+1
| | | | | | | | | | Conflicts: activerecord/test/cases/adapters/sqlite3/sqlite3_adapter_test.rb
* | 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-111-11/+52
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
| * Raise NoDatabaseError when db does not existschneems2013-12-241-0/+7
| | | | | | Building on the work of #13427 this PR adds a helpful error message to the adapters: mysql, mysql2, and sqlite3
| * fix url connections for sqlite3Aaron Patterson2013-12-201-0/+22
| |
| * stop adding singleton methods to the SQLite3 connectionAaron Patterson2013-10-041-11/+11
| |
| * Define enable_extension method to prevent undefined method errorAntonio Santos2013-08-021-0/+12
| | | | | | | | | | | | | | When mixing postgresql and another adapter like sqlite3 (for dev and test respectively), the task `db:test:prepare` will fail due to the `enable_extension` method not being defined in the abstract adapter. This patch simply adds an empty definition to prevent it.