...the Webpacker world: Automatic removal of expired assets Manifest backups # config/deploy.rb # No need to include public/packs here, but add the Webpacker cache dir (see link below) set :linked_dirs, %w...
...your Ruby's source is located: gem install debugger-linecache -v '1.1.2' -- --with-ruby-include=$rvm_path/src/ruby-1.9.3-p448 Resume what you were doing before (probably a bundle install).
...need configuration options. Provided configuration options: --with-opt-dir --without-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-lib=${opt-dir}/lib...
...Attention: This will replace all existing settings of the template. Make sure to include all default template settings by first checking: curl -XGET 'localhost:9200/_template/instance_foo?pretty" manual Overwrite the template...
...a better understanding, where the textContent and the innerHTML properties are defined. It also includes (just for completeness) the innerText property, which is similar to textContent, but has subtile differences...
...of waiting for a long timeout. The code expands on work by Tobias Kraze. Include the module Include the following StabilizeHeadlessChrome module in your tests: class StabilizeHeadlessChrome class Reaper
...like our "dev" cards deck, but groomed from a single person (Josh Branchaud). It includes an extensive list of over 900 TILs on many topics that might be interesting for...
...I should see the items "{array}"' ParameterType( name: 'array', # Note: the RegEx no longer includes the ^ and $ delimiter: regexp: /\[([^"\[\]]*)\]/, type: Array, transformer: lambda do |array_string| # Code to transform the...
Your commit messages should include the ID of the issue your code belongs to. Our preferred syntax prefixes the issue title with its ID in brackets, e.g. [FOO-123] Avatars...
...browser time to the time currently mocked with Timecop. To integrate those two, we include and activate timemachine.js in our Rails layout whenever we see that Timecop is mocking the...
- if defined?(Timecop) && Timecop.top_stack_item = javascript_include_tag "timemachine.js" :javascript timemachine.config({ dateString: #{Time.now.to_json}, tick: true }) Warning timemachine.js will mock the time as soon as it is loaded...
...other database objects. Scenario You've got two database dumps: dump_a.pgdump dump_b.pgdump Both dumps include these tables: foobar barfoo foobaz You want to create a dump with: dump_a.foobar dump_b.barfoo
...file by calling File.open(@file_path) {...
...} on the file directly instead. I will also include an example on how to use this for directories instead for files at the end...
...When coming from jQuery, also see the card on JavaScript without jQuery. This card includes a link to You Don't Need jQuery, which summarizes most of the alternatives in...
...buffer_size set to determine this limit. The default are two pages. This value includes the header buffers. There are two rules affecting the min and max values of proxy...
Since Roadie is now in passive maintenance mode, we go with premailer: Include premailer in your Gemfile: gem 'premailer-rails' In your ApplicationMailer define the mailer layout:
...and only the mailer stylesheet) we have a separated mailer.js in webpack/packs where we include the css file für our mail styles: import '../application/stylesheets/mailer.sass' In your mailer.html.erb you can now...
...with ActiveJob, the job arguments are logged. In case of a password reset, this includes the password reset token, which should not be logged. ActiveJob's logs can be disabled...
Option 1: JSON dump In config/webpack/environment.js you can get inspect environment which includes all webpack config options set for the current environment: const { environment } = require('@rails/webpacker') const webpack = require('webpack...
uri = URI('https://api.chucknorris.io/jokes/random') res = Net::HTTP.get_response(uri) expect(res.body).to include('Paul') end end rspec spec/chuck_norris_spec.rb . Finished in 0.00759 seconds (files took 0.49565 seconds to load...
In contrast to RSpec's included allow_value matcher, the attached matcher will also work on associations, which makes it ideal for testing assignable_values. Usage example describe Unit do...
...expect(unit.assignable_buildings).to contain_exactly(building, other_building) expect(unit.assignable_buildings).not_to include(unauthorized_building, nil) end ... See RSpec: Where to put custom matchers and other support code
...committing, you should always check the diff of your changes so you don't include any leftovers or irrelevant/bad changes. Any time spent on that is well invested as it...
...diff or git diff --cached (to diff staged changes), you can also have Git include the changes as a comment below the commit message: git commit -v That will open...
...this should not be an issue but it turns crazy if you try to include associated models deeper than 1 level: options = params.merge(:include => { :user => :avatar }) Post.paginate options When inspecting...
...the merged params you will get something like this: { :include=> { "user" => :avatar }, :page => 23 } Here the :user symbol in the hash of inclusions turned into a "user" string.\
...that follows after colon and ends at the line end (and this string may include quotes): When /^I fill in "([^"]*)" with: (.*)$/ do |field, value| pending # express the regexp above with...
rewrite_options is used by the ..._path methods in the views ^ module HostEnforcementTrait Include this method in a module because we cannot yield out of define_method module InstanceMethods...
yield ensure self.asset_host = old_asset_host end end as_trait do |*args| include HostEnforcementTrait::InstanceMethods options = args.first || {} methods = options[:for] around_filter :assets_have_urls, :only => methods
Ruby's standard library includes a class for creating temporary directories. Similar to Tempfile it creates a unique directory name. Note: You need to use a block or take care...
...We want to use `GlobalID.create` to avoid constructing a GID # ourselves, and because it includes some sanity checks as well. pluck(*columns).map do |(id, type)| klass = anonymous_classes_by...