-
Notifications
You must be signed in to change notification settings - Fork 102
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
Unanswered filter #131
Comments
Cool idea! |
I like it. We need to start mapping out some new features, this project's been stagnating for too long. |
As for stagnating I personally rather put my free time into shoes4 in order to have a reliably running hacketyhack again, but that's a different story. Of course the web platform shouldn't stagnate so I'm all for new features :-) |
I agree getting shoes working properly is more important, I'm just more familiar with web so this was a good place for me to start contributing. This may not be the right place to discuss this, but what is/is there a plan for more lessons? That seems to be a popular request and I'd be happy to help move that forward. Maybe we could adapt content from someone else with permission? Lastly, I'm very new to mongodb, can someone give me a tip about how to write a scope for unanswered questions? The whole no joins thing is throwing me :) |
Right, the advantage of us being multiple people! I don't think that saying that globally shoes is more important; people are using the site right now, and we should be helping them too!
There is, but I'm busy. As long as you're willing to let me revise them heavily, I'm all for you adding more lessons! We have a gem for that, hackety_hack-lessons. |
@steveklabnik yep you're right! Personally my priorities are more with shoes these days :-) Adding more lessons would be totally awesome. Would also be happy to revise. As for mongo, sorry no idea - always new stuff to learn out there! |
Hello, Please take a look at the following mockup done by Team Hackety Hack for the unanswered filter feature https://gomockingbird.com/mockingbird/#4a7borc/KC4JNQ Let me know what you think. All input welcome! |
Looks good! |
looks good, but what other drop down options (except no answer) would there be? If there are no other options I'd rather make it a button/checkbox |
Hello, Here's an additional mockup from our team for the unanswered questions filter: https://gomockingbird.com/mockingbird/#w6oglu4/mBiAW I also have a question about that unanswered questions handling. Here's what I've been mulling over in my mind: We need a user interface that tells the app that we want to see only unanswered questions. PragTob, you mentioned a button/checkbox or something to that effect that would either say "All" or "Unanswered" and direct the user accordingly. But if you put that in the view where the questions are, why not just put the "search" feature there and then you wouldn't need a button/checkbox. Do you guys want a separate search for un-answered questions versus a general search? |
Sure later on this functionality should be with the search functionality. Right now there is no search functionality. So right now links/buttons/whatever that say "show only unanswered questions" are sufficient. When we build search functionality this can be easily moved over, although we might want to keep the shortcut buttons. |
I am of the opinion that to do this we will need to add either a count of the answers to Questions. I know someone will say, "wait, let the database give us our count." The problem comes in writing a scope that returns only unanswered questions. Everything I've seen of mongo_mapper says you can only do scopes that use the attributes of the object you are scoping. The closest thing to doing that is to select all questions then pare down that list like: ^^ returns a nice list of unanswered questions but it is not a scope and thus is not paginated or ordered as they would be if I could apply those scopes to one that would return unanswered questions. |
Hi Ed, after some looking in the mongo_mapper docs and through stackoverflow I also couldn't find out a clever database way to do this and it also seems like MongoDB isn't capable of this. I'd slightly rephrase your query though: We probably should embed the answers document into the Questions document, but then we'd have to migrate old data so that's another story. Cheers, |
Tobi, Did you tell me that we were still using Active Record in places? Not for any data in Hackety.com right? What was the draw to Mongo, anyway? On Sep 9, 2013, at 3:41 PM, Tobias Pfeiffer [email protected] wrote:
|
Not for any data, right. AR just seems to be hooked in to some parts of Rails pretty badly, see the discussion over here: #146 . I wasn't around the project when it was first built and therefore not when the decision to use Mongo was made. So I don't know :-) |
I'd vote for moving back to AR unless there's good reason that mongo was picked. It seems silly to try and model relational data with mongo; relational databases do this very well. I gave up on this filter since I'm not familiar with mongodb and I couldn't figure out how to do this otherwise simple thing. |
I'd second the motion @jaredmoody. |
My concern would be mongo_mapper - don't think it is actively developed anymore. This may be the query/scope you're looking for:
I would hesitate from using it in prod because it really won't scale; it's loading all the answer ids. Joining in mongo is inefficient. As has been suggested already I think the right way to do it in mongo would be to denormalize - start questions with an unanswered flag and flip the flag the first time an answer is provided. |
There may be a way yet, Jared, but I tend to agree with you. Not just for the Unanswered Filter either. I recall there was more than one roadblock with trying to add Omniauthable authentications like Github, Twitter, Facebutt (er, I mean Facebook) and the like. If we were using AR it would have been done in the first week. On the other hand, I'd like to know why mongo was picked in the first place before second-guessing the original authors.
|
@jaredmoody and @jrgifford : I third it :) Actually, it may be easier just redoing the app from scratch using AR and in Rails 4.0. That way, several issues can be taken care of in one fell swoop. |
To be clear on the history: mongo is the datastore because at the time I originally wrote this code, mongo was my default data store that I wrote new projects with. |
So, if it could be done, you'd be ok to switching to AR, or are there other overriding concerns? On Sep 10, 2013, at 4:20 PM, Steve Klabnik [email protected] wrote:
|
I'd be okay with it. The only concern is actually transferring the data over... always risky and stressful. |
I'm also very concerned about moving the data over. I don't want to lose any data. Plus some application code has to be changed, we might use mongo features that you can not translate 1 to 1 etc. |
Like what, for instance? On Sep 10, 2013, at 6:14 PM, Tobias Pfeiffer [email protected] wrote:
|
The model code has to be changed and translated to migrations (because atm we got the attributes defined in the model, which I actually like but that's another topic). MongoDB has kind of an own querying language which we use some times e.g. that Exchanging the ORM is not something a lot of people do in the Ruby world as far as I know :-) |
Hello again :) I began an online course on MongoDB through 10Gen a couple days ago. Too bad it wasn't available earlier on in the Rails Girls SoC program. Also, tried Tobi's suggested syntax for the query while in pry (I LOVE pry), and that query works! I get a return of the questions I know for a fact have no answers. :) YAY! Now, on to fix the code block in the app accordingly. Thanks PragTob :) |
I see some inactivity... is someone working in this? |
To my knowledge no one is actively working on this :-( |
Ok, I will work on this! |
Thanks heaps 👍 |
I would like to contribute, however, I don't understand how question work actually. |
That's some hardcore black magic. E.g. The controller inherits from InheritedController which is part of the inherited resources gem to DRY up rails e.g. not have the same old actions rewritten in every control. You can hook into those actions or just overwrite the methods, there are a couple of samples in the code base. Does this answer the question? Tobi |
yeah actually it really looks like black magic! |
It would be nice to create a filter on the questions tab for unanswered questions, a la stack overflow.
What do you think?
The text was updated successfully, but these errors were encountered: