quakephil

Activity Graph

Page 1 of 1

2016-07-10

[04:59:53] quakephil: *.net *.split
[08:54:09] quakephil: has joined #ruby
[08:54:11] quakephil: has joined #RubyOnRails
[21:38:32] quakephil: has left #RubyOnRails: ()
[21:38:34] quakephil: has left #ruby: ()

2016-07-07

[13:49:13] quakephil: has joined #ruby
[13:50:43] quakephil: Rails/ar question... I have a model called group (can't change the name) with a relationship to user, and I'm trying to do user.group.select.etc but its failling on the .group part with"The method .group() must contain arguments"
[13:51:09] quakephil: has joined #RubyOnRails
[13:51:13] quakephil: Rails/ar question... I have a model called group (can't change the name) with a relationship to user, and I'm trying to do user.group.select.etc but its failling on the .group part with"The method .group() must contain arguments"
[13:51:38] quakephil: I guess its trying to do a group by instead of finding the relationship, is there any way I can give ar a hint to use a relationship instead
[13:55:30] quakephil: I figured it out... I was doing model.relationship.relationship2 which is nonsense, model.relationship2 worked

2016-06-25

[21:36:07] quakephil: Read error: Connection reset by peer

2016-06-24

[03:23:51] quakephil: Ping timeout: 240 seconds
[07:44:32] quakephil: has joined #ruby
[11:48:31] quakephil: Ping timeout: 250 seconds
[12:07:07] quakephil: has joined #ruby
[12:15:03] quakephil: Ping timeout: 240 seconds
[12:17:25] quakephil: has joined #ruby

2016-06-23

[03:41:15] quakephil: Ping timeout: 260 seconds
[10:37:46] quakephil: has joined #ruby

2016-06-22

[02:26:48] quakephil: Ping timeout: 246 seconds
[08:26:38] quakephil: has joined #ruby

2016-06-21

[17:57:51] quakephil: has joined #ruby
[17:59:21] quakephil: Greets all! How can I access an array inside a sort_by block? I'm getting "nil" when trying to use it here http://pastebin.ca/3649166
[18:00:01] quakephil: (line 22, sortedkeys.index(k) turns out to be nil)
[18:03:50] quakephil: jhass: that's by design
[18:04:16] quakephil: can you help me write the sorter? I essentually want to get to the sorted hash, from unsorted hash, using sortedkeys as a guide
[18:04:25] quakephil: sortedkeys may or may not have all keys
[18:04:39] quakephil: any hints/pointers are welcome
[18:05:13] quakephil: Ordering a hash is one of the basic functions of this data structure
[18:05:28] quakephil: jhass: either as before, or doesn't matter
[18:05:52] quakephil: whichever is simpler to implement
[18:06:20] quakephil: doesn't help
[18:09:14] quakephil: Holy mother of god... let me give that a shot
[18:10:26] quakephil: http://pastebin.ca/3649176 doesn't seem to be sorting; also returning a array whereas I should really want a hash in the same form back, but ordered
[18:11:03] quakephil: I'm on 2.3.0p0
[18:12:11] quakephil: ok that's fine, but the ordering doesn't seem to be working either, the resulting array is still in the original order?
[18:14:39] quakephil: I want to get this working. If I missed something, its not because I'm ignoring it
[18:14:59] quakephil: Its because I'm a noob who is trying to learn with your help
[18:15:18] quakephil: so what did I miss? Do I have to convert the hash to an array first?
[18:16:03] quakephil: I thought "should be your solution" meant it should be my solution
[18:17:57] quakephil: http://pastebin.ca/3649186 using to_sym doesn't seem to help either
[18:19:27] quakephil: Aha, that works
[18:19:44] quakephil: It doesn't handle missing sortedkeys well, but for now I don't think you guys have the patience to help with any more of this
[18:19:50] quakephil: sorry to be such a burden

2016-05-14

[01:17:33] quakephil: Ping timeout: 246 seconds
[01:26:42] quakephil: has joined #ruby
[02:08:34] quakephil: Ping timeout: 240 seconds
[02:24:37] quakephil: has joined #ruby
[22:40:09] quakephil: Read error: Connection reset by peer

2016-05-13

[03:00:22] quakephil: Ping timeout: 244 seconds
[08:51:28] quakephil: has joined #ruby

2016-05-12

[02:21:09] quakephil: Ping timeout: 244 seconds
[05:44:12] quakephil: has joined #ruby
[09:39:32] quakephil: guys let's be friends https://www.youtube.com/watch?v=vlq9UWWqe44

2016-05-11

[01:08:33] quakephil: Ping timeout: 265 seconds
[02:18:50] quakephil: has joined #ruby

2016-05-10

[14:02:58] quakephil: has joined #ruby
[14:03:31] quakephil: is there a way to load a sqlite3 in ruby using a different schema name? essentially something like 'attach blah.sqlite3 as different_schema_name' but in database.yml?
[14:04:30] quakephil: if you issue a create table blah.mycooltable it will work, but you will have to attach db.sqlite3 as blah to be able to access it
[14:04:42] quakephil: so it looks like it has schemas on the command line
[14:06:18] quakephil: i'm using it to facilitate rspec tests, whereas production db is a mysql with actual schemas, so I need this functionality in database.yml but I donno how to tell ruby to access the blah schema (gem must be loading it with the default "main" schema and therefore can't find my tables)
[14:07:38] quakephil: actually i'm not in rails, i'm in grape
[14:07:56] quakephil: wonderful...
[14:09:52] quakephil: we use codeship for qa and they can't tunnel to our databases
[14:11:00] quakephil: yeah you do have a point there
[14:11:12] quakephil: i just thought sqlite+ruby was mature enough by now
[14:11:47] quakephil: obviously our prod is separate server, vpc, etc
[14:12:36] quakephil: of course its a problem installing mysql on codeship all the same
[14:49:13] quakephil: So I have a calculated column in my ar model (like this: http://stackoverflow.com/questions/1982778/concat-two-fields-activerecord ) but I'm stumped how to select it.. I tried Myarclass.select('usual,fields', :calculated_field).other().stuff() ... but that just gave me 'calculated_field' as calculated_field instead of what I have in my def.... am I missing something obvious here?
[14:51:10] quakephil: If I do select('*') its not there either...
[14:52:23] quakephil: fuck it, I'll just have the front end do it
[15:01:26] quakephil: havenwood: I'm not using rails, I'm using grape, does that chan still apply?
[15:01:53] quakephil: apeiros: ok gotcha, I'll check there if I'm still stuck...

2016-04-29

[17:53:49] quakephil: has joined #ruby
[17:56:25] quakephil: doesn't have a single reference back to my code
[17:56:25] quakephil: Using activerecord with a basic Table.select().joins().to_json pattern... most of the time it works, except when it doesn't, segfaults with a 20 page report of all sorts of useless (for me) info. I know that the error happens in .rvm/gems/ruby-2.2.1/gems/eventmachine-1.0.9.1/lib/eventmachine.rb:1062 and that's it, and nowhere in my code do I invoke any eventmachines... How can I possibly debug this error with a function stack trace that
[17:58:12] quakephil: no its a new app and just started working on it recently
[17:58:33] quakephil: but I'm a ruby newb so I'm sure I'm missing something obvious that would help me debug this, instead of staring at pages of irrelevant output like an idiot :)
[18:09:50] quakephil: Ox0dea: http://pastebin.ca/3586111
[18:09:56] quakephil: What's odd is that it only crashes sometime TT
[18:10:54] quakephil: Like, I just restarted the app, tried to run the request again, and this time it works just fine
[18:11:08] quakephil: Ox0dea: well whatever it is, I have no idea how to fix it :/
[18:11:27] quakephil: Use sinatra they said. It will be easy they said :)
[18:44:24] quakephil: has left #ruby: ()
[19:22:46] quakephil: has joined #ruby
[19:24:35] quakephil: Ox0dea: fyi, I found the fix here (disable thin threaded mode) https://github.com/macournoyer/thin/issues/307
[22:50:29] quakephil: has left #ruby: ()

2016-04-28

[18:47:10] quakephil: has joined #ruby
[18:48:28] quakephil: I'm using sinatra/activerecord, and I'm trying to convert my sql functionality to it. I've figured out selects, but now I have something like "insert into table (a,b) values (?,now() + interval 1 day), 'fred'" ... how can I transform this to an activerecord method?
[18:48:56] quakephil: I guess it would look something like Table.create(a: 'fred', b: 'now() + interval 1 day') ?
[18:51:35] quakephil: Except that doesn't work: "fred" gets stored to column a just fine, but column b is ignored
[18:57:56] quakephil: Fuck it, I'll just make a db trigger
[18:58:02] quakephil: has left #ruby: ()

2016-04-11

[00:38:33] quakephil: Ping timeout: 240 seconds

2016-04-10

[13:15:16] quakephil: Ping timeout: 268 seconds
[15:50:33] quakephil: has joined #ruby

2016-04-09

[01:21:16] quakephil: Ping timeout: 252 seconds
[10:41:03] quakephil: has joined #ruby

2016-04-08

[20:28:07] quakephil: has joined #ruby
[20:28:45] quakephil: I have an object like this: [{"text"=>"test"}, {"text"=>"hello"}] what's the coolest way I can combine it to result in something like this: "test hello"
[20:28:49] quakephil: (ruby noob)
[20:29:31] quakephil: Nice... thanks

2016-03-24

[01:09:40] quakephil: Ping timeout: 244 seconds

2016-03-22

[11:51:27] quakephil: has joined #ruby

2016-03-21

[02:00:57] quakephil: Ping timeout: 244 seconds
[11:18:54] quakephil: has joined #ruby
[14:57:03] quakephil: Ping timeout: 244 seconds
[14:57:15] quakephil: has joined #ruby
[22:53:57] quakephil: Ping timeout: 276 seconds

2016-03-20

[02:43:22] quakephil: Ping timeout: 244 seconds
[11:28:41] quakephil: has joined #ruby

2016-03-18

[03:22:17] quakephil: Ping timeout: 244 seconds
[11:58:21] quakephil: has joined #ruby

2016-03-14

[04:01:45] quakephil: Ping timeout: 244 seconds
[12:12:02] quakephil: has joined #ruby

2016-03-13

[07:02:49] quakephil: has joined #ruby

2016-02-27

[12:21:41] quakephil: has joined #ruby
[22:38:20] quakephil: has joined #ruby
[22:53:58] quakephil: Ping timeout: 268 seconds
[22:54:03] quakephil: has joined #ruby
[23:04:57] quakephil: Read error: Connection reset by peer

2016-02-26

[00:16:32] quakephil: has joined #ruby
[03:50:40] quakephil: Ping timeout: 244 seconds
[12:35:03] quakephil: has joined #ruby
[19:49:08] quakephil: Ping timeout: 244 seconds

2016-02-25

[15:09:34] quakephil: Ping timeout: 252 seconds
[15:14:07] quakephil: has joined #ruby
[17:04:19] quakephil: Ping timeout: 244 seconds
[20:50:58] quakephil: has joined #ruby
[21:13:19] quakephil: Ping timeout: 255 seconds

2016-02-24

[21:02:12] quakephil: has joined #ruby

2016-02-14

[00:19:55] quakephil: Read error: Connection reset by peer

2016-02-13

[05:13:11] quakephil: Ping timeout: 276 seconds
[05:13:38] quakephil: has joined #ruby
[05:18:08] quakephil: Ping timeout: 256 seconds
[14:47:13] quakephil: has joined #ruby

2016-02-12

[05:10:05] quakephil: Read error: Connection reset by peer
[14:00:35] quakephil: has joined #ruby