Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dynamic approach dont persist on database #38

Open
thiagoliof opened this issue Feb 19, 2016 · 2 comments
Open

dynamic approach dont persist on database #38

thiagoliof opened this issue Feb 19, 2016 · 2 comments

Comments

@thiagoliof
Copy link

Guys, i dont know if this is my mistake or real bug.
someone can help me?

When i use dynamic approach, i geting one problem:
the state dont persisted on database.

i reproduce the issue in below repo
https://github.com/thiagoliof/testFlow
tks for all

@spyro1st
Copy link

Hi,

i face the same problem. When using the dynamic approach the state is written to the database but on load the state is always the initial state. Did you find a solution for that?

@farias-r7
Copy link

It looks like if you create an object via new first then call save it will set the initial state and override any other attributes assigned to the unsaved model.

f = Foo.new(name:'bob')
f.save

Will cause 'f' to be saved to the db with name set to nil.

If you do

f = Foo.create(name:'bob')
f.name = "chad"
f.save

It will set name to "chad".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants