aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* | | Avoid purging attached blob when replacing it with itselfGeorge Claghorn2018-03-042-2/+18
| | |
* | | [ci skip] Fix grammar in delegate, private: true docs.Kasper Timm Hansen2018-03-041-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | Convert the user to atheism by ditching the extra example that demonstrates the same thing as date_of_birth. Demonstrate the NoMethodError on date_of_birth first, then call age that uses date_of_birth internally. Thus showing that accessing it publicly fails, but using it internally succeeds.
* | | Merge pull request #32058 from gsamokovarov/rails-server-x-optionKasper Timm Hansen2018-03-048-61/+184
|\ \ \ | | | | | | | | Introduce explicit rails server handler option
| * | | Extract Rails::Command::SpellcheckerGenadi Samokovarov2018-03-045-41/+65
| | | |
| * | | Introduce explicit rails server handler optionGenadi Samokovarov2018-03-043-20/+119
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I mistype `rails server production` instead of `rails server -e production` expecting to lunch a server in the production environment all the time. However, the signature of `rails server --help` is: ``` Usage: rails server [puma, thin etc] [options] ``` This means that the `production` argument is being interpreted as a Rack server handler like Puma, Thin or Unicorn. Should we argue for the `rails server production`? I'm not sure of the reasons, but the `rails console production` behavior was deprecated in: https://github.com/rails/rails/pull/29358, so parity with the existing `rails console production` usage may not hold anymore. In any case, this PR introduces an explicit option for the Rack servers configuration. The option is called `--using` (or `-u` for short) to avoid the `rails server --server` tantrum. The new interface of `rails server` is: ``` Usage: rails server [using] [options] Options: -p, [--port=port] # Runs Rails on the specified port - defaults to 3000. -b, [--binding=IP] # Binds Rails to the specified IP - defaults to 'localhost' in development and '0.0.0.0' in other environments'. -c, [--config=file] # Uses a custom rackup configuration. # Default: config.ru -d, [--daemon], [--no-daemon] # Runs server as a Daemon. -e, [--environment=name] # Specifies the environment to run this server under (development/test/production). -u, [--using=name] # Specifies the Rack server used to run the application (thin/puma/webrick). -P, [--pid=PID] # Specifies the PID file. # Default: tmp/pids/server.pid -C, [--dev-caching], [--no-dev-caching] # Specifies whether to perform caching in development. [--early-hints], [--no-early-hints] # Enables HTTP/2 early hints. ``` As a bonus, if you mistype the server to use, you'll get an auto-correction message: ``` $ rails s tin Could not find handler "tin". Maybe you meant "thin" or "cgi"? Run `rails server --help` for more options. ```
* | | | Fix routes command tests broken in e137831726.Kasper Timm Hansen2018-03-041-23/+16
| | | |
* | | | Merge pull request #32165 from bogdanvlviv/fix-occurrences-Fixnum-BignumRyuta Kamizono2018-03-055-19/+11
|\ \ \ \ | | | | | | | | | | Fix occurrences Fixnum|Bignum
| * | | | Fix occurrences Fixnum|Bignumbogdanvlviv2018-03-045-19/+11
| | | | | | | | | | | | | | | | | | | | Related to https://github.com/rails/rails/commit/d4eb0dc89ee6b476e2e10869dc282a96f956c6c7#r27830891
* | | | | Merge pull request #32166 from bogdanvlviv/fix-actionview-tests-executionKasper Timm Hansen2018-03-041-7/+8
|\ \ \ \ \ | |_|/ / / |/| | | | Fix actionview tests execution
| * | | | Fix actionview tests executionbogdanvlviv2018-03-041-7/+8
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On my local environment execution of `cd actionview/ && bin/test` raises error: ``` (snip) rails/actionview/test/template/render_test.rb:6:in `<top (required)>': superclass mismatch for class TestController (TypeError) ``` In some test files `TestController` inherited from `ActionController::Base`, but in `test/actionpack/controller/render_test.rb` file `TestController` inherited from `ApplicationController`. This produces error `superclass mismatch for class TestController (TypeError)` Step to reproduce this on any environment: `cd actionview/ && bin/test test/template/streaming_render_test.rb test/actionpack/controller/render_test.rb`
* | | | Merge pull request #32164 from ydakuka/patch-1Ryuta Kamizono2018-03-041-2/+2
|\ \ \ \ | |_|/ / |/| | | Fix links in the psql guide [ci skip]
| * | | Fix links in the psql guide [ci skip]Yauheni Dakuka2018-03-041-2/+2
| | | |
* | | | Merge pull request #32162 from ↵Kasper Timm Hansen2018-03-047-100/+74
|\ \ \ \ | |/ / / |/| | | | | | | | | | | kaspth/ast-unify-preview-variant-routes-and-controllers Merge Previews/Variants controller into one Representations controller.
| * | | Merge Previews/Variants controller into one Representations controller.Kasper Timm Hansen2018-03-037-100/+74
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | Since ActiveStorage::Blob::Representable unifies the idea of previews and variants under one roof as representation, we may as well have the controllers follow suit. Thus ActiveStorage::RepresenationsController enters the fray. I've copied the old tests for both previews and variants and unified those as well.
* / / `id_in_database` do not return nil value for persisted recordRyuta Kamizono2018-03-042-4/+4
|/ / | | | | | | | | This removes `|| id` which were added in #9963 and #23887 since it is no longer necessary.
* | Eager loading with polymorphic associations should behave consistentlyRyuta Kamizono2018-03-043-9/+9
| | | | | | | | | | | | | | | | | | | | This reverts ignoring polymorphic error introduced at 02da8ae. What the ignoring want to solve was caused by force eager loading regardless of whether it is necessary, but it has been fixed by #29043. The ignoring is now only causing a mismatch of `exists?` behavior with `to_a`, `count`, etc. It should behave consistently.
* | Extract all `base_class.name` as `polymorphic_name`Ryuta Kamizono2018-03-048-23/+43
| | | | | | | | | | | | | | This is an alternative of #29722, and follow up of #32048. This does not change the current behavior, but makes it easier to modify all polymorphic names consistently.
* | Fix RDoc formatting [ci skip]yuuji.yaginuma2018-03-031-1/+1
| | | | | | | | The `+` does not work if the string contains spaces.
* | Deprecate "active_support/core_ext/numeric/inquiry"bogdanvlviv2018-03-024-108/+5
| | | | | | | | | | | | Numeric#positive? and Numeric#negative? was added to Ruby since 2.3, see https://github.com/ruby/ruby/blob/ruby_2_3/NEWS Rails 6 requires Ruby 2.4.1+ since https://github.com/rails/rails/pull/32034
* | Deprecate `active_support/core_ext/hash/compact`yuuji.yaginuma2018-03-026-75/+6
| | | | | | | | | | Ruby 2.4+ provides `Hash#compact` and `Hash#compact!` natively, so `active_support/core_ext/hash/compact` is no longer necessary.
* | Remove unnecessary `respond_to?(:report_on_exception)` checkingyuuji.yaginuma2018-03-024-8/+8
| | | | | | | | Since Rails 6 requires Ruby 2.4.1+.
* | Ruby 2.4: take advantage of String#unpack1Jeremy Daer2018-03-017-10/+10
| | | | | | | | | | https://bugs.ruby-lang.org/issues/12752 https://ruby-doc.org/core-2.4.0/String.html#method-i-unpack1
* | PostgreSQL adapter also supports bulk alter since #31331 [ci skip]yuuji.yaginuma2018-03-021-1/+1
| |
* | Remove staled comment for `JoinDependency#initialize`Ryuta Kamizono2018-03-021-21/+0
| | | | | | | | | | | | | | | | | | | | | | This comment was added at 070dda2. That arguments has already been changed since those are internal nodoc classes, but the comment does not reflect the current state. I decided to remove the staled comment since it is not useful for understanding what the class does. [ci skip]
* | Don't expose `verbose?` helper methodRyuta Kamizono2018-03-021-6/+4
| | | | | | | | | | | | Follow up of b988ecb99ff6c8854e4b74ef8a7ade8d9ef5d954. This was added for internal usage, it doesn't need to be public.
* | Use `delegate private: true` for `SchemaCreation`Ryuta Kamizono2018-03-022-5/+3
| | | | | | | | Duplicated method name list is no longer needed.
* | `ConsoleFormatter` is no longer used as a classRyuta Kamizono2018-03-021-2/+2
| | | | | | | | It is used as a namespace for `Sheet` and `Expanded`.
* | Clean up `RoutesTest` a bityuuji.yaginuma2018-03-011-8/+6
| | | | | | | | | | | | * Remove unused require * Remove redundant `test` * Change `rake` to `rails`
* | Merge pull request #32130 from benoittgt/rake-routes-compact-modeRafael França2018-02-288-82/+232
|\ \ | | | | | | Add "rails routes --expanded" mode
| * | Add --expanded option to "rails routes"Benoit Tigeot2018-02-288-82/+232
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using rails routes with small terminal or complicated routes it can be very difficult to understand where is the element listed in header. psql had the same issue, that's why they created "expanded mode" you can switch using `\x` or by starting psql with ``` -x --expanded Turn on the expanded table formatting mode. This is equivalent to the \x command. ``` The output is similar to one implemented here for rails routes: db_user-# \du List of roles -[ RECORD 1 ]---------------------------------------------- Role name | super Attributes | Superuser, Create role, Create DB Member of | {} -[ RECORD 2 ]---------------------------------------------- Role name | role Attributes | Superuser, Create role, Create DB, Replication Member of | {}
* | | Rebuild activestorage.jsGeorge Claghorn2018-02-281-1/+1
| | |
* | | Handle file checksumming errorsGeorge Claghorn2018-02-281-0/+6
| | |
* | | Remove CHANGELOG entries which were backported to 5-2-stableRyuta Kamizono2018-02-284-28/+3
| | |
* | | Alias `assign_attributes` to `attributes=` for `AttributeAssignment`Ryuta Kamizono2018-02-283-5/+10
| | | | | | | | | | | | There is no reason `attributes=` doesn't take `assign_attributes`.
* | | Don't include unused `ActiveSupport::Concern`Ryuta Kamizono2018-02-281-1/+0
| | | | | | | | | | | | This was added in 9bfa13b, but it is never used from the beginning.
* | | Merge pull request #32133 from bogdanvlviv/delegate-with-privateRyuta Kamizono2018-02-283-16/+23
|\ \ \ | | | | | | | | Add separate test to ensure that `delegate` with `:private` option returns correct value
| * | | Add separate test to ensure that `delegate` with `:private` option returns ↵bogdanvlviv2018-02-283-16/+23
|/ / / | | | | | | | | | | | | | | | | | | | | | correct value Remove extra comments `# Asking for private method` in activesupport/test/core_ext/module_test.rb Improve docs of using `delegate` with `:private` Update changelog of #31944
* | | Merge pull request #32137 from okkez/patch-1Andrew White2018-02-281-1/+1
|\ \ \ | | | | | | | | Fix a typo in activerecord/CHANGELOG.md
| * | | Fix a typo in activerecord/CHANGELOG.mdokkez2018-02-281-1/+1
|/ / / | | | | | | | | | columsn -> columns
* | | Merge pull request #31926 from composerinteralia/am-attributesRafael França2018-02-282-0/+24
|\ \ \ | | | | | | | | Add ActiveModel::Attributes#attributes
| * | | Add ActiveModel::Attributes#attributesDaniel Colson2018-02-072-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | This starts to fix #31832. ActiveModel::Attributes includes ActiveModel::AttributeMethods, which requires an `#attributes` method that returns a hash with string keys.
* | | | Merge pull request #32087 from prikha/add-better-select-tag-option-handlingRafael França2018-02-273-1/+36
|\ \ \ \ | | | | | | | | | | Let select render default selected option for required field
| * | | | Let select render default selected option for required fieldSerj Prikhodko2018-02-273-1/+36
| | |/ / | |/| |
* | | | Merge pull request #32131 from bogdanvlviv/fix-new_framework_defaults_6_0Rafael França2018-02-272-3/+3
|\ \ \ \ | | | | | | | | | | Fix `new_framework_defaults_6_0.rb`
| * | | | Fix `new_framework_defaults_6_0.rb`bogdanvlviv2018-02-272-3/+3
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `default_enforce_utf8` belongs to `config.action_view` Update info about `:skip_enforcing_utf8` since we can change default behavior via `config.action_controller.default_enforce_utf8` Related to #32125
* | | | Merge pull request #31171 from sambostock/improve-abstract-class-documentationRyuta Kamizono2018-02-281-10/+36
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | Expand AR::Base.abstract_class documentation [ci skip]
| * | | | Expand AR::Base.abstract_class documentationSam Bostock2018-02-201-10/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous documentation is somewhat unclear about the use case for an abstract ActiveRecord class. This clears it up by highlighting the following points: - table_name is not derived from the abstract class' name - type is not derived on direct descendants of the abstract class - validations, not abstract_class, should be used to specify whether the parent model can be instantiated or not
* | | | | Merge pull request #32134 from bogdanvlviv/use-with_partial_writesRyuta Kamizono2018-02-281-5/+1
|\ \ \ \ \ | |_|/ / / |/| | | | Use `with_partial_writes` helper in `activerecord/test/cases/dirty_test.rb`
| * | | | Use `with_partial_writes` helper in `activerecord/test/cases/dirty_test.rb`bogdanvlviv2018-02-281-5/+1
|/ / / / | | | | | | | | | | | | Related to 948b931925febac3c965ab13470065ced68f7b53
* | | | Merge pull request #32127 from zamith/zamith/screenshot-absolute-pathRafael França2018-02-272-6/+6
|\ \ \ \ | | | | | | | | | | Uses the absolute path for system test screenshots