Use rules to include or exclude jobs in pipelines. Rules are evaluated in order until the first match. When a match is found, the job is either included or excluded...
...methods. These will behave just like those you know from controller specs: module DeviseRequestSpecHelpers include Warden::Test::Helpers def sign_in(resource_or_scope, resource = nil) resource ||= resource_or_scope...
sign_in create(:user, name: 'John Doe') visit root_path expect(page).to include('John Doe...
Recent IRB versions include a multi-line autocomplete which may be helpful to novice users but can be distracting. Cycling through options works by pressing the Tab key (as usual...
...When you want to call methods from A inside B you would normally just include A into B: module B include A end Including exposes all of A's methods...
A cleaner way would be like this: module B module Outside include ::A module_function :foo end end This allows you to use B::Outside.foo or just...
...more consistent. The steps use "( not)? " now. The search via spreewald some query here includes steps with optional negation now...
...very helpful to refresh my understanding of database indexes. As a small bonus, it includes a few helpful SQL oneliners like these two: Detecting unused indexes Detecting duplicate indexes
...installed will not be reinstalled for the new RubyGems or Bundler. Some gems may include binaries that are turned into binstubs by RubyGems and thus implicitly rely on a certain...
There seems to be a nasty bug in Chrome 56 when testing with Selenium and Capybara: Slashes are not written...
...or link to available solutions. Global access to Rake DSL methods is deprecated. Please include Rake::DSL into classes and modules which use the Rake DSL methods. Open your Rakefile...
...and add the following line above YourApp::Application.load_tasks: YourApp::Application.class_eval do include Rake::DSL end Use of ole/file_system is deprecated. Use ole/storage (the file_system api is recommended...
...the systemd system and service manager. It is backwards compatible to System V and includes the System V services Therefore I prefer to use systemctl. See which services are there...
...virtual attributes with full coercion magic is to use Virtus: class User < ActiveRecord::Base include Virtus.model(:constructor => false) attribute :name, String attribute :age, Integer attribute :birthday, DateTime end
user.age = '65' user.age # => 65 user.birthday = '17.11.1982' user.birthday => DateTime<#...> Note how we had to include Virtus with the :constructor => false option so it doesn't overwrite the initializer provided by...
...methods to synchronize the string array with its underlying association: class Note < ActiveRecord::Base include DoesListField[:topic_list] private def read_topic_list topics.collect(&:name) end def write_topic_list...
...the :integer option so elements get casted to numbers automagically: class Note < ActiveRecord::Base include DoesListField[:author_list, integer: true]
...Reasons for this behavior It's probably because of this RFC: Clients SHOULD NOT include a Referer header field in a (non-secure) HTTP request if the referring page was...
In order to cover some edge cases you rarely care about, Range#include? will become very slow in Ruby 1.9: Range#include? behaviour has changed in ruby 1.9 for non...
...or max) [...] Ruby 1.9 introduces a new method Range#cover? that implements the old include? behaviour, however this method isn’t available in 1.8.7. The attached code will add a...
Create, or edit your ~/.irbrc file to include: require 'irb/ext/eval_history' # was 'irb/ext/save-history' for versions prior to Ruby 3.3 IRB.conf[:SAVE_HISTORY] = 2000 IRB.conf[:HISTORY_FILE] = "#{ENV['HOME']}/.irb-history...
...device-width: 1024px)' %> Here I chose 1024 pixels as the maximum device width to include the iPad. If you want to target only mobile phones, pick 960 to include high...
In FactoryBot factories, Rails' file_fixture is not available by default. To enable it, include a support module from rspec-rails: FactoryBot::SyntaxRunner.include(RSpec::Rails::FileFixtureSupport) That includes ActiveSupport::Testing...
The linked content includes a few design patterns implemented with Ruby on Rails. What is the card indented to achieve? You can use the pattern names for code reviews, so...
...design patterns in a wrong way", since design patterns do not replace good code Included Design Patterns: Service, Value object, Presenter, Decorator, Builder, Form object, Policy object, Query object, Observer...
...require model to be set should require place_id to be set #identifier should include the model and tag if the tool has a tag should return the model if...
...a text area with one row. f.text_area(:name, rows: 1, autosize: '') Step 2 Include the autosize library in your project yarn add autosize And make your textarea(s) grow...
...might be mysql_sandbox instead. This will install this version into /~/sandboxes/msb_5_7.21. The folder includes a command to start the MySQL daemon for that sandbox. It listens to a non...
...key that the params will be wrapped into. class UsersController < ApplicationController wrap_parameters :person, include: [:username, :password] end And there is more! Check the attached link for other features ...
...you use Form Models you need to add virtual attributes manually. E.g. wrap_parameters include: User.attribute_names + ['send_email...
...not_acceptable) end end end end Note: request.format more reliably tells the format, but includes Rails-required formats such as application/x-www-form-urlencoded (which we must not refuse). For our purposes, getting...
...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...
--without-make-prog --srcdir=. --curdir --ruby=/home/thomas/.rvm/rubies/ruby-1.8.7-p374/bin/ruby extconf.rb:15: undefined method `include_path' for Libv8:Module (NoMethodError) This is caused by therubyracer's extconf.rb requiring libv8 without Bundler...