MalkbabY has quit [Remote host closed the connection]
MalkbabY has joined #ruby
TCZ has quit [Quit: ...]
ur5us has quit [Ping timeout: 250 seconds]
ur5us has joined #ruby
roadie has joined #ruby
roadie has quit [Ping timeout: 240 seconds]
FetidToot has quit [Ping timeout: 240 seconds]
FetidToot has joined #ruby
FetidToot4 has joined #ruby
FetidToot has quit [Ping timeout: 252 seconds]
FetidToot4 is now known as FetidToot
bandithijo has quit [Quit: WeeChat 3.2]
roadie has joined #ruby
jpw has joined #ruby
Milos has quit [Ping timeout: 268 seconds]
Milos has joined #ruby
roadie has quit [Ping timeout: 250 seconds]
neshpion has quit [Quit: neshpion]
nirix has joined #ruby
VoidNoir0 has quit [Quit: Ping timeout (120 seconds)]
roadie has joined #ruby
pwnd_sfw has quit [Ping timeout: 252 seconds]
pwnd_sfw has joined #ruby
thad_the_man has quit [Ping timeout: 250 seconds]
hololeap has quit [*.net *.split]
aeris has quit [*.net *.split]
thad_the_man has joined #ruby
_ht has joined #ruby
aeris has joined #ruby
MalkbabY has quit [Remote host closed the connection]
MalkbabY has joined #ruby
ur5us has quit [Ping timeout: 250 seconds]
roadie has quit [Ping timeout: 240 seconds]
roadie has joined #ruby
roadie has quit [Ping timeout: 240 seconds]
_ht has quit [Remote host closed the connection]
roadie has joined #ruby
roadie has quit [Ping timeout: 240 seconds]
jpw_ has joined #ruby
jpw has quit [Ping timeout: 250 seconds]
roadie has joined #ruby
wmoxam has quit [Ping timeout: 255 seconds]
wmoxam has joined #ruby
roadie has quit [Quit: ERC (IRC client for Emacs 25.3.50.1)]
noa has joined #ruby
elf_fortrez has joined #ruby
nirix has quit [Quit: Connection closed for inactivity]
ua_ has joined #ruby
ua_ has quit [Quit: Leaving]
ua_ has joined #ruby
ua_ has quit [Read error: Connection reset by peer]
<EdwardIII>
adam12: mmm no i couldn't get it going, so i just put it in the :development, :test section for now (so it gets installed in both), then it works
<EdwardIII>
guess it doesn't hurt to have it available in the dev env too
thad_the_man has quit [Ping timeout: 250 seconds]
kiki_lamb has quit [Quit: Lost terminal]
ur5us has joined #ruby
MalkbabY has quit [Remote host closed the connection]
MalkbabY has joined #ruby
WhereIsMySpoon has joined #ruby
<WhereIsMySpoon>
Hi there - Ruby question here, I want to do array.sort_by, but my list of fields to sort by are not things I want to hard code, they're passed params. From what I know, you're supposed to do something like this: array.sort_by { |e| [e['foo'], e['bar']] }, but I dont know how to pass in a list of fields to sort_by so that it's dynamic rather than
<WhereIsMySpoon>
hardcoded fields.
elf_fortrez has quit [Ping timeout: 246 seconds]
<adam12>
WhereIsMySpoon: is the list of fields to sort by dynamic for each record in the array, or just in general?
<WhereIsMySpoon>
adam12 its dynamic each time the function this is in, is called, but when the function is called with say sort fields ['foo', 'bar'], i want to sort by first field foo, then field bar, for every record in the array
<adam12>
WhereIsMySpoon: maybe something like that?
<WhereIsMySpoon>
oh, hm...thats easy enough...
<WhereIsMySpoon>
what if i wanted to add search direction to each field?
<WhereIsMySpoon>
say I have:
<WhereIsMySpoon>
fields = {foo: 'desc', bar: 'asc' }
<adam12>
WhereIsMySpoon: Offhand I'm not sure, but you'd possibly have to negate the value that you retrieve, if that field is supposed to be reversed.
<WhereIsMySpoon>
i might have just stumbled onto something useful on SO