You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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!
This may not be the right place to discuss this, but what is/is there a plan for more lessons?
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.
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:
@all_questions.select {|q| (Answer.where(:question_id => q.id).count == 0)}
^^ 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.
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: Question.all.select{|question| question.answers.empty?}
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.
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: Question.all.select{|question| question.answers.empty?}
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
—
Reply to this email directly or view it on GitHub.
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.
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.
—
Reply to this email directly or view it on GitHub.
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.
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.
—
Reply to this email directly or view it on GitHub.
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 $or, that can be translated easily though. I don't have the full overview, just mentioning the possibility.
Exchanging the ORM is not something a lot of people do in the Ruby world as far as I know :-)
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 would like to contribute, however, I don't understand how question work actually.
If I do rake routes to see all the routes it returns that question/ should be managed by the questions controller and the index action. But there is no index action defined if the controller questions!
Can someone explain to me how it works?
Thanks in advance!
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.
Activity
PragTob commentedon Dec 10, 2012
Cool idea!
rhysforyou commentedon Dec 10, 2012
I like it. We need to start mapping out some new features, this project's been stagnating for too long.
PragTob commentedon Dec 11, 2012
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 :-)
jaredmoody commentedon Dec 12, 2012
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 :)
steveklabnik commentedon Dec 12, 2012
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.
PragTob commentedon Dec 12, 2012
@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!
trekr5 commentedon Aug 12, 2013
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!
steveklabnik commentedon Aug 12, 2013
Looks good!
PragTob commentedon Aug 12, 2013
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
jacqueline-homan commentedon Aug 29, 2013
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?
PragTob commentedon Aug 30, 2013
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.
SoldierCoder commentedon Sep 7, 2013
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:
@all_questions.select {|q| (Answer.where(:question_id => q.id).count == 0)}
^^ 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.
PragTob commentedon Sep 9, 2013
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:
Question.all.select{|question| question.answers.empty?}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
SoldierCoder commentedon Sep 9, 2013
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 notifications@github.com wrote:
PragTob commentedon Sep 9, 2013
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 :-)
4 remaining items
jacqueline-homan commentedon Sep 10, 2013
@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.
steveklabnik commentedon Sep 10, 2013
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.
SoldierCoder commentedon Sep 10, 2013
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 notifications@github.com wrote:
steveklabnik commentedon Sep 10, 2013
I'd be okay with it.
The only concern is actually transferring the data over... always risky and stressful.
PragTob commentedon Sep 10, 2013
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.
SoldierCoder commentedon Sep 11, 2013
Like what, for instance?
On Sep 10, 2013, at 6:14 PM, Tobias Pfeiffer notifications@github.com wrote:
PragTob commentedon Sep 11, 2013
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
$or, that can be translated easily though. I don't have the full overview, just mentioning the possibility.Exchanging the ORM is not something a lot of people do in the Ruby world as far as I know :-)
jacqueline-homan commentedon Oct 2, 2013
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 :)
hcarreras commentedon Nov 18, 2013
I see some inactivity... is someone working in this?
PragTob commentedon Nov 18, 2013
To my knowledge no one is actively working on this :-(
hcarreras commentedon Nov 18, 2013
Ok, I will work on this!
PragTob commentedon Nov 18, 2013
Thanks heaps 👍
hcarreras commentedon Nov 20, 2013
I would like to contribute, however, I don't understand how question work actually.
If I do rake routes to see all the routes it returns that question/ should be managed by the questions controller and the index action. But there is no index action defined if the controller questions!
Can someone explain to me how it works?
Thanks in advance!
PragTob commentedon Nov 20, 2013
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
hcarreras commentedon Nov 21, 2013
yeah actually it really looks like black magic!
thank you very much! I will try to understand better how it works before change anything. :D