Skip to content

Instantly share code, notes, and snippets.

@boo1ean
Created July 3, 2012 09:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save boo1ean/3038626 to your computer and use it in GitHub Desktop.
Save boo1ean/3038626 to your computer and use it in GitHub Desktop.
Available ActiveSupport data types
# Check out Rails::Generators::GeneratedAttribute::default
when :integer then 1
when :float then 1.5
when :decimal then "9.99"
when :datetime, :timestamp, :time then Time.now.to_s(:db)
when :date then Date.today.to_s(:db)
when :string then name == "type" ? "" : "MyString"
when :text then "MyText"
when :boolean then false
when :references, :belongs_to then nil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment