Currently if you use `helper_method` to define a method, and inside that method you get an error, the backtrace is off by one line.
This PR fixes that so that the backtrace now points to the line where you called `helper_method`.
* main: (21 commits)
feat: action cable connection callbacks
fix: action cable stream_test errors
Adds test coverage for #attach method behaviour in activestorage
Address QueryCacheTest#test_query_cache_does_not_allow_sql_key_mutation failure
Fixes ActiveStorage proxy downloads of files over 5mb in S3-like storage services
Fixes development Action Mailbox new mail form
Squash commits
Include the unexpected class in InvalidParameterKey message
Support unbounded time ranges for PostgreSQL
Fix CHANGELOG alignment [ci-skip]
Add ability to ignore tables by regexp for SQL schema dumps
Improve `rails s` error message when no server could be found.
Fix MySQL warning when creating Active Record's test databases
Add `--js` and --skip-javascript` options to `rails new`
Fix parsing operator classes for index columns in PostgreSQL
Fix rails test command to handle leading dot slash
Document that url_for can take classes
Don't change the encoding of frozen parameters
Update working_with_javascript_in_rails.md
Avoid query from calculations on contradictory relation
...
* main: (746 commits)
Address QueryCacheTest#test_query_cache_does_not_allow_sql_key_mutation failure
Fixes ActiveStorage proxy downloads of files over 5mb in S3-like storage services
Fixes development Action Mailbox new mail form
Squash commits
Include the unexpected class in InvalidParameterKey message
Support unbounded time ranges for PostgreSQL
Fix CHANGELOG alignment [ci-skip]
Add ability to ignore tables by regexp for SQL schema dumps
Improve `rails s` error message when no server could be found.
Fix MySQL warning when creating Active Record's test databases
Add `--js` and --skip-javascript` options to `rails new`
Fix parsing operator classes for index columns in PostgreSQL
Fix rails test command to handle leading dot slash
Document that url_for can take classes
Don't change the encoding of frozen parameters
Update working_with_javascript_in_rails.md
Avoid query from calculations on contradictory relation
Fix MemoryStore#write(name, val, unless_exist: true) with expired entry
Provide pattern matching for ActiveModel
Stop autoclosing of PRs
...
I wanted to add a test for sending an attachment that is an empty string
and a file but got this error:
NoMethodError: undefined method `original_filename' for "#<Rack::Test::UploadedFile:0x000000010840d388>":String
Related: #44702Fixes#45088
-----
Started POST "/rails/conductor/action_mailbox/inbound_emails" for ::1 at 2022-05-14 07:34:19 +0200
Processing by Rails::Conductor::ActionMailbox::InboundEmailsController#create as HTML
Parameters: {"authenticity_token"=>"[FILTERED]", "mail"=>{"from"=>"", "to"=>"", "cc"=>"", "bcc"=>"", "x_original_to"=>"", "in_reply_to"=>"", "subject"=>"", "body"=>"", "attachments"=>[""]}, "commit"=>"Deliver inbound email"}
Completed 500 Internal Server Error in 7ms (ActiveRecord: 0.0ms | Allocations: 2600)
NoMethodError (undefined method `original_filename' for "":String
mail.add_file(filename: attachment.original_filename, content: attachment.read)
^^^^^^^^^^^^^^^^^^):
actionmailbox (7.0.3) app/controllers/rails/conductor/action_mailbox/inbound_emails_controller.rb:26:in `block (2 levels) in new_mail'
actionmailbox (7.0.3) app/controllers/rails/conductor/action_mailbox/inbound_emails_controller.rb:25:in `each'
actionmailbox (7.0.3) app/controllers/rails/conductor/action_mailbox/inbound_emails_controller.rb:25:in `block in new_mail'
<internal:kernel>:90:in `tap'
actionmailbox (7.0.3) app/controllers/rails/conductor/action_mailbox/inbound_emails_controller.rb:23:in `new_mail'
actionmailbox (7.0.3) app/controllers/rails/conductor/action_mailbox/inbound_emails_controller.rb:17:in `create'
Co-Authored-By: Patrício dos Santos <hello@psantos.dev>
It is best practice to include the unexpected value in logs
and error message as it can often make it much easier to understand
where the error come from.
Ruby raises an `ArgumentError` when mixing `Time` and `Float` values in
a `Range`, such as `Time.now..Float::INFINITY`. Therefore, when
deserializing time ranges, we must use a beginless range to represent a
range with no lower bound, or an endless range to represent a range with
no upper bound.
Fixes#39833.
Closes#45082.
Co-authored-by: fatkodima <fatkodima123@gmail.com>
Fix: https://github.com/rails/rails/issues/45092
Up until 3.0, `rails s` would always at least find webrick. But since it
was removed in Ruby 3.0, it's now possible to end up with no available server
at all.
In such case we should recommend adding puma to the Gemfile.
An empty password argument was passed by default and would produce
warnings when doing `rake db:create` in `activerecord/`
mysql: [Warning] Using a password on the command line interface can be insecure.
mysql: [Warning] Using a password on the command line interface can be insecure.
By default the password is empty so not passing the password argument
prevents the warning from appearing.
Tested on "mysql Ver 8.0.29 for macos12.2 on arm64 (Homebrew)"
`--js` alias to `rails new --javascript ...`
Same as `-j`, e.g. `rails new --js esbuild ...`
`--skip-js` alias to `rails new --skip-javascript ...`
Same as `-J`, e.g. `rails new --skip-js ...`
Fix: https://github.com/rails/rails/issues/44923
The fix may seem very ad hoc, but this methods assumes all params
come from Rack, hence are mutable. So checking for frozen is a decent
proxy for ignoring the router defaults.
Previously calculations would make a query even when passed a
contradiction, like `User.where(id: []).count`. This commit optimzes
that to avoid an unnecessary query to the database.
Co-authored-by: John Hawthorn <jhawthorn@github.com>
Co-authored-by: Daniel Colson <composerinteralia@github.com>
It would be nice to be able to pattern match against ActiveModel (and
transitively ActiveRecord). If you want to check multiple attributes
with conditions, it's nice to be able use the pattern matching syntax.
For example:
```ruby
case Current.user
in { superuser: true }
"Thanks for logging in. You are a superuser."
in { admin: true, name: }
"Thanks for logging in, admin #{name}!"
in { name: }
"Welcome, #{name}!"
end
```
While the idea of cleaning up the the PRs list by nudging reviewers
with the stale message and closing PRs that didn't got a review in time
cloud work for the maintainers, in practice it discourages contributors
to submit contributions.
Keeping PRs open and not providing feedback also doesn't help with
contributors motivation, so while I'm disabling this feature of the bot
we still need to come up with a process that will help us to keep
the number of PRs in check, but celebrate the work contributors already
did instead of ignoring it, or dismissing in the form of a "stale"
alerts, and automatically closing PRs.