Created
August 8, 2012 10:30
-
-
Save Odaeus/3294088 to your computer and use it in GitHub Desktop.
ActiveRecord column defaults
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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