aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | | | | | | | introduce `conn.data_source_exists?` and `conn.data_sources`.Yves Senn2015-09-2216-34/+108
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These new methods are used from the Active Record model layer to determine which relations are viable to back a model. These new methods allow us to change `conn.tables` in the future to only return tables and no views. Same for `conn.table_exists?`. The goal is to provide the following introspection methods on the connection: * `tables` * `table_exists?` * `views` * `view_exists?` * `data_sources` (views + tables) * `data_source_exists?` (views + tables)
* | | | | | | | | | | Merge pull request #21718 from thiagoaugusto/patch-4Rafael Mendonça França2015-09-221-2/+2
|\ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Update i18n.md [ci skip]
| * | | | | | | | | | | Update i18n.md [ci skip]Thiago Augusto2015-09-221-2/+2
|/ / / / / / / / / / /
* | | | | | | | | | | Remove unneeded generator variable.Kasper Timm Hansen2015-09-221-1/+0
| | | | | | | | | | |
* | | | | | | | | | | Merge pull request #21356 from ronakjangir47/remove_mocha_railtiesKasper Timm Hansen2015-09-222-15/+35
|\ \ \ \ \ \ \ \ \ \ \ | |_|_|/ / / / / / / / |/| | | | | | | | | | Removed mocha from Railites PluginGeneratorTest
| * | | | | | | | | | Removed mocha from Railites PluginGeneratorTestRonak Jangir2015-09-222-15/+35
| | | | | | | | | | |
* | | | | | | | | | | tests, use `if_exists: true` instead of `rescue nil`.Yves Senn2015-09-221-1/+1
| | | | | | | | | | |
* | | | | | | | | | | AMo typosAkira Matsuda2015-09-222-3/+3
|/ / / / / / / / / /
* | | | | | | | | | Merge pull request #21714 from thiagoaugusto/patch-2Richard Schneeman2015-09-221-2/+2
|\ \ \ \ \ \ \ \ \ \ | |/ / / / / / / / / |/| | | | | | | | | Update routing.md
| * | | | | | | | | Update routing.mdThiago Augusto2015-09-221-2/+2
|/ / / / / / / / /
* | | | | | | | | fix `bin/test -a sqlite3_mem`.Yves Senn2015-09-221-19/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We should not run MysqlAdapter tests when running with `sqlite3_mem`. This also moves the test-case outside the MysqlAdapter namespace. This will prevent the following error when running everything: ``` 1) Error: TestAdapterWithInvalidConnection#test_inspect_on_Model_class_does_not_raise: TypeError: superclass mismatch for class MysqlAdapter ```
* | | | | | | | | Merge pull request #20569 from theSteveMitchell/masterYves Senn2015-09-223-15/+31
|\ \ \ \ \ \ \ \ \ | |_|/ / / / / / / |/| | | | | | | | | | | | | | | | | Check mysql structure_load for errors
| * | | | | | | | Check response of structure_load for mysql_database_tasks and make ↵Steve Mitchell2015-09-182-12/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | structure_dump consistent
* | | | | | | | | Merge pull request #21712 from amitsuroliya/html_fixYves Senn2015-09-221-2/+2
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | Correcting output of `file_field` with `multiple` attribute option [ci skip]
| * | | | | | | | | Correcting output of `file_field` with `multiple` attribute option [ci skip]amitkumarsuroliya2015-09-221-2/+2
| | | | | | | | | |
* | | | | | | | | | Merge pull request #21678 from ronakjangir47/array_to_formatted_s_docsYves Senn2015-09-221-1/+3
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | Added Examples in docs for internal behavior of Array#to_formatted_s [ci skip]
| * | | | | | | | | | Added Examples in docs for internal behavior of Array#to_formatted_s [ci skip]Ronak Jangir2015-09-191-1/+3
| | | | | | | | | | |
* | | | | | | | | | | Merge pull request #21710 from amitsuroliya/correct_resultClaudio B.2015-09-212-2/+2
|\ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Correcting output of `number_to_percentage` example in `number_helper…
| * | | | | | | | | | | Correcting output of `number_to_percentage` example in `number_helper` [ci skip]amitkumarsuroliya2015-09-222-2/+2
| | |/ / / / / / / / / | |/| | | | | | | | | | | | | | | | | | | | Here is correct output of `number_to_percentage(100, format: "%n %”)`
* | | | | | | | | | | Merge pull request #21711 from JuanitoFatas/doc/typo-1Robin Dupret2015-09-221-1/+1
|\ \ \ \ \ \ \ \ \ \ \ | |/ / / / / / / / / / |/| | | | | | | | | | Fix a typo: Mime::Types should be Mime::Type [ci skip]
| * | | | | | | | | | Fix a typo: Mime::Types should be Mime::Type [ci skip]Juanito Fatas2015-09-221-1/+1
|/ / / / / / / / / /
* | | | | | | | | | Merge pull request #21703 from ronakjangir47/redirect_error_messagesJeremy Daer2015-09-211-2/+4
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | Added assertion for error messages for redirection to nil and params
| * | | | | | | | | | Added assertion for error messages for redirection to nil and params Ronak Jangir2015-09-211-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As both `redirect_to_nil` and `redirect_to_params` are raising same `ActionController::ActionControllerError` so it’s good to assert error messages as well
* | | | | | | | | | | drop array allocations on Mime::Type#=~Aaron Patterson2015-09-211-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Synonyms are always a list of strings, and we have access to the internal string representation, so we can avoid allocating new arrays.
* | | | | | | | | | | remove another `blank?` callAaron Patterson2015-09-211-1/+1
| | | | | | | | | | |
* | | | | | | | | | | remove html_types setAaron Patterson2015-09-212-7/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that `all` has it's own object, we don't need the html_types Set.
* | | | | | | | | | | compare arrays not set objects.Aaron Patterson2015-09-211-3/+3
| | | | | | | | | | |
* | | | | | | | | | | introduce an `All` mime typeAaron Patterson2015-09-213-3/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This class gives us the `all?` predicate method that returns true without hitting method missing
* | | | | | | | | | | remove `blank?` calls on `==`Aaron Patterson2015-09-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since Mime::Type implements `method_missing`, and `blank?` triggers it's positive branch: https://github.com/rails/rails/blob/f9dda1567ea8d5b27bd9d66ac5a8b43dc67a6b7e/actionpack/lib/action_dispatch/http/mime_type.rb#L342 We should stop calling `blank?`.
* | | | | | | | | | | change inheritance to compositionAaron Patterson2015-09-212-16/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changes `Mimes` to compose a set rather than inherit from array. With this change we don't need to define as many methods, so ISEQ memory is saved. Also it is clear which methods break the set cache.
* | | | | | | | | | | update changelog for mime changesAaron Patterson2015-09-211-0/+13
| | | | | | | | | | |
* | | | | | | | | | | swap upcase and to_symAaron Patterson2015-09-211-1/+1
| | | | | | | | | | |
* | | | | | | | | | | stop calling deprecated methodsAaron Patterson2015-09-2122-93/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We should be asking the mime type method for the mime objects rather than via const lookup
* | | | | | | | | | | deprecate accessing mime types via constantsAaron Patterson2015-09-214-42/+92
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We don't want to manage a list of constants on `Mime::`. Managing constants is strange because it will break method caches, not to mention looking up by a constant could cause troubles. For example suppose there is a top level constant `HTML`, but nobody registers the HTML mime type and someone accesses `Mime::HTML`. Instead of getting an error about how the mime type doesn't exist, instead you'll get the top level constant. So, instead of directly accessing the constants, change this: Mime::HTML To this: Mime::Type[:HTML]
* | | | | | | | | | | cache the new type object on the stackAaron Patterson2015-09-211-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now we don't have to look it up with a `const_get`.
* | | | | | | | | | | Merge pull request #21704 from ronakjangir47/eliminate_testsAndrew White2015-09-211-8/+0
|\ \ \ \ \ \ \ \ \ \ \ | |_|_|_|/ / / / / / / |/| | | | | | | | | | Eliminate `test_tables_quoting` following seems to be left in #21687
| * | | | | | | | | | Eliminate `test_tables_quoting` following seems to be left in #21687Ronak Jangir2015-09-211-8/+0
|/ / / / / / / / / /
* | | | | | | | | | Skip the test added in 9cc324a on buggy versions of SQliteSean Griffin2015-09-212-17/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | See 7dcfc25e7c52682a4343c2ba7188a69e7c06c936 for more details
* | | | | | | | | | Ensure aliased attributes passed to `select` are quoted if using `from`Sean Griffin2015-09-214-1/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes #21488 [Sean Griffin & johanlunds]
* | | | | | | | | | Fix another implicit dependency of the AM test suiteSean Griffin2015-09-211-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Hopefully this is the last one
* | | | | | | | | | Require dependencies from stdlib in the Decimal typeSean Griffin2015-09-211-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In Active Record, it appears these were either autoloaded, which actually was likely due to test ordering since the method `Float#to_d` wouldn't trigger it. This makes it explicit, and unlikely to fail in the future.
* | | | | | | | | | We still need the `Helpers` constant in the `ActiveRecord` namespaceSean Griffin2015-09-211-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We should probably review the usage of these constants and decide whether we want to be more transparent about which things come from Active Model vs Active Record, as this is meaningful information as to whether there is database specific behavior or not.
* | | | | | | | | | Remove no-op options being passed in AM type registrationsSean Griffin2015-09-211-11/+11
|/ / / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `override` option is only a thing for Active Record registrations. We should figure out how to make this properly error out without doing anything too weird to the code.
* | | | | | | | | Merge pull request #21533Sean Griffin2015-09-2142-426/+655
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move ActiveRecord::Type to ActiveModel The intention has always been to move the attributes API off of Active Record and onto Active Model. This is the first step in that transition. This merges the pull request (which has been squashed and rebased), with various changes to the code to get the quality to a level which is acceptable to merge. Close #21533
| * | | | | | | | | Move the appropriate type tests to the Active Model suiteSean Griffin2015-09-219-225/+263
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Any tests for a type which is not overridden by Active Record, and does not test the specifics of the attributes API interacting in more complex ways have no reason to be in the Active Record suite. Doing this revealed that the implementation of the date and time types in AM was actually completely broken, and incapable of returning any value other than `nil`.
| * | | | | | | | | Simplify the implementation of Active Model's type registrySean Griffin2015-09-213-103/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Things like decorations, overrides, and priorities only matter for Active Record, so the Active Model registry can be implemented much more simply. At this point, I wonder if having Active Record's registry inherit from Active Model's is even worth the trouble? The Active Model class was also missing test cases, which have been backfilled. This removes the error when two types are registered with the same name, but given that Active Model is meant to be significantly more generic, I do not think this is an issue for now. If we want, we can raise an error at the point that someone tries to register it.
| * | | | | | | | | Various stylistic nitpicksSean Griffin2015-09-217-46/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We do not need to require each file from AM individually, the type module does that for us. Even if the classes are extremely small right now, I'd rather keep any custom classes needed by AR in their own files, as they can easily have more complex changes in the future.
| * | | | | | | | | `TypeMap` and `HashLookupTypeMap` shouldn't be in Active ModelSean Griffin2015-09-214-8/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These are used by the connection adapters to convert SQL type information into the appropriate type object, and makes no sense outside of the context of Active Record
| * | | | | | | | | Move ActiveRecord::Type to ActiveModelKir Shatrov2015-09-2131-96/+336
|/ / / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | The first step of bringing typecasting to ActiveModel
* | | | | | | | | Merge pull request #21612 from ronakjangir47/remove_unused_paramsSean Griffin2015-09-211-2/+2
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | Removed unused parameter `options` for `register_detail` method