Notes posted by Ramon

RSS feed
December 14, 2012 - (>= v3.2.1)
0 thanks

Now called class_attribute in Rails 3.2.x

See github.com/novafabrica/make_exportable/pull/4

November 3, 2010 - (<= v2.3.8)
0 thanks

Get the primary schema's name

If you’re using PostgreSQL and you’ve changed schema, sometimes you need to know what schema you’re in.

ActiveRecord::Base.connection.schema_search_path.split(",").first
March 10, 2010
0 thanks

Specify your own template

You can specify you own template this way:

def notice
  ...
  @template = "some_other_name.html.erb"
end
October 3, 2009
0 thanks

sort_by

array.sort_by {|element| [element.foo, element.bar.name, element.baz]}

Taken from http://redcorundum.blogspot.com/2006/10/using-sortby-instead-of-sort.html

June 11, 2009
2 thanks