Skip to content

Instantly share code, notes, and snippets.

@stympy
Created December 22, 2010 06:04
Show Gist options
  • Save stympy/751161 to your computer and use it in GitHub Desktop.
Save stympy/751161 to your computer and use it in GitHub Desktop.
en:
groceries:
sample_data: [Eggs, Milk, Bread]
class User
has_many :grocery_items
after_create Proc.new {|user| I18n.translate('groceries.sample_data').each {|g| user.grocery_items.create(:name => g) } }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment