« first day (1139 days earlier)      last day (2116 days later) » 

12:13 AM
Hi guys,
can you please help me on my RoR application? im just new to RoR and im still learning it.
I created a RoR application that searches using range of dates, it wont pass the date that I have selected on the query.
 
1:11 AM
I'm just curious, anyone have thoughts on
18
Q: Should every git commit leave the project in a working state?

SuanI'm curious to know what the prevailing best practice is about get commits are. Should they be enforced such that the project is in a working state (builds properly, all tests pass etc), or is committing broken code OK? If you waive the requirement, you can be more flexible with commits (use the...

 
 
3 hours later…
4:36 AM
@thesecretmaster I have a definite opinion on it, but it's bedtime now. I'll read it later and up-vote whoever has the correct (that is, agreeing with me) opinion :D
 
 
9 hours later…
1:41 PM
Good morning
 
1:59 PM
Good morning.
@thesecretmaster I agree with this answer
Thou Shalt Not Lie: git rebase, amend, squash, and other lies‌​, which I disagree with, has some thoughtful comments which are worth reading.
 
I read it as : A lot of things are bad on public repos. For local repo, the same may not be true
 
My favorite comment is this (which agrees with what you just said): "Embrace the difference between draft & published history. Don't edit published history."
 
2:19 PM
Not necessarily
Your master/production branch should always be in working state (passing all the tests etc)
However, you can work on your local copy as your wish.
 
@KartikeyTanna Hello, thanks for speaking up (not least because I agree with you :) ). Good morning, or evening, or whatever it is.
 
 
4 hours later…
6:39 PM
hi. I've one question.
Can you use pluck for pulling two columns from two separate tables?
 
It should be possible, provided you have done the appropriate join.
 
I joined. But I couldn't find proper way to directly get the values
 
Please show the query you are using.
 
I had to iterate through the first model to get other value. Though I could manage not to hit db for each iteration
CourseTypeRule.includes(:grade_level).where(batch_id: 6).pluck(:course_type_id, :grade_point)
the last :grade_point is on the association grade_level. I could get :grade_level_id, but no :grade_point
 
Try changing :grade_point to "grade_levels.grade_point" and see what happens.
 
6:50 PM
where? in place of the symbol?
 
Yes.
 
ActiveRecord::StatementInvalid: PG::UndefinedTable: ERROR:  missing FROM-clause entry for table "grade_level"
LINE 1: SELECT "course_type_rules"."course_type_id", grade_level.gra...
 
Only you know the name of the table... What you're doing there is specifying the table name along with the column name.
 
Ah! Thanks
It returned! I was using grade_level instead of grade_levels
sorry. I was wrong
 
Are you now getting both columns in the result of the query?
 
7:03 PM
Yes. Thank you again :)
 
I was only guessing, so I'm very glad it worked.
 
I tried earlier. But unfortunately I did the mistake I do often
the association has to be always plural when used in where
I didn't try with string though
 
I think that ActiveRecord is calling #to_s on the arguments to #pluck, so you can pass a string or a symbol.
 
Symbol wasn't successful
Good night
 
Goodnight, Thanks for dropping by.
 

« first day (1139 days earlier)      last day (2116 days later) »