...used (in development and tests)' do get 'http://www.example.com/test/set_cookie' response.headers['Set-Cookie'].should include('test=') # Cookie is still set response.headers['Set-Cookie'].should_not include('; Secure') end end

...will fail when trying to compile their assets up front. class ApplicationController < ActionController::Base include EsbuildErrorRendering if Rails.env.development? end module ApplicationController::EsbuildErrorRendering ESBUILD_ERROR = Rails.root.join("esbuild_error_#{Rails.env}.txt") # see...

...you need to skip those items that are #marked_for_destruction?. Otherwise you will include items that have been ticked for deletion in a nested form. See ActiveRecord: When aggregating...

...have an indefinitely high resolution). When ordering lists by timestamps, you should therefore always include a final order condition using the primary key of the table. class Photo < ActiveRecord::Base...

...scope :by_date, -> { order('created_at DESC, id DESC') } end Photo.by_date Remember to include the id field in the database index...

...you have the following code: module Mod def foo @@foo end end class Klass include Mod end @@foo does not mean Klass::@@foo (qualifier added to make my point; it...

...Ruby expression). It actually means Mod::@@foo and is shared between Mod, all classes including Mod as well as all their subclasses. Also note that only the class and module...

...your particular development server shows an error. Warning Unpoly cannot repeat form submissions that include file inputs. If it tries, the file data will be replaced with the string [object...

...To avoid confusion, this code will instead redirect to /__better_errors when a file is included in the submission. // Only do this in development. This requires a `[data-environment="development"]` attribute...

makandra dev

...them like this: *, :before, :after { transition-property: none !important; animation: none !important; } To only include these styles for tests, see Detect the current Rails environment from JavaScript or CSS.

4 0 - 5 Dev machines are not blocked on test runs; Code Reviews include test badge; Automatically merge a PR on green tests Upgrade Rails 5 0 - 5

...a list of acceptance criteria and (optionally) some additional notes. The introduction sentence should include the role of the user, what the user wants and why. The acceptance criteria are...

...client: Make a POST request with method override The default configuration Rails and Sinatra includes a Rack middleware that lets you control the HTTP method used for routing by POSTing...

thepugautomatic.com

...See https://thepugautomatic.com/2013/07/dsom/ module WithModuleInheritance def with_module_inheritance(&block) anonymous_module = Module.new include anonymous_module anonymous_module.module_eval &block end end Module.include(WithModuleInheritance...

...also need to override some methods, you can do this: class HelperProxy < ActionView::Base include ApplicationController.master_helper_module def current_user #let helpers act like we're a guest

Bare metal If you have strong nerves, you can also try to include the ApplicationController.master_helper_module directly into your model...

...power that specifies which deals and documents are accessible by a user: class Power include Consul::Power power :deals do Deal.where(author_id: user.id) end power :documents do admin? ? Document.all...

makandra dev
relishapp.com

...in an error like does not implement: current_power. The documentation on dynamic classes includes some ways to fix this by showing how dynamically defined attribute methods from ActiveRecord are...

getbootstrap.com

...BS 2+3, but not above there are some forks which say that they include a BS4 renderer, but they didn't work for me. Suggestion: Remove simple-navigation and...

...or overwrite the styles by using bootstrap variables. Upgrade Phase 1 First you should include the new version into your project and replace the old imports, e.g. with webpack

...then((latitude) => { done(latitude) }) JS expect(returned_latitude).to eq latitude end When we include this step into a scenario and run it, it will fail because StreetMap is not...

'New bar' end end module SuperClient prepend SuperClientExtension end Test class Test; include SuperClient; end Test.foo => 'New foo' Test.new.bar => 'New bar' Good practice If you do monkey patches...

SimpleForm comes with an option browser_validations which could be used to give fields that have a presence validation the...

...config/application.rb config.action_controller.include_all_helpers = true If you cannot use this setting, your spec can include individual helper modules like this: describe 'some view', type: :view do helper SomeHelper helper OtherHelper...

render 'view_that_uses_helpers' end end Alternatively you can also explicitly include all helpers of a given controller like this: describe 'some view', type: :view do

...excludes spaces, control characters, and similar) /[[:lower:]]/ Lowercase alphabetical character /[[:print:]]/ Like [[:graph:]], but includes the space character /[[:punct:]]/ Punctuation character /[[:space:]]/ Whitespace character ([[:blank:]], newline, carriage return, etc.)

chris.beams.io

...body with a blank line Limit the subject line to 50 characters (max. 72), include reference (unique story ID) to requirements tracker (Linear in our case) Capitalize the subject line...

guides.rubyonrails.org

However, this approach will explain all queries for the given scope which may include joins or includes. Output will resemble your database's EXPLAIN style. For example, it looks...

...like this on MySQL: User.where(id: 1).includes(:articles).explain EXPLAIN for: SELECT `users`.* FROM `users`  WHERE `users`.`id` = 1 +----+-------------+-------+-------+---------------+ | id | select_type | table | type  | possible_keys | +----+-------------+-------+-------+---------------+ |  1 | SIMPLE      | users...

...application must do one thing by itself: When sending HTML e-mails, you should include a plain-text body or tools like SpamAssassin will apply a significant score penalty. Here...

...README. Most likely you want: to add the Ruby, Rails and RSpec cops to include the unit test 2. Report all existing offenses and exclude them initially

...auto-gen-config to create a file that excludes all current violations. Your tests (including the Rubocop spec) should now all be green. Commit theses changes and consider whether you...