...database-specific tool like pg_dump, you can now serialize every single schema property, including proprietary features. Unfortunately using structure.sql comes with some disadvantages. Why structure.sql can churn wildly

...lot of noise and merge conflicts in your repository. Possible reasons for this churn include: Two developers use different versions of the database server (e.g. PostgreSQL 16 vs. 17).

...in your stylesheets. Usually this should not be a problem, but at times they include misleading Meta-information that leads to a strange error in the PDF. The setup

...a few minor changes. If you have the vcr and webmock gems installed, simply include: # spec/support/vcr.rb VCR.configure do |c| c.cassette_library_dir = Rails.root.join("spec", "vcr") c.hook_into :webmock end RSpec.configure...

makandra Curriculum

...versions. In this bonus chapter, we want to dive deeper. Common web apps often include static images like icons and application logos next to the dynamically created images versions of...

makandra dev
rails-sqli.org

...methods can open up code to SQL Injection exploits. The examples here do not include SQL injection from known CVEs and are not vulnerabilites themselves, only potential misuses of the...

makandra Curriculum

Read the card Before you make a merge request: Checklist for common mistakes Include the checklist in the description of all future merge requests and try to tick all...

...TypeScript, and modern browsers will run them natively. Features supported by all modern browsers include: fat arrow functions (() => { expr }) let / const class async / await Promises Generators Symbols Rest arguments (...args...

mso-line-height-rule: exactly; line-height: 0; } Make sure to include mso-line-height-rule: exactly. Otherwise, MS Outlook will treat your line-height as a minimum...

...need to parse the given string of Ruby code. You don't need to include methods from the superclass. You may assume that the given code contains exactly one class...

This card shows an uncommon way to retrieve a file using selenium where JavaScript is used to return a binary...

evilmartians.com

...suite of tools designed to improve the performance of Ruby test suites. Key tools include: EventProf: Measures the time spent on specific events during tests to identify slow processes.

Rails default config uses the ActiveSupport::Cache::NullStore and disables controller caching for all environments except production: config.action_controller.perform_caching = false...

makandra dev

Rails 6 includes a WYSIWYG editor, Action Text. It works out of the box quite well, but chances are that you want to add some custom functionality. This card contains...

...even if it spans over multiple elements in the HTML. Imagine a page that includes this HTML: Hi! Try to match me. Even though the text is separated by a...

I recently noticed a new kind of flaky tests on the slow free tier GitHub Action runners: Integration tests were...

There is no single place to look up documentation for our stack. This card includes some hints where you can find API documentation. You probably want to drag a few...

Learn to create test data effectively using factories. Decouple tests by having each test start with an empty database...

For Selenium tests, your browser starts in your local timezone, or whatever your system's environment specifies. This is usually...

...hook will run after all scenarios have been executed. AfterAll do ... end You can include code to Cucumber in the World module without polluting the application namespace (example from...

...combining international and local numbers, see example below) as the called number should not include that zero. def tel_to(text) groups = text.to_s.scan(/(?:^\+)?\d+/) if groups.size > 1 && groups...

...trait for validating the extensions and content types in all of your uploaders (by including it on the base uploader) and that it now looks like this: class BaseUploader

...in this trait, these lines should now be removed. class BaseUploader < CarrierWave::Uploader::Base include DoesStrictTypeValidations # ... end Now, in your uploaders... def extension_white_list %w[jpg jpeg gif png...

makandra dev

There is no does method anymore We now use traits with the vanilla include method: class Article < ActiveRecord::Base include DoesTrashable end When your trait has parameters, use square...

class Article < ActiveRecord::Base include DoesStripFields[:name, :brand] end Note how you can now follow trait names by CTRL+clicking on them in RubyMine! New naming convention for traits...

...their solution a little further to prevent the leak at its root. When you include the attached module in your ApplicationController, you can just use #prepend_view_path as before...

...versions (maybe more): Rails 4.0 - 7.0 This issue is now fixed and the fix included in Rails...

If you need to make an HTTPS connection to a host which uses an expired certificate, do not disable certificate...