Code Monkey home page Code Monkey logo

Comments (4)

vhochstein avatar vhochstein commented on June 2, 2024

That s because in dev mode you are receiving a parameter hash which includes only strings.
In your test case you are not passing a string, but instead a number, which activescaffold does nt like. Your fix might lead to trouble in case of localized number formats. In that case activescaffold expects the number to be in a special format.

from active_scaffold.

MikeBlyth avatar MikeBlyth commented on June 2, 2024

I don't quite understand. You're saying in dev mode the param hash is in strings, but in testing it is not, right? I do get the same error even if I put the number in quotes in the fixture. Is the hash in production mode in strings, also? If so, how would forcing value to be a string cause a problem? What is the right way to construct the test fixture?

from active_scaffold.

vhochstein avatar vhochstein commented on June 2, 2024

Unfortunetly, there is nt currently the "right" way. If you a re in dev or prod mode, user is entering values into a form. These values are passed to the server and activescaffold tries to read these string values and assign them to an activerecord object.
In test mode you are not entering values into a form, instead you are using a fixture in your case, which is basically an activerecord object at the end.
ActiveScaffold is nt prepared to receive attribute values directly from an activerecord object.
I do not think it will be a big change, though....

from active_scaffold.

MikeBlyth avatar MikeBlyth commented on June 2, 2024

..

from active_scaffold.

Related Issues (20)

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.