Activity Graph

Page 1 of 4 | Next »


[21:43:13] kallisti5: Ping timeout: 268 seconds


[20:24:15] kallisti5: <spam>If you're interested in keeping Net Neutrality (ISP's Under FCC Title II) to ensure they can't selectively charge you more for services like NetFlix and YouTube, please fill in a comment at http://gofccyourself.com . It only takes a few seconds. Thanks! </spam>


[16:52:15] kallisti5: is there a way to catch a .find non-match and continue with a fake record?
[16:52:18] kallisti5: aka - order = "(id='#{sbmids.join("', id='")}') DESC"
[16:52:36] kallisti5: whoops.. sorry :-( ActiveRecord::RecordNotFound
[16:53:43] kallisti5: bah. ok I guess I can run a where over the array first and delete_if it doesn't exist
[16:54:02] kallisti5: epochwolf: that won't work. I need to keep ordering intact. :-)
[16:54:28] kallisti5: epochwolf: oh.. right :-)
[16:55:23] kallisti5: epochwolf: you don't have that example still in your history do ya? :-)
[16:56:54] kallisti5: epochwolf: so if a record wasn't returned, sort_by will just omit the sort for that item?
[16:58:14] kallisti5: oh yeah... that works great
[16:58:22] kallisti5: epochwolf: see? you did have the best solution :-P
[18:17:20] kallisti5: whhhhahhaaa
[18:17:26] kallisti5: ubuntu to drop unity!


[15:23:53] kallisti5: has joined #ruby
[15:23:56] kallisti5: has left #ruby: ()
[15:23:59] kallisti5: has joined #RubyOnRails
[15:24:22] kallisti5: was there a change in 5.0.2 so active record queries with 0 results are no longer arrays?
[15:24:35] kallisti5: (well.. empty activerecord result sets)
[15:25:09] kallisti5: code that used to return [] compatible results seems to be returning something different after upgrading
[15:25:51] kallisti5: I'm using the activerecord result sets in map's and other things
[15:26:10] kallisti5: lol.. oh yeah. my older version running has the same bug :-)
[15:26:21] kallisti5: must of been the 5.0 upgrade when it started and nobody noticed
[15:26:52] kallisti5: so i'm expecting [] as a result set if there are 0 matches in a lot of places.
[15:26:55] kallisti5: what did it change to?
[15:29:34] kallisti5: https://gist.github.com/avongluck-r1soft/4ee7cdf421fdfe8f395e20b9ec391c36
[15:30:23] kallisti5: so pretty much regions gets PG::InvalidTextRepresentation: ERROR: invalid input syntax for uuid: ""
[15:30:42] kallisti5: actually... the error is from my order by hack.
[15:30:50] kallisti5: ACTION just read it again :-|
[15:31:34] kallisti5: yeah, I think I know whats wrong
[15:31:55] kallisti5: i'm ordering with an empty order
[15:32:32] kallisti5: anyone see a better way to "make sure the query returns in the order of the json?
[15:32:53] kallisti5: that was the best I could come up with and it felt a little messy
[15:33:23] kallisti5: matthewd: the order isn't guarenteed when its called like that
[15:35:54] kallisti5: epochwolf: the positioning is key, not the sorting of the uuids :-)
[15:35:58] kallisti5: matthewd: aaah.
[15:36:05] kallisti5: matthewd: I looked up the original code I was doing
[15:36:08] kallisti5: Sbm.where(:id => sbmids)
[15:36:17] kallisti5: so find will preserve ordering of the id's?
[15:36:52] kallisti5: epochwolf: oh.. that's a neat solution
[15:38:42] kallisti5: matthewd: hey! that'll work :-)
[15:39:47] kallisti5: undefined method `find_some_ordered' for #<Class:0x007fa86ad6d3b8>
[15:40:46] kallisti5: matthewd: ack. internal to find


[14:35:16] kallisti5: andywww: maybe stop the web server?
[14:35:30] kallisti5: or kill off any reque tasks?
[14:35:36] kallisti5: (aka, anything using the database)
[14:35:50] kallisti5: you could also try rake db:drop if you want to toss everything
[14:35:57] kallisti5: then re-migrate / seed
[14:36:46] kallisti5: http://jacopretorius.net/2014/02/all-rails-db-rake-tasks-and-what-they-do.html
[14:37:26] kallisti5: no worries.. never actually heard of purge.. maybe something new in rails 5?
[14:38:17] kallisti5: heh... i generally just mash in rails db:* commands until something happens"
[14:38:30] kallisti5: although that's bitten me before ^_^


[22:32:20] kallisti5: anyone have a better way to do this?
[22:32:23] kallisti5: @agents = currentrm.agents.where('agents.state like ?', "#{params[:state]}%").includes(:sbm).order(sort_column + " " + sort_direction)
[22:32:35] kallisti5: mostly the ordering
[22:32:50] kallisti5: thinking &:sort_column or something?
[22:36:17] kallisti5: .order(sort_column.to_sym => sort_direction.to_sym) maybe?


[17:16:21] kallisti5: /var/lib/gems/2.3.0/gems/activesupport-5.0.0/lib/active_support/dependencies.rb:293:in `require': cannot load such file -- rack/showexceptions (LoadError)
[17:16:29] kallisti5: post upgrade from rails 4.x to 5
[17:17:37] kallisti5: ack... didn't do app:update. just bundler update :-)
[17:22:43] kallisti5: huh... still no love
[17:22:58] kallisti5: anyone see the failure to load rack/showexceptions error above?
[17:23:07] kallisti5: I feel like a gem dep. changed
[17:30:37] kallisti5: huh... looks like cause was me mounting resque in my routes.rb
[17:31:29] kallisti5: so, I was require 'resque/server' , mount Resque::Server, at: "/resque" in my routes... once removed issue went away
[17:32:19] kallisti5: ActiveRecord::ImmutableRelation
[17:32:29] kallisti5: yeesh. gonna be a big upgrade :-)
[17:52:49] kallisti5: so in rails 5 you can no longer re-order post-query of activerecord objects?
[17:53:40] kallisti5: sec, working on example :-)
[17:55:09] kallisti5: https://gist.github.com/avongluck-r1soft/fda5504ea7d85f8b8fb7717dfacfd257
[17:55:28] kallisti5: so @sbms.order! shows ActiveRecord::ImmutableRelation
[17:55:36] kallisti5: in rails 5, before it worked fine
[17:56:19] kallisti5: does it matter? It seems you would want to order the smaller dataset last
[17:56:30] kallisti5: pre-ordering means you're doing more work :-)
[17:58:30] kallisti5: huh.. yeah, that fixed it
[18:30:53] kallisti5: uugh.. thinking of killing off turbolinks in our project
[18:31:11] kallisti5: ... it always causes hours and hours of javascript debugging because of "weird things happen"
[18:32:51] kallisti5: I get it, and like the idea... but if you have any javascript stuff it generally breaks everything in a hard-to-debug way
[18:44:52] kallisti5: yeah, removing on even on an old app is easy
[18:45:00] kallisti5: I admit, the app does feel a bit slower
[18:45:12] kallisti5: ... however I just need to do more ajax loads of content :-)
[18:45:21] kallisti5: turbolinks was kind of covering that up a bit
[18:45:36] kallisti5: with pretty nprogress ;-)
[18:46:03] kallisti5: well.. removing turbolinks gem + all the on ready hacks everywhere
[18:51:27] kallisti5: I could do pjax, I pretty much want to load some html content after page load
[18:52:20] kallisti5: yeah, but tuned down to only the things I want :-)
[18:52:25] kallisti5: not the whole site
[18:53:15] kallisti5: yeah, likely part of the faster feel
[18:55:10] kallisti5: rails doesn't offload things to clients as much as some newer stuff.
[19:19:25] kallisti5: https://coderwall.com/p/kqb3xq/rails-4-how-to-partials-ajax-dead-easy
[19:19:36] kallisti5: like that mostly... but that article is a bit confusing
[19:20:16] kallisti5: I have a pop-up modal in bootstrap showing data... it would be nice if I could not have the controller trigger until the user clicks on the button to open the dialog
[19:21:01] kallisti5: .. that way the page loads quicky... then I the user clicks the button and the longer running info could be loaded (with javascript spinner, whatever)


[07:04:46] kallisti5: *.net *.split


[16:54:46] kallisti5: uugh.. Have to work with soap... I hate xml.
[16:54:47] kallisti5: REXML::XPath.each(doc, "//[self::description or self::id]").each {|des| agents.push({"id" => des[1].to_s, "description" => des[0].to_s})}
[16:55:03] kallisti5: trying to turn two items into a hash'ed array
[16:55:27] kallisti5: But getting description, then id, then description
[16:55:38] kallisti5: ... there must be an easier way :-\


[19:02:20] kallisti5: Ping timeout: 260 seconds
[19:04:03] kallisti5: has joined #RubyOnRails
[19:04:03] kallisti5: has joined #ruby


[22:00:02] kallisti5: ok.. running into odd issue
[22:00:21] kallisti5: using grap microapi.. and trying to use resque-pool to manage our resque tasks
[22:00:57] kallisti5: I have config.paths.all and config.autoload_paths in application.rb to add app/api into my app
[22:01:14] kallisti5: it seems like resque-pool are missing those additions :-|
[22:02:36] kallisti5: http://pastebin.com/RxGbMy8g anyone see that before?
[22:03:43] kallisti5: I checked topic and didn't see it
[22:04:04] kallisti5: doing devops I'm in a lot of channels that perfor different pastebin alternatives :-|
[22:05:55] kallisti5: https://gist.github.com/avongluck-r1soft/68a3c899654dd030a2f8beb1f708885b
[22:07:17] kallisti5: same error taking it out
[22:07:43] kallisti5: nope.. however maybe I do now after removing it :-)
[22:07:45] kallisti5: ACTION checks
[22:09:07] kallisti5: Radar: app starts fine with the app/api inclusion commented out
[22:09:21] kallisti5: however, resque-pool still shows same error
[22:10:54] kallisti5: Radar: I have a rakefile task that gets loaded before the resque jobs start... is there a way to append the paths there?
[22:11:09] kallisti5: (for app/api)


[15:37:33] kallisti5: rails should really stop be before I do stupid things like:
[15:37:35] kallisti5: add_column :events, :class, :string
[15:38:13] kallisti5: after around 20 minutes of wondering why "omg everything is weird" before I realize naming my activerecord column "class" is likely a bad idea :-D


[06:26:54] kallisti5: Ping timeout: 260 seconds
[06:28:17] kallisti5: has joined #RubyOnRails
[06:28:17] kallisti5: has joined #ruby


[14:24:13] kallisti5: Ping timeout: 260 seconds
[14:25:15] kallisti5: has joined #RubyOnRails
[14:25:15] kallisti5: has joined #ruby


[01:45:28] kallisti5: Ping timeout: 264 seconds
[02:07:28] kallisti5: has joined #ruby
[02:07:29] kallisti5: has joined #RubyOnRails


[15:23:28] kallisti5: Q: I'm making a gem to interface with a rest API and turn the results into objects (Think ActiveRecord-like). I just can't figure out a great way to store something at the module level for the Gem... any ideas? I wrote an example gist: https://gist.github.com/avongluck-r1soft/4500a2279f9fc41be0ca698a2284bfa1
[15:24:08] kallisti5: I want to make a new instance of my gem and set the REST uri at the module level... if that makes sense :-|
[15:24:41] kallisti5: Right now i'm "CATApi::Breed.all"
[15:24:43] kallisti5: ACTION googles
[15:25:33] kallisti5: benzrf: is there a way users can define the constant though?
[15:26:31] kallisti5: oh.. so pretty much turn the CATAPi module into a class?
[15:27:06] kallisti5: That seems to make more sense... I just thought Gem's almost always worked out of modules :-|
[15:28:00] kallisti5: lol what's the best practice there? module CATApi -> class CATApi -> class Breed ?


[16:37:22] kallisti5: anyone know of a way to "custom order an activerecord result set"?
[16:38:15] kallisti5: I have an array ["a","c","b"]... I want to order the activerecord results by the values in that array [object[:X] "a", object[:X] "c", object[:X] "b"]
[16:38:36] kallisti5: not a simple order :P
[16:40:21] kallisti5: https://gist.github.com/avongluck-r1soft/cd398e2fde33240851c90d8e937e4384
[16:40:51] kallisti5: :id is a uuid
[16:41:41] kallisti5: I call "sbms" in my model and get a differing order each time which pretty much ruins my day :-)
[16:42:09] kallisti5: they have to be ordered by that json as the ordering is important in the application


[08:12:11] kallisti5: *.net *.split
[09:03:32] kallisti5: has joined #RubyOnRails
[09:03:32] kallisti5: has joined #ruby


[02:53:32] kallisti5: anyone see First argument in form cannot contain nil or be empty
[02:53:43] kallisti5: (while generating new scaffolds in rails 5)
[02:54:05] kallisti5: well.. generated scaffold. attempting to execise new
[20:12:20] kallisti5: so.. what's the operator for "string to method name" ?
[20:12:37] kallisti5: aka "thing" to activerecord.thing
[20:13:55] kallisti5: fox_mulder_cp: that won't work :-) thing.string.to_sym
[20:14:17] kallisti5: err.. activerecord."te".to_sym
[20:14:46] kallisti5: I think activerecord.&"string" maybe?
[20:20:34] kallisti5: arup_r: hm. actually a var not a method :-(
[20:20:56] kallisti5: so acti conversion.send(method, code.downcase) = (btc_cost / crypt_cost).round(12)
[20:21:07] kallisti5: so activerecord object
[20:21:29] kallisti5: trying to update column "string" to value. then save
[20:22:01] kallisti5: going over an array of columns, making an http call to update each :-)
[20:22:54] kallisti5: conversion = Conversion.new conversion."btc" = 0 etc etc conversion.save
[20:23:38] kallisti5: err.. you guys didn't like paste bin did you?
[20:24:33] kallisti5: https://gist.github.com/kallisti5/05f4c09ffe8e4b00ad4cd1be2f0bf0a4
[20:25:35] kallisti5: I've done it before, but don't remember the syntax to reference a field like that
[20:25:47] kallisti5: dcr is the activerecord column
[20:26:00] kallisti5: so I need to downcase (or upcase, whatever)
[20:26:18] kallisti5: (dcr only one for now, I plan on adding more ;-))
[20:27:19] kallisti5: that code should be conversion.dcr = 0
[20:27:56] kallisti5: heh. Mostly a job to "cache cryptocurrency conversion rates to USD"
[20:28:28] kallisti5: I did it in the model originally which was really stupid.. hitting the api too damn much per record :-)
[20:29:01] kallisti5: ACTION gives it a whirl
[20:29:12] kallisti5: is that o a 0? :-)
[20:31:08] kallisti5: arup_r: https://gist.github.com/kallisti5/fd376256340749eeeb119f1e30323992
[20:31:17] kallisti5: whelp... my math is off but that looks correct :-) thanks!


[20:10:33] kallisti5: anyone have a good way to compare data in a table?
[20:10:56] kallisti5: aka, I have a model with data. I want to show "missing" data
[20:11:14] kallisti5: Y: A,B, Z: A
[20:11:28] kallisti5: I want to highlight B is missing, or at least show a blank cell
[20:12:00] kallisti5: Y: A,B,C Z: A, (blank), C
[20:13:54] kallisti5: arup_r: yeah, it's a complex problem to solve with the "rails way" :-)
[20:15:27] kallisti5: arup_r: yeah. let me type up a clearer example
[20:18:31] kallisti5: arup_r: http://pastebin.com/Cp1pErGc
[20:18:42] kallisti5: ACTION ignores helpa for now
[20:23:53] kallisti5: arup_r: the biggest point is pointing out that there are differences between servers
[20:24:19] kallisti5: so If date doesn't exist on server B but exists on the rest I want to highlight it
[20:27:46] kallisti5: arup_r: aah.. i got you
[20:27:52] kallisti5: Agent.find("09a597f6-5973-43bd-b026-952bd3201dde").recovery_points.group_by(&:created_at).keys
[20:28:10] kallisti5: that'll give me dates, then points by date


[22:29:30] kallisti5: anyone have a classy way to get "the index of an activerecord result"
[22:29:51] kallisti5: aka: index_of(item) gives 0,1,2,etc...
[22:30:03] kallisti5: but that doesn't exist within ActiveRecord result :-\
[22:33:13] kallisti5: nvmd. ActiveRecordResult.index(result) does it


[21:36:49] kallisti5: Agent.all.each do |agent| agent.reset_counters(:recovery_points) end
[21:36:55] kallisti5: starting to use counter_cache
[21:37:12] kallisti5: I can Agent.reset_counters("UUID", :recovery_points)
[21:37:15] kallisti5: ... is there a better way?
[21:39:27] kallisti5: nevermind.. Agent.find_each { |agent| Agent.reset_counters(agent.id, :recovery_points) }
[21:39:45] kallisti5: once set up, counter_cache should update that record automagically... right?


[07:15:31] kallisti5: *.net *.split
[07:16:12] kallisti5: has joined #ruby
[07:16:13] kallisti5: has joined #RubyOnRails


[22:07:44] kallisti5: Ping timeout: 276 seconds
[22:08:43] kallisti5: has joined #RubyOnRails
[22:08:43] kallisti5: has joined #ruby


[20:21:02] kallisti5: *.net *.split
[20:21:06] kallisti5: has joined #RubyOnRails
[20:21:06] kallisti5: has joined #ruby


[22:03:16] kallisti5: so... coffee scripts are compiled and loaded on every controller view?
[22:04:06] kallisti5: ex.. I was expecting something done in app/assets/javascript/bob.coffee to show up in /bobs but not /janes
[22:04:27] kallisti5: atm it seems like all the coffees are in all the controlers :-|
[22:07:31] kallisti5: cnk: oooohhh.
[22:07:40] kallisti5: cnk: application.coffee loads em' all, doesn't it?
[22:44:02] kallisti5: cnk: almost set, now turbolinks is giving me hell :-\
[22:44:04] kallisti5: https://gist.github.com/avongluck-r1soft/0fb97119880a51f59693
[22:44:14] kallisti5: I thought that would solve the turbolinks issue, but no love
[22:44:24] kallisti5: any thoughts?


[09:57:24] kallisti5: Ping timeout: 272 seconds
[09:57:47] kallisti5: has joined #RubyOnRails
[09:57:47] kallisti5: has joined #ruby
[10:08:11] kallisti5: *.net *.split
[10:09:09] kallisti5: has joined #RubyOnRails
[10:09:09] kallisti5: has joined #ruby


[23:08:12] kallisti5: http://hpkgbot.haiku-os.org:3000/erd.pdf Having some N+1 issues with an index page showing: recipes + package for each architecture. Tried all the normal stuff (includes etc) Any ideas?
[23:13:20] kallisti5: tubbo: yeah, i'm also on the BoD
[23:14:45] kallisti5: tubbo: the issue is I do the normal includes(packages: :architectures) and I get a bunch of db queries :-\
[23:15:06] kallisti5: and for some reason nothing sees the N+1 :-\
[23:15:43] kallisti5: https://github.com/kallisti5/haikeuken/blob/master/app/views/recipes/index.html.erb#L36
[23:16:24] kallisti5: so the architectures are in the database, and I want to show blanks for empty ones... but a few days in and I just can't find an efficent way to do it :-


[12:29:46] kallisti5: has joined #RubyOnRails
[12:29:49] kallisti5: has joined #ruby