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

Add Rails 4 support #9

Merged
merged 1 commit into from Sep 10, 2014
Merged

Add Rails 4 support #9

merged 1 commit into from Sep 10, 2014

Conversation

zporter
Copy link
Contributor

@zporter zporter commented Sep 10, 2014

Quite a few things needed to be addressed to make this happen:

  • Bump AR version in gemspec
  • Use Ruby's 1.9+ MiniTest instead of TestUnit.
  • This test was failing due to the except option here. "email" was replaced with "name".
  • The encode method within ActiveSupport calls dup on options. When using to_json, we were allowing the Symbol for set to be passed to this method. dup cannot be called on Symbol, so to_json had to be added back as a method that we parse the options for.

Quite a few things needed to be addressed to make this happen:

Bump AR version in gemspec.

The test at the following line was failing due to the `except` option.
"email" was replaced with "name".
https://github.com/vigetlabs/serialize_with_options/blob/d792a472431c72b93dd00b14e7654a8f2c7ebb89/test/serialize_with_options_test.rb#L184

The `encode` method within ActiveSupport calls `dup` on `options`.
When using `to_json`, we were allowing the Symbol for `set` to be
passed to this method. `dup` cannot be called on Symbol, so `to_json`
had to be added back as a method that we parse the options for. Here's
the offending line in Rails:
https://github.com/rails/rails/blob/4-1-6/activesupport/lib/active_support/json/encoding.rb#L34
@dce
Copy link
Member

dce commented Sep 10, 2014

👍 💯

@mackermedia
Copy link

Noice 🍬

@dce dce merged commit 152a5a6 into master Sep 10, 2014
@dce dce deleted the rails-4 branch September 10, 2014 20:14
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.

None yet

3 participants