| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Substitutes 'in via' for 'by running'
|
|
|
|
|
|
|
|
|
| |
As discussed in #33203 rails command already looks for, and runs,
bin/rails if it is present.
We were mixing recommendations within guides and USAGE guidelines,
in some files we recommended using rails, in others bin/rails and
in some cases we even had both options mixed together.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Allow get arguments for follow_redirect
Now all arguments passed to `follow_redirect!` are passed to the
underlying `get` method. This for example allows to set custom headers
for the redirection request to the server.
This is especially useful for setting headers that may, outside of the
testing environment, be set automatically on every request, i.e. by a
web application firewall.
* Allow get arguments for follow_redirect
[Remo Fritzsche + Rafael Mendonça França]
|
|\
| |
| | |
Use testing lazy-load hooks
|
| |
| |
| |
| | |
- In order to avoid loading classes prematurely, let's use lazy load hooks that are now provided with each test case
|
|\ \
| | |
| | | |
Make NotesCommand tests more performant by getting rid of unnecessary map
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
* Get rid of map and replace it with a multiplication of "\n" to generate document with multiple line preceding the annotation
* Reduce number from 1000 to 100 since it achieves the same goal
* Only keep one test for the multiple lines document since it's unecessary to test multiple times
* Update some language in tests names to make it clearer what we are testing
|
|\ \ \
| |/ /
|/| | |
Shorter code: remove unnecessary condition
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
See https://github.com/rails/rails/commit/136fc65c9b8b66e1fb56f3a17f0d1fddff9b4bd0#r28897107
I _think_ that this method can now be rewritten from:
```ruby
def attribute_previous_change(attr)
previous_changes[attr] if attribute_previously_changed?(attr)
end
```
to:
```ruby
def attribute_previous_change(attr)
previous_changes[attr]
end
```
without losing performance.
---
Calling
```ruby
previous_changes[attr] if attribute_previously_changed?(attr)
```
is equivalent to calling
```ruby
previous_changes[attr] if previous_changes.include?(attr)
```
When this commit 136fc65c9b was made, Active Record had its own `previous_changes` method, added here below. However, that method has been recently removed from the codebase, so `previous_changes` is now only the method defined in Active Model as:
```ruby
def previous_changes
@previously_changed ||= ActiveSupport::HashWithIndifferentAccess.new
@previously_changed.merge(mutations_before_last_save.changes)
end
```
Since we are dealing with a memoized Hash, there is probably no need to check `if .include?(attr_name)` before trying to fetch `[attr]` for it.
Does that make sense? Did I miss anything? Thanks!
|
|\ \
| | |
| | | |
Adds `Rails::Command::NotesCommand` and makes `rake notes` use it under the hood
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
* Invokes the notes Rails::Command and passes the rake task ENV variables as annotations options to it
* Adds a deprecation warning for unsupported commands
* Gets rid of reference to ENV["SOURCE_ANNOTATION_DIRECTORIES"] in SourceAnnotationExtractor since its now dealt with in the NotesCommand
* Gets rid of rake desc for each rake notes task so they are not documented while using `rails -T` or `rails --help`
|
| | |
| | |
| | |
| | |
| | | |
* Require the application and environnement in the notes command in order to load the config files
* Adds tests for both register_directories and register_extensions added to a config file
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
* It is called with `rails notes`
* It defaults to displaying [OPTIMIZE, FIXME and TODO] annotations
* It accepts custom annotations by using `rails notes -a CUSTOM_ANNOTATION OTHER_ANNOTATION`
* It defaults to look for annotations in [app config db lib test] as dictated by SourceAnnotationExtractor
* It supports ENV["SOURCE_ANNOTATION_DIRECTORIES"] but adds a deprecation warning and recommends using register_directories instead
|
| | |
| | |
| | |
| | |
| | |
| | | |
* Get rid of references to rake notes in the documentation
* Get rid of references to environement variables used in SourceAnnotationExtractor
* Updates the command line guide to reflect the new rails notes API
|
|\ \ \
| |_|/
|/| | |
Remove vestigial require on ActiveStorage GCSService
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The file `filename.rb` as mentioned in `require "active_storage/filename"`
belongs to the `app` folder while GCSService belongs to the lib folder.
Looking at the git blame, it was added in commit https://github.com/rails/rails/commit/ccac681122db9747fec9512076772bca345e24b9#diff-bda6a610ef1575b2c8458c96b7f12578
where ActiveStorage::Filename was actually used. But it is no longer
required on master and therefore can be removed.
This allows anyone to use GCSService directly without enabling
ActiveStorage engine.
|
|\ \
| | |
| | | |
Better compatibility with SPEC.
|
| | |
| | |
| | |
| | |
| | |
| | | |
If `env` is duped or otherwise not the same as the original `env` that was
generated at the top of rack middleware, it is impossible for the server hijack
proc to update the right `env` instance. Therefore, capturing the return value
is more reliable. This is the recommendation of the rack SPEC.
|
| | | |
|
|\ \ \
| |/ /
|/| | |
Use class_eval or instance_eval when triggering lazy load hooks
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
- When lazy load hooks were triggered we were using
`Object.instance_eval` which evaluates the block in the context of
the class being passed. Most of the time that class was a
`Class`. If one wants to define a instance method on the class then
it wasn't possible.
```ruby
class A; end;
A.instance_eval do
def foo
puts 'bar'
end
end
A.new.foo #> NoMethodError: undefined method `foo`
A.foo #> bar
```
- This PR checks what object is passed when triggering the hooks and
either call `class_eval` or `instance_eval`. My rational and assumptions being
that if an instance of a class is passed, then the blocks needs to
evaluate in the context of that instance (i.e. defining a method
should only define it on that instance).
On the other hand, if a Class or Module is passed when triggering
hooks, then defining a method should define it on the class itself
- #32776 Pushed me to introduce this change
|
|\ \ \
| | | |
| | | |
| | | | |
Add changelog entry for 42c3537 [ci skip]
|
| | | | |
|
|\ \ \ \
| |/ / /
|/| | |
| | | |
| | | | |
Remove old TODO comment
[ci skip]
|
|/ / /
| | |
| | |
| | |
| | | |
This TODO comment has been here more than 7 years and doesn't seem to be
a temporary implementation anymore.
|
|\ \ \
| | | |
| | | | |
Fix route eager loading
|
| | | | |
|
| |\ \ \ |
|
| | | | | |
|
| | | | | |
|
|\ \ \ \ \
| | | | | |
| | | | | | |
ActiveJob::Base no longer dependents on ActiveJob::Serializers
|
| | | | | | |
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
Add safe html support to arrays of translations
|
| | | | | | | |
|
|\ \ \ \ \ \ \
| |_|/ / / / /
|/| | | | | | |
Update sprockets to Security release for CVE-2018-3760
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
See:
https://github.com/rails/sprockets/blob/v3.7.2/CHANGELOG.md
https://github.com/rails/sprockets/commit/9c34fa05900b968d74f08ccf40917848a7be9441
|
| | | | | | | |
|
| | | | | | | |
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Currently, the seen object cache is shared if join nodes have the same
target class. But it is a wrong assumption, we can't share the seen
object cache between different join nodes (e.g. `:readonly_account` and
`:accounts` have the same target class `Account`, but the instances
have the different state `readonly`).
Fixes #26805.
Closes #27737.
|
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
Change location for running copy migrations command
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
This fixes the location from where the command to copy migrations from the engine to the application should be run
[ci skip]
|
|\ \ \ \ \ \ \ \
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
Support readonly option in SQLite3Adapter
|
|/ / / / / / / /
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
Readonly sqlite database files are very useful as a data format for
storing configuration/lookup data that is too complicated for YAML
files. But since such files would typically be committed to a source
control repository, it's important to ensure that they are truly safe
from being inadvertently modified. Unfortunately using unix permissions
isn't enough, as sqlite will "helpfully" add the write bit to a database
file whenever it's written to.
sqlite3-ruby has supported a `:readonly` option since version 1.3.2 (see
https://github.com/sparklemotion/sqlite3-ruby/commit/c20c9f5dd2990042)
This simply passes that option through to the adapter if present in the
config hash. I think this is best considered an adapter-specific option
since no other supported database has an identical concept.
|
|\ \ \ \ \ \ \ \
| | | | | | | | |
| | | | | | | | | |
[ci skip] fix error of a file name
|
|/ / / / / / / / |
|
|\ \ \ \ \ \ \ \
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
yhirano55/fix-app-update-when-hyphenated-name-is-given
Fix app:update when hyphenated name is given
|
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
* Fixed app_name's difference between `rails new` and `app:update`
* Changed be prefer to const name than directory name.
* Kept original app name which use exception message.
|
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
It breaks Active Job when run in isolation. E.g. bin/test test/cases/logging_test.rb:
https://travis-ci.org/rails/rails/jobs/398779028
Consider Rafaels suggestion of reviewing the eager loading instead:
https://github.com/rails/rails/pull/33234#issuecomment-401027419
This reverts commit cb0fdaacb277bd0595bfd73178329922aa24477e, reversing
changes made to a0a1abb3c7942084111d87ae95837a83bcc794f6.
|
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
Firstly, increment and decrement shouldn't care about the particulars of
key expiry. They should only know that they have to pass that responsibility
on to somewhere else.
Secondly, it moves the key normalization back inside the instrumentation like
it was originally. I think that matches the original design intention or at
the very least it lets users catch haywire key truncation.
Thirdly, it moves the changelog entry to the top of the file, where new entries
go. I couldn't understand what the entry was saying so I tried to rewrite it.
|
|\ \ \ \ \ \ \ \ \
| | | | | | | | | |
| | | | | | | | | | |
Fix assignment of TESTOPTS in railties test task
|