aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | | Merge pull request #29692 from fimmtiu/avoid-translating-non-database-exceptionsMatthew Draper2017-07-093-2/+31
|\ \ \ \ \ | | | | | | | | | | | | Don't translate non-database exceptions.
| * | | | | Remove driver-specific hard-coding in the tests.Dennis Taylor2017-07-071-9/+1
| | | | | |
| * | | | | Rename the StatementInvalid test method for clarity.Dennis Taylor2017-07-071-1/+1
| | | | | |
| * | | | | Fix changelog wording as suggested.Dennis Taylor2017-07-071-2/+2
| | | | | |
| * | | | | Use StandardError instead of RuntimeError.Dennis Taylor2017-07-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Whoops.
| * | | | | Fix indentation style for private method.Dennis Taylor2017-07-051-5/+5
| | | | | |
| * | | | | Don't translate non-database exceptions.Dennis Taylor2017-07-053-2/+39
| |/ / / / | | | | | | | | | | | | | | | The AbstractAdapter will translate all StandardErrors generated during the course of a query into ActiveRecord::StatementInvalids. Unfortunately, it'll also mangle non-database-related errors generated in ActiveSupport::Notification callbacks after the query has successfully completed. This should prevent it from translating errors from ActiveSupport::Notifications.
* | | | | Merge pull request #29297 from ↵Matthew Draper2017-07-093-3/+31
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | palkan/fix/action-cable-postgres-identifiers-limit Fix bug with long stream identifiers when using Postgres adapter
| * | | | | [Fix #28751] Hash stream long stream identifiers when using Postgres adapterpalkan2017-07-063-3/+31
| |/ / / /
* | | | | Merge pull request #29495 from eugeneius/_write_attributeMatthew Draper2017-07-096-13/+19
|\ \ \ \ \ | | | | | | | | | | | | Improve the performance of writing attributes
| * | | | | Rename raw_write_attribute to write_attribute_without_type_castEugene Kenny2017-07-073-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This name more accurately describes what the method does, and also disambiguates it from `_write_attribute`, which ignores aliases. We can also make the method private, since it's not public API and only called from one place - `update_columns` - without an explicit receiver.
| * | | | | Improve the performance of writing attributesEugene Kenny2017-06-184-8/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using a similar approach to 08576b94ad4f19dfc368619d7751e211d23dcad8, this change adds a new internal `_write_attribute` method which bypasses the code that checks for attribute aliases and custom primary keys. We can use this method instead of `write_attribute` when we know that we have the name of the actual column to be updated and not an alias. This makes writing an attribute with `attribute=` about 18% faster. Benchmark: ``` begin require "bundler/inline" rescue LoadError => e $stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler" raise e end gemfile(true) do source "https://rubygems.org" gem "rails", github: "rails/rails" gem "arel", github: "rails/arel" gem "sqlite3" gem "benchmark-ips" end require "active_record" ActiveRecord::Base.establish_connection(adapter: "sqlite3", database: ":memory:") ActiveRecord::Schema.define do create_table :posts, force: true do |t| end end class Post < ActiveRecord::Base end post = Post.new(id: 1) Benchmark.ips do |x| x.report("attribute=") { post.id = post.id + 1 } end ``` Before: Warming up -------------------------------------- attribute= 25.889k i/100ms Calculating ------------------------------------- attribute= 290.946k (± 3.1%) i/s - 1.476M in 5.077036s After: Warming up -------------------------------------- attribute= 30.056k i/100ms Calculating ------------------------------------- attribute= 345.088k (± 4.8%) i/s - 1.743M in 5.064264s
* | | | | | Merge pull request #29695 from y-yagi/secrets_showMatthew Draper2017-07-094-1/+22
|\ \ \ \ \ \ | | | | | | | | | | | | | | Add `rails secrets:show` command
| * | | | | | Add `rails secrets:show` commandyuuji.yaginuma2017-07-074-1/+22
| | |/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When secrets confirmed with the `secrets:edit` command, `secrets.yml.enc` will change without updating the secrets. Therefore, even if only want to check secrets, the difference will come out. This is a little inconvenient. In order to solve this problem, added the `secrets:show` command. If just want to check secrets, no difference will occur use this command.
* | | | | | Merge pull request #29705 from y-yagi/do_not_update_secrets_yml_encMatthew Draper2017-07-092-1/+21
|\ \ \ \ \ \ | | | | | | | | | | | | | | Do not update `secrets.yml.enc` when secretes do not change
| * | | | | | Do not update `secrets.yml.enc` when secretes do not changeyuuji.yaginuma2017-07-072-1/+21
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, if open a file with `secrets:edit` command, `secrets.yml.enc` will be changed even if its contents do not change. Therefore, even if only want to check secrets, the difference will come out. This is a little inconvenient. As a fix to the above problem, when content does not change, `secrets.yml.ecn` is fixed so that it is not changed.
* | | | | | Merge pull request #29706 from ↵Matthew Draper2017-07-092-2/+2
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | kamipo/use_information_schema_to_extract_expression Use `information_schema` to extract `generation_expression` for MariaDB
| * | | | | | Use `information_schema` to extract `generation_expression` for MariaDBRyuta Kamizono2017-07-072-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since MariaDB 10.2.5, `information_schema` supports Virtual Columns. Fixes #29670.
* | | | | | | Merge pull request #29708 from kamipo/fix_current_timestamp_for_mariadbMatthew Draper2017-07-091-2/+2
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Fix default `CURRENT_TIMESTAMP` in schema dumping for MariaDB 10.2
| * | | | | | | Fix default `CURRENT_TIMESTAMP` in schema dumping for MariaDB 10.2Ryuta Kamizono2017-07-071-2/+2
| |/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since MariaDB 10.2, `CURRENT_TIMESTAMP` is shown as a function (`current_timestamp()`). Fix matching column default to address that case. Fixes #29698.
* | | | | | | Merge pull request #29718 from ragesoss/masterRichard Schneeman2017-07-081-2/+20
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Clarify i18n guide for how pluralization rules work by default
| * | | | | | | Clarify i18n guide for how pluralization rules work by defaultSage Ross2017-07-071-2/+20
| | |_|_|/ / / | |/| | | | | | | | | | | | | | | | | | | The guide misleadingly indicates that the I18n gem will apply the CLDR pluralization rules for each language. This is not the case; only the English algorithm, with support for :zero, :one, and :other, is available by default. Locale-specific pluralization rules require additional configuration and must be supplied by the application (or by another gem).
* | | | | | | Don't call register on custom driverseileencodes2017-07-082-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's possible for developers toadd a custom driver and then call it using `driven_by`. Because we were only skipping `register` for `:rack_test` that meant any custom driver would attempt to be registered as well. The three listed here are special because Rails registers them with special options. If you're registering your own custom driver then you don't want to separately register that driver. Fixes #29688
* | | | | | | Merge pull request #29680 from ↵Eileen M. Uchitelle2017-07-081-2/+40
|\ \ \ \ \ \ \ | |/ / / / / / |/| | | | | | | | | | | | | | | | | | | | koic/update_default_app_files_in_app_generator_test Update default app files in app_generator_test
| * | | | | | Update default app files in app_generator_testKoichi ITO2017-07-061-2/+40
| | |/ / / / | |/| | | |
* | | | | | Merge pull request #29714 from jahfer/implement-errors-mergeRafael França2017-07-073-0/+28
|\ \ \ \ \ \ | | | | | | | | | | | | | | Add ActiveModel::Errors#merge!
| * | | | | | Add ActiveModel::Errors#merge!Jahfer Husain2017-07-073-0/+28
| | |/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ActiveModel::Errors#merge! allows ActiveModel::Errors to append errors from a separate ActiveModel::Errors instance onto their own. Example: person = Person.new person.errors.add(:name, :blank) errors = ActiveModel::Errors.new(Person.new) errors.add(:name, :invalid) person.errors.merge!(errors) puts person.errors.messages # => { name: ["can't be blank", "is invalid"] }
* / | | | | Test thor masterRafael Mendonça França2017-07-072-1/+8
|/ / / / /
* | | | | Merge pull request #29704 from kamipo/fix_mariadb_versionJeremy Daer2017-07-061-2/+6
|\ \ \ \ \ | |/ / / / |/| | | | Fix extracting MariaDB version
| * | | | Fix extracting MariaDB versionRyuta Kamizono2017-07-071-2/+6
|/ / / / | | | | | | | | | | | | | | | | | | | | Currently `version` method always returns `5.5.5` because the `full_version` is `5.5.5-10.x.y-MariaDB...` since MariaDB 10.x. It should be ignored if the prefix is `5.5.5-`.
* | | | Merge pull request #29662 from deivid-rodriguez/engine_multiple_mount_pointsRafael França2017-07-055-10/+112
|\ \ \ \ | | | | | | | | | | Allow mounting same engine under several locations
| * | | | Allow mounting same engine under several locationsDavid Rodríguez2017-07-055-10/+112
| | | | |
* | | | | Merge pull request #29676 from lugray/fix_date_time_serializeRafael França2017-07-052-0/+17
|\ \ \ \ \ | | | | | | | | | | | | Fix `ActiveModel::Type::DateTime#serialize`
| * | | | | Fix `ActiveModel::Type::DateTime#serialize`Lisa Ugray2017-07-052-0/+17
| |/ / / / | | | | | | | | | | | | | | | | | | | | `ActiveModel::Type::DateTime#serialize` should return a `Time` object so that finding by a datetime column works correctly.
* | | | | Merge pull request #28668 from Dorian/mention-time-parse-argument-errorAaron Patterson2017-07-052-1/+13
|\ \ \ \ \ | |/ / / / |/| | | | Mention Time.zone.parse possibly throwing ArgumentError
| * | | | Mention and test for possible ArgumentError when parsing timesDorian Marié2017-04-082-1/+13
| | | | |
* | | | | Merge pull request #29677 from eugeneius/parameters_configuration_testsRafael Mendonça França2017-07-051-0/+36
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | Fix Parameters configuration integration tests
| * | | | | Fix Parameters configuration integration testsEugene Kenny2017-07-041-0/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These tests relied on `ActionController::Parameters` being configured as part of the boot process; since that now happens lazily we need to force `ActionController::Base` to load so that we can test the behaviour. The new tests added here ensure that `ActionController::Parameters` can be configured from an initializer, which was broken until recently.
* | | | | | Force ActionController::Base lazy laod hooks to runRafael Mendonça França2017-07-051-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that the parameters configurations are only loaded when ActionController::Base is we need to foce them to load in our tests. In an application this is not needed since every request already load the controllers.
* | | | | | Merge pull request #29690 from kamipo/fix_warningsRafael França2017-07-051-2/+2
|\ \ \ \ \ \ | | | | | | | | | | | | | | Fix warning: `*' interpreted as argument prefix
| * | | | | | Fix warning: `*' interpreted as argument prefixRyuta Kamizono2017-07-061-2/+2
|/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ``` /Users/kamipo/src/github.com/rails/rails/activesupport/test/core_ext/module_test.rb:402: warning: `*' interpreted as argument prefix /Users/kamipo/src/github.com/rails/rails/activesupport/test/core_ext/module_test.rb:420: warning: `*' interpreted as argument prefix ```
* | | | | | Merge pull request #29687 from k3rni/private-prefixed-delegateMatthew Draper2017-07-062-1/+39
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | Return prefixed method names from `Module.delegate`, if using prefixes
| * | | | | | Use `map` in `delegate` so that actual prefixed method names are returned, ↵Krzysztof Zych2017-07-052-1/+40
|/ / / / / / | | | | | | | | | | | | | | | | | | if using prefix version.
* | | | | | Merge pull request #29413 from kamipo/fix_association_with_scope_including_joinsRafael França2017-07-049-70/+60
|\ \ \ \ \ \ | | | | | | | | | | | | | | Fix association with scope including joins
| * | | | | | Fix eager loading association with scope including joinsRyuta Kamizono2017-07-044-11/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes #28324.
| * | | | | | Fix preloading association with scope including joinsRyuta Kamizono2017-07-046-49/+32
| | | | | | |
| * | | | | | Remove unused `association_key` and `table` methods in `Preloader::Association`Ryuta Kamizono2017-07-041-10/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | These are no longer used since b98668decb9712f26118de57623fd15d7d28646d.
* | | | | | | Merge pull request #29667 from kamipo/add_missing_attr_name_to_sRafael França2017-07-041-2/+3
|\ \ \ \ \ \ \ | |_|/ / / / / |/| | | | | | Add missing `attr_name.to_s` in `AttributeMutationTracker`
| * | | | | | Add missing `attr_name.to_s` in `AttributeMutationTracker`Ryuta Kamizono2017-07-041-2/+3
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `attributes` (`values` in `LazyAttributeHash` in `AttributeSet`) has string keys, not symbols. Fixes #29665.
* | | | | | Fix endRafael Mendonça França2017-07-041-0/+1
| | | | | |