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

Enum field change #202

Closed
r00takaspin opened this issue Jan 19, 2015 · 10 comments · Fixed by #429
Closed

Enum field change #202

r00takaspin opened this issue Jan 19, 2015 · 10 comments · Fixed by #429

Comments

@r00takaspin
Copy link

Hello,

I have status field, that has enum type in ActiveRecord. When value of this field changes, old_value is string, but new_value is integer.
2015-01-19 16 49 03

Is it bug or feature?

@Marthyn
Copy link

Marthyn commented May 18, 2015

bump i got the same problem :/

@Jidek
Copy link

Jidek commented Nov 17, 2017

bump This problem still exists

@fatkodima
Copy link
Contributor

Which versions of rails and audited are you using? I can't reproduce this issue.

@Jidek
Copy link

Jidek commented Mar 30, 2018

I was just able to reproduce again. Here are my version numbers: rails (4.2.6), audited (4.2.0).

Steps to reproduce:

  1. Have a model with a field defined by an enum, like so:
    screen shot 2018-03-30 at 2 19 07 pm
  2. Change that field on an audited record

Expected Result:
audited_changes should look like this:
screen shot 2018-03-30 at 2 21 43 pm
OR like this:
screen shot 2018-03-30 at 2 23 47 pm

Actual Result:
audited_changes actually looks like this:
screen shot 2018-03-30 at 2 21 08 pm

I don't think it matters too much if the audited changes shows the keys or the values of the enum, but I would like it to be consistent between old and new.

Please let me know if you have any more questions I can help with for reproducing this issue.

@fatkodima
Copy link
Contributor

@Jidek I have fixed this here #429
Let me know, if this works for you.

@Jidek
Copy link

Jidek commented Apr 25, 2018

I've been running into a lot of trouble trying to import the fix into my project for testing. It seems bundler won't let me use that branch as other gems have dependencies on the specific version of audited that we use.

Do you have any advice on how to solve the dependency issues? If not I might have to just put together a quick rails demo project for testing the fix.

@fatkodima
Copy link
Contributor

@Jidek In your situation, I think

If not I might have to just put together a quick rails demo project for testing the fix.

is the way to go.

@Jidek
Copy link

Jidek commented Jun 12, 2018

@fatkodima I finally found some time to set up a demo environment and test your fix. It looks like it's working perfectly.
Thanks for fixing this issue.
Do you have any idea when this might go onto the live version of audited?

@fatkodima
Copy link
Contributor

@Jidek Nice.
No, I have no idea.

@tbrisker
Copy link
Collaborator

I haven't had as much time to dedicate to the gem as I wish recently, so progress on the next release has been quite slow. There are several issues I would like to address in the 5.0 release, please see #430 for discussion of those.

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 a pull request may close this issue.

5 participants