- 21 6月, 2019 2 次提交
-
-
由 Ryuta Kamizono 提交于
Address test_statement_cache_with_in_clause failure
-
由 Rafael França 提交于
Revert schema dumper to use strings rather than integers
-
- 20 6月, 2019 12 次提交
-
-
由 Yasuo Honda 提交于
This failure is occasional, does not always reproduce. ```ruby $ cd activerecord $ bundle exec rake test_postgresql ... snip ... ....F Failure: ActiveRecord::BindParameterTest#test_statement_cache_with_in_clause [/home/yahonda/git/rails/activerecord/test/cases/bind_parameter_test.rb:97]: Expected: [1, 3] Actual: [3, 1] rails test home/yahonda/git/rails/activerecord/test/cases/bind_parameter_test.rb:93 ```
-
由 eileencodes 提交于
I think we should change this, but not in 6-0-stable since that's already in RC and I was trying to only make changes that won't require any app changes. This reverts a portion of https://github.com/rails/rails/pull/36439 that made all schema migration version numbers get dumped as an integer. While it doesn't _really_ matter it did change behavior. We should bring this back in 6.1 with a deprecation.
-
由 Ryuta Kamizono 提交于
Add test cases to ensure deterministic order for ordinal methods
-
由 Yuji Yaginuma 提交于
Include BCC in the mail that sent from the development page
-
由 yuuji.yaginuma 提交于
The BCC should be included as we show input field for BCC in view. https://github.com/rails/rails/blob/bf625f7fecabbcda22b388e088ad5c29016b2385/actionmailbox/app/views/rails/conductor/action_mailbox/inbound_emails/new.html.erb#L21-L24
-
由 Yuji Yaginuma 提交于
Allow using env var to specify pidfile
-
由 Kasper Timm Hansen 提交于
Stop serializing and parsing columns_hash in Active Record schema caches
-
由 Gannon McGibbon 提交于
Autoload SyntaxErrorInTemplate
-
由 Guilherme Mansur 提交于
When a SyntaxError is detected in a template we raise this exception. On a first request to the server the exception we get a NameError since the exception is not required from `active_view/template/error.rb` yet. However later on it gets required and a second request will succeed. On the first request we see the rails "Something Wen Wrong" page and not the expected syntax error in template error page with the webconsole and stacktrace. By autoloading the constant we fix this issue. Co-authored-by: NGannon McGibbon <gannon.mcgibbon@gmail.com>
-
由 Gannon McGibbon 提交于
Better error message for calling columns_hash
-
由 Guilherme Mansur 提交于
When a record does not have a table name, as in the case for a record with `self.abstract_class = true` and no `self.table_name` set the error message raises a cryptic: "ActiveRecord::StatementInvalid: Could not find table ''" this patch now raises a new `TableNotSpecified Error` Fixes: #36274 Co-Authored-By: NEugene Kenny <elkenny@gmail.com>
-
由 Jean Boussier 提交于
-
- 19 6月, 2019 3 次提交
-
-
由 Ryuta Kamizono 提交于
Before 1340498d, `order` with no-op value (e.g. `nil`, `""`) had broken the contract of ordinal methods, which returns a result deterministic ordered.
-
由 Ben Thorner 提交于
Previously it was only possible to specify the location of the pidfile for the 'rails server' command with the '-P' flag. This adds support for specifying the pidfile using a PIDFILE env var, which can still be overridden by the '-P' flag and with the default pidfile path unchanged. The motivation for this feature comes from using Docker to run multiple instances of the same rails app. When developing a rails app with Docker, it's common to bind-mount the rails root directory in the running container, so that changes to files are shared between the container and the host. However, this doesn't work so well with the pidfile and it's necessary to (remember to) add a '-P' flag to the 'rails server' command line; being able to specify this flag using an env var would make developing with Rails+Docker a bit simpler.
-
由 Kasper Timm Hansen 提交于
Deduplicate various Active Record schema cache structures
-
- 18 6月, 2019 3 次提交
-
-
由 Ryuta Kamizono 提交于
Avoid redundant `time.getutc` call if it is already utc time object
-
由 Rafael França 提交于
Fix TranslationHelper#translate handling of Hash defaults
-
由 Ryuta Kamizono 提交于
Currently `type.serialize` and `connection.{quote|type_cast}` for a time object always does `time.getutc` call regardless of whether it is already utc time object or not, that duplicated proccess (`connection.type_cast(type.serialize(time))`) allocates extra/useless time objects for each type casting. This avoids that redundant `time.getutc` call if it is already utc time object. In the case of a model has timestamps (`created_at` and `updated_at`), it avoids 6,000 time objects allocation for 1,000 times `model.save`. ```ruby ObjectSpace::AllocationTracer.setup(%i{path line type}) pp ObjectSpace::AllocationTracer.trace { 1_000.times { User.create } }.select { |k, _| k[0].end_with?("quoting.rb", "time_value.rb") } ``` Before (c104bfe4): ``` {["~/rails/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb", 203, :T_ARRAY]=>[1004, 0, 778, 0, 1, 0], ["~/rails/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb", 220, :T_STRING]=>[2, 0, 2, 1, 1, 0], ["~/rails/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb", 209, :T_ARRAY]=>[8, 0, 8, 1, 1, 0], ["~/rails/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb", 57, :T_ARRAY]=>[4, 0, 4, 1, 1, 0], ["~/rails/activemodel/lib/active_model/type/helpers/time_value.rb", 17, :T_DATA]=>[4000, 0, 3096, 0, 1, 0], ["~/rails/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb", 120, :T_DATA]=>[2000, 0, 1548, 0, 1, 0], ["~/rails/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb", 126, :T_STRING]=>[4000, 0, 3096, 0, 1, 0]} ``` After (this change): ``` {["~/rails/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb", 203, :T_ARRAY]=>[1004, 0, 823, 0, 1, 0], ["~/rails/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb", 220, :T_STRING]=>[2, 0, 2, 1, 1, 0], ["~/rails/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb", 209, :T_ARRAY]=>[8, 0, 8, 1, 1, 0], ["~/rails/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb", 57, :T_ARRAY]=>[4, 0, 4, 1, 1, 0], ["~/rails/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb", 126, :T_STRING]=>[2000, 0, 1638, 0, 1, 0]} ```
-
- 17 6月, 2019 4 次提交
-
-
由 Ryuta Kamizono 提交于
PostgreSQL: Fix GROUP BY with ORDER BY virtual count attribute
-
由 Ryuta Kamizono 提交于
GROUP BY with virtual count attribute is invalid for almost all databases, but it is valid for PostgreSQL, and it had worked until Rails 5.2.2, so it is a regression for Rails 5.2.3 (caused by 311f0011). I can't find perfectly solution for fixing this for now, but I would not like to break existing apps, so I decided to allow referencing virtual count attribute in ORDER BY clause when GROUP BY aggrigation (it partly revert the effect of 311f0011) to fix the regression #36022. Fixes #36022.
-
由 Prem Sichanugrist 提交于
Fix typo initialzer -> initializer [ci skip]
-
由 Abhay Nikam 提交于
-
- 16 6月, 2019 3 次提交
-
-
由 Ryuta Kamizono 提交于
Delete method definition in rails that is compatible with ruby defini…
-
由 soartec-lab 提交于
Tests are also only on the `Time` class Update doc forgetting to erase when moved Update guide `Date` class to `Time` class and defined file Update guide correction omission
-
由 yuuji.yaginuma 提交于
Ref: bcf370d6, 06ab7b27.
-
- 15 6月, 2019 13 次提交
-
-
由 Ryuta Kamizono 提交于
Remove unused `Arel::Attributes.for`
-
由 Ryuta Kamizono 提交于
Delete 'ruby' in the description of the method defined in rails [skip ci]
-
由 soartec-lab 提交于
-
由 Ryuta Kamizono 提交于
`Arel::Attributes.for` is no longer used since https://github.com/rails/arel/pull/196.
-
由 Ryuta Kamizono 提交于
No allocation `Arel::Visitors::ToSql#visit`
-
由 Ryuta Kamizono 提交于
Each `visit o, collector` allocates one extra array due to receiving args by splat array. https://github.com/rails/rails/blob/2c3332cc4c0fa77dbe2e13e8a792f80fbd8f4ad3/activerecord/lib/arel/visitors/visitor.rb#L27-L29 Currently 1,000 times `User.where(id: 1).to_sql` allocates 13,000 arrays in `visitor.accept`. This avoids receiving args by splat array, it makes `visitor.accept` no array allocation. ```ruby ObjectSpace::AllocationTracer.setup(%i{path line type}) pp ObjectSpace::AllocationTracer.trace { 1_000.times { User.where(id: 1).to_sql } }.select { |k, _| k[2] == :T_ARRAY && k[0].end_with?("visitor.rb", "to_sql.rb") } ``` Before (2c3332cc): ``` {["~/rails/activerecord/lib/arel/visitors/to_sql.rb", 18, :T_ARRAY]=>[1000, 0, 0, 0, 0, 0], ["~/rails/activerecord/lib/active_record/connection_adapters/determine_if_preparable_visitor.rb", 11, :T_ARRAY]=>[1000, 0, 0, 0, 0, 0], ["~/rails/activerecord/lib/arel/visitors/visitor.rb", 12, :T_ARRAY]=>[1000, 0, 0, 0, 0, 0], ["~/rails/activerecord/lib/arel/visitors/to_sql.rb", 788, :T_ARRAY]=>[3000, 0, 0, 0, 0, 0], ["~/rails/activerecord/lib/arel/visitors/to_sql.rb", 794, :T_ARRAY]=>[3000, 0, 0, 0, 0, 0], ["~/rails/activerecord/lib/arel/visitors/to_sql.rb", 156, :T_ARRAY]=>[1000, 0, 0, 0, 0, 0], ["~/rails/activerecord/lib/arel/visitors/to_sql.rb", 443, :T_ARRAY]=>[1000, 0, 0, 0, 0, 0], ["~/rails/activerecord/lib/arel/visitors/to_sql.rb", 603, :T_ARRAY]=>[1000, 0, 0, 0, 0, 0], ["~/rails/activerecord/lib/arel/visitors/to_sql.rb", 611, :T_ARRAY]=>[1000, 0, 0, 0, 0, 0]} ``` After (this change): ``` {} ```
-
由 Akira Matsuda 提交于
-
由 Ryuta Kamizono 提交于
Tables in tests are not always empty so `klass.first` does not always find last created record. Fixes #36479.
-
由 Ryuta Kamizono 提交于
-
由 Eileen M. Uchitelle 提交于
Move while_preventing_writes from conn to handler
-
由 eileencodes 提交于
If we put the `while_preventing_writes` on the connection then the middleware that sends reads to the primary and ensures they can't write will not work. The `while_preventing_writes` will only be applied to the connection which it's called on - which in the case of the middleware is Ar::Base. This worked fine if you called it directly like `OtherDbConn.connection.while_preventing_writes` but Rails didn't have a way of knowing you wanted to call it on all the connections. The change here moves the `while_preventing_writes` method from the connection to the handler so that it can block writes to all queries for that handler. This will apply to all the connections associated with that handler.
-
由 Eileen M. Uchitelle 提交于
Update multi-db docs
-