- 05 3月, 2020 10 次提交
-
-
由 Yash Ladha 提交于
This is done because concerns of respective steps can be separated, which in turns leads to easier walkthrough and verbosity. Also stretching a function to large horizontal bounds doesn't looks good.
-
由 Rafael França 提交于
Allow `rails new . --master` to point to master branch
-
由 Rafael França 提交于
Properly close a tag to avoid errors with some ruby versions
-
由 Nick Schwaderer 提交于
Co-Authored-By: NRafael França <rafael@franca.dev>
-
由 Xavier Noria 提交于
Here we want end of string, no optional newlines are to be expected, so \z is more concise.
-
由 Xavier Noria 提交于
Deduplicate Module#module_parent_name cache
-
由 Rafael França 提交于
[guides] Update missing translation example
-
由 Rafael França 提交于
Fixed Active Storage Overview guide containing XSS vulnerability
-
由 Jean Boussier 提交于
-
由 Humberto 提交于
It raises an error if the ruby version is 2.5.0
-
- 04 3月, 2020 12 次提交
-
-
由 Eileen M. Uchitelle 提交于
Refactor invert predicate
-
由 eileencodes 提交于
Instead of doing a case statement here we can have each of the objects respond to `invert`. This means that when adding new objects we don't need to increase this case statement, it's more object oriented, and let's be fair, it looks better too. Aaron and I stumbled upon this while working on some performance work in Arel. I removed `random_object` from the invert test because we don't support random objects. If you pass a random object to Arel, it should raise, not be inverted. Co-authored-by: NAaron Patterson <aaron.patterson@gmail.com>
-
由 Eileen M. Uchitelle 提交于
Add support for que name to Que adapter.
-
由 Wojciech Wnętrzak 提交于
Co-authored-by: NBrad Nauta <bradnauta@gmail.com>
-
由 Nick Schwaderer 提交于
Currently the `rails new` generator supports options `—dev` and `—edge`. `—dev` points to one’s local rails setup and `--edge` points to the latest stable Rails branch. However, in the Rails community we often think of the ‘edge’ as the latest merged master. We can see as much in Shopify’s fantastic article showing how they point to the latest master version of Rails: https://engineering.shopify.com/blogs/engineering/living-on-the-edge-of-rails I would originally have recommended changing ‘edge’ to point to master, as it has tripped me up on numerous occasions now. However I would rather add the desired functionality then change the current edge functionality. Therefore this PR adds the `—master` flag. It is intended to do exactly as `edge` does, simply with the changethat it points to Rails’ master branch instead of latest stable (i.e. 6_0_stable) Whenever developers see a new feature in Rails, such as the recently committed horizontal sharding (which prompted my PR), we would love to spin up a new Rails App to try out these new features. This command would allow us to jump right in with no configuration and offer our testing of the features, even those of us who aren’t able to spend a lot of time on OSS support.
-
由 Jakub 提交于
-
由 Jakub 提交于
-
由 Rafael França 提交于
Fix AJ wrong deprecation message on `after_callbacks_if_terminated`:
-
由 Edouard CHIN 提交于
- ### Problem In some cirumstances, the deprecation message to warn that AJ won't run `after_(enqueue/perform)` callbacks when the chain is halted by a `throw(:abort)` will be thrown even though no `throw(:abort)` was thrown. ```ruby run_callback(:foo) do ... end ``` There is two possible way for the callback body to not be executed: 1) `before` callback throw a `abort` 2) `before` callback raises an error which is rescued by an around callback (See associated test in this commit for an example) When 2) happen we don't want to output a deprecation message, because what the message says isn't true and doesn't apply. ### Solution In order to differentiate between 1) and 2), I have added a `halted_callback_hook` which is called by ActiveSupport callback whenever the callback chain is halted.
-
由 Edouard CHIN 提交于
- The `halted_callback_hook` method is called whenever the `terminator` halt the callback execution. Usually, this translate to when a `before` callback throw an `:abort`. <details> <summary> Example </summary> ```ruby class Foo include ActiveSupport::Callbacks define_callbacks :save set_callback(:save, :before) { throw(:abort) } def run run_callbacks(:save) do 'hello' end end def halted_callback_hook(filter) # filter is the proc passed to `set_callback` above end end ``` </details> ### Problem When a class has multiple callbacks, (i.e. `save`, `validate` ...), it's impossible to tell in the halted_callback_hook which type of callback halted the execution. This is useful to take different action based on the callback. <details> <summary> Use Case </summary> ```ruby class Foo include ActiveSupport::Callbacks define_callbacks :save define_callbacks :validate set_callback(:save, :before) { throw(:abort) } set_callback(:validate, :before) { throw(:abort) } def run run_callbacks(:validate) do ... end run_callbacks(:save) do ... end end def halted_callback_hook(filter) Rails.logger.warn("Couldn't save the record, the ??? callback halted the execution") end end ``` </details> ### Solution Allow `halted_callback_hook` to receive a second argument which is the name of the callback being run.
-
由 Rafael França 提交于
Simplify route score
-
由 Rafael França 提交于
Add activerecord/db/ to gitignore
-
- 03 3月, 2020 3 次提交
-
-
由 Vinicius Stock 提交于
-
由 bogdanvlviv 提交于
-
由 Geoff Harcourt 提交于
The Rails Guides contain an example of how to raise for a missing translation when `I18n.t` is called from anywhere, including non-ActionView contexts. The example builds a custom exception handler that catches and raises any instance of `I18n::MissingTranslationData` and passes on any other exception to be handled by `I18n` as normally happens. Unfortunately, while `I18n::MissingTranslationData` is what eventually should be raised for a missing translation, the initial exception the handler sees is actually `I18n::MissingTranslation`, and `MissingTranslationData` is the product of calling `#to_exception` on that exception object. As a result, the example in the guides ends up not raising for missing translations, silently resulting in the return of the missing translation key. This change updates the guides to with a working example, catching `I18n::MissingTranslation` which results in a raise of `I18n::MissingTranslationData` with the missing key.
-
- 02 3月, 2020 3 次提交
-
-
由 bogdanvlviv 提交于
After running `bundle exec rake test:sqlite3` and `bundle exec rake test:sqlite3_mem` on my VM I noticed that it had created untracked files: ```bash vagrant@ubuntu-bionic:/rails/activerecord$ git status Untracked files: (use "git add <file>..." to include in what will be committed) db/ file::memory: ``` To prevent them from being accidentally committed I put 'file::memory:' to `activerecord/db/` folder and added the folder to .gitignore Also, we could consider fixing this by removing `db/` folder in each test that creates the folder. It would be great if someone confirms that it happens not only on my VM.
-
由 Arun Agrawal 提交于
Fixed typo classsic -> classic [ci skip]
-
由 Abhay Nikam 提交于
-
- 29 2月, 2020 4 次提交
-
-
由 Eileen M. Uchitelle 提交于
Fix error in deprecation
-
由 Ryuta Kamizono 提交于
[ci skip] Security guide: change raw HTML elements and signs to backquoted ones
-
由 hachi8833 提交于
-
由 eileencodes 提交于
When I implemented the deprecation for #38536 I left in the setter in the initalizer. This meant that objects returned had both `@name` and `@spec_name` set and objects looked like this: ``` <ActiveRecord::DatabaseConfigurations::HashConfig:0x00007fe0f7100c68 @env_name="development", @name="primary", @spec_name="primary", @config={ :adapter=>"mysql2", :database=>"recipes_app_development" } > ``` Since we don't use the kwarg to create the hash config and we have the reader for reading off the object or selecting from the configurations objects list we can remove this so the object looks like: ``` <ActiveRecord::DatabaseConfigurations::HashConfig:0x00007fe0f7100c68 @env_name="development", @name="primary", @config={ :adapter=>"mysql2", :database=>"recipes_app_development" } > ```
-
- 28 2月, 2020 8 次提交
-
-
由 Eileen M. Uchitelle 提交于
Testing Guides: Added section on Parallell Testing of Transactions
-
由 Thomas Fankhauser 提交于
Based on https://github.com/rails/rails/issues/38578, it would be nice to have some information on transactions in test cases
-
由 Ryuta Kamizono 提交于
Closes #37435.
-
由 Abhay Nikam 提交于
-
由 Aaron Patterson 提交于
ActionText is using ActionView in a way that ActionView doesn't have in it's test suite. This is just a regression test to hit that same use case.
-
由 Kasper Timm Hansen 提交于
[ci skip] Documentation: Use yml extension for locale files example
-
由 Alberto Almagro 提交于
The default extension we use for locale files is `.yml`. This patch reflects this in the documentation example.
-
由 Eileen M. Uchitelle 提交于
Dumps the schema or structure of a database when calling db:migrate:name
-