« first day (1235 days earlier)      last day (2020 days later) » 

1:32 AM
Anyone know what the "right" way to do soft deletion in AR is?
 
1:46 AM
Ruby is awesome
2
 
 
1 hour later…
3:04 AM
@thesecretmaster ...you mean one where you remove the link that displays for the user, but still remains in the db?
 
3:19 AM
rdingwall.com/2009/11/20/the-trouble-with-soft-delete ... some great ideas in there for 'softdelete'
2
 
 
1 hour later…
4:44 AM
@DmitryKudriavtsev Yes it is!
 
4:57 AM
i've almost got every error cleared out of my test suit on the monolith
like 3 weeks later
 
 
2 hours later…
7:20 AM
Hi ,i have recently got a task on my job to
migrate the old data from a php website to new rails website.php website
data is in mysql and rails data is in postgres,i cannot find a way in which
i can transport the whole data from php to rails provided that there are
some extra fields and tables being added in rails database also the field
names are different in both tables.
 
 
1 hour later…
8:24 AM
should I use foo.sort_by{|el|bar.find_index el}, bar.select{|el|foo.contains? el} or perhaps bar & foo ? The last one is the most conscise and should be the fastest, but it's also a little unreadable.
 
9:18 AM
@JanDvorak The last one is far more readable. Its intent is clear.
 
bar is a superset of foo
 
bar & foo gets you the intersection whether bar is a superset or not, unless I'm misunderstanding something.
 
My goal is to take the elements of foo in the order in which they appear in bar
 
Oh, it just became a much more interesting question. Let's think.
Does ruby define that bar & foo preserves order?
Yes, it does specify that order is preserved. I'd still say bar & foo, but with a comment (or a method name to serve as a comment) explaining that you are exploiting the order-preserving quality of &.
# take the elements of foo in the order in which they appear in bar
bar & foo
 
9:33 AM
undertood, thanks.
 
Thanks for the great question.
 
 
1 hour later…
10:40 AM
Is there a way to run code before every transaction in AR?
Backstory: I'm implimenting soft delete by flag because users will be undeleting often, and there isn't much data. I don't want to add a constrainted to all my queries that avoids deleted elemnts, so I want to add it to my model.
 
 
2 hours later…
1:50 PM
Hey everyone! Good morning!
 
If I have an exception happening in one thread, can I catch it and send it to a Queue that is being read by the main thread, so it has some idea of what is happening? I'm getting deadlocks in my implementation.
 
You can, manually.
 
2:07 PM
You're right. I tried this simple example and it's fine, so there must have been something else wrong in my code.

q = Queue.new

Thread.new do
i = 1
loop do
begin
sleep i
i += 1
raise 'whatever'

rescue StandardError => e
q << e
end
end
end

loop do
puts q.size
end
 
 
1 hour later…
 
2 hours later…
5:18 PM
I just got this gem from a TWC support person: "network traffic of more number of customers using the same channel bandwith frequency." What is it supposed to mean? Nobody knows!
 
5:59 PM
Too many people on a wifi band?
 
6:15 PM
Looks like an ESL speaker perhaps. But there's not much you can do with it.
 
 
5 hours later…
11:54 PM
@thesecretmaster yes, there is its the before_commit or some such filter - it's highly not recommended by people far better than me, but I use it when a new user is registered to chain on to devise & create a user profile table entry ... did you see the soft delete pattern called momento from my other link?
 

« first day (1235 days earlier)      last day (2020 days later) »