...to_sort_atoms on non-strings so you can define your own natural sort order. There is also natural_sort_by which works like Ruby's sort_by(&block).
...puppetdb_query( "resources [ parameters, title ]{ exported=true and type = 'Nagios_service' and parameters.ensure != 'absent' order by certname, title }" ) Then we join the queried services with our template file { '/etc/naemon/conf.d/services.cfg':
In order to have monitoring for Sidekiq (like queue sizes, last run of Sidekiq) your application should have a monitoring route which returns a json looking like this: { "sidekiq": {
...if page.find('.that-element') # Do something else # Never happens because #find raises end In order to simply check whether an element is present, without errors raised, you can use #has...
...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:
VCR lets you configure how it matches requests to recorded cassettes: In order to properly replay previously recorded requests, VCR must match new HTTP requests to a previously recorded one...
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
-# 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...
...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
...can tune the threshold: Closer to 1.0 = stricter match Closer to 0.0 = looser match Ordering by best match User .where("similarity(name, ?) > 0.3", "John") .order(Arel.sql("similarity(name, 'John') DESC...
...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"
...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...
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...
...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...
...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...
...Info and Size Including NEXT_DATA Inline CSS Info and Size Get your in order Event Processing Time Interaction Long Task Layout Shifts
...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...
...You can ignore the field. The second number fs_passno This field determines the order of partition to fsck. Every partition that have seen more than Maximum mount count will...
...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
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...