aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [ci skip] Don't mention unrotatable secret_key_base.Kasper Timm Hansen2017-09-251-18/+20
|
* Merge pull request #30705 from frodsan/use-digest-thread-safeMatthew Draper2017-09-262-2/+2
|\ | | | | Preload digest/sha2 to avoid thread safe error.
| * Preload digest/sha2 to avoid thread safe error.Francesco Rodriguez2017-09-252-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I got this error in production using Puma in multi-threaded mode: ``` RuntimeError: Digest::Base cannot be directly inherited in Ruby from active_support/security_utils.rb:23:in `variable_size_secure_compare' from active_support/security_utils.rb:23:in `hexdigest' from active_support/security_utils.rb:23:in `digest' ``` Looks like Digest uses const_missing to load Digest::SHA256 (https://github.com/ruby/ruby/blob/trunk/ext/digest/lib/digest.rb#L8) - https://bugs.ruby-lang.org/issues/9494 - https://github.com/ruby/ruby/commit/c02fa39463a0c6bf698b01bc610135604aca2ff4
* | Merge pull request #30700 from y-yagi/respect_quiet_optionKasper Timm Hansen2017-09-253-17/+22
|\ \ | | | | | | Respect quiet option in all process of `rails new` command
| * | Respect quiet option in all process of `rails new` commandyuuji.yaginuma2017-09-253-17/+22
| |/ | | | | | | | | If specify the `quiet` option, expect that no status will be shown. However, some process show status. This suppresses all status output.
* | Merge pull request #30703 from dixpac/fix_minor_code_climate_issueKasper Timm Hansen2017-09-251-1/+1
|\ \ | | | | | | Fix minor CodeClimate issue
| * | Fix minor CodeClimate issuedixpac2017-09-251-1/+1
| |/
* | Fix cookies/session tests broken after merging key rotation.Kasper Timm Hansen2017-09-253-37/+34
| | | | | | | | | | | | | | | | | | | | | | | | Based on, yet closes https://github.com/rails/rails/pull/30708 Fix the session test by properly truncating the legacy encryption key for cbc encryption. Borrowed straight from 👆. Fix the cookies test a little differently than the PR. Basically keep every config within the config block. [ Michael Coyne & Kasper Timm Hansen ]
* | Merge pull request #30704 from ydakuka/new-fixesRyuta Kamizono2017-09-252-3/+3
|\ \ | | | | | | New missing backquotes [ci skip]
| * | new missing backquotes [ci skip]Yauheni Dakuka2017-09-252-3/+3
| | |
* | | Merge pull request #30706 from tgxworld/fix_preload_memoizationRyuta Kamizono2017-09-251-6/+5
|\ \ \ | |_|/ |/| | PERF: Restore memoization when preloading associations.
| * | PERF: Restore memoization when preloading associations.Guo Xiang Tan2017-09-251-6/+5
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Benchmark Script ``` require 'active_record' require 'benchmark/ips' require 'ruby-prof' require 'memory_profiler' require 'byebug' ActiveRecord::Base.establish_connection(ENV.fetch('DATABASE_URL')) ActiveRecord::Migration.verbose = false ActiveRecord::Schema.define do create_table :users, force: true do |t| t.string :name, :email t.integer :topic_id t.timestamps null: false end create_table :topics, force: true do |t| t.string :title t.timestamps null: false end end attributes = { name: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.', email: 'foobar@email.com' } class Topic < ActiveRecord::Base has_many :users end class User < ActiveRecord::Base belongs_to :topic end 100.times do User.create!(attributes) end users = User.first(50) Topic.create!(title: 'This is a topic', users: users) Benchmark.ips do |x| x.config(time: 10, warmup: 5) x.report("preload") do User.includes(:topic).all.to_a end end ``` Before ``` Calculating ------------------------------------- preload 26.000 i/100ms ------------------------------------------------- preload 265.347 (± 3.0%) i/s - 2.652k ``` After ``` Calculating ------------------------------------- preload 39.000 i/100ms ------------------------------------------------- preload 406.053 (± 1.7%) i/s - 4.095k ```
* | mocha 1.3.0Akira Matsuda2017-09-252-3/+3
| |
* | Unneeded Mocha stubs for Kernel#systemAkira Matsuda2017-09-251-2/+0
| | | | | | | | It's done inside each test via assert_called_with or Kernel.expects
* | Extract `integer_like_primary_key_type` to ease to handle it for adaptersRyuta Kamizono2017-09-254-17/+18
| |
* | Merge pull request #30615 from yhirano55/update_form_helpers_guideRyuta Kamizono2017-09-251-7/+11
|\ \ | | | | | | Update Form Helpers guide [ci skip]
| * | Update Form Helpers guide to fix example codes [ci skip]Yoshiyuki Hirano2017-09-171-7/+11
| | | | | | | | | | | | | | | | | | | | | | | | * It looks that example codes are not based on actual output. So I've fixed it. * Specifically: * There are no lines about utf-8 and authenticity_token. * The submit button doesn't have data-disabled-with attribute. * Each attribute order of html element is different from actual ones.
* | | Merge pull request #30698 from ↵Ryuta Kamizono2017-09-251-1/+0
|\ \ \ | | | | | | | | | | | | | | | | bogdanvlviv/remove-unused-variables-from-release_rb Remove unused variable `gem_version` from `tasks/release.rb`
| * | | Remove unused variable `gem_version` from `tasks/release.rb`bogdanvlviv2017-09-241-1/+0
| | | |
* | | | Fix `test_should_sanitize_illegal_style_properties` failureRyuta Kamizono2017-09-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://travis-ci.org/rails/rails/jobs/279300966#L2600 The result of `Loofah::HTML5::Scrub.scrub_css` was changed since v2.1.0.rc1. https://github.com/flavorjones/loofah/commit/ca56295ff9e802018ea18d23ed49be235a95ccad
* | | | Skip complex cookie tests for now; I'll deal with them tomorrow.Kasper Timm Hansen2017-09-242-0/+6
| | | |
* | | | Fix RotationConfiguration test and remove nil-kind rotates.Kasper Timm Hansen2017-09-242-29/+8
| | | |
* | | | Fix "warning: `*' interpreted as argument prefix"Ryuta Kamizono2017-09-251-2/+2
| | | |
* | | | Merge pull request #30693 from yhirano55/refactor_css_scaffold_generatorKasper Timm Hansen2017-09-241-3/+3
|\ \ \ \ | | | | | | | | | | Refactor Css::Generators::ScaffoldGenerator
| * | | | Refactor Css::Generators::ScaffoldGeneratorYoshiyuki Hirano2017-09-251-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | * define source_root by source_root method * it don't create file, but copy it.
* | | | | [ci skip] Attempt a new explanation for rotations.Kasper Timm Hansen2017-09-244-81/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's become clear to me that the use case is still a bit muddy and the upgrade path is going to be tough for people to figure out. This attempts at understanding it better through documentation, but still needs follow up work. [ Michael Coyne & Kasper Timm Hansen ]
* | | | | Use new rotation signature in cookies.Kasper Timm Hansen2017-09-243-73/+25
| | | | | | | | | | | | | | | | | | | | [ Michael Coyne & Kasper Timm Hansen ]
* | | | | Remove advanced key generator rotations from verifier/encryptor.Kasper Timm Hansen2017-09-243-198/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Noticed that verifiers and encryptors never once mentioned key generators and salts but only concerned themselves with generated secrets. Clears up the confusing naming around raw_key and secret as well. And makes the rotation API follow the constructor signature to the letter.
* | | | | Infer options from the primary verifier.Kasper Timm Hansen2017-09-243-12/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Spares users from passing in non-changing values explicitly. [ Michael Coyne & Kasper Timm Hansen ]
* | | | | [ci skip] RotationConfiguration is an implementation detail, not public API.Kasper Timm Hansen2017-09-242-8/+5
| |/ / / |/| | |
* | | | Merge pull request #29716 from mikeycgto/active-support-key-rotatorKasper Timm Hansen2017-09-2420-253/+975
|\ \ \ \ | | | | | | | | | | Add Key Rotation to MessageEncryptor and MessageVerifier and simplify the Cookies middleware
| * | | | Add key rotation cookies middlewareMichael Coyne2017-09-2411-248/+396
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using the action_dispatch.cookies_rotations interface, key rotation is now possible with cookies. Thus the secret_key_base as well as salts, ciphers, and digests, can be rotated without expiring sessions.
| * | | | Add key rotation message Encryptor and VerifierMichael Coyne2017-09-2310-5/+579
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Both classes now have a rotate method where new instances are added for each call. When decryption or verification fails the next rotation instance is tried.
* | | | | [ci skip] Fix the with order and explain it.Kasper Timm Hansen2017-09-241-3/+8
| | | | |
* | | | | Merge pull request #30593 from BigChief45/guides/action-mailer-parameterizedKasper Timm Hansen2017-09-241-29/+48
|\ \ \ \ \ | |_|/ / / |/| | | | Update Action Mailer Basics [ci skip]
| * | | | Update Action Mailer Basics [skip ci]Jaime Alvarez2017-09-241-29/+48
| | | | |
* | | | | Merge pull request #30668 from yhirano55/fix_api_guideRyuta Kamizono2017-09-241-1/+0
|\ \ \ \ \ | | | | | | | | | | | | Fix rails middleware list in api_app guide [ci skip]
| * | | | | Fix rails middleware list in api_app guide [ci skip]Yoshiyuki Hirano2017-09-241-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | * `MyApi::Application::Routes` is not middleware.
* | | | | | Merge pull request #30689 from ↵Sean Griffin2017-09-231-2/+2
|\ \ \ \ \ \ | |_|_|/ / / |/| | | | | | | | | | | | | | | | | yhirano55/fix_email_in_active_support_instrumentation Fix email in Active Support Instrumentation [ci skip]
| * | | | | Fix email in Active Support Instrumentation [ci skip]Yoshiyuki Hirano2017-09-241-2/+2
|/ / / / / | | | | | | | | | | | | | | | * `s/ddh/dhh/`
* | | | | Merge pull request #30688 from ↵Sean Griffin2017-09-232-1/+14
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | y-yagi/make_bang_verion_work_with_inheritable_options Make bang version work with `InheritableOptions`
| * | | | | Make bang version work with `InheritableOptions`yuuji.yaginuma2017-09-232-1/+14
| | |_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, bang version does not work with `InheritableOptions`. `InheritableOptions` treats the argument Hash as the default value. However, `Hash#fetch` does not use the default value when key is not found, so can not get the default value. So in bang version, should use `Hash#[]` instead of `Hash#fetch`.
* | | | | Move integer-like primary key normalization to `new_column_definition`Ryuta Kamizono2017-09-236-38/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the normalization only exists in `primary_key` shorthand. It should be moved to `new_column_definition` to also affect to `add_column` with primary key.
* | | | | Adding legacy primary key should be compatibleRyuta Kamizono2017-09-232-0/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently implicit legacy primary key is compatible, but adding explicit legacy primary key is not compatible. It should also be fixed. Fixes #30664.
* | | | | Merge pull request #30686 from metaskills/sqlserver-1as1fixSean Griffin2017-09-221-1/+1
|\ \ \ \ \ | | | | | | | | | | | | Ensure `1 AS one` for SQL Server with Calculations
| * | | | | Ensure `1 AS one` for SQL Server with calculations.Ken Collins2017-09-221-1/+1
|/ / / / /
* | | | | Prevent extra `column_for` for `change_column_{default,null,comment}`Ryuta Kamizono2017-09-231-7/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `change_column_{default,null,comment}` in mysql2 adapter are passing `column.sql_type` as `type` to `change_column` to intend keeping previous type. But `column_for` requires extra query, so use passing `nil` to `type` explicitly in the internal for the purpose.
* | | | | `index_name` should be quotedRyuta Kamizono2017-09-221-1/+1
| | | | |
* | | | | Return nil if table comment is blankRyuta Kamizono2017-09-222-2/+2
| | | | |
* | | | | Merge pull request #30677 from alecspopa/masterRyuta Kamizono2017-09-222-0/+32
|\ \ \ \ \ | | | | | | | | | | | | Implement change_table_comment and change_column_comment