18 April 2014

The Ruby Reflector


Peter Jaros

  Source Favicon
By Obie Fernandez of Obie Fernandez 2 years ago.

This commit by Grant Hutchins & Peter Jaros back in July 2011 gives ActiveModels the ability to define their own partial paths by implementing a to_partial_path method. (You can find a great explanation of this killer new feature on José Valim's blog post about it . Just scroll down to #4 Custom Partial Paths.)

I'm blogging about it here, because it impacts a technique that I described in May 2011 as Rendering Heterogeneous Collections of Objects …

obiefernandez.com Read
  Source Favicon
By José Valim of Plataformatec Blog 2 years ago.

…model.class.model name.partial path . Grant Hutchins & Peter Jaros noticed that this was not very flexible because the class was responsible to define the partial path and therefore they decided to move this responsibility to the instance. In order to better understand how you can use this feature, let's consider the following practical example.

Imagine your application have an activity feed and each activity in the feed has a certain type. Usually, each type is rendered …

blog.plataformatec.com.br Read
  Source Favicon
By David of David Chelimsky almost 3 years ago.


full changelog


shared context ( Damian Nurzynski)

extend groups matching specific metadata with:

method definitions

subject declarations

let/let! declarations

etc (anything you can do in a group)

its([:key]) works for any subject with #[]. ( Peter Jaros)

treat symbols as metadata keys with true values ( Myron Marston)

Print a deprecation warning when you configure RSpec after defining an example. All configuration should happen before any examples are defined. ( Myron Marston)

blog.davidchelimsky.net Read