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

fix rails4 enums attribute issue #383

Merged
merged 1 commit into from
Jun 17, 2014
Merged

Conversation

gregmolnar
Copy link
Contributor

I am not sure how to make a test for this. It should be AR 4 only test. As far as I see the current tests are run against 1 version of AR only.

@gregmolnar
Copy link
Contributor Author

Would you be open to make your test suite run against multiple versions of rails in a similar way than it is outlined in this article? http://www.rubytutorial.io/how-to-test-your-gem-against-multiple-rails/
I would be happy work on that.

@batter
Copy link
Collaborator

batter commented Jun 12, 2014

We already do. Travis runs against Rails 3 and Rails 4. Was contemplating whether it was necessary to run against Rails 4.0 and 4.1, but I think that's likely overkill. We also test against multiple versions of Ruby.

@batter batter added this to the 3.0.3 milestone Jun 12, 2014
@gregmolnar
Copy link
Contributor Author

With the current setup is there a way to add a model with an AR enum field for the tests? I guess if I would use that model only from a test which exercises that feature it should break anything else. I will give that a spin when I got some time to see how it goes.

With a Rails 4 enum field the changed attributes hash contains the
mapped value and when prev[attr] assigns the value it will be lost.
@gregmolnar
Copy link
Contributor Author

I've added a test and rebased.

@gregmolnar
Copy link
Contributor Author

My test fails on Travis with the rails3 gemfile. Any suggestion how to get around that?

@batter batter merged commit 348b71e into paper-trail-gem:master Jun 17, 2014
@batter
Copy link
Collaborator

batter commented Jun 17, 2014

Cheers! I cleaned things up with d9cf951 if you're curious as to how I tackled the failures against ActiveRecord < 4.1.

@gregmolnar
Copy link
Contributor Author

@batter Thanks! Everyday is a schoolday :)

@jaredbeck jaredbeck mentioned this pull request May 11, 2016
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