- 05 1月, 2019 23 次提交
-
-
由 George Claghorn 提交于
Remove comment from `actiontext/actiontext.gemspec`
-
由 George Claghorn 提交于
Fix API docs of `ActionText::RichText` [ci skip]
-
由 Javan Makhmali 提交于
Use ES6 and Webpacker in ActionCable guide.
-
由 bogdanvlviv 提交于
This comment was autogenerated, see `railties/lib/rails/generators/rails/plugin/templates/%name%.gemspec.tt` Since actiontext is well described in this file, I think we shouldn't keep this comment. Note that this commit is more like cosmetic change, so it is OK if we don't merge this.
-
由 bogdanvlviv 提交于
This text should appear on the page https://api.rubyonrails.org/v6.0/classes/ActionText/RichText.html Related to 86517942
-
由 George Claghorn 提交于
-
由 George Claghorn 提交于
-
由 George Claghorn 提交于
Import Action Text
-
由 George Claghorn 提交于
-
由 Rosa Gutierrez 提交于
Also, make tests and examples for individual execution counters clearer, as it wasn't entierly clear what would happen in this case: ``` retry_on CustomException, OtherException, attempts: 3 ``` The job would be retried at most 3 times in total, for both CustomException and OtherException. To have the job retry 3 times at most for each exception individually, the following retry_on declarations are necessary: ``` retry_on CustomException, attempts: 3 retry_on OtherException, attempts: 3 ```
-
由 Gannon McGibbon 提交于
[ci skip]
-
由 Rikki Pitt 提交于
When using the `rich_text_area_tag` form helper from within a Rails engine, the direct_upload_url and blob_url_template options would default to non-existent routes. By prefixing these routes with `main_app` we ensure the application root is used rather than the engine.
-
由 George Claghorn 提交于
Test Action Mailbox configurations
-
由 Kasper Timm Hansen 提交于
Fix `new_framework_defaults_6_0.rb` file
-
由 Rafael França 提交于
Add `ActiveModel::Errors#of_kind?`
-
由 Ryuta Kamizono 提交于
Clarify `delegate_missing_to` [ci skip]
-
由 bogdanvlviv 提交于
Since #34864 removed explicit receiver to clarify the purpose of `delegate_missing_to`, I think it will be better to do the same a few lines above to easier figure out that `delegate_missing_to` defines `method_missing`, `respond_to_missing?` when comparing these examples.
-
由 bogdanvlviv 提交于
`Rails.application.config.active_job.return_false_on_aborted_enqueue` should be commented as well.
-
-
由 George Claghorn 提交于
Match Action Mailbox, which sets a default queue for each of its two jobs.
-
由 Rafael França 提交于
Clarify benefit of `delegate_missing_to`
-
由 Michael Gee 提交于
Removing the explicit receiver clarifies the purpose of `delegate_missing_to`.
-
- 04 1月, 2019 14 次提交
-
-
由 Eileen M. Uchitelle 提交于
Don't expect defined protect_against_forgery? in {token,csrf_meta}_tag
-
由 Vipul A M 提交于
Fix example of I18n setting in the guide [ci skip]
-
由 bogdanvlviv 提交于
Since #34356 logging `locale` value is more correct
-
由 Eileen M. Uchitelle 提交于
For fixtures share the connection pool when there are multiple handlers
-
由 Ryuta Kamizono 提交于
Make average compatible across ruby versions
-
由 Alberto Almagro 提交于
Since Ruby 2.6.0 NilClass#to_d is returning `BigDecimal` 0.0, this breaks `average` compatibility with prior Ruby versions. This patch makes `average` return `nil` in all Ruby versions when there are no rows.
-
由 Alberto Almagro 提交于
This reverts commit 89b4612f.
-
由 Rafael França 提交于
Update the "Configuring Rails Applications" guide [ci skip]
-
由 bogdanvlviv 提交于
Add section "Results of `load_defaults`" to the guide.
-
由 Ryuta Kamizono 提交于
-
由 Ryuta Kamizono 提交于
`nil`, `Numeric`, and `String` are most basic objects which are passed to `type_cast`. But now each `when *types_which_need_no_typecasting` evaluation allocates extra two arrays, it makes `type_cast` slower. The `types_which_need_no_typecasting` was introduced at #15351, but the method isn't useful (never used any adapters) since all adapters (sqlite3, mysql2, postgresql, oracle-enhanced, sqlserver) still overrides the `_type_cast`. Just expanding the method would make the `type_cast` 2x faster. ```ruby module ActiveRecord module TypeCastFast def type_cast_fast(value, column = nil) value = id_value_for_database(value) if value.is_a?(Base) if column value = type_cast_from_column(column, value) end _type_cast_fast(value) rescue TypeError to_type = column ? " to #{column.type}" : "" raise TypeError, "can't cast #{value.class}#{to_type}" end private def _type_cast_fast(value) case value when Symbol, ActiveSupport::Multibyte::Chars, Type::Binary::Data value.to_s when true then unquoted_true when false then unquoted_false # BigDecimals need to be put in a non-normalized form and quoted. when BigDecimal then value.to_s("F") when nil, Numeric, String then value when Type::Time::Value then quoted_time(value) when Date, Time then quoted_date(value) else raise TypeError end end end end conn = ActiveRecord::Base.connection conn.extend ActiveRecord::TypeCastFast Benchmark.ips do |x| x.report("type_cast") { conn.type_cast("foo") } x.report("type_cast_fast") { conn.type_cast_fast("foo") } x.compare! end ``` ``` Warming up -------------------------------------- type_cast 58.733k i/100ms type_cast_fast 101.364k i/100ms Calculating ------------------------------------- type_cast 708.066k (± 5.9%) i/s - 3.583M in 5.080866s type_cast_fast 1.424M (± 2.3%) i/s - 7.197M in 5.055860s Comparison: type_cast_fast: 1424240.0 i/s type_cast: 708066.0 i/s - 2.01x slower ```
-
由 Rafael Mendonça França 提交于
Add `--skip-action-mailbox` option to `rails new`
-
由 Eileen Uchitelle 提交于
In an application that has a primary and replica database the data inserted on the primary connection will not be able to be read by the replica connection. In a test like this: ``` test "creating a home and then reading it" do home = Home.create!(owner: "eileencodes") ActiveRecord::Base.connected_to(role: :default) do assert_equal 3, Home.count end ActiveRecord::Base.connected_to(role: :readonly) do assert_equal 3, Home.count end end ``` The home inserted in the beginning of the test can't be read by the replica database because when the test is started a transasction is opened byy `setup_fixtures`. That transaction remains open for the remainder of the test until we are done and run `teardown_fixtures`. Because the data isn't actually committed to the database the replica database cannot see the data insertion. I considered a couple ways to fix this. I could have written a database cleaner like class that would allow the data to be committed and then clean up that data afterwards. But database cleaners can make the database slow and the point of the fixtures is to be fast. In GitHub we solve this by sharing the connection pool for the replicas with the primary (writing) connection. This is a bit hacky but it works. Additionally since we define `replica? || preventing_writes?` as the code that blocks writes to the database this will still prevent writing on the replica / readonly connection. So we get all the behavior of multiple connections for the same database without slowing down the database. In this PR the code loops through the handlers. If the handler doesn't match the default handler then it retrieves the connection pool from the default / writing handler and assigns the reading handler's connections to that pool. Then in enlist_fixture_connections it maps all the connections for the default handler because all the connections are now available on that handler so we don't need to loop through them again. The test uses a temporary connection pool so we can test this with sqlite3_mem. This adapter doesn't behave the same as the others and after looking over how the query cache test works I think this is the most correct. The issues comes when calling `connects_to` because that establishes new connections and confuses the sqlite3_mem adapter. I'm not entirely sure why but I wanted to make sure we tested all adapters for this change and I checked that it wasn't the shared connection code that was causing issues - it was the `connects_to` code.
-
由 Gannon McGibbon 提交于
Add missing keys to ActiveSupport#instrumentation guide [skip ci]
-
- 03 1月, 2019 3 次提交
-
-
由 Kasper Timm Hansen 提交于
Only define attribute methods from schema cache
-
由 David Heinemeier Hansson 提交于
-
由 yuuji.yaginuma 提交于
Don't need to specify the version because Bundler 2.0 released. Ref: https://bundler.io/blog/2019/01/03/announcing-bundler-2.html
-