...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...
...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...
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...
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...
...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]
...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...
...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...
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...
...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...
...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...
Was ist Elastic? Suchmaschine, basierend auf Apache Lucene größtenteils Open-Source einige kommerzielle Features ("Elastic Stack", früher "X-Pack") Zugriffsrechte...
...file name and extension for a given version. Uploader class VideoUploader < CarrierWave::Uploader::Base include DoesCarrierwaveFormatPatches version :mp4 do set_file_specs file_type: 'video/mp4', extension: :mp4, suffix: '1080p'
...format: :mp4, resolution: 1080] end end Trait This trait uses our gem Modularity. Just include the code in your uploader if you don't want to use the gem.
...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...
...If you want to enable OS upgrades using do-release-upgrade make sure you include $release-proposed packages in the mirror script, e.g., precise-proposed. Additionally, you have to add...
...your script as debmirror silently ignores some directories. I attached our modified script to include current releases Enable Ubuntu release upgrade from the local mirror Download the following two files...
...matched on method and URI. However, no request URI will equal another when they include a nonce. You won't be able to match these requests with VCR. Solution
# spec/support/vcr.rb or wherever you need it VCR.configure do |config| # For matching requests that include OAuth params in the query string config.register_request_matcher(:oauth_uri) do |reqA, reqB|
...element again. This unblocks the entire JavaScript API for the current page. You can include the following module in your test to get a method interact_with_page that does...
The proxying server adds a header X-Forwarded-For to every request. It includes the original client IP. You can include that header in your access log by using...
...id: 2, title: "How to rock", state: "draft"> ] Let's say you wanted to include deleted articles. Removing the available scope is one way but you might also add another...
...just does memoization and does it well. The syntax is similiar also: class Foo include Memoizer def bar ... end memoize :bar end If you're using Ruby 2.1+, you can...
...write this even shorter: class Foo include Memoizer memoize def bar ... end end This is because def returns the method name as a symbol in...
...Here's how to reproduce the issue: Example 1 # bad code (Time.current .. Time.current + 1.hour).include?(Time.current) # Use Range#cover? instead of Range#include? since the former does no typecasting into...