brent__

Activity Graph

Page 1 of 13 | Next »

2019-01-17

[01:54:35] brent__: has joined #RubyOnRails
[01:54:41] brent__: has joined #ruby
[05:54:06] brent__: Quit: Connection closed for inactivity

2018-09-06

[02:13:29] brent__: Quit: Connection closed for inactivity

2018-09-05

[19:43:46] brent__: has joined #RubyOnRails
[19:43:53] brent__: has joined #ruby

2018-08-30

[03:14:13] brent__: Quit: Connection closed for inactivity

2018-08-29

[23:04:37] brent__: has joined #RubyOnRails
[23:04:43] brent__: has joined #ruby

2018-08-20

[01:20:13] brent__: has joined #RubyOnRails
[01:20:19] brent__: has joined #ruby
[04:49:49] brent__: Quit: Connection closed for inactivity

2018-05-24

[17:40:17] brent__: has joined #RubyOnRails
[17:40:19] brent__: has joined #ruby
[18:11:00] brent__: i was wondering how i could translate `curl -u user_name:api_key url` to httparty
[18:11:20] brent__: I'm not sure how to replicate the user_name_api_key into the request
[18:15:34] brent__: any idea how to do so via postman?
[18:16:05] brent__: like like is the `-u user:pass` relate to a standard header or params?
[18:17:25] brent__: no worries
[18:17:41] brent__: any idea how to see what exactly the curl -u request looks like
[18:17:43] brent__: after you send it?
[18:20:55] brent__: baweaver: fyi, in postman I was able to add basic_auth options, and the user_id and api_key as user/pass which worked
[22:49:51] brent__: Quit: Connection closed for inactivity

2018-05-03

[09:53:12] brent__: Quit: Connection closed for inactivity

2018-05-02

[19:23:48] brent__: has joined #RubyOnRails
[19:23:50] brent__: has joined #ruby

2018-04-25

[04:09:30] brent__: Quit: Connection closed for inactivity

2018-04-24

[18:34:52] brent__: has joined #RubyOnRails
[18:34:54] brent__: has joined #ruby

2018-03-08

[15:49:55] brent__: has joined #RubyOnRails
[15:49:57] brent__: has joined #ruby
[19:19:30] brent__: Quit: Connection closed for inactivity

2018-02-20

[18:28:24] brent__: has joined #RubyOnRails
[18:30:29] brent__: anybody have good activerecord skills? I am trying to figure out how to distanct records from 2 different joins in a query
[21:07:35] brent__: Remote host closed the connection

2018-01-12

[00:29:59] brent__: Quit: Connection closed for inactivity

2018-01-11

[00:04:19] brent__: Quit: Connection closed for inactivity
[05:32:08] brent__: has joined #RubyOnRails
[05:32:14] brent__: has joined #ruby
[08:31:32] brent__: Quit: Connection closed for inactivity
[20:05:16] brent__: has joined #RubyOnRails
[20:05:18] brent__: has joined #ruby
[20:10:32] brent__: I'm having a bing scraper cause throw a COR error
[20:11:55] brent__: on a show page, I have `$.get('#{view_poster_path(@poster, format: :js)}');` that hits a contrller w/ `format.html { redirect_to poster_path(@poster) }; format.js { capture_view_event Event::PosterWas::Viewed, @poster }`

2018-01-10

[19:44:38] brent__: has joined #RubyOnRails
[19:44:40] brent__: has joined #ruby
[19:45:58] brent__: `= Rails.application.assets_manifest.find_sources("mailer/cureus_template.css").first.to_param`
[19:46:08] brent__: I have that line inside a layout, which works local, yet break on production
[20:28:21] brent__: xco: helper.image_tag
[20:29:26] brent__: in my rails console
[20:29:57] brent__: i was just able to run helper.image_tag(string)
[20:30:45] brent__: and it returned the <img> tag in string format
[20:47:59] brent__: whats the code thats making the request?
[21:48:58] brent__: Andr3as: local or production?
[21:49:35] brent__: you should be able to see the stack trace in the server, no?
[21:51:49] brent__: app/views/layouts/application.html.erb:9
[21:52:19] brent__: can you copy that area of the file?
[21:52:25] brent__: a few lines aroudn it and put it in the gist

2018-01-09

[04:45:59] brent__: Quit: Connection closed for inactivity

2018-01-08

[18:56:23] brent__: has joined #RubyOnRails
[18:56:25] brent__: has joined #ruby

2018-01-04

[04:25:07] brent__: Quit: Connection closed for inactivity

2018-01-03

[21:45:27] brent__: has joined #RubyOnRails
[21:45:29] brent__: has joined #ruby
[21:47:05] brent__: I have been updating my works rails app, we had an old migration that had a Proxy Model and inside had the following `default_scope where(type: 'Paper')` during migration it throws an error saying thats deprecated and needs to be inside a block, however when adding the block to the migration it then throws the error PG::Error: ERROR: cached plan must not change result type
[23:07:13] brent__: thoughts on best way to reduce a n+1 query
[23:08:01] brent__: https://gist.github.com/brentluna/2545e5c67a0e9347dc522432c091ecf3
[23:08:50] brent__: that method is on Article, contrller is returning a query of Article.where(blah).includes(:events)
[23:09:34] brent__: the view iterates over the article records, and calls that method on each record
[23:09:54] brent__: if i just called "article.events" it retunrs the events w/ no extra query
[23:10:09] brent__: but when i do article.events.where(blah) then it does the additional query
[23:11:14] brent__: Is there an ideal way to handle this? I could just make another method that does a the same thing w/ a select to avoid the extra record grab
[23:12:20] brent__: and work w/ the events already loaded, but that seems like a bit of a hack
[23:12:27] brent__: yeah refactor/performance
[23:14:09] brent__: i updated the gist
[23:14:45] brent__: w/ the log
[23:17:57] brent__: Radar: its in a haml view, active_record_article_response.each { |art| art.was_deferred }
[23:18:53] brent__: yes a method on the model
[23:31:02] brent__: Radar: used to conditionaly render somethign in table rows
[23:46:01] brent__: Radar: would it be possible add a select to the query and pass in a method that uses the joined events to return a boolean?
[23:47:58] brent__: BY select I meant writing out the select sql
[23:48:05] brent__: not [].select
[23:49:01] brent__: I understand that
[23:49:04] brent__: on the initial query
[23:49:47] brent__: Article.select('deferred_logic(returns boolean) as was_deferred, other info needed')
[23:54:05] brent__: Article.where(id: filtered_id).select("articles.title as title, articles.author as author, helper_method_using_joined_events as was_deferred").joins(:events)

2017-12-15

[17:51:09] brent__: has joined #RubyOnRails
[17:51:11] brent__: has joined #ruby
[18:25:34] brent__: Whats suppose to be the benefit of trailblazer?
[22:15:37] brent__: Quit: Connection closed for inactivity

2017-12-14

[08:32:32] brent__: Quit: Connection closed for inactivity

2017-12-13

[17:33:03] brent__: has joined #RubyOnRails
[17:33:05] brent__: has joined #ruby
[17:34:06] brent__: I'm working on upgrading our rails app, and upon updating some gems, I'm currently getting issues w/ some controller rspec tests
[17:35:24] brent__: We have tests for an ajax GET that hits an action that is only suppose to create an event, and do nothing else. However rspec is breaking expecting a template to be rendered and throwing an MissingTemplate error
[19:20:55] brent__: is it crazy to try and update from rails 4.0 to 5? Or should i take incremental updates?

2017-12-01

[19:06:41] brent__: has joined #RubyOnRails
[19:06:43] brent__: has joined #ruby
[19:09:02] brent__: I have a query that does .select("ownerships.time_to_completion as ttc")
[19:09:50] brent__: is there a way to use rubys #distance_in_words(ttc) inside the select? Or do i just have to map over the querys results and call it on that?
[20:16:02] brent__: dminuoso: can you eleborate?
[20:17:20] brent__: I understand, which is why I waas wondering if there was any way to work aorund
[23:26:23] brent__: Quit: Connection closed for inactivity

2017-11-29

[17:18:03] brent__: has joined #RubyOnRails
[17:18:05] brent__: has joined #ruby
[17:20:01] brent__: I'm getting a " TypeError Exception: no implicit conversion of nil into Hash " when trying to call a route inside a model
[17:20:47] brent__: https://gist.github.com/brentluna/381fe6770f9ef1fe904b64d34630c7b1
[17:21:59] brent__: it comes from line 12, i've tried puttin ga debugger inside the #stat_path and when invoking the path, it throws that type error
[17:23:11] brent__: dminuoso: updated the gist w/ the trace in additional file
[17:24:07] brent__: i spent almost a month a couple months ago updating from 3.1 to 4
[17:24:26] brent__: we have storys for further updates when time is available
[17:24:52] brent__: also updating ruby from 2.0 to 2.3
[17:25:02] brent__: I never knew so much could be broken with an update
[17:26:29] brent__: dminuoso: It's not. I can put a debugger right above line 12, and invoke the method and get the same error
[17:26:35] brent__: with a hash or without
[17:27:30] brent__: oh I know, i came onto this job w/ rails 3.1, and ruby 2.0 and was able to get some time to update
[17:27:50] brent__: hoping the next updates up to 5.0 won't be as bad
[17:30:18] brent__: dminuoso: i'm pretty sure it's not part of opts... in byebug i can invoke 'retrieve_stat_admin_dashboard_path' w/ no argument and get the same error
[17:31:34] brent__: correct, which it is
[17:31:38] brent__: i can invoke it elsehwere
[17:31:54] brent__: for instance I have 2 other models with this method
[17:31:56] brent__: #stat_path
[17:31:59] brent__: and those 2 work fine
[17:32:20] brent__: this is the only one throwing the error
[17:32:57] brent__: retrieve_stat_admin_dashboard GET /admin/dashboard/retrieve_stat(.:format) admin/dashboards#retrieve_stat
[17:34:01] brent__: statable.stat_path(stat_type: 'PublishedContent')
[17:34:06] brent__: that's the origin where it's called
[17:35:41] brent__: https://gist.github.com/brentluna/381fe6770f9ef1fe904b64d34630c7b1
[17:36:08] brent__: dminuoso: i included the methods from the other 2 models in the first file
[17:36:29] brent__: the paths called are slightly different as they belong to a competition or channel
[17:38:07] brent__: Rails.application.routes.default_url_options = { host: 'localhost', port: '3000' }
[17:38:23] brent__: thats id development.rb
[17:39:12] brent__: that line i showed you where the method is called "statable.stat_path"
[17:39:25] brent__: if i put a debugger there, i can invoke that path and it works fine
[17:39:44] brent__: it just doens't seem to want to work inside that model
[17:45:34] brent__: https://gist.github.com/brentluna/381fe6770f9ef1fe904b64d34630c7b1
[17:46:00] brent__: dminuoso: at this point 't' is the nullstatable instance
[17:46:12] brent__: and t.url_options == nil
[17:49:16] brent__: just about to be at the when Hash
[17:50:12] brent__: dminuoso: at that case, url_options is nil
[17:52:12] brent__: i noticed a difference. the NullStatable doesn't inherit from ActiveRecord::Base
[17:52:15] brent__: while the 2 working do
[17:52:24] brent__: would that exclude url_options from NullStatable
[18:14:53] brent__: dminuoso: FYI, it was that defined class method inside the model that was breaking it
[18:15:16] brent__: somoene put a method def class; OpenStruct.new(base_class: nil);end
[18:15:22] brent__: that lost the default_url_options
[18:15:43] brent__: just defining def self.base_class and removing the openstruct fixed it
[22:47:30] brent__: Quit: Connection closed for inactivity

2017-11-28

[02:23:38] brent__: Quit: Connection closed for inactivity

2017-11-27

[19:04:04] brent__: has joined #ruby
[19:04:04] brent__: has joined #RubyOnRails
[19:04:19] brent__: Anybody around got some activerecord/sql skills?
[19:06:00] brent__: https://pastebin.com/FRcRaAzi
[19:09:39] brent__: whats the reason for gist? I usually use gist but decided pastebin this time
[19:11:27] brent__: https://gist.github.com/brentluna/aebdc3b9b21f03972c17538bb54a6abe I'm trying to get the select to return all the info even if count == 0
[19:15:20] brent__: pretty sure thats what shappening
[19:15:50] brent__: i tried the where inside the joins string thinking maybe it would handle the range before the joins/select
[19:16:36] brent__: jhass: but then my count will will be including null values
[19:18:23] brent__: jhass: maybe add your suggestion
[19:19:05] brent__: then follow it w/ a .having("event_deferral_reasons is not null")
[19:23:37] brent__: jhass: https://gist.github.com/brentluna/aebdc3b9b21f03972c17538bb54a6abe
[19:24:26] brent__: going to test now, thiunking removing the where, and then doing the having to filter by the date
[19:27:40] brent__: nvm, its saying the created_at needs to be included in the group_by
[19:50:49] brent__: jhass: https://gist.github.com/brentluna/aebdc3b9b21f03972c17538bb54a6abe
[19:51:19] brent__: any thoughts on this? it works if i hard code in the dates, but gives me a syntax error when using the "? and ?"
[19:53:12] brent__: I don't think it would work, as there wouldn't ever a null created_at
[19:53:56] brent__: I think your idea led me to this, basically not filtering in where and instead doing this count/sum in the select

2017-11-07

[08:47:07] brent__: Quit: Connection closed for inactivity

2017-11-06

[22:17:28] brent__: has joined #ruby
[22:17:28] brent__: has joined #RubyOnRails
[22:18:55] brent__: I have a controller that querys and returns different type of objects(User, Articles, etc.), I have serializers for the different type of objects that utilize ActiveModel::Serializer, how can I serialize each of those objects with the corresponding serializer?
[22:19:32] brent__: When I have results of the same Type, i was doing, ActiveModel::ArraySerializer.new(@contents, each_serializer: ArticleSerializer)

2017-10-04

[06:19:02] brent__: Quit: Connection closed for inactivity

2017-10-03

[17:48:12] brent__: has joined #ruby
[17:48:55] brent__: Client Quit
[17:50:35] brent__: has joined #ruby
[17:50:35] brent__: has joined #RubyOnRails

2017-09-28

[03:31:42] brent__: Quit: Connection closed for inactivity

2017-09-27

[03:41:42] brent__: Quit: Connection closed for inactivity
[17:14:47] brent__: has joined #ruby
[17:14:47] brent__: has joined #RubyOnRails

2017-09-26

[17:49:15] brent__: has joined #ruby
[17:51:16] brent__: Client Quit
[17:52:37] brent__: has joined #ruby
[17:52:37] brent__: has joined #RubyOnRails

2017-09-25

[20:11:43] brent__: has joined #RubyOnRails
[20:11:43] brent__: has joined #ruby
[20:48:41] brent__: has joined #ruby
[20:48:43] brent__: has joined #RubyOnRails
[20:49:28] brent__: I have some haml link_to's w/ data: {disable_with: 'blah'}.... the text changes, yet it does't seem to disable and prevent 2nd clicks
[23:24:55] brent__: has joined #ruby

2017-09-22

[01:15:28] brent__: has joined #ruby
[01:18:29] brent__: Remote host closed the connection
[05:39:08] brent__: has joined #RubyOnRails
[05:39:08] brent__: has joined #ruby
[05:47:25] brent__: Remote host closed the connection
[12:48:32] brent__: has joined #ruby
[12:48:33] brent__: has joined #RubyOnRails
[12:52:41] brent__: Ping timeout: 240 seconds
[16:49:00] brent__: has joined #RubyOnRails
[16:49:00] brent__: has joined #ruby
[16:53:18] brent__: Ping timeout: 252 seconds

2017-09-21

[00:35:35] brent__: has joined #RubyOnRails
[00:35:35] brent__: has joined #ruby
[00:39:59] brent__: Ping timeout: 248 seconds
[01:39:34] brent__: has joined #ruby
[01:44:10] brent__: Remote host closed the connection
[05:15:56] brent__: has joined #RubyOnRails
[05:15:56] brent__: has joined #ruby
[05:24:25] brent__: Remote host closed the connection
[10:25:22] brent__: has joined #RubyOnRails
[10:25:22] brent__: has joined #ruby
[10:29:48] brent__: Ping timeout: 240 seconds
[12:41:11] brent__: has joined #ruby
[12:41:12] brent__: has joined #RubyOnRails
[12:45:41] brent__: Ping timeout: 240 seconds
[15:39:30] brent__: has joined #ruby
[22:09:38] brent__: Remote host closed the connection
[22:12:22] brent__: has joined #RubyOnRails
[22:12:22] brent__: has joined #ruby
[22:16:41] brent__: Ping timeout: 240 seconds

2017-09-20

[07:10:47] brent__: has joined #RubyOnRails
[07:15:08] brent__: Ping timeout: 240 seconds
[09:26:40] brent__: has joined #RubyOnRails
[09:26:40] brent__: has joined #ruby
[09:31:19] brent__: Ping timeout: 240 seconds
[09:41:57] brent__: has joined #RubyOnRails
[09:41:57] brent__: has joined #ruby
[09:46:07] brent__: Ping timeout: 248 seconds
[11:47:41] brent__: has joined #RubyOnRails
[11:47:41] brent__: has joined #ruby
[11:52:19] brent__: Ping timeout: 240 seconds
[15:43:16] brent__: has joined #RubyOnRails
[15:43:16] brent__: has joined #ruby
[15:43:56] brent__: Remote host closed the connection
[15:44:10] brent__: has joined #ruby
[23:35:58] brent__: Remote host closed the connection
[23:39:46] brent__: has joined #RubyOnRails
[23:39:46] brent__: has joined #ruby
[23:43:59] brent__: Ping timeout: 248 seconds