-
Notifications
You must be signed in to change notification settings - Fork 629
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
Collections - support for sets and symbols #885
Conversation
Hi, just wondering if you've had a chance to look at this. Thanks! |
@dwbutler looks okay, will need some documentation! |
Sure, no problem! I don't see an obvious place to add documentation though. Should I just add some comments to the modified code? |
@dwbutler I think something would need to go in the examples at the top of CheckBoxesInput and anything else that mixes in Collections, not ideal, but shouldn't take long :) |
I took a look at this again and realized I didn't actually test sets and symbols with the other collection input types. I'll have some more thorough testing and documentation ready to go later this week. |
Okay, I wrote some tests and examples for the three collection classes I could find - check box input, radio input, and select input. I think this should be good to go now. |
@dwbutler CI fails for 1.8.7 and ree, so I guess you're using some 1.9-only syntax? Haven't looked closely yet, ping me when you think the build is good! |
Nope, everything is passing for me in 1.8.7. Looks like an unhappy coincidence that Travis happened to fail in 1.8.7 and ree. (It failed while trying to run bundle install.) |
Hey, just wondering if you had a chance to run the specs for this. I'm pretty sure the Travis CI results were a fluke. Here's a fairly clean Travis run (which had a misfire in 1.9.3 / Rails 4 this time): https://travis-ci.org/dwbutler/formtastic/builds/4104685 |
Bump! :) I know it's been quite a while, but I merged in master yesterday and the Travis build passes. Would you mind giving this another look? Thanks! |
Very late merge. Thanks! |
Add support for Sets and Symbols as collections for collections (check box, radio and select inputs).
Nice! Thanks!
|
I'm using the role_model gem to model roles in my application. RoleModel exposes a 'roles' attribute which is implemented as a set of symbols. I tried creating a checkboxes input, but Formtastic just ignored the selected values.
I modified Formtastic input collections to accept sets (or any array-like object that responds to :to_a). I also modified it to work with symbols.