Fix to_json / serializable hash issue when using two uploaders on the same model. #81

Merged
merged 1 commit into from Jan 15, 2013

Conversation

Projects
None yet
2 participants
Contributor

peteonrails commented Jan 15, 2013

  1. Added two failing tests that illustrate the problem.
  2. Fixed issue by changing serializable hash to use column.to_sym instead of string interpolation (which overwrites the method definition at the time mount_uploader is called)
  3. Fix an unrelated issue that caused my tests to fail: check that options are defined before sending :[](which nil doesn't repond to)
@peteonrails peteonrails Correctly serialize JSON for two separate uplaoders on the same model.
1. Added two failing tests that illustrate the problem.
2. Fixed issue by changing serializable hash to use column.to_sym instead of string interpolation (which overwrites the method definition at the time mount_uploader is called)
3. Fix an unrelated issue that caused my tests to fail: check that options are defined before sending :[] (which nil doesn't repond to)
f977b5d

@rmm5t rmm5t added a commit that referenced this pull request Jan 15, 2013

@rmm5t rmm5t Merge pull request #81 from peteonrails/master
Fix to_json / serializable hash issue when using two uploaders on the same model.
60d63a0

@rmm5t rmm5t merged commit 60d63a0 into carrierwaveuploader:master Jan 15, 2013

Member

rmm5t commented Jan 15, 2013

Thanks Pete!

Member

rmm5t commented Jan 17, 2013

This fix was just released in v0.3.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment