aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Configure form_with_generates_remote_forms in its own initializerRafael Mendonça França2017-04-213-0/+61
| | | | | | | | | This configuration is not present in ActionView::Base so we can't let the action_view.set_configs initializer set it. Also add tests to make sure this config works. Fixes #28824
* Add test case to make sure we can implicit convert a Parameters to a HashRafael Mendonça França2017-04-201-0/+7
|
* Merge pull request #28432 from marksiemers/masterRafael França2017-04-201-1/+1
|\ | | | | Update 'Building Complex Forms' with `inverse_of`
| * Update 'Building Complex Forms' with `inverse_of`marksiemers2017-03-151-1/+1
| | | | | | If the example for complex forms is implemented, ActiveRecord will prevent saving unless `inverse_of: :person` is added to the `has_many :addresses` association.
* | Merge pull request #28818 from y-yagi/add_requireRafael França2017-04-201-0/+1
|\ \ | | | | | | Add missing require
| * | Add missing requireyuuji.yaginuma2017-04-211-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Without this, unit test fails. ``` bundle exec ruby -w -Ilib:lib:test test/cases/logging_test.rb Using inline Run options: --seed 41246 # Running: SE......S.... Finished in 0.052938s, 245.5696 runs/s, 831.1585 assertions/s. 1) Error: LoggingTest#test_job_error_logging: NameError: uninitialized constant LoggingTest::RescueJob test/cases/logging_test.rb:130:in `rescue in test_job_error_logging' test/cases/logging_test.rb:129:in `test_job_error_logging' 13 runs, 44 assertions, 0 failures, 1 errors, 2 skips You have skipped tests. Run with --verbose for details. ```
* | | Merge pull request #28596 from betesh/fix-double-habtm-insertRafael Mendonça França2017-04-203-0/+32
|\ \ \ | | | | | | | | | | | | Fix #24032
| * | | Don't attempt to create a new record that was already created.Isaac Betesh2017-04-203-0/+32
|/ / / | | | | | | | | | Fixes #24032
* | | Merge pull request #28640 from kamipo/prevent_double_firing_before_save_callbackRafael França2017-04-205-54/+70
|\ \ \ | |/ / |/| | Prevent double firing the before save callback of new object when the parent association saved in the callback
| * | Prevent double firing the before save callback of new object when the parent ↵Ryuta Kamizono2017-04-215-54/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | association saved in the callback Related #18155, #26661, 268a5bb, #27434, #27442, and #28599. Originally #18155 was introduced for preventing double insertion caused by the after save callback. But it was caused the before save issue (#26661). 268a5bb fixed #26661, but it was caused the performance regression (#27434). #27442 added new record to `target` before calling callbacks for fixing #27434. But it was caused double firing before save callback (#28599). We cannot add new object to `target` before saving the object. This is improving #18155 to only track callbacks after `save`. Fixes #28599.
* | | Add commaJon Moss2017-04-201-1/+1
|/ / | | | | | | [ci skip]
* | Merge pull request #28681 from runephilosof/fix-mysql-grantRafael Mendonça França2017-04-203-2/+6
|\ \ | | | | | | | | | Fix quoting in db:create grant all statement.
| * | Fix quoting in db:create grant all statement.Rune Schjellerup Philosof2017-04-203-2/+6
| | | | | | | | | | | | | | | | | | The database name used in the test would have actually shown this if it had tried to execute on a real Mysql instead of being stubbed out (dashes in database names needs quotes).
* | | Merge pull request #28582 from sbull/activejob-error-loggingRafael França2017-04-205-4/+26
|\ \ \ | | | | | | | | Add error logging to Active Job
| * | | Add error logging to Active JobSteven Bull2017-03-275-4/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Active Job logging instrumentation is changed to log errors (with backtrace) when a job raises an exception in #perform. This improves debugging during development and test with the default configuration. Prior to Rails 5, the default development configuration ran jobs with InlineAdapter, which would raise exceptions to the caller and be shown in the development log. In Rails 5, the default adapter was changed to AsyncAdapter, which would silently swallow exceptions and log a "Performed SomeJob from Async..." info message. This could be confusing to a developer, as it would seem that the job was performed successfully. This patch removes the "Performed..." info message from the log and adds an error-level "Error performing SomeJob..." log message which includes the exception backtrace for jobs that raise an exception within the #perform method. It provides this behavior for all adapters.
* | | | Merge pull request #28815 from joshnuss/fix/hash-from-xml-nokogiriRafael França2017-04-205-13/+9
|\ \ \ \ | | | | | | | | | | Fixes Hash.from_xml with frozen strings for all engines
| * | | | Fixes Hash.from_xml with frozen strings for all backendsJosh Nussbaum2017-04-205-13/+9
|/ / / /
* | | | Merge pull request #28814 from halfbyte/fix_error_pages_for_turbolinksRafael França2017-04-204-18/+25
|\ \ \ \ | | | | | | | | | | Namespace CSS selectors on error pages
| * | | | Namespace CSS selectors on error pagesJan Krutisch2017-04-204-18/+25
|/ / / / | | | | | | | | | | | | The css selectors on the generated error pages are too broad (for example `text-align: center` on `body` and thus bleed out to the following pages (say, by pressing the back button) when using Turbolinks. This commit namespaces all the selectors.
* | | | Merge pull request #28807 from oiorain/oiorain-callbackChain-commentKasper Timm Hansen2017-04-201-1/+0
|\ \ \ \ | | | | | | | | | | Remove outdated comment
| * | | | Remove outdated commentMarion Bouguet2017-04-201-1/+0
|/ / / / | | | | | | | | Since 3aee9126aa6309538ee64064dcabcd34d7cc7d26, this class hasn't inherited from Array.
* | | | Merge pull request #28733 from kamipo/dont_fallback_to_utf8mb3_after_mysql_8.0.0Rafael França2017-04-193-10/+12
|\ \ \ \ | | | | | | | | | | Don't fallback to utf8mb3 after MySQL 8.0.0
| * | | | Don't fallback to utf8mb3 after MySQL 8.0.0Ryuta Kamizono2017-04-173-10/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `internal_string_options_for_primary_key` is used for creating internal tables in newly apps. But it is no longer needed after MySQL 8.0.0. MySQL 5.7 has introduced `innodb_default_row_format` (default `DYNAMIC`) and has deprecated `innodb_large_prefix` and `innodb_file_format`. The purpose of the deprecated options was for compatibility with earlier versions of InnoDB. https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_large_prefix > innodb_large_prefix is deprecated and will be removed in a future release. innodb_large_prefix was introduced in MySQL 5.5 to disable large index key prefixes for compatibility with earlier versions of InnoDB that do not support large index key prefixes. https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_file_format > The innodb_file_format option is deprecated and will be removed in a future release. The purpose of the innodb_file_format option was to allow users to downgrade to the built-in version of InnoDB in MySQL 5.1. Now that MySQL 5.1 has reached the end of its product lifecycle, downgrade support provided by this option is no longer necessary. The deprecated options has removed in MySQL 8.0.0. It is no longer needed to take care newly created internal tables as a legacy format after MySQL 8.0.0. Fixes #28730.
* | | | | Merge pull request #28776 from kamipo/respect_limit_for_cache_keyRafael França2017-04-192-8/+44
|\ \ \ \ \ | | | | | | | | | | | | `cache_key` respects the limit in a relation even if a relation is not loaded
| * | | | | `cache_key` respects the limit in a relation even if a relation is not loadedRyuta Kamizono2017-04-172-8/+44
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | `cache_key` includes the size of a relation. But if a relation is not loadded, the size is not respected even if a relation has a limit. It should be respected for consistency.
* | | | | Merge pull request #28708 from y-yagi/dont_generate_system_test_filesRafael França2017-04-192-0/+15
|\ \ \ \ \ | | | | | | | | | | | | Don't generate system test files if `skip_system_test` option is specified
| * | | | | Don't generate system test files if `skip_system_test` option is specifiedyuuji.yaginuma2017-04-122-0/+15
| | | | | |
* | | | | | Fix all style guides violationsRafael Mendonça França2017-04-1919-33/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Closes #28382 Closes #28651
* | | | | | Use released sass-rails instead of master versionRafael Mendonça França2017-04-191-1/+1
| | | | | |
* | | | | | Merge pull request #28757 from edwardmp/log-actioncable-write-read-errorsRafael França2017-04-192-1/+8
|\ \ \ \ \ \ | | | | | | | | | | | | | | Log any write errors originating from the socket
| * | | | | | Log any errors originating from the socketedwardmp2017-04-162-1/+8
| | | | | | |
* | | | | | | Merge pull request #28166 from bogdanvlviv/fix_migration_tasksRafael França2017-04-193-6/+78
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Fix migration tasks
| * | | | | | | Add additional raise UnknownMigrationVersionErrorbogdanvlviv2017-04-193-6/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Raise error on the movement of migrations when the current migration does not exist.
| * | | | | | | Fix `bin/rails db:forward` first migrationbogdanvlviv2017-04-193-1/+36
| | | | | | | |
* | | | | | | | Merge pull request #28800 from Shopify/deprecation_includes_gem_name_and_versionRafael França2017-04-195-16/+56
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | Include gem name and deprecation horizon when calling the deprecation behaviors
| * | | | | | | | Send deprecation horizon and gem name as arguments to deprecation heavier ↵Willem van Bergen2017-04-195-16/+56
| |/ / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | handler, and make sure they are used for the ActiveSupport::Notifications message.
* | | | | | | | Merge pull request #28734 from rafaelfranca/strong-parametersRafael França2017-04-1912-91/+168
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | Improve the upgrade path of Strong Parameters
| * | | | | | | | Reuse the Parameters#to_h check in the routing helpersRafael Mendonça França2017-04-1810-39/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since this protection is now in Parameters we can use it instead of reimplementing again.
| * | | | | | | | Follow the style guide rules in the documetationRafael Mendonça França2017-04-181-30/+30
| | | | | | | | |
| * | | | | | | | Improve documentationRafael Mendonça França2017-04-181-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We are talking about a list of parameters even so we need to use plural. Even if we were talking about the instance of the Parameters object we would have to use the capital and monospaced font.
| * | | | | | | | Implement ActionController::Parameters#to_query and #to_paramRafael Mendonça França2017-04-182-5/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously it was raising an error because it may be unsafe to use those methods in a unpermitted parameter. Now we delegate to to_h that already raise an error when the Parameters instance is not permitted. This also fix a bug when using `#to_query` in a hash that contains a `ActionController::Parameters` instance and was returning the name of the class in the string.
| * | | | | | | | Use the right assetions to better error messagesRafael Mendonça França2017-04-181-7/+7
| | | | | | | | |
| * | | | | | | | Add test to make sure that to_unsafe_h don't mutate the targetRafael Mendonça França2017-04-181-0/+10
| | | | | | | | |
| * | | | | | | | Add ActionController::Parameters#to_hash to implict conversionRafael Mendonça França2017-04-182-0/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now methods that implicit convert objects to a hash will be able to work without requiring the users to change their implementation. This method will return a Hash instead of a HashWithIndefirentAccess to mimic the same implementation of HashWithIndefirentAccess#to_hash.
| * | | | | | | | Raise exception when calling to_h in a unfiltered ParametersRafael Mendonça França2017-04-182-17/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before we returned either an empty hash or only the always permitted parameters (:controller and :action by default). The previous behavior was dangerous because in order to get the attributes users usually fallback to use to_unsafe_h that could potentially introduce security issues. The to_unsafe_h API is also not good since Parameters is a object that quacks like a Hash but not in all cases since to_h would return an empty hash and users were forced to check if to_unsafe_h is defined or if the instance is a ActionController::Parameters in order to work with it. This end up coupling a lot of libraries and parts of the application with something that is from the controller layer.
| * | | | | | | | Test the correct objectRafael Mendonça França2017-04-181-1/+1
| | | | | | | | |
* | | | | | | | | Reword sentenceJon Moss2017-04-191-3/+3
| |/ / / / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sentence had some awkward grammar and was kind of confusing, tried to make it easier to understand what it was trying to say :) [ci skip]
* | | | | | | | Merge branch 'master' of github.com:rails/docrailsVijay Dev2017-04-191-1/+1
|\ \ \ \ \ \ \ \
| * | | | | | | | [ci skip] Change ++ by markdown quotesMikhail Dieterle2017-04-081-1/+1
| | | | | | | | |
* | | | | | | | | Merge pull request #28794 from vishalzambre/activerecord-guidRafael França2017-04-191-5/+5
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | [ci skip] Changed plain text to NOTE.