...you need to tell it which Firefox to use for Selenium tests. If you call Cucumber using the cuc script (also part of the geordi gem), this will happen automatically...

The associated record has its own universe of things; when delegating calls to it, you ca not stub methods on the associated record and expect them to...

...Its real class is ActiveRecord::Associations::BelongsToAssociation which is sometimes exposed, for example when calling undefined methods: post.thread.foobar NoMethodError Exception: undefined method `foobar' for # This means that you actually stubbed...

...Gemfile.something and a .bundle directory. The contents of the .bundle directory redirect all gem calls to another configuration in the Gemfile.something directory, preventing your application from seeing the gems it...

...you can take any scope and extend it with additional joins or conditions. We call this chaining scopes. In practice chaining becomes problematic when scope chains grow more complex. In...

...record's ID is among them. This list of IDs is cached for subsequent calls, so you will only touch the database once. As scary as it might sound, fetching...

...you under most circumstances. Basics When ActionController picks up a flash object, it will call the #sweep method once; that method checks the list of used flash entries and deletes...

...def_delegator :topic, :title, :subject end Looks a lot like the above def_delegators call but behaves differently. Rails does not provide a pretty solution to this, but simply write...

...time you start the VNC server. It will not be used by the above call after that (due to SecurityTypes None). So for a first-time setup run it without...

...to serve too many masters. E.g. we are adding a lot of logic and callbacks for a particular form screen, but then the model becomes a pain in tests, where...

...all those callbacks just get in the way. Or we have different forms for the same model but they need to behave very differently (e.g. admin user form vs. public...

...event.currentTarget still refers to the . If you wanted to get document, you need to call event.delegateTarget. Rule of thumb Use event.currentTarget. When binding event callbacks, you usually want to do...

makandra dev
github.com

end If you want to save the graph as image (format is .png), call write('path/to/filename.png') on a graph. For displaying the graph in a view of you own...

.../spellcheck31/wscbundle/wscbundle.js is loaded as described in the docs. To activate WProofreader, you can now call WEBSPELLCHECKER.init on CKEditor's iframe (not the textarea). Note that you should be using CKEDITOR.replace...

makandra dev

...accessible in define_method. self is the "current object" and implicit receiver of method calls: in a method body, self is the receiver of the method

...cucumber_factory. Marking step definitions as overridable To mark a step definition as overridable, call #overridable on the definition object: Given /^there is a movie with a (.*?) tone$/ do ... end.overridable...

makandra dev

...of arguments (given 1, expected 0) Use procs instead of lambdas where they are called with variable arguments. Look for named_scopes. Error: Attempt to call private method, NoMethodError

...and (in old Clearances) remember me functionality works. Login Clearance defines a database column called "remember_token". When you login in, that token will be saved in a cookie. For...

...value (be aware that you should use a secure and salted hash) or better call the the_user_to_log_out.reset_remember_token! method that does the things for you. Note: Have a look...

markodenic.com

Table of content for the linked article: 1. The `loading=lazy` attribute 2. Email, call, and SMS links 3. Ordered lists `start` attribute 4. The `meter` element 5. HTML Native...

...with the following line: # application_controller.rb rescue_from ActiveRecord::RecordNotFound, :with => :render_404 This will call the method render_404 whenever a RecordNotFound error occurs (you could pass a lambda instead...

github.com

...barby/outputter/png_outputter) Pro tips Barby's PNG outputter uses ChunkyPNG under the hood. You can call to_image to receive a ChunkyPNG::Canvas that you can rotate, resample, or just convert...

github.com

...Rails < 4.1 and want it to replace #to_json (but you can always just call Oj.dump explicitely). Security warning: Oj does not escape HTML entities in JSON

...check with a type rake just to be sure. Yaaaay. No more clumsy rake calls...

...are already set will not be overwritten when defined again. Thus, put your inherit calls after all other attribute definitions inside a blueprint...

...the attached script. To use it, you first need to wrap the require 'mathn' call (usually by wrapping Bundler.require) like this: # config/application.rb MathnWorkaround.intercept do Bundler.require(:default, Rails.env) if defined?(Bundler...

makandra dev

...X forwarding, when connecting to the remote machine, and add -X to the ssh call. Now, when you start a program with a UI (e.g. virtualbox) in that SSH session...