makandra dev

...a thread which caused the application to stop responding. Rails 4.x ActiveSupport::Dependencies includes logging support. It is easy to use: ActiveSupport::Dependencies.logger = Rails.logger Rails 5+ Logging support was...

stackoverflow.com

...for now, it shows a deprecation warning. Since Rails 3.2.14 and 3.2.15 did not include security updates, you might not have applied them and probably now encounter these deprecation warnings...

...logic how to roll back the initial migration.\ So, in your new migration, just include the old one and call it: require 'db/migrate/20120201031337_add_population_to_destinations' class DropPopulationFromDestinations < ActiveRecord::Migration def self.up AddPopulationToDestinations.down...

solnic.eu

...cool example. It allows you to inject some state into the module you are including elsewhere. Check it out! class AttributeAccessor < Module def initialize(name) @name = name end def included...

define_method(@name) do instance_variable_get("#{ivar}") end end end class Book include AttributeAccessor.new(:title) def title "#{super} + super works!" end end book = Book.new book.title = "Module Subclassing Guide...

github.com

JavaScript structures that include circular references can't be serialized with a"plain" JSON.stringify. Example: a = { name: 'Groucho' }; b = { name: 'Harpo', sibling: a }; a.sibling = b; Doing a JSON.stringify(a) will...

httpd.apache.org

Adding that to your site's vhost will create log files that include the current date in their name, like access.2011-04-20.log, without any need to restart the web server...

...modified_at" DESC NULLS LAST, "title"; PostgreSQL will only use your index, if it includes all columns, and all columns are order correctly (or if all columns are ordered reversely...

...but its contents will be kept. $container.html() // returns " Hello World" Also note that contents() includes text and comment nodes which is essential for this approach to work. jQuery usually won...

When submitting textareas, browsers sometimes include carriage returns (\r) instead of just line feeds (\n) at the end of each line. I don't know when this happens, and most...

...is often useful in views where might think about writing [state_A, state_B].include? object.state (which you should not). Keep in mind that this will not call any validations...

...x), you need the mysql2 in a 0.2.x version. Newer versions no longer include the ActiveRecord adapter (which is part of ActiveRecord since Rails .1). So your Gemfile should...

...to its asset paths by default. This means that when you write this: <%= javascript_include_tag 'all.js' %> ... you always get the same path, regardless of the contents of all.js...

...validation in exactly this order ResourceController - here you have to be careful class PostController include ResourceController::Controller does 'post_controller/behavior' index.before { do_something } end module PostController::BehaviorTrait

...don't store the files local but remote (e.g. S3) the url will already include the full url...

...config/initializer/carrierwave.rb require 'carrierwave/processing/rmagick' ... and define a custom processor MyUploader.rb class MyUploader < CarrierWave::Uploader::Base include CarrierWave::RMagick def cover manipulate! do |frame, index| frame if index.zero? # take only the first...

...for an ApplicationController requiring Aegis::Controller from the aegis gem: class ApplicationController < ActionController::Base include Aegis::Controller end In this case aegis must be listed before resource_controller in your...

...any characters outside the standard Latin-1 set. When browsers encounter a character not included in the current font, they use a fallback font for this one character. And that...

...current font. What you can do is to use an icon font that probably includes the symbol you are looking for...

...This will print all unused step definitions from your project – however, the result will include false positives. Steps that are exclusively called from other steps will be in the list...

...changed, use the --name-only switch: $ git diff --name-only app/controllers/sessions_controller.rb app/models/user.rb features/sign_in.feature To include some brief information about changed lines, use the --stat switch: $ git diff --stat app/controllers/sessions_controller.rb...

api.rubyonrails.org

...instrumentation API for Ruby. It is used throughout rails to publish instrumentation events that include information about each part of a request/response cycle. Have a look at your application log...

apidock.com

...different results on different Rubies. Consider this: module Foo FOO = 42 end class Bar include Foo end On Ruby 1.8, Bar won't have FOO defined as a constant since...

For clarity and traceability, your commit messages should include the ID and title of the Pivotal Tracker story you're working on. For example: [#12345] Add Google Maps to user...

Controller responses often include Javascript code that contains values from Ruby variables. E.g. you want to call a Javascript function foo(...) with the argument stored in the Ruby variable @foo...

makandra dev

...describes how to migrate an existing cucumber test suite to Spreewald. Add the gem Include spreewald into your cucumber environment by putting require 'spreewald/web_steps' require 'spreewald/email_steps' # ... or just require 'spreewald/all_steps...

...into your support/env.rb. Look through your step definitions for everything that might be included in Spreewald. Candidates are web_steps, shared_steps, table_steps, email_steps etc. Comment it out...