- 05 12月, 2017 1 次提交
-
-
由 Yoshiyuki Hirano 提交于
1) It seems that it raise error on example code in `ActiveJob::Core`. Before: ```ruby class DeliverWebhookJob < ActiveJob::Base def serialize super.merge('attempt_number' => (@attempt_number || 0) + 1) end def deserialize(job_data) super @attempt_number = job_data['attempt_number'] end rescue_from(Timeout::Error) do |exception| raise exception if @attempt_number > 5 retry_job(wait: 10) end def perform raise Timeout::Error end end ``` Then it run `DeliverWebhookJob.perform_now` in `rails console`. And raise error: NoMethodError: undefined method `>' for nil:NilClass from /app/jobs/deliver_webhook_job.rb:12:in `block in <class:DeliverWebhookJob>' So I thought it's necessary to fix it. After: ```ruby class DeliverWebhookJob < ActiveJob::Base attr_writer :attempt_number def attempt_number @attempt_number ||= 0 end def serialize super.merge('attempt_number' => attempt_number + 1) end def deserialize(job_data) super self.attempt_number = job_data['attempt_number'] end rescue_from(Timeout::Error) do |exception| raise exception if attempt_number > 5 retry_job(wait: 10) end def perform raise Timeout::Error end end ``` Then it run `DeliverWebhookJob.perform_now` in `rails console`. And it does'nt raise error NoMethodError. 2) Use `Timeout::Error` instead of `TimeoutError` (`TimeoutError` is deprecated).
-
- 04 12月, 2017 9 次提交
-
-
由 Guillermo Iguaran 提交于
Add tests for the `--webpack` option
-
由 Tsukuru Tanimichi 提交于
We probably don't have any tests for the `--webpack` option. related: #27288
-
由 Ryuta Kamizono 提交于
`get_all_versions` doesn't use passed `connection`. So it should be caught `NoDatabaseError` from `SchemaMigration.table_exists?`.
-
由 Sean Griffin 提交于
Update "Active Record Query Interface" guide [ci skip]
-
由 bogdanvlviv 提交于
- Add missing `LIMIT 1` for some queries - Make some examples of query more readable
-
由 Kasper Timm Hansen 提交于
-
由 Kasper Timm Hansen 提交于
Update cookie_store_test to use encrypted cookies
-
由 Kasper Timm Hansen 提交于
Ignore `NoDatabaseError` when loading schema cache
-
由 Kasper Timm Hansen 提交于
-
- 03 12月, 2017 13 次提交
-
-
由 Ryuta Kamizono 提交于
This is a regression since Rails 4.2. SQLite3 integer is stored in 1, 2, 3, 4, 6, or 8 bytes depending on the magnitude of the value. Assuming default valid value as 4 bytes caused that actual valid value in INTEGER storage class cannot be stored and existing value cannot be found. https://www.sqlite.org/datatype3.html We should allow valid value in INTEGER storage class in SQLite3 to fix the regression. Fixes #22594.
-
由 Ryuta Kamizono 提交于
Actually SQLite3 doesn't have JSON storage class (so it is stored as a TEXT like Date and Time). But emulating JSON types is convinient for making database agnostic migrations.
-
由 Ryuta Kamizono 提交于
If do not execute a type changing first, filling in default value may be failed. ``` % ARCONN=postgresql be ruby -w -Itest test/cases/migration/compatibility_test.rb -n test_legacy_change_column_with_null_executes_update Using postgresql Run options: -n test_legacy_change_column_with_null_executes_update --seed 20459 E Error: ActiveRecord::Migration::CompatibilityTest#test_legacy_change_column_with_null_executes_update: StandardError: An error has occurred, this and all later migrations canceled: PG::StringDataRightTruncation: ERROR: value too long for type character varying(5) : UPDATE "testings" SET "foo"='foobar' WHERE "foo" IS NULL ```
-
由 George Claghorn 提交于
-
由 Yuji Yaginuma 提交于
Fix typo in test error message
-
由 yuuji.yaginuma 提交于
This is necessary in order to make the processing dependent on `Migrator.current_version` work even without database. Context: https://github.com/rails/rails/pull/31135#issuecomment-348404326
-
由 Ryuta Kamizono 提交于
`klass` has removed in 5358f2b6.
-
由 Ryuta Kamizono 提交于
This test failed due to dirty schema cache. It is needed to call `clear_cache!` when using same named table with different definition. https://travis-ci.org/rails/rails/jobs/310627767#L769-L772
-
由 Ryuta Kamizono 提交于
And placed `add_options_for_index_columns` in `schema_statements.rb` consistently to ease to find related code.
-
由 Ryuta Kamizono 提交于
-
由 Ryuta Kamizono 提交于
-
由 claudiob 提交于
With the current code, a failing test shows this error, which is missing the number of times called and has two periods at the end. ``` /railties$ be ruby -Itest test/generators/app_generator_test.rb -n test_active_storage_install Failure: AppGeneratorTest#test_active_storage_install [test/generators/app_generator_test.rb:313]: active_storage:install expected to be called once, but was called times.. Expected: 1 Actual: 2 ``` After the fix, the error message looks correct: ``` /railties$ be ruby -Itest test/generators/app_generator_test.rb -n test_active_storage_install Failure: AppGeneratorTest#test_active_storage_install [test/generators/app_generator_test.rb:313]: active_storage:install expected to be called once, but was called 2 times. Expected: 1 Actual: 2 ```
-
由 Matthew Draper 提交于
Extract sql fragment generators from PostgreSQL adapter
-
- 02 12月, 2017 6 次提交
-
-
由 Yuji Yaginuma 提交于
[ci skip] Add a missing space before closing curly braces
-
由 willnet 提交于
-
由 Dinah Shi 提交于
-
由 yuuji.yaginuma 提交于
-
由 Matthew Draper 提交于
Add ability to create/validate invalid foreign keys in Postgres
-
由 George Claghorn 提交于
-
- 01 12月, 2017 11 次提交
-
-
由 Travis Hunter 提交于
Add validate_constraint and update naming
-
由 Ryuta Kamizono 提交于
-
由 Ryuta Kamizono 提交于
-
由 Matthew Draper 提交于
Add support for PostgreSQL operator classes to add_index
-
由 Matthew Draper 提交于
Drop the before_fork/on_worker_boot advice
-
由 Ryuta Kamizono 提交于
-
由 Ryuta Kamizono 提交于
It makes more sense than ignoring invalid IDs.
-
由 George Claghorn 提交于
-
由 Ryuta Kamizono 提交于
In 35836019, class level `update` and `destroy` suppressed `RecordNotFound` to ensure returning affected objects. But `RecordNotFound` is a common exception caught by a `rescue_from` handler. So changing the behavior when a typical `params[:id]` is passed has a compatibility problem. The previous behavior should not be changed. Fixes #31301.
-
由 Yuji Yaginuma 提交于
Cosmetic changes for Gemfile [ci skip]
-
由 Ryuta Kamizono 提交于
[ci skip] Updated links for unicorn which redirect & added https for n…
-