GithubHelp home page GithubHelp logo

db_fixtures_dump's People

Contributors

afoster avatar formless avatar iiska avatar pacojp avatar thams avatar undo1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

db_fixtures_dump's Issues

Only first object can load

If the database contains many objects, the yml dump file will contain --- to separate each item, and this string will lead yml load finish.
So the loader can NOT find the second and more objects.

stopped working

well first of all, great idea. I used to use yaml_db but since fixtures are baked into AR, providing the missing dump is all i need.

The symptom: Loading a dump only ever loads one object per table.
This seems to be because of the "new" string replacement not working (for me)

Having looked at the code, you could just simplify it by creating a hash of the array of objects and just dumping the hash into the file. Saves the loop and the string replacement and is actually what you want, as AR loads a hash.

I can do a pull if you want (and will accept it)

store attributes don't work

This is a bit more tricky, don't know if you use store attributes. http://api.rubyonrails.org/classes/ActiveRecord/Store.html

Basically they allow you to store a hash in a column. And they let you use different encodings, default being YAML. I recently read that that is unsafe and switched to JSON.

But it seems AR stores the data as a HASH and just dumping it as yaml will off course serialise it as yaml.
So when it loads it it gets the yaml string into the db, but AR can't then access the objects anymore because it gets a yaml string where it expects a json string and bang!

I would suggest a small warning for starters and YAML as a workaround.

More elaborate schemes call for some kind of encoders, or maybe just going through the attributes types . . . . .

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.