aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | [ci skip] Add changelog entry for #28139.Kasper Timm Hansen2017-03-021-0/+16
| | | | | | | | | | | | | | | | Includes a script to ease an app's upgrade.
* | | | Inline CIPHER constant.Kasper Timm Hansen2017-03-021-6/+3
| | | |
* | | | Move key packing into encryptor.Kasper Timm Hansen2017-03-022-6/+4
| | | |
* | | | Add back yaml require.Kasper Timm Hansen2017-03-021-0/+1
| | | |
* | | | Merge pull request #28139 from stouset/update-secrets-to-use-modern-cryptoKasper Timm Hansen2017-03-022-17/+16
|\ \ \ \ | |/ / / |/| | | Update secrets to use modern crypto
| * | | Default Secrets to AES-128-GCM, using ActiveSupport::MessageEncryptorStephen Touset2017-03-012-17/+16
| | | | | | | | | | | | | | | | Fixes #28135.
* | | | Merge pull request #28245 from y-yagi/use_blank_instead_of_emptyKasper Timm Hansen2017-03-021-1/+1
|\ \ \ \ | |_|/ / |/| | | Use `blank?` instead of `empty?`
| * | | Convert `ENV["EDITOR"]` to string before checkyuuji.yaginuma2017-03-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | In order to avoid `NoMethodError` when it is nil. Follow up to 82f7dc6178f86e5e2dd82f9e528475a6acee6cd8
* | | | Merge pull request #28242 from rails/add-fractional-support-to-datetime-changeAndrew White2017-03-024-17/+46
|\ \ \ \ | |/ / / |/| | | Update `DateTime#change` to support usec and nsec
| * | | Update `DateTime#change` to support usec and nsecAndrew White2017-03-024-17/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adding support for these options now allows us to update the `DateTime#end_of` methods to match the equivalent `Time#end_of` methods, e.g: datetime = DateTime.now.end_of_day datetime.nsec == 999999999 # => true Fixes #21424.
* | | | Merge pull request #28220 from kamipo/valid_type_accept_only_supported_typesRafael França2017-03-015-42/+10
|\ \ \ \ | | | | | | | | | | `valid_type?` should accept only supported types
| * | | | `valid_type?` should accept only supported typesRyuta Kamizono2017-02-285-42/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `valid_type?` is used in schema dumper to determine if a type is supported. So if `valid_type?(:foobar)` is true, it means that schema dumper is allowed to create `t.foobar`. But it doesn't work. I think that `valid_type?` should accept only supported types. https://github.com/rails/rails/blob/v5.1.0.beta1/activerecord/lib/active_record/schema_dumper.rb#L135-L142 ```ruby columns.each do |column| raise StandardError, "Unknown type '#{column.sql_type}' for column '#{column.name}'" unless @connection.valid_type?(column.type) next if column.name == pk type, colspec = @connection.column_spec(column) tbl.print " t.#{type} #{column.name.inspect}" tbl.print ", #{format_colspec(colspec)}" if colspec.present? tbl.puts end ```
* | | | | [ci skip] Add changelog entry for encrypted secrets.Kasper Timm Hansen2017-03-011-0/+14
| | | | | | | | | | | | | | | | | | | | Just dispatch to the command help itself for more info.
* | | | | Put it to me straight: just say it.Kasper Timm Hansen2017-03-011-3/+3
| | | | | | | | | | | | | | | | | | | | Prefer Thor's say method to Kernel's plain puts.
* | | | | Tell users how to assign a $EDITOR.Kasper Timm Hansen2017-03-012-0/+35
| |/ / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In case there's no $EDITOR assigned users would see a cryptic: ``` % EDITOR= bin/rails secrets:edit Waiting for secrets file to be saved. Abort with Ctrl-C. sh: /var/folders/wd/xnncwqp96rj0v1y2nms64mq80000gn/T/secrets.yml.enc: Permission denied New secrets encrypted and saved. ``` That error is misleading, so give a hint in this easily detectable case. Fixes #28143.
* | | | Merge pull request #28239 from ↵Kasper Timm Hansen2017-03-011-1/+1
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | y-yagi/use_appropriate_type_for_test_framework_option Use appropriate type for `test_framework` option
| * | | | Use appropriate type for `test_framework` optionyuuji.yaginuma2017-03-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes the following warning. ``` Expected string default value for '--test-framework'; got false (boolean) ```
* | | | | Merge pull request #28237 from lzap/default-cipher-dryKasper Timm Hansen2017-03-011-1/+1
|\ \ \ \ \ | | | | | | | | | | | | Use DEFAULT_CIPHER constant in MessageEncryptor
| * | | | | Use DEFAULT_CIPHER constant in MessageEncryptorLukas Zapletal2017-03-011-1/+1
|/ / / / /
* | | | | Whitelist adapters that support aliases in `HAVING` clauseAndrew White2017-03-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Support for using `SELECT` column or expression aliases in the `HAVING` clause isn't part of the SQL standard so it's better to whitelist the test for adapters where we know it works and skip it on others.
* | | | | Merge pull request #28230 from y-yagi/HOST_to_be_in_uppercaseRafael França2017-02-281-1/+1
|\ \ \ \ \ | | | | | | | | | | | | `HOST` must be all capital letters
| * | | | | `HOST` must be all capital lettersyuuji.yaginuma2017-03-011-1/+1
| |/ / / / | | | | | | | | | | | | | | | Ref: https://github.com/rails/rails/blob/master/railties/lib/rails/commands/server/server_command.rb#L194
* | | | | Merge pull request #25296 from kamipo/use_inspect_for_type_cast_for_schemaRafael França2017-02-284-9/+14
|\ \ \ \ \ | | | | | | | | | | | | Use `inspect` in `type_cast_for_schema` for date/time and decimal values
| * | | | | Use `inspect` in `type_cast_for_schema` for date/time and decimal valuesRyuta Kamizono2016-12-114-9/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently dumping defaults on schema is inconsistent. Before: ```ruby create_table "defaults", force: :cascade do |t| t.string "string_with_default", default: "Hello!" t.date "date_with_default", default: '2014-06-05' t.datetime "datetime_with_default", default: '2014-06-05 07:17:04' t.time "time_with_default", default: '2000-01-01 07:17:04' t.decimal "decimal_with_default", default: 1234567890 end ``` After: ```ruby create_table "defaults", force: :cascade do |t| t.string "string_with_default", default: "Hello!" t.date "date_with_default", default: "2014-06-05" t.datetime "datetime_with_default", default: "2014-06-05 07:17:04" t.time "time_with_default", default: "2000-01-01 07:17:04" t.decimal "decimal_with_default", default: "1234567890" end ```
* | | | | | Merge pull request #28120 from vfonic/plugin-generator-skip-turbolinks-dummyRafael França2017-02-281-0/+1
|\ \ \ \ \ \ | | | | | | | | | | | | | | Allow skipping of turbolinks for test dummy application for plugin/engine
| * | | | | | Skip turbolinks for engine test applicationViktor Fonic2017-02-281-0/+1
| | |_|/ / / | |/| | | | | | | | | | | | | | | | | | | | | | When `rails new plugin` is invoked, turbolinks should be skipped in the dummy test application generated by the plugin generator.
* | | | | | Merge pull request #28210 from cefigueiredo/improve_required_testRafael França2017-02-281-7/+35
|\ \ \ \ \ \ | |_|_|/ / / |/| | | | | Make required by default test for belongs_to association clearer
| * | | | | Ensure that tests will reset belongs_to_requierd_by_default configCarlos Figueiredo2017-02-271-23/+27
| | | | | |
| * | | | | Make required by default test for belongs_to association clearerCarlos Figueiredo2017-02-271-1/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since #18937 `belongs_to` associations receive a setting to determine if it should be or not treated as `required` by default. While the tests were still passing, it was not evident that the "default" behaviour for `required` could change in fuction of a setting, that is set by default for fresh Rails5 apps, but not for upgraded apps. This commit try to relate them to make it clear what is the behaviour expected when the setting is set as `true` or not set.
* | | | | | Merge pull request #28217 from ↵Rafael França2017-02-282-8/+17
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | kamipo/create_join_table_respects_reference_key_type `create_join_table` should respect `references` column type
| * | | | | | `create_join_table` should respect `references` column typeRyuta Kamizono2017-02-282-8/+17
| | |/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Follow up of #26266. The default type of `primary_key` and `references` were changed to `bigint` since #26266. But `create_join_table` column type is still `integer`. It should respect `references` column type.
* | | | | | Merge pull request #28063 from Erol/prioritize-callback-on-action-before-ifRafael França2017-02-282-1/+41
|\ \ \ \ \ \ | | | | | | | | | | | | | | Do not evaluate :if arguments when :on is not satisfied for transaction callbacks
| * | | | | | Prioritize checking `:on` actions before `:if` for transaction callbacksErol Fornoles2017-02-212-1/+41
| | | | | | |
* | | | | | | Revert "Dupping a CollectionProxy should dup the load_target"eileencodes2017-02-282-12/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I incorrectly changed behavior of `dup`. Reading the original issue I thought that `dup` should retain the original contents of the record and it's associations but it is in fact supposed to be a copy as if a record had been reinitialized. This reverts commit ca8c21df0fdbf1f03ba2f7fb16b39c3282dc1be0.
* | | | | | | Merge pull request #28214 from kamipo/use_tablesRafael França2017-02-281-1/+1
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Use `tables` instead of `data_sources - views`
| * | | | | | | Use `tables` instead of `data_sources - views`Ryuta Kamizono2017-02-281-1/+1
| | |/ / / / / | |/| | | | | | | | | | | | | | | | | | | `tables` returns only tables now.
* | | | | | | Merge pull request #28215 from y-yagi/take_failed_screenshot_before_reset_driverRafael França2017-02-281-1/+1
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Take failed screenshot before reset driver
| * | | | | | | Take failed screenshot before reset driveryuuji.yaginuma2017-02-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now reset the driver before take failed screenshot since #28144. However, I think that failed screenshot should be take with the driver actually used in the test. So, fixed to take screenshot before reset driver.
* | | | | | | | Merge pull request #28202 from ↵Rafael França2017-02-281-0/+4
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | baerjam/improve-testing-your-mailers-documentation Improve documentation for Testing Your Mailers [ci skip]
| * | | | | | | | Improve documentation for Testing Your Mailers [ci skip]James Baer2017-02-281-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current Basic Test Case example has the following assertion ``` assert_equal read_fixture('invite').join, email.body.to_s ``` email.body.to_s returns an empty string if both HTML and text templates exist for a given mailer. This commit adds a note to section 11.2.2 explaining this and also suggests using email.text_part.body.to_s and email.html_part.body.to_s as alternatives.
* | | | | | | | | Merge pull request #28222 from kenta-s/fix-railstutorial-urlVipul A M2017-02-282-2/+2
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | Fix http -> https [ci skip]
| * | | | | | | | | Fix http -> https [ci skip]kenta-s2017-02-282-2/+2
| | |_|/ / / / / / | |/| | | | | | |
* | | | | | | | | Dupping a CollectionProxy should dup the load_targeteileencodes2017-02-282-0/+12
| |/ / / / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In Rails 3.2 dupping a `CollectionProxy` would dup it's `load_target` as well. That functionality has been broken since the release of Rails 4.0. I hit this in an application upgrade and wondered why duplicating a CollectionProxy and assigning it to a variable stopped working. When calling `dup` on a `CollectionProxy` only the owner (ex. topic) was getting duplicated and the `load_target` would remain in tact with it's original object ID. Dupping the `load_target` is useful for performing a logging operation after records have been destroyed in a method. For example: ``` def transfer_operation saved_replies = topic.replies topic.replies.clear saved_replies.each do |reply| user.update_replies_count! end end ``` This change adds a `initialize_dup` method that performs a `deep_dup` on the `@associatiation` so that the `load_target` is dupped as well. Fixes #17117
* | | | | | | | Merge pull request #28208 from yahonda/rails28183_oracleAndrew White2017-02-281-1/+1
|\ \ \ \ \ \ \ \ | |/ / / / / / / |/| | | | | | | Oracle database also does not allow aliases in the having clause
| * | | | | | | Oracle database also does not allow aliases in the having clauseYasuo Honda2017-02-271-1/+1
| |/ / / / / / | | | | | | | | | | | | | | | | | | | | | Follow up #28183
* | | | | | | Merge pull request #28212 from ↵Rafael França2017-02-271-1/+1
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | y-yagi/user_released_webpacker_in_new_applications Use released webpacker in new applications
| * | | | | | | Use released webpacker in new applicationsyuuji.yaginuma2017-02-281-1/+1
| |/ / / / / / | | | | | | | | | | | | | | | | | | | | | Because webpacker 1.0 already released.
* | | | | | | Merge pull request #28061 from andrewhood125/strip_tags_updateRafael França2017-02-273-4/+19
|\ \ \ \ \ \ \ | |/ / / / / / |/| | | | | | Remove `encode_special_chars` option from `strip_tags`
| * | | | | | Remove `encode_special_chars` option from `strip_tags`Andrew Hood2017-02-273-4/+19
|/ / / / / /
* | | | | | Merge pull request #28196 from ↵Andrew White2017-02-272-3/+25
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | y-yagi/set_correct_host_except_development_environment Set correct host except development environment