Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3313252
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T22:05:37+00:00 2026-05-17T22:05:37+00:00

In my app I have a table for ROLES. Pretty simple: 1: Admin, DESC

  • 0

In my app I have a table for ROLES. Pretty simple:
1: Admin, DESC stuff
2: Guest, Desc stuff

etc..

The issue I just got hit with was I went to deploy the app on heroku and everything broke, reason was that these default roles in the database were not populated on deployment… Something I hadn’t thought about.

With Rails 3, is there a way to say, hello Mr Rails, here are the table’s default values? on migrate or database create?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T22:05:37+00:00Added an answer on May 17, 2026 at 10:05 pm

    There is a concept called Seed Data in Rails which you can use to do this.

    There is a file called seeds.rb is created in the db directory. In which you can create such things.

    So for example

     Role.create(:name => "Administrator") 
    

    will go into this file.

    You can call rake db:seed to seed this data into your application.

    There is a railscast about this as well – http://railscasts.com/episodes/179-seed-data.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my iPhone app I have a table view where I add a tick
I have a table in a django app where one of the fields is
In my app I have a scroll view and four table views. Each time
I am developing an app in which I have a table. In the table
I have an app that presents Table View of different files. I have it
I have a working table view on my iphone app, and am implementing a
I have a categories table view controller. In my app, categories can have subcategories.
I have an ASP.Net-MVC app using LinqToSql. I have a subcontracts table, a service_lines
I am building an app using storyboard. I have added a table view to
I have an iPhone app which has a Table View-based data input screen with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.