aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Add `as` to encode a request as a specific mime type.Kasper Timm Hansen2016-01-042-4/+122
| | | | | | | | | | | | | | | Turns ``` post articles_path(format: :json), params: { article: { name: 'Ahoy!' } }.to_json, headers: { 'Content-Type' => 'application/json' } ``` into ``` post articles_path, params: { article: { name: 'Ahoy!' } }, as: :json ```
* [ci skip] Space out framework names in USAGEKasper Timm Hansen2015-12-302-5/+5
| | | | | | Two USAGE files were referring to Active Record and Active Model without a space, which is incorrect because we're referring to the framework name and not the constants.
* [ci skip] Update rails/all.rb reference.Kasper Timm Hansen2015-12-301-9/+10
| | | | It didn't mention Action Cable's engine.
* Merge pull request #22855 from rafbm/avoid-time-parseRafael França2015-12-301-1/+1
|\ | | | | Avoid `Time.parse` for static date
| * Avoid `Time.parse` for static dateRafaël Blais Masson2015-12-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Benchmark.ips do |x| x.report('Time.parse') { Time.parse('2011-01-01') } x.report('Time.new') { Time.new(2011, 1, 1) } end Calculating ------------------------------------- Time.parse 6.640k i/100ms Time.new 15.082k i/100ms ------------------------------------------------- Time.parse 71.915k (± 3.1%) i/s - 365.200k Time.new 167.645k (± 3.3%) i/s - 844.592k
* | Add sass-rails back to the default GemfileRafael Mendonça França2015-12-302-0/+9
|/ | | | It was removed by mistake at 877a411d0c16baa4e670dae9a28f5cfcc201adc1
* Merge pull request #22848 from derekprior/dp-postgresql-versionRafael França2015-12-301-5/+5
|\ | | | | Make `postgresql_version` public
| * Make `postgresql_version` publicDerek Prior2015-12-301-5/+5
| | | | | | | | | | | | | | | | | | | | | | This is useful to libraries that want to feature gate based on the version of PostgreSQL the user is connected to. For instance, I want to know if the user is connected to a version of Postgres that supports concurrent materialized view refreshes. I could add that as a method on the adapter as a PR, but rails has no need for this itself. Rails is already using the postgresql_version for its own feature gating and this makes that possible for other libraries.
* | Merge pull request #22851 from prathamesh-sonpatki/fix-to-unsafe-h-testRafael França2015-12-301-2/+2
|\ \ | | | | | | Fix test for AC::Parameters#to_unsafe_h
| * | Fix test for AC::Parameters#to_unsafe_hPrathamesh Sonpatki2015-12-301-2/+2
| | | | | | | | | | | | - Test should call `to_unsafe_h` instead of `to_h`
* | | Merge pull request #22241 from kamipo/add_columns_for_distinct_for_mysql57Rafael França2015-12-303-5/+67
|\ \ \ | | | | | | | | Add `columns_for_distinct` for MySQL 5.7 with ONLY_FULL_GROUP_BY
| * | | Add `columns_for_distinct` for MySQL 5.7 with ONLY_FULL_GROUP_BYRyuta Kamizono2015-12-233-2/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In MySQL 5.7.5 and up, ONLY_FULL_GROUP_BY affects handling of queries that use DISTINCT and ORDER BY. It requires the ORDER BY columns in the select list for distinct queries, and requires that the ORDER BY include the distinct column. See https://dev.mysql.com/doc/refman/5.7/en/group-by-handling.html
| * | | Avoid `distinct` if a subquery has already materializedRyuta Kamizono2015-12-231-3/+5
| | | | | | | | | | | | | | | | Follow up to #19359 and avoid #22241.
* | | | Merge pull request #22447 from kamipo/fix_test_to_null_agnostic_wayRafael França2015-12-303-3/+14
|\| | | | |/ / |/| | Fix `test_find_with_order_on_included_associations_with_construct_finder_sql_for_association_limiting_and_is_distinct` to NULL-agnostic way
| * | Fix ↵Ryuta Kamizono2015-12-193-3/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `test_find_with_order_on_included_associations_with_construct_finder_sql_for_association_limiting_and_is_distinct` to NULL-agnostic way The sort order of NULL depends on the RDBS implementation. This commit is to fix the test to NULL-agnostic way. Example: ``` activerecord_unittest=# SELECT DISTINCT "posts"."id", author_addresses_authors.id AS alias_0 FROM "posts" LEFT OUTER JOIN "authors" ON "authors"."id" = "posts"."author_id" LEFT OUTER JOIN "author_addresses" ON "author_addresses"."id" = "authors"."author_address_id" LEFT OUTER JOIN "categorizations" ON "categorizations"."category_id" = "posts"."id" LEFT OUTER JOIN "authors" "authors_posts" ON "authors_posts"."id" = "categorizations"."author_id" LEFT OUTER JOIN "author_addresses" "author_addresses_authors" ON "author_addresses_authors"."id" = "authors_posts"."author_address_id" ORDER BY author_addresses_authors.id DESC; id | alias_0 ----+--------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 1 | 1 (12 rows) ``` ``` root@localhost [activerecord_unittest] > SELECT DISTINCT `posts`.`id`, author_addresses_authors.id AS alias_0 FROM `posts` LEFT OUTER JOIN `authors` ON `authors`.`id` = `posts`.`author_id` LEFT OUTER JOIN `author_addresses` ON `author_addresses`.`id` = `authors`.`author_address_id` LEFT OUTER JOIN `categorizations` ON `categorizations`.`category_id` = `posts`.`id` LEFT OUTER JOIN `authors` `authors_posts` ON `authors_posts`.`id` = `categorizations`.`author_id` LEFT OUTER JOIN `author_addresses` `author_addresses_authors` ON `author_addresses_authors`.`id` = `authors_posts`.`author_address_id` ORDER BY author_addresses_authors.id DESC; +----+---------+ | id | alias_0 | +----+---------+ | 1 | 1 | | 3 | NULL | | 1 | NULL | | 2 | NULL | | 4 | NULL | | 5 | NULL | | 6 | NULL | | 7 | NULL | | 8 | NULL | | 9 | NULL | | 10 | NULL | | 11 | NULL | +----+---------+ 12 rows in set (0.00 sec) ```
* | | Merge pull request #22829 from jcoyne/test_parametersYves Senn2015-12-303-1/+10
|\ \ \ | | | | | | | | TestController#parameters returns AC::Parameters
| * | | TestController#parameters returns AC::ParametersJustin Coyne2015-12-293-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes #22827 ActionView::TestCase::TestController#parameters should return an instance of ActionController::Parameters rather than a hash. This enables helper methods to use the correct interface.
* | | | Merge pull request #22844 from prathamesh-sonpatki/issue_22836Yves Senn2015-12-301-2/+2
|\ \ \ \ | | | | | | | | | | Fix documentation for configuring default_charset [ci skip]
| * | | | Fix documentation for configuring default_charset [ci skip]Prathamesh Sonpatki2015-12-301-2/+2
| | | | | | | | | | | | | | | | | | | | - Fixes #22836.
* | | | | Merge pull request #22842 from akshay-vishnoi/typo-fixYves Senn2015-12-301-1/+1
|\ \ \ \ \ | | | | | | | | | | | | Fix typo
| * | | | | Fix typoAkshay Vishnoi2015-12-301-1/+1
| | | | | |
* | | | | | Merge pull request #22843 from akshay-vishnoi/fix-release-5Yves Senn2015-12-301-3/+3
|\ \ \ \ \ \ | | | | | | | | | | | | | | [ci skip] Put all removals in its section
| * | | | | | [ci skip] Put all removals in its sectionAkshay Vishnoi2015-12-301-3/+3
| |/ / / / /
* | | | | | Merge pull request #22845 from yui-knk/remove_not_used_fixtureYves Senn2015-12-301-1/+0
|\ \ \ \ \ \ | |/ / / / / |/| | | | | Remove not used test fixture
| * | | | | Remove not used test fixtureyui-knk2015-12-301-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'actionmailer/test/mailers/async_mailer.rb' was deleted by f9da785d0b1b22317cfca25c15fb555e9016accb . This template is not used now.
* | | | | | Merge pull request #22803 from kamipo/improve_select_one_in_mysql2_adapterRafael França2015-12-302-27/+15
|\ \ \ \ \ \ | | | | | | | | | | | | | | Improve `select_one` in `Mysql2Adapter`
| * | | | | | Remove outdated commentRyuta Kamizono2015-12-271-28/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | These `select_*` methods improved already.
| * | | | | | Improve `select_one` in `Mysql2Adapter`Ryuta Kamizono2015-12-272-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Avoid instanciate `ActiveRecord::Result` and calling `ActiveRecord::Result#hash_rows` for the performance.
* | | | | | | Merge pull request #22547 from kamipo/fix_create_table_info_cacheRafael França2015-12-291-2/+6
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Correctly cache create_table_info
| * | | | | | | Correctly cache create_table_infoRyuta Kamizono2015-12-171-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Follow up to #21664.
* | | | | | | | Merge pull request #22830 from jcoyne/parameters_includeRichard Schneeman2015-12-293-1/+11
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | Add AC::Parameters#include?
| * | | | | | | | Add AC::Parameters#include?Justin Coyne2015-12-293-1/+11
| | |_|_|_|/ / / | |/| | | | | | | | | | | | | | | | | | | | | | Fixes #22818
* | | | | | | | Merge pull request #22831 from ↵Santiago Pastorino2015-12-292-3/+24
|\ \ \ \ \ \ \ \ | |/ / / / / / / |/| | | | | | | | | | | | | | | | | | | | | | | jmbejar/mime-negotiation-format-from-extension-fix Mime negotiation format from extension improvements
| * | | | | | | Format from Accept headers have higher precedence than path extension formatJorge Bejar2015-12-292-2/+11
| | | | | | | |
| * | | | | | | Rely on default Mime format when MimeNegotiation#format_from_path_extension ↵Jorge Bejar2015-12-292-3/+15
|/ / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | is not a valid type Closes #22747
* | | | | | | Merge pull request #22622 from akshay-vishnoi/range_format_fixKasper Timm Hansen2015-12-293-1/+31
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Fix - `to_s(:db)` in numeric range
| * | | | | | | Fix - to_s(:db) on Numeric rangeAkshay Vishnoi2015-12-293-1/+31
|/ / / / / / /
* | | | | | | Merge pull request #22824 from maclover7/add-numericwithformat-testsYves Senn2015-12-291-0/+6
|\ \ \ \ \ \ \ | |_|_|_|/ / / |/| | | | | | Add test coverage for ActiveSupport::NumericWithFormat#to_formatted_s
| * | | | | | Add test coverage for ActiveSupport::NumericWithFormat#to_formatted_sJon Moss2015-12-281-0/+6
| | |_|_|_|/ | |/| | | |
* | | | | | Merge pull request #22822 from maclover7/fix-22805Richard Schneeman2015-12-281-0/+1
|\ \ \ \ \ \ | | | | | | | | | | | | | | Add a missing require to ActiveSupport::NumericWithFormat
| * | | | | | Add a missing require to ActiveSupport::NumericWithFormatJon Moss2015-12-281-0/+1
| |/ / / / /
* | | | | | Merge pull request #22053 from Empact/first-loadedYves Senn2015-12-284-16/+76
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | Fix #first(limit) to take advantage of #loaded? records if available
| * | | | | | Fix `first(limit)` to take advantage of `loaded?` records if availableBen Woosley2015-12-243-8/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I realized that `first(2)`, etc. was unnecessarily querying for the records when they were already preloaded. This was because `find_nth_with_limit` can not know which `@records` to return because it conflates the `offset` and `index` into a single variable, while the `@records` only needs the `index` itself to select the proper record. Because `find_nth` and `find_nth_with_limit` are public methods, I instead introduced a private method `find_nth_with_limit_and_offset` which is called internally and handles the `loaded?` checking. Once the `offset` argument is removed from `find_nth`, `find_nth_with_limit_and_offset` can be collapsed into `find_nth_with_limit`, with `offset` always equal to `offset_index`.
| * | | | | | Deprecate passing `offset` to `find_nth`Ben Woosley2015-12-242-8/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All uses of the `offset` are passing `offset_index`. Better to push down the `offset` consideration into `find_nth`. This also works toward enabling `find_nth_with_limit` to take advantage of the `loaded?` state of the relation.
* | | | | | | tests, don't connect to mysql when running sqlite3 tests.Yves Senn2015-12-281-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This resolves the following error: ``` Error: TestAdapterWithInvalidConnection#test_inspect_on_Model_class_does_not_raise: TypeError: superclass mismatch for class Mysql2Adapter /Users/senny/Projects/rails/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb:35:in `<module:ConnectionAdapters>' /Users/senny/Projects/rails/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb:34:in `<module:ActiveRecord>' /Users/senny/Projects/rails/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb:6:in `<top (required)>' /Users/senny/Projects/rails/activesupport/lib/active_support/dependencies.rb:302:in `require' /Users/senny/Projects/rails/activesupport/lib/active_support/dependencies.rb:302:in `block in require' /Users/senny/Projects/rails/activesupport/lib/active_support/dependencies.rb:268:in `load_dependency' /Users/senny/Projects/rails/activesupport/lib/active_support/dependencies.rb:302:in `require' /Users/senny/Projects/rails/activerecord/lib/active_record/connection_adapters/connection_specification.rb:174:in `spec' /Users/senny/Projects/rails/activerecord/lib/active_record/connection_handling.rb:50:in `establish_connection' /Users/senny/Projects/rails/activerecord/test/cases/invalid_connection_test.rb:12:in `setup' ```
* | | | | | | Merge pull request #22809 from prathamesh-sonpatki/fix-broadcast-typoMatthew Draper2015-12-281-1/+1
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Removed extra "the" in the documentation of `broadcast_message` [ci skip]
| * | | | | | | Removed extra "the" in the documentation of `broadcast_message` [ci skip]Prathamesh Sonpatki2015-12-281-1/+1
|/ / / / / / /
* | | | | | | [ci skip] Fix typos in Active Support changelog.Kasper Timm Hansen2015-12-271-2/+2
| | | | | | | | | | | | | | | | | | | | | It's numeric and the framework is called Action Controller.
* | | | | | | Merge pull request #22771 from nwjsmith/document-broadcast-messagesEileen M. Uchitelle2015-12-271-1/+9
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Document `Logger#broadcast_messages` option
| * | | | | | | Document `Logger#broadcast_messages` optionNate Smith2015-12-231-1/+9
| | | | | | | |