Skip to content

Instantly share code, notes, and snippets.

@Odaeus
Created August 8, 2012 10:30
Show Gist options
  • Save Odaeus/3294088 to your computer and use it in GitHub Desktop.
Save Odaeus/3294088 to your computer and use it in GitHub Desktop.
ActiveRecord column defaults
# Given an articles table with a title column
class Article < ActiveRecord::Base
column_defaults["title"] = "Blank"
end
assert_equals Article.new.title, "Blank"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment