{"id":15480293,"url":"https://github.com/andyatkinson/rails-with-seedster","last_synced_at":"2026-01-30T22:04:41.688Z","repository":{"id":39694710,"uuid":"200264750","full_name":"andyatkinson/rails-with-seedster","owner":"andyatkinson","description":"Example application using Seedster gem","archived":false,"fork":false,"pushed_at":"2023-01-19T14:03:44.000Z","size":46,"stargazers_count":0,"open_issues_count":8,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-19T04:31:17.903Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://github.com/groupon/seedster","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andyatkinson.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-08-02T16:17:44.000Z","updated_at":"2020-05-02T03:54:02.000Z","dependencies_parsed_at":"2023-02-11T03:15:31.977Z","dependency_job_id":null,"html_url":"https://github.com/andyatkinson/rails-with-seedster","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andyatkinson%2Frails-with-seedster","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andyatkinson%2Frails-with-seedster/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andyatkinson%2Frails-with-seedster/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andyatkinson%2Frails-with-seedster/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andyatkinson","download_url":"https://codeload.github.com/andyatkinson/rails-with-seedster/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246045418,"owners_count":20714774,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-02T04:41:26.159Z","updated_at":"2026-01-30T22:04:41.660Z","avatar_url":"https://github.com/andyatkinson.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rails App With Seedster\n\n### Initializer\n\nRunning `rails g` should show:\n\n```sh\nSeedster:\n  seedster:initializer\n```\n\nThis can be run with `rails g seedster:initializer`\n\n#### Rake Tasks\n\n```sh\n$ rake -T seedster\nrake seedster:dump  # Dump application seed data to a data dump file\nrake seedster:load  # Load application seed data from a remote dump file\n```\n\n## Testing The Flow\n\nEven thought the intention is to create data dumps in production, we can create a dump locally for testing purposes.\n\n#### Set Up\n\n* Create the Seedster initializer file by running the command above\n* Configure the `users` table in the Seedster tables configuration, e.g. `%{SELECT * FROM users WHERE id = '%{user_id}'}`\n* Populate the database, for example by using the Rails seeds, `rake db:seed`\n\nNow we can run the data dump task.\n\n#### Testing Data Dumps\n\n```sh\nrake seedster:dump USER_ID=1\n```\n\nThe users data file should have been generated.\n\n#### Testing Data Loads\n\n* To test loads, reset the database: `rake db:reset`\n* We should have the data file in the `tmp` dirs.\n* To clear out the database and reset it, check the section below Resetting the Database\n* We can `truncate users, posts, comments` via `psql` to empty the tables out if we've already loaded data\n* Seedster can be configured to load from local files, without trying to download. In the Seedster initializer file, set the option `skip_download` to `true`.\n\nNow the load task can be run to load from the local data files.\n\n```sh\nrake seedster:load\n```\n\nWe should now have `users` data, running `User.first` in `rails console` should return the User.\n\n\n#### Resetting the Database\n\nFrom a `psql` prompt:\n\n```sql\ntruncate posts,users,comments;\n\nALTER SEQUENCE users_id_seq RESTART WITH 1;\nALTER SEQUENCE posts_id_seq RESTART WITH 1;\nALTER SEQUENCE comments_id_seq RESTART WITH 1;\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandyatkinson%2Frails-with-seedster","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandyatkinson%2Frails-with-seedster","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandyatkinson%2Frails-with-seedster/lists"}