...placeholder for the remote Rails root directory. # * Append ` || test $? =1;` to grep calls in order to avoid exit code 1 (= "nothing found") # * To be able to process the output with...

When an object is created / updated, various callbacks are executed in this order: before_validation after_validation before_save around_save before_create around_create after_create after_save

github.com

...can see sent mails in your browser when opening http://127.0.0.1:1080 Note: In order to see the emails in the MailCatcher interface and keep your cucumber features running, copy...

...this functionality/behavior and the value you assign will be translated one by one. In order to tell the SASS compiler that it should resolve the assigned value as variable, you...

...string values. Be careful when dealing with e.g. font-family definitions in variables. In order to preserve existing quotes, you may use the meta.inspect() function: @use "sass:meta"

Note that jQuery's html() method explicitely traverses through all removed elements in order to clean up the jQuery Cache: $('body').html(''); Detached elements cannot be collected if they...

github.com

...then returned as an array of responses: // This is batch request payload: { "requests": [ { "name": "order", "path": "/orders", "method": "POST", "body": { "address": "Home, 12345" } }, { "name": "order_item", "path": "/orders/{{ order.uuid }}/items...

"method": "POST", "body": { "title": "A Book" } }, { "name": "payment", "path": "/payments", "method": "POST", "body": { "orders": [ "{{ order.uuid }}" // <-- and here ] } } ] } // This is a possible response: [ { "name": "order", // <-- "order" part of "order.uuid" "status...

github.com

...Info and Size Including NEXT_DATA Inline CSS Info and Size Get your in order Event Processing Time Interaction Long Task Layout Shifts

...you're using one. Add this file to your config/initializers, it fixes the loading order issue but will only work for Rails >= 6: # fix_active_record_filter_attributes.rb # We're loading ActiveRecord before `filter_parameter_logging.rb...

...quality lie ahead. First, make sure your code is reliable: 1. Reliable code In order to reach the baseline for good code, make your code: deterministic tested (automated)

When using ORDER BY "column" in PostgreSQL, NULL values will come last. When using ORDER BY "column" DESC, NULLs will come first. This is often not useful. Luckily, you can...

...tell PostgeSQL where you want your NULLs, by saying ... ORDER BY "column" DESC NULLS LAST ... ORDER BY "column" ASC NULLS FIRST Your indexes will have to specify this as well...

When dealing with AR scopes, you can remove conditions, order, etc by using the unscope method. It is available on Rails 4+. Examples Consider an exemplary User class as follows...

...User < ActiveRecord::Base scope :active, -> { where(locked: false) } scope :admins, -> { where(role: 'admin') } scope :ordered, -> { order(:name) } end users = User.active.admins.ordered ^ SELECT "users".* FROM "users" WHERE "users"."locked" = 'f' AND "users...

...also disables the old should-syntax: RSpec.configure do |config| config.disable_monkey_patching! end In order to still use describe without Rspec, you can set expose_dsl_globally = true after disable...

makandra dev
tpgi.com

...on how to do it correctly. No link text Non-active element in tab order Missing link alt attribute No alt text List not nested correctly Duplicate labels used

...ujs will not set CSRF headers. This is by design and improves security. In order to send those headers for specific hosts, add this piece of CoffeeScript directly after jQuery...

makandra dev

In order to monitor a Rake task using God your Rake file must write a file with its process ID (PID) to a path determined by God. This way God...

...might have noticed that JS and CSS are not cached by all browsers. In order to force Apache to add expiry dates to its response, add the attached .htaccess to...

Browsers usually cache website content in order to provide the user with faster responses. Examples are returning to a website using the "Back" button, or reopening a browser and restoring...

...may display an outdated list. In these cases, client caching should be disabled. In order to prevent client caching, set a Cache-Control header of no-store. This tells the...

...reverse_order does not work with complex sorting constraints and may even silently create malformed SQL for rails < 5. Take a look at this query which orders by the maximum...

...GREATEST(pages.published_from_de, pages.published_from_en) DESC').to_sql # => SELECT "pages".* FROM "pages" ORDER BY GREATEST(pages.published_from_de, pages.published_from_en) DESC Rails 4 Rails 4 will not...

When the order matters: expect(array1).toEqual(array2) Regardless of order: expect(array1).toEqual(jasmine.arrayWithExactContents(array2)) Ignoring extra elements: expect(array1).toEqual(jasmine.arrayContaining(array2...

...or Rack::SteadyETag). Those middlewares usually want to capture the entire response body in order to generate the ETag based on its contents. If they do that, you won't...

...user tables without changing existing passwords Use salts to disarm brute force attacks. In order to let users keep their passwords, hash passwords as before, then hash the result again...

wiki.postgresql.org

...nspname NOT IN ('pg_catalog', 'information_schema') AND C.relkind <> 'i' AND nspname !~ '^pg_toast' ORDER BY pg_total_relation_size(C.oid) DESC LIMIT 5; Example output: relation | total_size ----------------------+------------ public.snapshots...

...value or UTF-8 codepoint) can be done in different ways in Ruby: String#ord or String#unpack to get character values Integer#chr or Array#pack to convert character...

...asterisk (*) is required for strings longer than 1 character. Strings to character values String#ord To convert back from a String to its codepoint, use String#ord:

...its name as table#name, table.name or #name_table. Extra columns are ignored, column order does not matter, whereas row order does. Then /^I should see the following ([\w]+) table...

Looks for table#name. Expects columns and rows to be in the given order, but ignores extra rows and columns. Only looks at one row at once, so does...