similar to: Best practice for initializing woriing data for development

Displaying 20 results from an estimated 20000 matches similar to: "Best practice for initializing woriing data for development"

2006 Jan 20
6
Pre-populate db with yaml outside of testing?
Hi. What is the best way to pre-populate your database with records while developing, not testing? For example, I want to: 1) > [run this command to populate db] 2) > ruby script/server 3) now I can surf to localhost:3000 and my app will already have relevant data I''m hoping to use yaml to suck it in. Is there a way to use the Fixture class to handle this even though this is
2006 Feb 18
6
Naming join models
I''ve been playing around with EdgeRails and checking out some of the new features. The one that will probably have the biggest affect on my designs is join models (or :through associations). For those not familiar with this feature, it lets you replace your habtm association with a pair of has_many associations indirected through an intermediate model class. Looks like good
2005 Dec 12
2
Using a lib in YAML fixtures
I''m using the runt library [1] to do some temporal expression matching. I want to keep the expression in a binary field in my db. I figured that then in order to do the fixtures, I''d need to do some erb in the yaml file. So I came up with this: onetime: id: 1 name: One Time description: This event occurs only one time. timex: <%= REYear.new(7) & REMonth.new(24)
2006 Jun 10
5
[REL] Manage Fixtures 2.0.0
Just released a new version of the _Managed Fixtures_ plugin, previously known as _Export Fixtures_. The name change comes with some added functionality for managing the fixtures, primarily with two new import tasks for importing specific Models or all of them within the test/fixtures directory. Both new import tasks take the exported fixtures, and allow you to directly import one, or all of
2006 Jul 18
1
Fixtures Max Size? SystemStackError: stack level too deep
Hello, I have a table of zipcodes that I am using in my application, so there are approximately 50,000 rows in this table. I have dumped the table to a fixture yaml file to represent this data, but when I try to load it, I get this error: SystemStackError: stack level too deep Is there a max size allowed for a fixture file..? Here is the --trace output: rake db:fixtures:load --trace **
2006 Apr 24
4
[TIP] Ensure your test data is valid
Recently I wanted to check that my test data was valid. Seems like a reasonable thing to want to do so I thought I''d share the rake task. Add this code to a rake file in lib/tasks and run with rake db:fixtures:validate. It will print out the class, record id and error messages for any model objects that fail validation. Enjoy! -Jonathan. -- namespace :db do namespace :fixtures do
2006 Mar 30
3
Export Fixtures Plugin
= Description This plugin is a super lightweight tool used to export data into the test/fixtures directory. So if you want to export all your data from your production server into your development environment, this will simplify the process without having to load up your database manager. [%] rake db:fixtures:export_all RAILS_ENV=development [%] rake db:fixtures:load = INSTALLATION
2004 Dec 09
3
fixture problem, TypeError: nil is not a symbol
When I run rake against Rails 8.5 to test unaltered model tests with yaml fixtures I get the error and stack trace reproduced below for every one of my model objects. Has anyone seen something this before? Any idea what could be going on here? The following ruby-talk thread may or may not be relevant: http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/95301. Thanks much,
2006 Feb 21
0
How do you order fixtures within each yml file?
Hi. I''ve come across the following documentation: Note that YAML fixtures are unordered. If you want ordered fixtures, use the omap YAML type. See yaml.org/type/omap.html for the specification. You will need ordered fixtures when you have foreign key constraints on keys in the same table. This is commonly needed for tree structures. Example: --- !omap - parent: id:
2006 Jul 10
1
rake db:fixtures:load FIXTURES=xyz
I am attempting to do selective fixture loading against my test database. When I run rake db:fixtures:load FIXTURES=DataSetInfo I get no output. (A full trace is below). I''m trying to figure out why nothing happens. 1) Does the command above attempt to operate against my test database? 2) DataSetInfo is the name of my table and the name of my yml file I generated these YAML
2005 Jul 06
3
populating development database from test fixtures
Hi, Is it possible to populate the development database from the test fixtures? I''m trying to keep the development database schema in a plain-text sql file and modifying that when I need to modify the database structure. However, then I have to either manually repopulate the database or add in additional sql statements that populate the test database. It seems like it would be useful
2010 Jun 03
2
creating fixtures for has_many :through
I''m stymied at how to create a fixture that establishes a has_many :through relationship. I''ve watched the railscast at: http://media.railscasts.com/videos/081_fixtures_in_rails_2.mov ... but that''s for HABTM relationships. I''ve read: http://www.ruby-forum.com/topic/145676 but that ultimately doesn''t answer any question. So with no further ado:
2008 Feb 07
2
[CruiseControl] RubyOnRails build 8820 fixed
The build has been fixed. CHANGES ------- Revision 8820 committed by bitsweat on 2008-02-07 23:10:01 Remove empty .rhtml templates D /trunk/actionmailer/test/fixtures/templates/signed_up.rhtml D /trunk/actionmailer/test/fixtures/helper_mailer/use_example_helper.rhtml D /trunk/actionmailer/test/fixtures/first_mailer/share.rhtml D
2006 Jul 24
3
Creating performance test fixtures from development db? How?
Hi all! I''m looking into the testing chapter of Agile Web Development With Rails (2nd ed.). I want to performance test my app, but I''m too lazy to write fixtures for performance test. I''d rather use the data from my development db (because the data is so close to the production data). How do I get the data into the test db without writing fixtures? Could you please
2008 Apr 03
0
Importing (bootstrapping) the initial data from fixtures(.yml) with foreign keys in Rails 2.0
Hi, I''m trying to import data from YAML files in Rails 2.0.2. I learned that new features came out for fixtures at RailsCasts http://railscasts.com/episodes/81 . And, in Rails 1.2.6 and before, I used a "rake" task I found online. Looks like there are many variations for this "bootstrap" file. Do you know if there''s a file available that does something
2007 May 21
2
Rails'' fixtures suck! But what about something like this?
Sorry about the very long email, but this is a hairy topic that''s been annoying me for some time and I decided to try to do something about. Also, if you got this twice, I apologize too, but it didn''t seem to have successfully gone out the first time. Background: ---------- I''ve been dealing with Rails for about a year and a half now. I''ve been using
2012 May 09
0
best practice for publishing modules that use Hiera?
I''ve begun moving some of my modules the using hiera lookups in place of parameters being defined in a host''s node entry. For data such as that I figure I can document the format of what the module expects from the yaml files, but if I use hiera to replace the typical "module::params", how do I include that in a published module? All the docs I''ve seen
2006 Aug 16
2
accessing a model from a migration
Hello again! ok, i have some initial migration code which sets up my apps schema. i have a few tables that get initialized with data in this migration where i have the table data in yaml format in test/fixtures. i use db:fixtures:load FIXTURES=countries,provstates,employees to initialize these tables.. here''s the wrinkle: employees when it gets loaded should only contain the admin
2008 Oct 17
0
Add fixtures Class mothodes
Dear All I am using fixtures to load data into my program. But when loading data into the table later, I use: directory = File.join(File.dirname(__FILE__), "data/2007") Fixtures.create_fixtures(directory, "filename") The problem with the "create_fixtures" methode is that it moves all the "old data" in the table and load the new data. I would just
2009 Jul 21
1
[RAILS] - 2.3.3 creating a sea of red
hello, I''ve already asked via Rails channels on this and have received no response, so I''m asking here in hopes someone has run into something similar. I updated to rails 2.3.3 yesterday, and now all of my specs are failing with the following error: Fixture::FormatError in ''PublishedGallery Methods#thumbnail should delegate to its lead asset'' a YAML error