...are equivalent. Equivalency means: Whitespace is ignored Types of attribute quotes are irrelevant Attribute order is irrelevant Comments are ignored You use it like this: html = ... expect(html).to match...

# Options documented here: https://github.com/vkononov/compare-xml default_options = { collapse_whitespace: true, ignore_attr_order: true, ignore_comments: true, } options = default_options.merge(options).merge(verbose: true) diff = CompareXML.equivalent?(expected_doc, actual...

...to overwrite these methods or call the parent version with super depending in which order and in which way they were added to singleton class. Consider the following code:

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...

-# record/_form.haml = form_for record do |form| -# ... .form-actions yield(form) In order to make your template record/_form.haml accept a block when you render it, you can render...

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...

...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...

track down warnings and to see failing specs immediately or to get an overview of the core functionalities, you can use RSpec's "nested" format. It looks...

...model and maker should find tools by serial number Call RSpec like this in order to use the nested format: spec spec -f documentation

...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"

...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...

...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)

...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...

...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...

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

stackoverflow.com

...you are on MySQL ≥ 5.1.7, do this instead: SELECT * FROM information_schema.processlist WHERE command != 'Sleep' ORDER BY id; That also allows you to only show some values or order differently, like...

SELECT user, time, state, info FROM information_schema.processlist WHERE command != 'Sleep' ORDER BY time DESC, id; One more example -- see all non-sleeping queries that take some time, for example...

...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...

...information embedded into font files is usually very bad, especially for unexpensive fonts. In order to remedy this, Linux and MacOS ignore hinting information in font files and replace it...

...information. Now use ttfautohint to generate an autohinted TTF font: ttfautohint myfont.ttf myfont_autohinted.ttf In order to support all desktop browsers, we need to offer one other font format, EOT. You...

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...

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...