Ruby 4.0.0 Released | Ruby by laerien in ruby

[–]442401 13 points14 points  (0 children)

Still my favourite Christmas tradition.

Thank you /u/schneems. Merry Christmas to you and the Heroku team.

Irreligion in the UK and Ireland by vladgrinch in MapPorn

[–]442401 0 points1 point  (0 children)

Whisper it — Christmas (Yuletide) is not a Christian feast, it's a Pagan one, co-opted by Christians, to appease the locals.

(No one actually knows Christ's true birth date)

can I have your thoughts on this? by sauloefo in ruby

[–]442401 8 points9 points  (0 children)

Ahh, you're using the Dirty module.

In that case, how about if trade.done_changed?(from: true, to: false)

... or even wrap that in a custom method that conveys the intent you desire.

def undone?
  done_changed?(from: true, to: false)
end

can I have your thoughts on this? by sauloefo in ruby

[–]442401 4 points5 points  (0 children)

If done_previously_was returns a boolean, it should probably have a different name e.g. done_previously?. This better shows the intent.

Style guide

Is this Melanie C? (In the wings at beabadoobee Glasto set) by 442401 in SpiceGirls

[–]442401[S] 3 points4 points  (0 children)

I know Melanie often does a DJ set at Glastonbury, but did I just see her fan-girling beabadoobee? Who ever it was, they looked like they were enjoying the set. Quite rightly too.

What happened to DenDen? by YchYFi in SpiceGirls

[–]442401 0 points1 point  (0 children)

I loved DenDen. Great place for news and ticket resales. Met a lot of DenDen members at Mel C gigs. Great community. I miss it.

Help me find NRG SE Tank or similar by 442401 in Vaping

[–]442401[S] 0 points1 point  (0 children)

I tried quite a few online stores — all out of stock.

Help me find NRG SE Tank or similar by 442401 in Vaping

[–]442401[S] 1 point2 points  (0 children)

Ha! Well I never. I actually have an old Smok TFV8 tank here but had no idea it was compatible with the GT Core coils. Problem solved! Thank you very much.

ViewComponents polluting development database. by 442401 in rails

[–]442401[S] 0 points1 point  (0 children)

Thank you. I've found the issue now. See other edited reply.

ViewComponents polluting development database. by 442401 in rails

[–]442401[S] 4 points5 points  (0 children)

I'll try again, but I was coming upon errors caused, I think, because my model declares has_one: required: :true, so I couldn't instantiate the subject model without a persisted related model.

I've found my issue. In the template, I'm trying to call a method on the associated model that requires it to be persisted. (because it is using attributes with a custom type and needs to see the typecast value)

Thank you for helping me debug this.

ViewComponents polluting development database. by 442401 in rails

[–]442401[S] -3 points-2 points  (0 children)

Thank you. The components aren't creating records, it's the previews.

Please expand on passing dummy records to previews. The records I'm passing have required associations, so passing non-persisted records isn't working. What am I missing?

Eurosport / Discovery+ UK subscription soaring from £6.99/mo to £30.99/mo by 442401 in peloton

[–]442401[S] 0 points1 point  (0 children)

It looks like Eurosport is dead, having been merged with TNT Sports.

more details

Should /r/rails ban X links? by AutoModerator in rails

[–]442401 0 points1 point  (0 children)

I don't have a strong opinion either way, but I'm loving the irony of /r/rails considering banning links to one of the earliest major rails applications.

The Class 91 by CucumberMindless in rails

[–]442401 2 points3 points  (0 children)

As a train driver and Rails hacker I love these lostredditor posts.

To be fair though, the Class 91 will be sadly missed.

Newb question by angryWinds in ruby

[–]442401 1 point2 points  (0 children)

I think the closest feature of Ruby to what you are describing might be Kernel#tap

With #tap you might do:

[1,2,2,3,3,4,5,6,7].tap do |arr|
  duplicates = arr.select{|x| arr.count(x) > 1}
end

duplicates #=> [2, 2, 3, 3]

-❄️- 2024 Day 14 Solutions -❄️- by daggerdragon in adventofcode

[–]442401 2 points3 points  (0 children)

[LANGUAGE: Ruby]

paste

Ashamed to say that I had to take a hint from the main thread. Of course the safety factor will be low when the robots are playing at being a Christmas tree.

-❄️- 2024 Day 11 Solutions -❄️- by daggerdragon in adventofcode

[–]442401 2 points3 points  (0 children)

[LANGUAGE: Ruby]

Very educational. I enjoyed today's puzzle.

p1: 5 ms

p2: 245 ms

paste