similar to: Plugin w/ Migrations and/or Fixtures?

Displaying 20 results from an estimated 7000 matches similar to: "Plugin w/ Migrations and/or Fixtures?"

2006 Mar 27
5
Fixtures, Postgres & Constraints
Anyone have any tips for handling postgres constraints when using fixtures to load the database, other than to sort out the proper insertion orders or leaving the constraints out? I''d prefer not to do the former since I''d rather use my app to generate my fixture data (using a dump_fixtures task) and I''d prefer not to do the latter because leaving out constraints till the
2006 Apr 21
1
Using fixtures inside migrations
Hi, I want to add data from a fixture file to a table inside a migration. I''ve saved the file in db/migrate/fixtures/countries.yml I guess I could just open the file, read the entries, and add them to the database using AR, but I''m hoping I can use Rails for all that. Also, if I have a file, say, with 200,000+ records, what would be the best method (performance-wise) to go
2006 Mar 08
3
migrations schema_info table, Rails Recipes Bug?
I have the rails recipes book and i was going through the migrations recipe. Everything seemed to work except for the last part in trying to do a rake migrate with a migration file version 1 and the schema_info version set to 0. Without the force attribute, the rake migration fails, as expected. So the recipe says to run this: ruby script/runner
2006 Jan 19
3
problems with migrations in sql server
Is anyone using migrations with a SQL Server database who might be able to lend me a hand? I''ve used migrations with MySql in the past and haven''t run into any issues so forgive When I run rake migrate nothing is actually getting updated in my database. I created a migration using ./script/generate migration AddFooTable and updated the migration to look as follows: class
2007 Aug 27
7
Foreign key constraints, fixtures, and rake task
I''ve got a spec that loads a fixture in the "before" block. This works fine running scripts/spec, but when I run rake spec instead, I get: ActiveRecord::StatementInvalid in ''User in fixture :quentin with an IM service but no IM name should be invalid'' Mysql::Error: Cannot delete or update a parent row: a foreign key constraint fails
2006 Jul 13
4
Regenerate DB
Hi again :), I''m playing with migrations. I''ve created some migrations classes and with rake db:migrate the tables are created and altered fine, but then I dropped some of the tables and when I run db:migrate command again I don''t get tables being re-created. What am I doing wrong? Is there a way to run db:migration in order to drop the tables? -- Posted via
2005 Dec 15
3
Fixtures and table name
Is there a way to use table name other than the default or to turn it around have multiple fixture files associated to the same table. Here''s my use case: I have multiple unit test classes that all work with the same model class and hence the same database table. However, for each test class I want the data to be in a different state. So I''d like to have something like class
2006 May 09
2
load fixtures
I''m finally getting beyond using basic test fixtures, and a few questions have popped up. Has anyone found ways to do these? 1. Use a test fixture that is named differently from its table name? We''d like to have more than one possible fixture per table. (Or perhaps use test fixtures named similarly but in different directories.) 2. Load a test fixture for one test method only
2009 Mar 28
10
Use fixtures within fixtures?
Heya, I''m using globalize2 and have following problem with my fixtures: categories.yml: one: parent_id: two color: #ff00aa two: color: #00ff11 three: parent_id: two color: #ab00ab category_translations.yml one-en: id: one locale: en name: Cars one-es: id: one locale: es name: Coches two-en: id: two locale: en name: Start two-es: id: two locale: es
2006 Mar 16
1
Use Migrations in modules in separate source trees?
We have a scenario where we have a core engine with module add-ons. What modules that will be used differ from deployment to deployment. Each of these modules might need different things in the db (both structure and data) and I want each module to be in charge of its own db structure. Each module is contained in its own source directory and what modules to use is determined in the build
2007 Sep 07
4
fixtures in before(:all)
I was planning on using a fixture within a description that didn''t modify the fixture, so I put it in a before(:all) block: describe "Customer", "xml" do fixtures :customers before(:all) do one = customers(:one) end # ... As a result, I got this message: 1) NoMethodError in ''Customer xml before(:all)'' You have a nil object when you
2007 Aug 08
1
Transactional fixtures not working as expected
Hi! I am quite new to BDD and I just wrote my first tests. Suddenly I received unexpected results because in a model test I load only users-fixtures but when the views-fixtures in which I load the posts-fixtures, are run before this model-test, the posts-fixtures are loaded too. I test for example if there is one record in the posts-table after creating one post. But when there are fixtures
2006 May 23
2
Putting fixtures into subdirectories
I want to organize my fixtures just like the namespace of my models. So for example if I have a model Company::Employee I''d like the fixture to be in fixtures/company/employees.yml. However, I can''t figure out how to specify the path of the fixture file. If I do: fixtures :employees in my unit test it can''t find the fixture file. Any suggestions? Thanks, Todd
2006 Feb 13
5
now that I have migrations working (I think I do anyway)
Do I now define database changes directly in db/migration/0001_add_a_new_table file ? Obviously the point is not to make the changes directly in postgresql db anymore right? Thanks Craig
2005 Oct 27
2
Fixtures are not loading into instance variables. Why not?
Hi, I have a fixture in a unit test and I see that the fixture is loaded correctly into the database table, but no instance variables are created. So now I''m stuck. More background: this is my first RoR project and I have just installed the SaltedLoginGenerator and generated its output. Running the unit tests gives an error, so I cut it down to just 1 test:
2007 Dec 01
10
Fixtures Cleanup
All, I''ve been playing a bit with some patches to make the fixture loading and management code a little bit easier to maintain. If I were to start chopping out features, how would you feel about losing: Fixture instantiation, Old school single-file fixtures, CSV fixtures, The ability to specify a subset of fixtures (everything''s always loaded instead), The ability to
2006 Aug 03
2
Including ALL fixtures for a test
I am running into some issues with my functional tests because they need info from almost every single table in the database. I have long laundry lists of fixture names to include on these test files and then I have to troubleshooot bizarre test failures because of a fixture that was not included. So is there a way to simply include all fixtures in a test? Something like: fixtures :all
2006 Jul 06
1
migrations work from script/console, but not command line
Having a weird issue where I can migration to version 1, but then go no further, and cannot go back to 0 -- but only from the command line. If I open up script/console I can do migrations just fine - down to 0 or up to 2, via ActiveRecord::Migrator. So I know the migrations must be valid, and I can verify that tables are created or destroyed in the database. Does anyone have any idea why this
2008 Feb 07
4
rspec fixtures stay in the test db - is this right?
I have some fixtures set up to put a few records in some of my tables. In some of my rspec describe blocks, i''m *not* calling the fixtures, and expecting the tables to be empty. But they''re not - the fixture data is in there. Am i using fixtures wrongly? I thought that the db was wiped at the start of every test and the fixtures were only added if asked for. Is that not the
2007 Jun 27
5
Mosquito Fixtures Won''t Load
I can''t get fixtures to load correctly in a Mosquito test. The first fixture loads in the unit test, but the rest don''t load at all. File structure: tracker/ tracker.rb test/ test_tracker.rb fixtures/ tracker_measurements.yml tracker_projects.yml Relevant test code: require ''rubygems''