Skip to content

Fix field is reseted to default if error happened#3066

Merged
mshibuya merged 1 commit into
railsadminteam:masterfrom
lazebny:fix-for-caching-field-with-error
Sep 24, 2018
Merged

Fix field is reseted to default if error happened#3066
mshibuya merged 1 commit into
railsadminteam:masterfrom
lazebny:fix-for-caching-field-with-error

Conversation

@lazebny

@lazebny lazebny commented Sep 12, 2018

Copy link
Copy Markdown
Contributor

When error is raised for some object in instance_eval(&value) then instance_variable_set("@#{option_name}_recurring", false) won't be reset. As a result all other objects (from that model) will have a default value instead of custom value (even if they do not raise an error).

@mshibuya

Copy link
Copy Markdown
Member

Needs a test case, could you write one?

@lazebny

lazebny commented Sep 14, 2018

Copy link
Copy Markdown
Contributor Author

Sure thing, will do)

@lazebny

lazebny commented Sep 17, 2018

Copy link
Copy Markdown
Contributor Author

@mshibuya i added test, please check it

@mshibuya

Copy link
Copy Markdown
Member

Rubocop check is failing:
https://travis-ci.org/sferik/rails_admin/jobs/432086755#L1183

@lazebny

lazebny commented Sep 24, 2018

Copy link
Copy Markdown
Contributor Author

Sorry, I missed it. Checks are green now.

@mshibuya mshibuya merged commit 875dcb4 into railsadminteam:master Sep 24, 2018
@mshibuya

Copy link
Copy Markdown
Member

Awesome, thanks!

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

Successfully merging this pull request may close these issues.

2 participants