aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | | | | | | | | | | | Revert "Switch `has_secure_token` to `before_save`."Kasper Timm Hansen2016-01-091-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Mistakenly interpreted the test case as a sign that we should switch to before_save, when the original pitch use case was intended as before_create. Revert a3ab6ad00872d24d4d87637f93fdae798d0edc79.
* | | | | | | | | | | | | | Switch `has_secure_token` to `before_save`.Kasper Timm Hansen2016-01-091-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adding `if` and `unless` support doesn't bode well if the callback to assign a token only runs on create. Switch to `before_save`, but keep the conditional so that no token already assigned is overriden.
* | | | | | | | | | | | | | Add conditional_token to users.Kasper Timm Hansen2016-01-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix the NoMethodErrors introduced in 224eddf, when adding conditional token creation. The model declarations but the column wasn't added to the schema.
* | | | | | | | | | | | | | Merge pull request #20835 from glittershark/if-and-unless-in-secure-tokenKasper Timm Hansen2016-01-094-2/+40
|\ \ \ \ \ \ \ \ \ \ \ \ \ \ | |/ / / / / / / / / / / / / |/| | | | | | | | | | | | | Support :if and :unless in has_secure_token
| * | | | | | | | | | | | | Support :if and :unless in has_secure_tokenGriffin Smith2016-01-094-2/+40
|/ / / / / / / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pass through :if and :unless options from has_secure_token to the generated before_create callback
* | | | | | | | | | | | | Merge pull request #22703 from joshsoftware/rake-log-clearKasper Timm Hansen2016-01-094-10/+33
|\ \ \ \ \ \ \ \ \ \ \ \ \ | |_|/ / / / / / / / / / / |/| | | | | | | | | | | | rake log:clear task updated
| * | | | | | | | | | | | rake log:clear task updated refs[#22544]Pramod2016-01-094-10/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Avoided truncating all files if no ENV['LOGS'] specified - Updated task to accept LOGS=all for truncating all files from log/ i.e. log/*log - If no LOGS specified will truncates standard environment log files i.e. 'development,test,production' - CHANGELOG & guide update added - bin/setup test cases fixed
* | | | | | | | | | | | | [ci skip] Clarify some Minitest origins.Kasper Timm Hansen2016-01-091-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It might be tough for readers to know why we implement `===`, and where the Regexp in `derive_regexp` came from.
* | | | | | | | | | | | | Extract line filtering to Railties.Kasper Timm Hansen2016-01-094-64/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The line filter parsing added to ActiveSupport::TestCase is only half the story to enable line filtering. The other half, of adding the patterns to the options, is done in the Minitest plugin that Railties has. Thus it makes more sense to have the filter in Railties with the other half and all the line filtering tests. Move the filter and extend Active Support in an initializer, so that when users or `rails/all.rb` require `rails/test_unit/railtie` we can still filter by line.
* | | | | | | | | | | | | Merge pull request #22988 from ↵Richard Schneeman2016-01-091-1/+1
|\ \ \ \ \ \ \ \ \ \ \ \ \ | |/ / / / / / / / / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | y-yagi/match_environment_variable_name_and_error_message match the environment variable name that actually checking and error message
| * | | | | | | | | | | | match the environment variable name that actually checking and error messageyuuji.yaginuma2016-01-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The error message has become a `DISABLE_DATABASE_ENVIRONMENT_CHECK`, modified to match the error message. ref: https://github.com/rails/rails/blob/master/activerecord/lib/active_record/migration.rb#L161
* | | | | | | | | | | | | Merge pull request #22986 from yui-knk/fix_automatic_inverse_of_commentप्रथमेश Sonpatki2016-01-091-1/+1
|\ \ \ \ \ \ \ \ \ \ \ \ \ | |/ / / / / / / / / / / / |/| | | | | | | | | | | | [ci skip] `automatic_inverse_of` returns `false` not `nil` (document …
| * | | | | | | | | | | | [ci skip] `automatic_inverse_of` returns `false` not `nil` (document fix)yui-knk2016-01-091-1/+1
| | | | | | | | | | | | |
* | | | | | | | | | | | | Merge pull request #22987 from ↵Richard Schneeman2016-01-081-0/+8
|\ \ \ \ \ \ \ \ \ \ \ \ \ | |/ / / / / / / / / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | prathamesh-sonpatki/add-missing-changelong-for-schema-migrations-version Added missing CHANGELOG entry for https://github.com/rails/rails/pull/22976
| * | | | | | | | | | | | Added missing CHANGELOG entry for https://github.com/rails/rails/pull/22976Prathamesh Sonpatki2016-01-091-0/+8
|/ / / / / / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ci skip]
* | | | | | | | | | | | Merge pull request #22976 from schneems/schneems/schema-migration-primary-keySean Griffin2016-01-082-3/+3
|\ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | Get update_attributes working with SchemaMigration
| * | | | | | | | | | | | Get update_attributes working with SchemaMigrationschneems2016-01-082-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | You cannot use `update_attributes` on models that do not have a primary key. Since SchemaMigration versions are guaranteed to be unique (they have a unique index on them) we can safely use them as a primary key.
* | | | | | | | | | | | | Fix the broken buildSean Griffin2016-01-081-0/+2
| |_|_|_|_|_|_|/ / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is really strange, as it passes on Travis for 2.3, and it passes for me locally on 2.2. But on travis w/ 2.2, passing `Float::INFINITY` in is resulting in an infinite loop. This should resolve it.
* | | | | | | | | | | | Merge pull request #22984 from akshay-vishnoi/fix-docsRichard Schneeman2016-01-081-1/+1
|\ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | [ci skip] Fix typo Renderering --> Rendering
| * | | | | | | | | | | | [ci skip] Fix typo Renderering --> RenderingAkshay Vishnoi2016-01-091-1/+1
|/ / / / / / / / / / / /
* | | | | | | | | | | | Refactor tz aware types, add support for PG rangesSean Griffin2016-01-085-8/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is an alternate implementation to #22875, that generalizes a lot of the logic that type decorators are going to need, in order to have them work with arrays, ranges, etc. The types have the ability to map over a value, with the default implementation being to just yield that given value. Array and Range give more appropriate definitions. This does not automatically make ranges time zone aware, as they need to be added to the `time_zone_aware` types config, but we could certainly make that change if we feel it is appropriate. I do think this would be a breaking change however, and should at least have a deprecation cycle. Closes #22875. /cc @matthewd
* | | | | | | | | | | | Merge pull request #22967 from schneems/schneems/generic-metadataSean Griffin2016-01-0817-14/+253
|\ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | Prevent destructive action on production database
| * | | | | | | | | | | | Fixing tests and re-locating error checking.schneems2016-01-085-16/+17
| | | | | | | | | | | | |
| * | | | | | | | | | | | Fix kwarg to not have circular dependencyschneems2016-01-081-1/+1
| | | | | | | | | | | | |
| * | | | | | | | | | | | Use hash like syntax for InternalMetadataschneems2016-01-086-14/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Discussion: https://github.com/rails/rails/pull/22967#discussion_r49137035
| * | | | | | | | | | | | Add EnvironmentMismatchErrorschneems2016-01-082-4/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Raise an error when a destructive action is made on a database where the current environment is different from the environment stored in the database.
| * | | | | | | | | | | | Use `key` as primary key in schema.schneems2016-01-081-1/+1
| | | | | | | | | | | | |
| * | | | | | | | | | | | [ci skip] Add comment to remove silenced code.schneems2016-01-071-0/+1
| | | | | | | | | | | | |
| * | | | | | | | | | | | Prevent destructive action on production databaseschneems2016-01-0716-14/+232
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This PR introduces a key/value type store to Active Record that can be used for storing internal values. It is an alternative implementation to #21237 cc @sgrif @matthewd. It is possible to run your tests against your production database by accident right now. While infrequently, but as an anecdotal data point, Heroku receives a non-trivial number of requests for a database restore due to this happening. In these cases the loss can be large. To prevent against running tests against production we can store the "environment" version that was used when migrating the database in a new internal table. Before executing tests we can see if the database is a listed in `protected_environments` and abort. There is a manual escape valve to force this check from happening with environment variable `DISABLE_DATABASE_ENVIRONMENT_CHECK=1`.
* | | | | | | | | | | | | Merge pull request #22977 from rails/revert-22934-masterDavid Heinemeier Hansson2016-01-0815-46/+36
|\ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Revert "Move async execution from celluloid to concurrent-ruby"
| * | | | | | | | | | | | | Revert "Move async execution from celluloid to concurrent-ruby"David Heinemeier Hansson2016-01-0815-46/+36
|/ / / / / / / / / / / / /
* | | | | | | | | | | | | Merge pull request #22934 from mperham/masterDavid Heinemeier Hansson2016-01-0815-36/+46
|\ \ \ \ \ \ \ \ \ \ \ \ \ | |_|/ / / / / / / / / / / |/| | | | | | | | | | | | Move async execution from celluloid to concurrent-ruby
| * | | | | | | | | | | | don't need explicit dep and a pretty neat pickMike Perham2016-01-052-2/+1
| | | | | | | | | | | | |
| * | | | | | | | | | | | Use Module#thread_mattr_accessorMike Perham2016-01-051-8/+6
| | | | | | | | | | | | |
| * | | | | | | | | | | | Remove celluloid referencesMike Perham2016-01-056-6/+1
| | | | | | | | | | | | |
| * | | | | | | | | | | | Move async execution from celluloid to concurrent-rubyMike Perham2016-01-059-30/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This removes 8 runtime gem dependencies from Rails: ``` Using hitimes 1.2.3 Using timers 4.1.1 Using celluloid-essentials 0.20.5 Using celluloid-extras 0.20.5 Using celluloid-fsm 0.20.5 Using celluloid-pool 0.20.5 Using celluloid-supervision 0.20.5 Using celluloid 0.17.2 ```
* | | | | | | | | | | | | [doc] The capture method isn't always used inside views to create a variableAkira Matsuda & saya2016-01-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | but rather very often used inside helpers to directly return a String value. [ci skip]
* | | | | | | | | | | | | Merge pull request #22973 from kamipo/fix_select_values_method_signatureRafael França2016-01-082-4/+4
|\ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix `select_values` method signature for consistency
| * | | | | | | | | | | | | Fix `select_values` method signature for consistencyRyuta Kamizono2016-01-082-4/+4
| | | | | | | | | | | | | |
* | | | | | | | | | | | | | Merge pull request #22971 from kamipo/insert_sql_is_almost_same_as_insertRafael França2016-01-084-25/+2
|\ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `{update|delete}_sql` are almost the same as `{update|delete}`
| * | | | | | | | | | | | | | `{update|delete}_sql` are almost the same as `{update|delete}`Ryuta Kamizono2016-01-084-25/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Simply `{update|delete}_sql` aliases to `{update|delete}`.
* | | | | | | | | | | | | | | Merge pull request #22972 from prathamesh-sonpatki/fix-typoRafael França2016-01-081-1/+1
|\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | |_|/ / / / / / / / / / / / / |/| | | | | | | | | | | | | | Fix typo in ActionPack CHANGELOG [ci skip]
| * | | | | | | | | | | | | | Fix typo in ActionPack CHANGELOG [ci skip]Prathamesh Sonpatki2016-01-081-1/+1
|/ / / / / / / / / / / / / /
* | | | | | | | | | | | | | Merge pull request #18909 from ↵Sean Griffin2016-01-073-8/+24
|\ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | davidcornu/fix-hash-with-indifferent-access-default Match HashWithIndifferentAccess#default & Hash#default
| * | | | | | | | | | | | | | Match HashWithIndifferentAccess#default's behaviour with Hash#defaultDavid Cornu2016-01-073-8/+24
|/ / / / / / / / / / / / / /
* | | | | | | | | | | | | | Merge pull request #22966 from mastahyeti/add_gregRafael França2016-01-071-1/+1
|\ \ \ \ \ \ \ \ \ \ \ \ \ \ | |/ / / / / / / / / / / / / |/| | | | | | | | | | | | | Fix changelog for per-form CSRF tokens
| * | | | | | | | | | | | | add gregBen Toews2016-01-071-1/+1
|/ / / / / / / / / / / / /
* | | | | | | | | | | | | Ensure `config.active_record.time_zone_aware_types` is always setSean Griffin2016-01-071-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While the option on `ActiveRecord::Base` is always around, we need to explicitly set it on the config object. Otherwise the recommended configuration change results in an error. Fixes #22839
* | | | | | | | | | | | | Merge pull request #22942 from Edouard-chin/rake-routes-error-messageKasper Timm Hansen2016-01-073-7/+64
|\ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Better error message when running `rake routes` with CONTROLLER arg:
| * | | | | | | | | | | | | Better error message when running `rake routes` with CONTROLLER arg:Edouard CHIN2016-01-073-7/+64
|/ / / / / / / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - `CONTROLLER` argument can now be supplied in different ways (Rails::WelcomeController, Rails::Welcome, rails/welcome) - If `CONTROLLER` argument was supplied but it does not exist, will warn the user that this controller does not exist - If `CONTROLLER` argument was supplied and no routes could be found matching this filter, will warn the user that no routes were found matching the supplied filter - If no routes were defined in the config/routes.rb file, will warn the user with the original message