- 12 5月, 2020 12 次提交
-
-
由 Kasper Timm Hansen 提交于
Optimize dangerous_attribute_method?
-
由 George Claghorn 提交于
Depends on newer Rack API. This reverts commit fbf1d82e.
-
由 Xavier Noria 提交于
-
由 Xavier Noria 提交于
-
由 Aaron Patterson 提交于
Add Arel support for PostgreSQL contains and overlaps operators
-
由 Adam Lassek 提交于
Per [this discussion][arel-discussion] on the discourse forum, this is an addition to Arel for supporting `@>` (contains) and `&&` (overlaps) operators in PostgreSQL. They are useful for GIN-indexed data such as a `jsonb` or array column. [arel-discussion]: https://discuss.rubyonrails.org/t/what-has-happened-to-arel/74383/51
-
由 Aaron Patterson 提交于
Clean up the generate method signature
-
由 Aaron Patterson 提交于
Journey is a private API inside Rails now, so lets start cleaning up some of its signatures. In this case, we always wan to parameterize things the same way, so lets just do that in the code (rather than passing some strategy object in).
-
由 Ryuta Kamizono 提交于
Fix Ruby 2.7 keyword arguments warning
-
由 Jonathan Hefner 提交于
Partially addresses #39227. Co-authored-by: NRyuta Kamizono <kamipo@gmail.com>
-
由 Jonathan Fleckenstein 提交于
-
由 प्रथमेश Sonpatki 提交于
Also cleanup Action Text Changelog.
-
- 11 5月, 2020 5 次提交
-
-
由 Jean Boussier 提交于
Profiling our application boot shows this method at 1.3% of boot time: ``` ActiveRecord::AttributeMethods::ClassMethods#dangerous_attribute_method? (/tmp/bundle/ruby/2.7.0/bundler/gems/rails-4919b459d946/activerecord/lib/active_record/attribute_methods.rb:100) samples: 5 self (0.0%) / 866 total (1.3%) callers: 866 ( 100.0%) ActiveRecord::AttributeMethods::PrimaryKey::ClassMethods#dangerous_attribute_method? callees (861 total): 861 ( 100.0%) ActiveRecord::AttributeMethods::ClassMethods#method_defined_within? ``` [A quick benchmark](https://gist.github.com/casperisfine/0ce1161253ab643f5f15ff63e901b818) shows that we can make it 2 to 3 times faster by precomputing the list of dangerous methods, and doing a simple set lookup. Of course this isn't strictly equivalent, as it's no longer dynamic, so if you include a module in `AR::Base` after the list was computed, new dangerous methods won't be considered. But at the same time, if the list was already computed, it means you defined attribute methods before AR::Base was fully initialized. `dangerous_class_method?` is pretty much invisible on profiles, but I applied the same optimization to it for consistency's sake.
-
由 Niklas Häusele 提交于
* Adds a rails test:all rake task This task runs all tests, including system tests. * Better placement + slight tweak of the comment Co-authored-by: NDavid Heinemeier Hansson <david@loudthinking.com>
-
由 Eugene Kenny 提交于
Address `InnerJoinAssociationTest#test_eager_load_with_string_joins` failure with mysql2
-
由 Yasuo Honda 提交于
`ReadOnlyTest#test_field_named_field` performs implicit commit the transaction by `ReadOnlyTest#setup` because of the MySQL database behavior. This commit addresses the failure at https://buildkite.com/rails/rails/builds/68962#68213887-1cef-4f76-9c95-aebc8799c806 Here are minimum steps to reproduce: ```ruby % ARCONN=mysql2 bin/test test/cases/readonly_test.rb test/cases/dirty_test.rb test/cases/associations/inner_join_association_test.rb \ -n "/^(?:ReadOnlyTest#(?:test_has_many_with_through_is_not_implicitly_marked_readonly)|DirtyTest#(?:test_field_named_field)|InnerJoinAssociationTest#(?:test_eager_load_with_string_joins))$/" --seed 50855 Using mysql2 Run options: -n "/^(?:ReadOnlyTest#(?:test_has_many_with_through_is_not_implicitly_marked_readonly)|DirtyTest#(?:test_field_named_field)|InnerJoinAssociationTest#(?:test_eager_load_with_string_joins))$/" --seed 50855 ..F Failure: InnerJoinAssociationTest#test_eager_load_with_string_joins [/Users/yahonda/src/github.com/rails/rails/activerecord/test/cases/associations/inner_join_association_test.rb:87]: Expected: 3 Actual: 4 bin/test test/cases/associations/inner_join_association_test.rb:82 Finished in 0.114674s, 26.1611 runs/s, 26.1611 assertions/s. 3 runs, 3 assertions, 1 failures, 0 errors, 0 skips ``` References: - "13.3.3 Statements That Cause an Implicit Commit" https://dev.mysql.com/doc/refman/8.0/en/implicit-commit.html
-
由 Jonathan Hefner 提交于
Clarify existing app behavior when being upgraded [ci skip]
-
- 10 5月, 2020 18 次提交
-
-
由 Ryuta Kamizono 提交于
Fix incorrectly successful datetime precision tests
-
由 akinomaeni 提交于
datetime with precision was passing assert_no_microsecond_precision unintentionally, because `/\d\z/` is match to both datetime with precision and datetime without precision. Fixed that by changing time and regex to make it easier to grasp with and without precision. Fix stub_version to consider schema_cache. ref: #35795 Remove failing test for unsupported version of MariaDB. ref: fb6743ac
-
由 Ryuta Kamizono 提交于
-
由 Ryuta Kamizono 提交于
Support `ALGORITHM = INSTANT` DDL option for index operations on MySQL
-
由 Jonathan Hefner 提交于
Closes #39213.
-
由 Duncan Brown 提交于
Rack decided to tolerate proxies which choose to attach ports to X-Forwarded-For IPs by stripping the port: https://github.com/rack/rack/pull/1251. Attaching a port is rare in the wild but some proxies (notably Microsoft Azure's App Service) do it. Without this patch, remote_ip will ignore X-Forwarded-For IPs with ports attached and the return value is less likely to be useful. Rails should do the same thing. The stripping logic is already available in Rack::Request::Helpers, so change the X-Forwarded-For retrieval method from ActionDispatch::Request#x_forwarded_for (which returns the raw header) to #forwarded_for, which returns a stripped array of IP addresses, or nil. There may be other benefits hiding in Rack's implementation. We can't call ips_from with an array (and legislating for that inside ips_from doesn't appeal), so refactor out the bit we need to apply in both cases (verifying the IP is acceptable to IPAddr and that it's not a range) to a separate method called #sanitize_ips which reduces an array of maybe-ips to an array of acceptable ones.
-
由 Ryuta Kamizono 提交于
Since MySQL 8.0.12, MySQL supports `ALGORITHM=INSTANT` DDL option. https://dev.mysql.com/doc/refman/8.0/en/innodb-online-ddl-operations.html#online-ddl-index-operations
-
由 Ryuta Kamizono 提交于
Eager generate relation methods if a method is on `Kernel`
-
由 Ryuta Kamizono 提交于
Follow up of #34122. Relation method call is relying on method_missing, but if `Kernel` has the same named method (e.g. `open`, etc), it will invoke Kernel's method since method_missing is not happened. To prevent that, eager generate relation methods if a method is the same name on `Kernel`. Fixes #39195.
-
由 Ryuta Kamizono 提交于
dfa439ee 6708f3a5
-
由 Ryuta Kamizono 提交于
-
由 Ryuta Kamizono 提交于
-
由 Ryuta Kamizono 提交于
-
由 Ryuta Kamizono 提交于
`singleton_class` is in Ruby 1.9.2, and there is no use singleton class eval in the files.
-
由 Ryuta Kamizono 提交于
Refactor index creation to use index definition visitor
-
由 Ryuta Kamizono 提交于
Current SQL generation code is hard to maintenance, I've found a bug that create index comment in bulk change table when I'm refactoring that.
-
由 Ryuta Kamizono 提交于
I've found the bug when I'm refactoring index creation code in #39203.
-
由 Ryuta Kamizono 提交于
Add tests for to_s(:inspect)
-
- 09 5月, 2020 5 次提交
-
-
由 akinomaeni 提交于
-
由 Jonathan Hefner 提交于
Association callbacks work with abort instead of exceptions [ci skip]
-
由 Petrik 提交于
To prevent an object from being added/removed from an association an abort must be thrown, not an Exception.
-
由 John Hawthorn 提交于
Support kwargs for named scopes
-
由 Ryuta Kamizono 提交于
We fixed `generate_relation_method` to address kwargs warnings at #38038, but I missed generated named scopes also need the same fix. Test case has picked from #39196. Co-authored-by: NJohn Hawthorn <john@hawthorn.email>
-