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

Collections - support for sets and symbols #885

Merged
merged 8 commits into from
Apr 1, 2014

Conversation

dwbutler
Copy link
Contributor

@dwbutler dwbutler commented Sep 4, 2012

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.

@travisbot
Copy link

This pull request fails (merged a93299a into 4bd0330).

@dwbutler
Copy link
Contributor Author

dwbutler commented Nov 8, 2012

Hi, just wondering if you've had a chance to look at this. Thanks!

@justinfrench
Copy link
Member

@dwbutler looks okay, will need some documentation!

@dwbutler
Copy link
Contributor Author

Sure, no problem! I don't see an obvious place to add documentation though. Should I just add some comments to the modified code?

@justinfrench
Copy link
Member

@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 :)

@dwbutler
Copy link
Contributor Author

dwbutler commented Jan 1, 2013

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.

@dwbutler
Copy link
Contributor Author

dwbutler commented Jan 2, 2013

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.

@justinfrench
Copy link
Member

@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!

@dwbutler
Copy link
Contributor Author

dwbutler commented Jan 3, 2013

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.)

@dwbutler
Copy link
Contributor Author

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

@dwbutler
Copy link
Contributor Author

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!

@justinfrench
Copy link
Member

Very late merge. Thanks!

justinfrench added a commit that referenced this pull request Apr 1, 2014
Add support for Sets and Symbols as collections for collections (check box, radio and select inputs).
@justinfrench justinfrench merged commit 3aecd12 into formtastic:master Apr 1, 2014
@dwbutler
Copy link
Contributor Author

dwbutler commented Apr 1, 2014

Nice! Thanks!

On Apr 1, 2014, at 3:01 AM, Justin French notifications@github.com wrote:

Merged #885.


Reply to this email directly or view it on GitHub.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants