...query param than foo, e.g. https://www.example.com/old_location?another_param=1. This is because url_for will call to_h on ActionController::Parameters, which will raise if there are unpermitted parameters.
When you mocked method calls in RSpec, they are mocked until the end of a spec, or until you explicitly release them. You can use RSpec::Mocks.with_temporary_scope to...
...does happen, so it might seam confusing why the IDP logout is not working. Calling current_user within the after logout route results in an exception This might show up...
...saml_authenticatable (at least up to version 1.9.1) has a bug there: If you call current_user when a LogoutResponse is present as an URL param it fails to parse...
...and its methods is not suggested in the usual in-app workflow, as validations, callbacks, custom getters/setters etc. are ignored. However, for database-centered stuff like migrations, these fill the...
...but can be used as if it were an array of hashes. You may call #to_hash or #to_a on the result, which both will return a real Array...
...To stabilize asynchronous work of Turbo, we have to find good events to wrap calls to startWork and stopWork around them. The framework currently does not define symmetric events for...
...not currently offer perfectly symmetrical event pairs. // We must ensure that stopWork is not called more often than startWork this.lockCounter-- window.CapybaraLockstep?.stopWork(event.type) } } } const application = Application.start() application.register("capybara-lockstep", CapybaraLockstepController...
...on the source system to use the forwarded SSH agent --rsync-path "sudo rsync": Call rsync as root on the target system to allow writing the files
...If you did this you will need to find the original branch point and call git rebase with a SHA1 revision. Your editor will open with a file like
Stacktrace frame [n] -- Moves to a frame in the n-th call stack You can use where to find out the numbers finish [n] -- Runs the program...
handle_unverified_request When Rails gets a request with wrong/missing CSRF-Token, it calls ApplicationController#handle_unverified_request and continues processing the request!. Per default, the method only resets...
...the session id when logging in. After authentication, but before writing to the session, call reset_session. (Know this also wipes all data from the session – which might be ok...
...setTimeout(() => window.CapybaraLockstep.stopWork(taskName), delay) }) } } if (window.CapybaraLockstep) { // lock capybara for all changes to fields with callbacks up.compiler('[up-observe]', (formOrField) => { return lockCapybaraForObservedChanges(formOrField, { taskName: `[up-observe]: ${formOrField}` }) }); up.compiler('[up-autosubmit]', (formOrField...
...up-autosubmit] and [up-validate]. For uses of up.observe or up.autosubmit, you need to call the lockCapybaraForObservedChanges function directly. You can use it like this: import { lockCapybaraForObservedChanges } from './path/to/the/file/above' // ...
...of memory leaks are APIs like these: addEventListener. This is the most common one. Call removeEventListener to clean it up. setTimeout / setInterval. If you create a recurring timer (e.g. to...
...it’s used like setInterval – i.e., scheduling a new setTimeout inside of the setTimeout callback.) IntersectionObserver, ResizeObserver, MutationObserver, etc. These new-ish APIs are very convenient, but they are also...
...handled before e.g. a page.refresh statement returns. That that this also applies to wrapped calls like accept_confirm { page.refresh }. Recommendation We do not recommend BiDi mode as a default because...
prettier calls itself an opinionated code formatter. I recommend using it for your JavaScript and TypeScript code. prettier only concerns itself with the formatting of your JavaScript (and also some...
...Write tests for both exercises. Write multiple variants, each using a different approach: Just call the real API from the example (skip this variant for the "upcoming movie" exercise)
...updates your $PATH when the prompt is being displayed). For these commands you can call mise explicitly in your shell config: eval "$(mise exec starship -- starship init zsh)"
...mise/asdf plugin and the second one is the name of the plugin we're calling. Install tools mise will re-use .tool-versions files in your home directory or in...
...element or set scrollTop on both and . Finding the scrolling element Your JavaScript can call document.scrollingElement to retrieve the scrollable element for the main viewport. On Chrome, Firefox and modern...
...you try order yourself. If you are on Rails 2.3, be aware that find calls inside the block are implicitly scoped. This is fixed in Rails...
...new node feature that automatically installs yarn (and pnpm) for you when it is called. It allows you to specify a desired yarn version inside package.json and makes sure the...
...Node.js starting from 14.19.0 and 16.9.0 but is disabled by default. To enable it, call: corepack enable The yarn command will be available afterwards. Note To start a new project...
expect(array.include?(5)).to eq(true) Custom matchers Write a custom matcher called have_same_attributes_as. It should compare the attributes of two ActiveRecord instances: movie1 = create...
...examples and contexts in RSpec Testing shared traits or modules without repeating yourself ActiveRecord callbacks Composing a custom matcher from existing matchers Exercise: Shared examples Make the following change to...
...constants, constantize and safe_constantize. Neither is safe for untrusted user input. Before you call either method you must validate the input string against an allowlist. The only difference between...
} } } }) }) Usage expect(actualValue).toBeAnything(...matcherArguments) When a matcher is invoked, Jasmine will call its compare() function with the actualValue, followed by any arguments passed to the matcher. It...
...seconds to 168 milliseconds. Maybe it's a good time to stop and call it a day. If the JSON you are trying to build is fairly simple, you could...
...that it already owns? By writing it to the disk (or into a so called "materialized view"). First, tell PostgreSQL with a migration what the contents of this view should...
...app that manages a list of movies and a list of actors. We will call this app "MovieDB" in subsequent cards. Skim the README file of the project if you...
...an optional database kwarg (specified using the model representative). It may be added by calling the indexer method on the DatabaseCleaner module: DatabaseCleaner[:active_record, db: Foo]. The DatabaseCleaner gem...
...executes your statement for each of them. This means whenever you use this direct call in your code, you actually perform this on a list of cleaners, there is no...