Ruby :: Sometimes on Rails

The humane programming language. Be nice. Have fun. Lurkers...
Jan 8, 2019 01:01
for example user opens 2 tabs.. now they can upload as many as as they want so client side validation doesn't really work in this case
Jan 8, 2019 00:02
though technically the question is broader than album/images it can be any other system logic that requires a hard cap but can be vulnerable to concurrency

example: spinning up a number of user accounts etc (which might be a lengthy process)
Jan 8, 2019 00:00
yea that's exactly what i was thinking.. thanks @Mirv
Jan 7, 2019 23:47
i have an Album class with has many Image
the images are created on the front end using javascript promises

I want to limit the number of images the album can have.
However i simply can't use the rails validation because the promises are concurrent so initially the images.count is 0

what is the right way to approach this?
Dec 9, 2016 17:24
yea lol
Dec 9, 2016 17:18
and you guessed it.. because of day light saving !
Dec 9, 2016 17:18
it drove us crazy figuring out why it was failing
Dec 9, 2016 17:10
we had a test that would randomly fail only on the week of November 6th after 7PM lol
Dec 9, 2016 17:09
with rails.
Dec 9, 2016 17:09
i went nuts with DST stuff
Dec 9, 2016 17:08
haha lol
Dec 9, 2016 17:05
thanks @WayneConrad !
Dec 9, 2016 17:03
:)
Dec 9, 2016 17:03
i am back!
Nov 11, 2016 18:26
especially DST
Nov 11, 2016 18:25
god i hate time zones
Oct 16, 2016 16:29
right
Oct 16, 2016 16:21
I don't think ruby is going anywhere anytime soon. It has a strong and welcoming community; It is also very easy to get started with.
I agree with you that Rails requires following conventions but then again which framework doesn't?
Rails is a mature framework and has been widely used in production. The reason why rails succeeds is because it allows you to deliver applications very quickly to market to meet the business needs.
Ruby's philosophy is move quickly and break things, I have no doubt ruby will stay relevant thanks to the community embracing change rapidly.
Oct 16, 2016 16:16
on another note.. i really dont understand the hate against ruby in HN ..
[..]
I don't see a bright future for ruby, I think it had some lead advantage, but RoR/opinionated-design really cut down the options for innovation with a Ruby based web dev group. It is interesting to see how diametrically opposed philosophy of Ruby the language is from the RoR community, it is like Ruby created a liberal blank space and RoR immediately filled it with conservative inflexibility.
[..]
Oct 16, 2016 16:14
@thesecretmaster good point
Oct 16, 2016 16:05
which one makes more sense.
the route is:

GET /users/:user_id/orders/:id/edit

user = User.find(params[:user_id])
OR
user = current_user
Oct 14, 2016 15:57
some really interesting comments though:
https://news.ycombinator.com/item?id=12703751
Oct 14, 2016 15:56
i know right lol .. this whole thing is because of yesterday's slack post regarding PHP: slack.engineering/taking-php-seriously-cf7a60065329#.eq9zlsiwm
Oct 14, 2016 15:44
lol.. i really love the comments on HN..
[..]
If you're programming in PHP, you're not running around talking about "convention over configuration" giving talks, or trying to make your code beautiful. It's a garbage language, and you know it
[..]
Oct 14, 2016 15:29
@WayneConrad very well said
Oct 14, 2016 04:03
[..]
After I use both php and ruby for the same employer over more than a year. I would rather say Ruby is more like a garbage language -- 1) twist syntax to allow people write the same function into different ways is not a cool feature, it is disaster feature which causes more for a team to sync. 2) Duck typing is not interface, don't kidding yourself. they are totally two different thing. 3) ruby attract a lot of master level people try to make the community better, however, the whole community filled with mediocre developers who cannot even understand Rail != Ruby, and also they believe
Oct 14, 2016 04:03
is it more or does this* person not understand ruby clearly?
Oct 13, 2016 14:53
it somehow hijacked it.. lol OSX..
Oct 13, 2016 14:53
wow.. this is a new one.. pressing the the A key on friends machine randomly opens last pass lol
Oct 11, 2016 16:20
@WayneConrad .. well I think the problem is mainly with JIRA setups that are not correctly configured .. if you configure it correctly to your needs it becomes easy to use IMO
Oct 11, 2016 16:20
lol
Oct 11, 2016 16:20
@Jared I love Jira
Oct 11, 2016 15:28
nice when is the release date?
Oct 11, 2016 15:25
whats new in the ruby/rails world?
Oct 11, 2016 15:09
pretty awesome city!
Oct 11, 2016 15:09
i was in Chicago for a while for HRTech
Oct 11, 2016 15:09
good to be back
Oct 11, 2016 15:08
+)
Oct 11, 2016 15:08
i am back
Oct 11, 2016 15:08
Hi all!
 

SQL

Got a SQL question? Any SQL flavor here, just ask. Indicate yo...
Dec 9, 2016 17:39
:)
Dec 9, 2016 17:35
:)
Dec 9, 2016 17:35
yea thanks @War
Dec 9, 2016 17:24
i thought about doing something like:
first, build a temporary table:
post_id, user_id, has_comment, status
from there, i thought about a trick:
select *, (if !has_comment then 1; if has_comment && status==‘whatever’ then 2; else 3) as rank from (table above) order rank asc
Dec 9, 2016 17:23
is it possible in just plain sql?
Dec 9, 2016 17:07
im really stuck on this problem.
I have the following:

User has many comments
Post has many comments
Post belongs to a User

I want to : list Posts and order them by:
posts user hasn't commented on
posts that user created
posts user has commented on and the comment status is approved
posts user has commented on and the comment status is anything else

any idea what an efficient SQL query would look for this?
 

JavaScript

Topic: Anything JavaScript, ECMAScript including Node, React, ...
Sep 22, 2016 16:15
great! thats all i really need here
Sep 22, 2016 16:14
not looking to start a flamewar btw..
Sep 22, 2016 16:14
lol
Sep 22, 2016 16:13
looks like angular 2 is easier to learn than react?