aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Use `load` rather than `collect` for force loadingRyuta Kamizono2017-03-194-20/+20
| | | | | | | Since b644964b `ActiveRecord::Relation` includes `Enumerable` so delegating `collect`, `all?`, and `include?` are also unneeded. `collect` without block returns `Enumerable` without preloading by that. We should use `load` rather than `collect` for force loading.
* Delegate `uniq` to `records`Ryuta Kamizono2017-03-181-1/+1
| | | | | | | | | | This fixes CI failure due to 48f3be8c. `Enumerable#uniq` was introduced since Ruby 2.4. We should delegate `uniq` to `records` explicitly. And since b644964b `ActiveRecord::Relation` includes `Enumerable` so delegating `map` is unneeded.
* Always use original url_for when generating direct routesAndrew White2017-03-173-1/+55
| | | | | | | Action View overrides `url_for` in the view context to render paths by default when using `url_for` and this means that direct route helpers don't get the full url when called with the url suffix. To fix this always call the original `url_for`.
* Merge pull request #28191 from eugeneius/string_assoc_orderRafael França2017-03-172-2/+30
|\ | | | | Allow order to be given expressions as hash keys
| * Allow order to be given expressions as hash keysEugene Kenny2017-02-272-2/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | When `order` is given a hash, the keys are currently assumed to be attribute names and are quoted as such in the query, which makes it impossible to pass an expression instead: Post.order("LENGTH(title)" => :asc).last # SELECT `posts`.* FROM `posts` ORDER BY `posts`.`LENGTH(title)` DESC LIMIT 1 If the key is an `Arel::Nodes::SqlLiteral`, we now use it directly in the query. This provides a way to build a relation with a complex order clause that can still be reversed with `reverse_order` or `last`.
* | Merge pull request #28154 from aripollak/remove-comments-from-structure-sqlRafael Mendonça França2017-03-173-3/+43
|\ \ | | | | | | | | | Drop comments from structure.sql in postgresql
| * | Only remove comments before the first statementAri Pollak2017-02-242-7/+12
| | |
| * | Drop comments from structure.sql in postgresqlAri Pollak2017-02-243-3/+38
| | | | | | | | | | | | Fixes #28153.
* | | Fix resolve usage in the release notesRafael Mendonça França2017-03-171-1/+1
| | | | | | | | | | | | [ci skip]
* | | Merge pull request #28096 from prathamesh-sonpatki/5-1-release-notes-first-draftRafael França2017-03-171-0/+267
|\ \ \ | | | | | | | | Add first draft of release notes for Rails 5.1 :tada:
| * | | Add blurbs about each new feature [ci skip]Prathamesh Sonpatki2017-03-131-0/+158
| | | |
| * | | Add PR links for major features [ci skip]Prathamesh Sonpatki2017-03-031-0/+11
| | | |
| * | | Add first draft of release notes for Rails 5.1 :tada:Prathamesh Sonpatki2017-03-031-0/+98
| | | | | | | | | | | | | | | | [ci skip]
* | | | uniq was deprecated and removed alreadyRafael Mendonça França2017-03-171-1/+1
| | | | | | | | | | | | | | | | | | | | This was causing an infinity loop since it was delegating to `all` and all delegating back to this module.
* | | | Add support for calling nested direct routes (#28462)Andrew White2017-03-174-32/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Not all requirements can be expressed in terms of polymorphic url options so add a `route_for` method that allows calling another direct route (or regular named route) which a set of arguments, e.g: resources :buckets direct :recordable do |recording| route_for(:bucket, recording.bucket) end direct :threadable do |threadable| route_for(:recordable, threadable.parent) end This maintains the context of the original caller, e.g. threadable_path(threadable) # => /buckets/1 threadable_url(threadable) # => http://example.com/buckets/1
* | | | Merge pull request #28341 from mtsmfm/pass-options-to-driven-byRafael França2017-03-173-4/+6
|\ \ \ \ | | | | | | | | | | Pass options to `driven_by`
| * | | | Pass options to `driven_by`Fumiaki MATSUSHIMA2017-03-133-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Capybara drivers can handle some options such like `url`. ### before ``` # test/test_helper.rb Capybara.register_driver :remote_chrome do |app| Capybara::Selenium::Driver.new(app, browser: :chrome, url: "http://example.com/wd/hub") end # test/application_system_test_case.rb class ApplicationSystemTestCase < ActionDispatch::SystemTestCase driven_by :remote_chrome end ``` ### after ``` # test/application_system_test_case.rb class ApplicationSystemTestCase < ActionDispatch::SystemTestCase driven_by :selenium, using: :chrome, screen_size: [1400, 1400], options: {url: "http://chrome:4444/wd/hub"} end ```
* | | | | Merge pull request #28318 from ↵Rafael França2017-03-175-49/+4
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | bogdanvlviv/remove-ability-update-locking_column-value Remove ability update locking_column value
| * | | | | Remove ability update locking_column valuebogdanvlviv2017-03-165-49/+4
| | | | | |
* | | | | | Add :default option to belongs_to (#28453)George Claghorn2017-03-175-1/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use it to specify that an association should be initialized with a particular record before validation. For example: # Before belongs_to :account before_validation -> { self.account ||= Current.account } # After belongs_to :account, default: -> { Current.account }
* | | | | | Bump Capybara and include Minitest::Assertionseileencodes2017-03-174-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Capybara was updated in teamcapybara/capybara#1841 to use Minitest style assertions so that system test output shows x number of assertions, x numbe of failures, etc. Before: ``` 6 runs, 0 assertions, 0 failures, 0 errors, 0 skips ``` After: ``` 6 runs, 7 assertions, 1 failures, 0 errors, 0 skips ``` This change bumps Capybara from 2.7.0 to 2.13.0 and includes the required minitest assertion file in the test case. :tada:
* | | | | | Cleanup documentation fixes (#28460)Vipul A M2017-03-172-5/+5
| | | | | |
* | | | | | Merge pull request #28421 from tangposmarvin/docs-assest-pipelineVipul A M2017-03-171-1/+1
|\ \ \ \ \ \ | | | | | | | | | | | | | | Fix guide incorrectly refers to public/assets/images [ci ckip]
| * | | | | | Fix asset_pipeline docs incorrect image dir infomarvin2017-03-161-1/+1
| | | | | | |
* | | | | | | Merge pull request #28444 from budnik/patch-2Vipul A M2017-03-171-4/+3
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Updates incorrect documentation [ci skip]
| * | | | | | | Updates incorrect documentation [ci skip]Dmitriy Budnik2017-03-161-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Looking on code for this method it's clear that it's just returns `response.status` instead of full `response` object. It's better to correct docs as probably lots of specs are relying on this behavior.
* | | | | | | | Merge pull request #28445 from denniszelada/feature-documentation-with_optionsVipul A M2017-03-171-0/+11
|\ \ \ \ \ \ \ \ | |/ / / / / / / |/| | | | | | | Add documentation to use with_options anywhere in the same class [ci
| * | | | | | | Add documentation to use with_options in the same class [ci skip]Dennis Zelada2017-03-161-0/+11
| | | | | | | |
* | | | | | | | Fix test warningsAndrew White2017-03-161-5/+5
| | | | | | | |
* | | | | | | | Move `to_time` to `DateTime` compatibility.rb fileAndrew White2017-03-164-6/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We are overriding it in `Time` and `ActiveSupport::TimeWithZone` so there's no point in having it in the `DateAndTime::Compatibility` module. Also add some docs for the `to_time` implementations.
* | | | | | | | Merge pull request #28147 from kmcphillips/master-time-freezeAndrew White2017-03-166-22/+206
|\ \ \ \ \ \ \ \ | |_|_|/ / / / / |/| | | | | | | Allow Time#to_time on frozen objects. Return frozen time rather than "RuntimeError: can't modify frozen Time"
| * | | | | | | Handle #to_time and memoization taking into account memoization, frozen ↵Kevin McPhillips2017-03-066-22/+206
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | state, and preserve_timezone flag.
* | | | | | | | Merge pull request #28368 from y-yagi/add_test_for_secrets_commandKasper Timm Hansen2017-03-151-0/+13
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | Add secrets edit test
| * | | | | | | | Add secrets edit testyuuji.yaginuma2017-03-121-0/+13
| | | | | | | | |
* | | | | | | | | Tweak 28412Jon Moss2017-03-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PR was merged before I could finished reviewing :grimacing: [ci skip]
* | | | | | | | | Remove unnecessary params mungingAndrew White2017-03-152-2/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In 9b654d4 some params munging was added to ensure that they were set whenever `recognize_path` would call either a proc or callable constraint. Since we no longer mutate the environment hash within the method it's now unnecessary and actually causes params to leak between route matches before checking constraints. Fixes #28398.
* | | | | | | | | Revert #27850 following test breakage (#28427)David Heinemeier Hansson2017-03-153-19/+7
| | | | | | | | |
* | | | | | | | | Merge pull request #28426 from mtsmfm/fix-fragile-testRafael França2017-03-151-36/+34
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | Fix fragile test (`AssociationProxyTest#test_save_on_parent_saves_children`)
| * | | | | | | | | Fix fragile test (`AssociationProxyTest#test_save_on_parent_saves_children`)Fumiaki MATSUSHIMA2017-03-161-36/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we run only following tests: - test/cases/scoping/default_scoping_test.rb - test/cases/associations_test.rb ``` $ cat Rakefile.test require "rake/testtask" ENV["ARCONN"] = "postgresql" Rake::TestTask.new do |t| t.libs << "test" t.test_files = %w( test/cases/scoping/default_scoping_test.rb test/cases/associations_test.rb ) end ``` a test will fail: ``` $ bundle exec rake test -f Rakefile.test /app/activesupport/lib/active_support/core_ext/enumerable.rb:20: warning: method redefined; discarding old sum Using postgresql Run options: --seed 11830 # Running: .........................................................................................F................ Finished in 6.939055s, 15.2759 runs/s, 27.9577 assertions/s. 1) Failure: AssociationProxyTest#test_save_on_parent_saves_children [/app/activerecord/test/cases/associations_test.rb:185]: Expected: 1 Actual: 2 106 runs, 194 assertions, 1 failures, 0 errors, 0 skips rake aborted! Command failed with status (1) /usr/local/bin/bundle:22:in `load' /usr/local/bin/bundle:22:in `<main>' Tasks: TOP => test (See full trace by running task with --trace) ``` In #28083, change `self.use_transactional_tests` to `false` but we forget to clean-up fixture. However we don't have to disable transaction except a few tests.
* | | | | | | | | | Merge pull request #28425 from rails/remove-duration-deprecationAndrew White2017-03-155-38/+214
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | Remove implicit coercion deprecation of durations
| * | | | | | | | | | Restore 5.minutes changed in #28204Andrew White2017-03-151-1/+1
| | | | | | | | | | |
| * | | | | | | | | | Use better duration aliases in testsAndrew White2017-03-151-2/+2
| | | | | | | | | | |
| * | | | | | | | | | Remove implicit coercion deprecation of durationsAndrew White2017-03-153-35/+211
| |/ / / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In #28204 we deprecated implicit conversion of durations to a numeric which represented the number of seconds in the duration because of unwanted side effects with calculations on durations and dates. This unfortunately had the side effect of forcing a explicit cast when configuring third-party libraries like expiration in Redis, e.g: redis.expire("foo", 5.minutes) To work around this we've removed the deprecation and added a private class that wraps the numeric and can perform calculation involving durations and ensure that they remain a duration irrespective of the order of operations.
* | | | | | | | | | Merge pull request #28412 from benoittgt/add_doc_for_message_encryptor_newRafael França2017-03-151-0/+5
|\ \ \ \ \ \ \ \ \ \ | |/ / / / / / / / / |/| | | | | | | | | Add documentation about signature_key for MessageEncryptor.new [ci skip]
| * | | | | | | | | Add documentation about signature_key for MessageEncryptor.new [ci skip]Benoit Tigeot2017-03-151-0/+5
| | | | | | | | | |
* | | | | | | | | | Merge pull request #28423 from eugeneius/rm_txnRichard Schneeman2017-03-152-2/+0
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | Remove unused `@txn` variable
| * | | | | | | | | | Remove unused `@txn` variableEugene Kenny2017-03-152-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was added in c24c885209ac2334dc6f798c394a821ee270bec6, removed in b89ffe7f0047eb614e42232a21201b317b880755, and then (unintentionally?) reintroduced in 2d7ae1b08ee2a10b12cbfeef3a6cc6da55b57df6.
* | | | | | | | | | | Merge pull request #28409 from y-yagi/make_destroy_command_work_within_enginesEileen M. Uchitelle2017-03-152-2/+57
|\ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Make destroy command work within engines
| * | | | | | | | | | | Make destroy command work within enginesyuuji.yaginuma2017-03-142-2/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of calling methods of Rails.application directly, we need to use a method that is considered for the rails engine.
* | | | | | | | | | | | Merge pull request #28422 from ↵Kasper Timm Hansen2017-03-151-7/+7
|\ \ \ \ \ \ \ \ \ \ \ \ | |_|/ / / / / / / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | y-yagi/rename_app_update_test_to_more_appropriate_name Rename test of `app:update` to more appropriate name