« Back to channel list

#RubyOnRails - 01 September 2017

« Back 1 day Forward 1 day »
[00:05:00] Trynemjoel: has joined #RubyOnRails
[00:08:05] karmayogi23: has joined #RubyOnRails
[00:17:46] Rodya_: has joined #RubyOnRails
[00:21:49] dviola: has joined #RubyOnRails
[00:23:26] orbyt_: has joined #RubyOnRails
[00:23:35] fschuindt: has joined #RubyOnRails
[00:24:45] orbyt_: has joined #RubyOnRails
[00:26:35] jmay: has joined #RubyOnRails
[00:29:26] orbyt_: has joined #RubyOnRails
[00:32:43] irishfromua: has joined #RubyOnRails
[00:34:09] brent__: has joined #RubyOnRails
[00:34:30] baash05: Hey all.. I'm trying to override circle ci to run specs that live in a different folder.. anyone know how to do that?
[00:36:24] irishfromua: has joined #RubyOnRails
[00:41:53] sevenseacat: has joined #RubyOnRails
[00:50:04] Trynemjoel: has joined #RubyOnRails
[00:51:33] shilon: has joined #RubyOnRails
[01:01:04] Trynemjoel: has joined #RubyOnRails
[01:01:09] jmay: has joined #RubyOnRails
[01:06:28] JusticeFries: has joined #RubyOnRails
[01:17:22] juggler: has joined #RubyOnRails
[01:20:57] bronson: has joined #RubyOnRails
[01:23:30] ResidentBiscuit: has joined #RubyOnRails
[01:29:18] jonno112: has joined #RubyOnRails
[02:02:50] shilon: has joined #RubyOnRails
[02:06:21] Rodya_: has joined #RubyOnRails
[02:22:42] bronson: has joined #RubyOnRails
[02:25:34] baash05: Is there a way to tell rspec to read from many different folders... I have an engine folder and it has a pile of "sub" rails apps with their own tests.. I want them to all run when I run rspec from the CLI
[02:33:38] jmay: has joined #RubyOnRails
[03:05:16] xibalba: has joined #RubyOnRails
[03:20:45] lessless: has joined #RubyOnRails
[03:23:26] bronson: has joined #RubyOnRails
[03:25:33] lessless: Hello folks! If anyone here with Shopify plugin development experience is into cryptocurrencies and wants to participate in a project that helps to preserve online anonymity, then look no further https://www.reddit.com/r/Monero/comments/6xbxa7/calling_out_ruby_devs_we_need_a_shopify_plugin/
[03:38:55] cagomez: has joined #RubyOnRails
[03:40:25] cagomez: has joined #RubyOnRails
[03:47:43] Trynemjoel: has joined #RubyOnRails
[03:58:29] tenderlo_: has joined #RubyOnRails
[04:00:55] timdotrb: has joined #RubyOnRails
[04:15:17] ltd: has joined #RubyOnRails
[04:24:39] bronson: has joined #RubyOnRails
[04:32:23] Rodya_: has joined #RubyOnRails
[04:46:31] tenderlove: has joined #RubyOnRails
[05:00:33] baash05: we be all dead inside :)
[05:02:06] biox: has joined #RubyOnRails
[05:19:47] kies: has joined #RubyOnRails
[05:22:19] joelroa: has joined #RubyOnRails
[05:25:11] bronson: has joined #RubyOnRails
[05:38:06] Rodya_: has joined #RubyOnRails
[05:39:44] conta: has joined #RubyOnRails
[05:40:32] tenderlove: has joined #RubyOnRails
[05:52:08] arBmind: has joined #RubyOnRails
[05:54:04] milesmatthias: has joined #RubyOnRails
[05:59:02] tenderlo_: has joined #RubyOnRails
[06:01:27] tenderlo_: has joined #RubyOnRails
[06:23:15] blindMoe: has joined #RubyOnRails
[06:24:29] blindMoe: I am using paper_trail to store audit logs and have it setup with the object column as type jsonb. When I run rspec to test the audit log it seems that it returns the .object field as a string and not a hash. Anyone have any pointers as to what I should check to see why it would do that?
[06:25:17] rafadc: has joined #RubyOnRails
[06:35:45] matthewd: blindMoe: If you put a string in, you'll get a string back out.
[06:37:42] rafadc: has joined #RubyOnRails
[06:38:17] blindMoe: matthewd: paper_trail handles that and the serializer is set to a json serializer
[06:38:36] blindMoe: it is just odd that it only seems to do it when RAILS_ENV is test
[06:39:39] Rodya_: has joined #RubyOnRails
[06:40:09] conta: has joined #RubyOnRails
[06:47:29] srinidhi: has joined #RubyOnRails
[06:48:06] high_fiver: has joined #RubyOnRails
[06:49:21] high_fiver: has joined #RubyOnRails
[06:55:52] AzaToth: has joined #RubyOnRails
[07:01:36] defsdoor: has joined #RubyOnRails
[07:01:46] crst: has joined #RubyOnRails
[07:05:52] crst: Anybody knows how to configure webpacker that live reloading works for changes with scss and erb files, too?
[07:06:44] matthewd: crst: I could be wrong, but personally I doubt that's a thing anyone's got working [yet]
[07:09:18] crst: matthewd: Ah, really? I thought it would be rather easy to add a watch files/folders entry to the webpack environment.
[07:13:41] matthewd: Maybe. I don't know how live reloading works at all... if it just does a full page reload, then yeah, that sounds plausible
[07:15:45] crst: matthewd: It works with this: https://github.com/vigetlabs/blendid But I'm not sure what I'm going to mess up if I add blendid to my rails new . --webpack=vue project
[07:19:19] arup_r: has joined #RubyOnRails
[07:26:07] bronson: has joined #RubyOnRails
[07:29:54] wtiger: has joined #RubyOnRails
[07:30:06] wtiger: has left #RubyOnRails: ()
[07:40:34] Rodya_: has joined #RubyOnRails
[07:51:55] ChoiKyuSang: has joined #RubyOnRails
[07:59:14] mikecmpbll: has joined #RubyOnRails
[08:01:50] twilling: has joined #RubyOnRails
[08:12:54] DTZUZO: has joined #RubyOnRails
[08:18:53] drale2k_: has joined #RubyOnRails
[08:18:57] sandstrom: has joined #RubyOnRails
[08:20:53] dionysus69: has joined #RubyOnRails
[08:21:06] Pumukel: has joined #RubyOnRails
[08:21:27] sandstrom: has joined #RubyOnRails
[08:26:54] shilon: has joined #RubyOnRails
[08:26:55] KeyJoo: has joined #RubyOnRails
[08:30:43] dLobatog: has joined #RubyOnRails
[08:31:04] arBmind: has joined #RubyOnRails
[08:31:44] dLobatog: hi, anyone knows how to skip parameters JSON parsing on selected methods of a controller?
[08:32:18] dLobatog: from what I see on the stack, actionpack is called in *before* it even gets to the controller layer, so I'm not sure whether it's possible ..
[08:33:25] dLobatog: something like https://github.com/Katello/katello/blob/master/lib/katello/params_parser_wrapper.rb but 5.0 compatible :)
[08:35:44] brunto: has joined #RubyOnRails
[08:37:00] mikecmpbll: has joined #RubyOnRails
[08:42:25] Rodya_: has joined #RubyOnRails
[08:44:21] ferr: has joined #RubyOnRails
[08:44:58] Terens: has joined #RubyOnRails
[08:46:45] Terens: I have several models.I want after updating or creating a model thourgh controllers to update a timestamp like last updated.
[08:47:29] Terens: simplest idea is to have a method at controller and be called after model is changed.
[08:47:43] Terens: or using a filter
[08:47:49] lxsameer: has joined #RubyOnRails
[08:48:25] Terens: but callbacks at model seem to be tricky. Since too many updates would happen and sometimes I might not want it to happen
[08:56:21] Jameser: has joined #RubyOnRails
[09:16:48] dminuoso: The request is missing a required parameter, includes an unsupported parameter value, or is otherwise malformed
[09:16:50] dminuoso: I hate doorkeeper.
[09:17:02] dminuoso: Is there any conceivable way in which the error message could be less helpful?
[09:17:38] dminuoso: "The problem is A, B or anything else"
[09:26:28] marr: has joined #RubyOnRails
[09:27:46] bronson: has joined #RubyOnRails
[09:28:13] marahin: Does anyone know Linux-compatible package for Sublime Text 3 that would allow to look up source code of gems I'm using? Similar to RubyMine.
[09:30:20] Sigyn: has joined #RubyOnRails
[09:37:28] crst: Can this be condensed into a single line? https://pastebin.com/66KYYBMe
[09:41:01] dminuoso: crst: = post.errors.any? && render 'shared/error-messages', msg: @post
[09:43:11] Rodya_: has joined #RubyOnRails
[09:43:21] crst: dminuoso: that does not work for me unfortunately.
[09:48:10] Ergo: has joined #RubyOnRails
[09:51:41] roshanavand: has joined #RubyOnRails
[10:00:31] shilon: hello, I had turbolinks and had my bootstrap modals working, now I removed turbolinks and added npm, reinstalled all JS libraries and now when I open my model I get ActionController::RoutingError (No route matches [GET] "/assets/bootstrap.css.map")
[10:00:40] shilon: anyone ever had this problem?
[10:01:02] shilon: can it be because I’ve removed @import "bootstrap-sprockets”; ?
[10:02:44] sekmo: has joined #RubyOnRails
[10:33:27] sevenseacat: has joined #RubyOnRails
[10:38:45] egray: has joined #RubyOnRails
[10:40:02] bruno-: has joined #RubyOnRails
[10:44:08] Rodya_: has joined #RubyOnRails
[10:45:19] Terens: is there a way
[10:45:36] Terens: after touch(:col) in the callback which col changed?
[10:45:41] Terens: after_rtouch
[10:54:05] antg85: has joined #RubyOnRails
[10:55:52] sekmo: hi folks! I have a plain rails app with a StaticPagesController and two views. Why is Rails setting the session even the controller action is emtpy?
[10:56:36] futilegames: has joined #RubyOnRails
[11:02:04] xco: has joined #RubyOnRails
[11:03:42] crst: For a migration, there is belongs_to, references and add_foreign_key... What am I supposed to use?
[11:03:59] Chernobuk: has joined #RubyOnRails
[11:04:31] zacts: has joined #RubyOnRails
[11:05:07] bruno-: has joined #RubyOnRails
[11:07:13] tbuehlmann_: crst: what do you need?
[11:07:52] antg85: afternoon folks I'm using activeresources for a project I'm working and I would like to reference the resource from an active model which works if I set it with the actual object however I need to persist the reference in the db so ideally I need to save the id in the db however I am not sure this will work here's a gist https://gist.github.com/antgrimmitt/657870d20cacd758b641e503ce4f745e
[11:07:52] xco: hi. can someone help me with ActionView::Template::Error: Attempting to generate a URL from non-sanitized request parameters! ? https://gist.github.com/xcobar/9cea42f72c7d7bb2a9aa6a8b027bfdf4
[11:09:35] freite: has joined #RubyOnRails
[11:10:53] antg85: xco strong params so params should be group_by_param and start_at_param in the history method
[11:10:56] apparition47: has joined #RubyOnRails
[11:11:23] xco: antg85 yes i did that already just wanted to show the original code
[11:12:31] crst: tbuehlmann_: I'm on latest rails and like to set the relationship in the migrations, has_many, belongs_to, then auto insert test data in a migration. At the moment the relationship is defined in the model files and the table after the migration is missing a foreign key. I'm also pretty confused on where and how to set the indexes.
[11:20:05] freite: how/where does rails cache views when running in production mode?
[11:24:35] Tempesta: has joined #RubyOnRails
[11:24:43] crst: When you create a table in a migration, does t.belongs_to even exist anymore?
[11:26:37] Tempesta: has joined #RubyOnRails
[11:28:13] rgr: has joined #RubyOnRails
[11:28:26] bronson: has joined #RubyOnRails
[11:35:13] gregf_: has joined #RubyOnRails
[11:35:56] tbuehlmann_: crst: belongs_to is an alias to references
[11:38:27] xco_: has joined #RubyOnRails
[11:38:29] crst: tbuehlmann_: ah, that's a relief. and when I use either of both add_foreign_key is not necessary, I assume.
[11:40:29] crst: So, t.belongs_to :user, index: true is what I use now
[11:41:55] brent__: has joined #RubyOnRails
[11:42:59] crst: tbuehlmann_: Can this: has_many :grandchildren, through: :child also be specified in a migration?
[11:44:40] Rodya_: has joined #RubyOnRails
[11:46:34] jottr: has joined #RubyOnRails
[11:49:39] jottr_: has joined #RubyOnRails
[11:50:04] worknick: has joined #RubyOnRails
[11:50:46] worknick: where to put webpack configuration in rails app? i already have config/wepback.yml and config/webpack/dev|prod|test.js it should be in one of these files or webpack.config.js at root?
[11:56:38] xco_: has joined #RubyOnRails
[11:59:00] tbuehlmann_: crst: that would be two migrations, right?
[11:59:44] tbuehlmann_: crst: I just use whatever `bin/rails generate model child parent:belongs_to` generates in the migration
[12:01:13] crst: tbuehlmann_: 3 models (parent, child, grandchild), Migration does not matter, at the moment each there is one for each creation of the table
[12:02:29] crst: tbuehlmann_: ah oh, and the you set as_many :grandchildren, through: :child in the model
[12:04:04] tbuehlmann_: yes, the migration is only responsible for setting up the tables and indices correctly
[12:05:29] yorickpeterse: has joined #RubyOnRails
[12:05:43] drale2k_: has joined #RubyOnRails
[12:06:27] yorickpeterse: I'm running into a case where using `SomeModel.eager_load(:bla).first.bla` returns nil, but `SomeModel.includes(:bla).first.bla` returns the expected object. Does #eager_load have additional requirements for this to work?
[12:07:38] yorickpeterse: https://gist.github.com/YorickPeterse/99419a942229c796bb0bb2b1a94a9db1 for example
[12:08:41] yorickpeterse: The underlying SQL query used for #eager_load is fine and includes the expected data
[12:08:48] yorickpeterse: but for whatever reason Rails doesn't set the association
[12:08:57] yorickpeterse: but it does for other models, to make things weirder
[12:15:57] samosa: has joined #RubyOnRails
[12:17:18] crst: tbuehlmann_: great. thank you everything works perfectly now and I have the peace of mind. The insertion of data is done via execute "RAW SQL;"
[12:19:44] tbuehlmann_: crst: what data is that?
[12:20:58] crst: tbuehlmann_: mostly inserts for each table and a CREATE MATERIALIZED VIEW to handle a very complicated query.
[12:21:06] samosa: has left #RubyOnRails: ()
[12:21:48] crst: Is use postgres btw.
[12:29:23] keegnotrub: has joined #RubyOnRails
[12:43:56] karmayogi23: has joined #RubyOnRails
[12:45:30] Rodya_: has joined #RubyOnRails
[12:45:34] rgr: has joined #RubyOnRails
[12:50:54] twilling: has joined #RubyOnRails
[12:55:40] konos5_: has joined #RubyOnRails
[13:02:19] konos5_: has joined #RubyOnRails
[13:12:12] keegnotrub: has joined #RubyOnRails
[13:16:59] Rodya_: has joined #RubyOnRails
[13:21:13] TvL2386: has joined #RubyOnRails
[13:23:02] mars777: has joined #RubyOnRails
[13:25:44] crst: Is there a good guide on how to manage views and controllers, render different parts depending on if the user has any objects? I have a total mess here and get undefined methods and nil errors constantly :(
[13:29:20] bronson: has joined #RubyOnRails
[13:38:05] crst_: has joined #RubyOnRails
[13:51:12] ams__: has joined #RubyOnRails
[13:54:16] Rodya_: has joined #RubyOnRails
[13:57:42] futilegames: has left #RubyOnRails: ()
[14:02:07] kapil___: has joined #RubyOnRails
[14:08:54] dminuoso: crst_: I no londer use rails views, but I think the following still applies: 1) Test whether nullability is actually a contraint violation, is so enforce it at the database
[14:09:12] dminuoso: 2) Separate views into partials for specific concerns.
[14:09:34] dminuoso: Each concern can then short-circuit with a top level - if object.foo.nil?
[14:10:17] dminuoso: (Dont try to do this too deeply inside views as it rapidly becomes unreadable and unclear what is being short-circuited
[14:13:32] ResidentBiscuit: has joined #RubyOnRails
[14:20:34] bruno-: has joined #RubyOnRails
[14:21:01] LBRapid: has joined #RubyOnRails
[14:22:14] crst_: dminuoso: Thanks for the insight, though I'm not really getting 1). How does that look like in practice? What do you use instead of the views? Do you use rails primarily as an api, I'm really curious about that?
[14:23:44] dminuoso: crst_: It's just an observation that sometimes when you do -if tree.leaves.nil? you actually just try to catch against cases where people wrongly forgot to specify leaves for your tree.
[14:23:50] dminuoso: crst_: so the real answer is to dont let a tree not have leaves.
[14:23:56] dminuoso: You don't always anticipate the necessary constraints and validations until you implement other features that begin to rely on these attributes being there or making sense.
[14:25:17] crst_: dminuoso: Ah, that I get completely. You're right. The db is pretty solid with it's constraints already.
[14:26:07] FrostCandy: has joined #RubyOnRails
[14:27:23] markit: has joined #RubyOnRails
[14:29:24] CommanderViral: has joined #RubyOnRails
[14:29:33] FrostCandy: I'm trying to redirect to my general error page to the index method. (redirect_to general_error_path) , this sends me to the show method for some reason. I'm not sending an ID along with the redirect_to so why is it attempting to go to the show method?
[14:30:28] theunraveler: has joined #RubyOnRails
[14:31:20] Pumukel: has joined #RubyOnRails
[14:32:21] jottr_: has joined #RubyOnRails
[14:33:07] FrostCandy: maybe i need to specify the action: "index"
[14:33:07] Rodya_: has joined #RubyOnRails
[14:35:42] helpa: Clearly explain what is happening and create a Gist (http://gist.github.com), (formatted neatly please: http://bit.ly/1q75oia) of the code that is causing the problem you are encountering, as well as any useful output like stacktraces.
[14:38:07] s2013: has joined #RubyOnRails
[14:45:50] daydreamm: has joined #RubyOnRails
[14:46:21] orbyt_: has joined #RubyOnRails
[14:50:32] LBRapid: has joined #RubyOnRails
[14:53:47] FrostCandy: https://gist.github.com/anonymous/4d72ca324de5696d7cde40fef57caa1e
[14:54:06] FrostCandy: That attempts to redirect_to show instead of index
[14:55:06] sevenseacat: your routes are mucked up - youve defined a plural (resources) and a singular (general_error)
[14:55:27] FrostCandy: oh wow ok thanks
[14:55:40] sevenseacat: controllers should also always be plural
[14:55:49] FrostCandy: right forgot that
[15:02:12] LBRapid: has joined #RubyOnRails
[15:03:36] rafadc: has joined #RubyOnRails
[15:08:13] timdotrb: has joined #RubyOnRails
[15:08:33] npgm: has joined #RubyOnRails
[15:11:18] crst_: Can you share just @var = query in a controller concern or is it imperative to have it inside a def ... end ?
[15:12:11] Rodya_: has joined #RubyOnRails
[15:13:42] jottr_: has joined #RubyOnRails
[15:15:16] ivanskie: has joined #RubyOnRails
[15:15:45] ivanskie: im getting confused
[15:16:03] ivanskie: im adding a method to a model "get_sensors"
[15:16:39] ivanskie: for debugging, if i put a single block in there 'puts id' and run (instance of Device).get_sensors i get the output that i want.
[15:17:05] ivanskie: but when im trying to do Sensor.where(device_id: id) it complains that it doesn't know what 'id' is.
[15:17:21] ivanskie: i tried "#{id}", and id.to_s
[15:17:55] elomatreb: It complains as in Undefined Method or some other error?
[15:18:02] ivanskie: undefined method yes
[15:18:15] ivanskie: (undefined method `id' for nil:NilClass)
[15:18:34] elomatreb: Could you gist your code?
[15:18:42] ivanskie: oh i think i see what is happening
[15:18:49] ivanskie: that line is not the problem
[15:19:07] ivanskie: its the next one, now that im reading the error properly lol...
[15:19:08] irishfromua: has joined #RubyOnRails
[15:19:35] ivanskie: okay next question. can i send the insance of the model? rather than just the id?
[15:20:27] crst_: Buy guys! Thanks for everything
[15:20:28] ivanskie: meh i'll just send id
[15:20:48] tycoon177: is there a way that i can have 2 handlers for response formats? like prawn pdf as the default pdf output, but the ability to use wicked_pdf when it's needed
[15:21:53] ivanskie: awesome now its working.
[15:23:38] ivanskie: elomatreb: what was happening is that i was doing 'if Sensor.where(device_id: id.to_s).empty?' and then next line was 'GetSensorsForDeviceJob.perform_later @sensor' and it was trying to do run .id method on @sensor which evaluates to nothing in this case. so
[15:24:08] ivanskie: i was trying to add the get_sensors method to the Device controller.
[15:24:20] elomatreb: :) Carefully checking line numbers often helps with confusion like that
[15:24:23] ivanskie: and it wasn't working from console so i moved it into model instead
[15:26:39] milesmatthias: has joined #RubyOnRails
[15:27:07] ivanskie: lol i just realized what im doing is dumb
[15:27:33] ivanskie: im running it inside the model so 'if Sensor.where(device_id: id.to_s).empty?' should actually be 'if sensors.empty?'
[15:29:06] ivanskie: which is (instance of Device model).sensors.empty? = Sensor.where(device_id: (instance of Device model).id.to_s).empty?
[15:29:14] ivanskie: anywho back to work
[15:30:45] bronson: has joined #RubyOnRails
[15:34:35] tycoon177: how would i designate the generation of pdfs through prawn pdf by default but with the ability to use wicked_pdf in other cases?
[15:34:50] brent__: has joined #RubyOnRails
[15:38:39] arup_r: has joined #RubyOnRails
[15:45:17] ivanskie: does ActiveJob try to parse everything thats passed to it and check if its Time?
[15:45:37] ivanskie: im trying to pass a string with datetime to a job as argument. and it says unsupported type.
[15:45:40] ivanskie: but its a string
[15:45:53] ivanskie: *head_explode gif*
[15:48:22] ivanskie: essentially I am passing "device.sensors.find_by_name("Unit Filter Differential Pressure").sensor_data.last.datetime.xmlschema" which is => "2016-04-10T07:40:56Z"
[15:48:32] ivanskie: and i get ActiveJob::SerializationError: Unsupported argument type: Time
[15:48:36] ivanskie: argh its a string
[15:48:58] ivanskie: device.sensors.find_by_name("Unit Filter Differential Pressure").sensor_data.last.datetime.xmlschema.class => String
[15:51:44] catbusters: has joined #RubyOnRails
[15:52:23] ivanskie: https://gist.github.com/i5okie/42884e937f7da72d6abdffcb5f157e6b#file-sensor-rb-L10
[15:54:35] ivanskie: pry(main)> device.sensors.find_by_name("Unit Filter Differential Pressure").sensor_data.last.datetime.send('+', 5.minutes).xmlschema.class
[15:54:59] ivanskie: anyone have bullseye stickers for banging head on the wall??
[15:55:29] dblessing: has joined #RubyOnRails
[15:59:00] ivanskie: tycoon177 how do you determine when to use prawn vs wicked_pdf?
[15:59:37] tycoon177: ivanskie: i'm just making a minimal example to see if i can just use either based on the template file extensions
[16:00:14] tycoon177: but basically, most of our reporting is done with prawn currently but i have a use for wicked_pdf so that i can use html and css to make more customizable things
[16:00:25] tycoon177: so wicked_pdf would be used where prawn cannot
[16:00:34] ivanskie: have you tried to check for file extension, if .a do (process file with prawn), else (process file with wicked_pdf) ?
[16:00:53] tycoon177: ivanskie: it's mostly handled in the backend of rails
[16:00:58] tycoon177: just format.pdf
[16:01:07] tycoon177: and it looks for anything ending in .pdf.prawn
[16:01:32] tycoon177: i'm hoping that by adding wicked_pdf to my gemfile it will also look for the .pdf.erb variants
[16:01:42] ivanskie: have you tried?
[16:01:45] tycoon177: i should've just checked first before asking twice in here lol
[16:01:48] tycoon177: i'm doing that shortly
[16:02:03] tycoon177: i have become what i hate lol
[16:02:12] ivanskie: do you have some bullseye stickers?
[16:02:54] ivanskie: https://i.pinimg.com/736x/4d/b0/e4/4db0e42c179729e4d0c487c8d45f3084--metal-signs-bangs.jpg
[16:03:07] ivanskie: i need some.
[16:03:34] tycoon177: i'll take 12
[16:04:04] ivanskie: i've seen some a few years back at in my college' student services office.
[16:04:49] DTZUZO: has joined #RubyOnRails
[16:05:59] keegnotrub: has joined #RubyOnRails
[16:07:56] ivanskie: i just don't understand where activejobs sees Time type in my code.
[16:10:30] gusrub: has joined #RubyOnRails
[16:12:47] irishfromua: has joined #RubyOnRails
[16:14:26] gusrub_: has joined #RubyOnRails
[16:16:37] orbyt_: has joined #RubyOnRails
[16:17:17] ivanskie: i wonder if i should uhm reload rails console
[16:18:04] keegnotrub: has joined #RubyOnRails
[16:19:11] ivanskie: one of those days.
[16:19:15] conta1: has joined #RubyOnRails
[16:19:46] ivanskie: i fixed the problem. but didn't reload the console so i was like why the fff is it still not working!
[16:20:12] timdotrb_: has joined #RubyOnRails
[16:21:36] ivanskie: okay this is going to take a long time.
[16:22:03] ivanskie: i have 251 devices. on average they have about 200 sensors.
[16:22:16] ivanskie: each of those sensors has historical data going back to march of 2016.
[16:22:48] ivanskie: my update_data. method calls an active job that gets the latest 1000 records from the last known datetime
[16:23:06] ivanskie: two runs. and im still in April of 2016.
[16:23:16] ivanskie: and this is just for the single sensor. omg
[16:25:16] worknick: has joined #RubyOnRails
[16:26:33] worknick: I am facing this issue https://github.com/reactjs/react-rails/issues/711 . My code: https://gist.github.com/anonymous/2bb9722321f11bfe513beb45198bb271
[16:26:49] worknick: I am using rails 5.1.2 ruby 2.4.0 webpack 3.5.5
[16:27:25] worknick: I get the error for return <TimerExample line
[16:27:34] worknick: how to fix it?
[16:29:05] ivanskie: have you tried the fix mentioned on github?
[16:29:47] worknick: yes. you can see it in the code i shared react.js file which is in my loadrs folder of webpack
[16:30:45] ivanskie: right but you have 'stage=3' there
[16:30:51] dionysus69: has joined #RubyOnRails
[16:31:23] ivanskie: rmosolgo mentioned you need stage-2
[16:32:55] worknick: tried with stage-2 did not worked. hence tried latest version.
[16:33:54] ivanskie: Sorry I do not know.
[16:34:10] worknick: unanwered https://github.com/reactjs/react-rails/issues/531
[16:40:58] dionysus69: has joined #RubyOnRails
[16:41:52] bruno-_: has joined #RubyOnRails
[16:47:26] brent__: has joined #RubyOnRails
[16:47:41] brent__: has joined #RubyOnRails
[16:53:11] brendan-: has joined #RubyOnRails
[16:56:05] brendan-: has joined #RubyOnRails
[16:56:30] openstruct: has joined #RubyOnRails
[17:04:06] one_zero: has joined #RubyOnRails
[17:15:30] milesmatthias: has joined #RubyOnRails
[17:19:51] sekmo: has joined #RubyOnRails
[17:28:35] one_zero: has joined #RubyOnRails
[17:31:36] bronson: has joined #RubyOnRails
[17:32:11] zacts: has joined #RubyOnRails
[17:37:54] milesmatthias: has joined #RubyOnRails
[17:38:34] milesmatthias: has joined #RubyOnRails
[17:38:45] jottr_: has joined #RubyOnRails
[17:39:09] Or1on: has joined #RubyOnRails
[17:39:44] gusrub: has joined #RubyOnRails
[17:40:21] Rodya_: has joined #RubyOnRails
[17:43:53] sandstrom: has joined #RubyOnRails
[17:48:04] shilon: has joined #RubyOnRails
[17:49:09] mostlybadfly: has joined #RubyOnRails
[17:53:56] orbyt_: has joined #RubyOnRails
[17:54:14] opekktar: has joined #RubyOnRails
[17:56:41] NoGodDamnIdea: has joined #RubyOnRails
[17:57:24] milesmatthias: has joined #RubyOnRails
[18:10:53] ivanskie: is there a way to run activejob one at a time?
[18:12:22] milesmatthias: has joined #RubyOnRails
[18:12:27] centrx: has joined #RubyOnRails
[18:13:47] milesmatthias: has joined #RubyOnRails
[18:14:32] milesmatthias: has joined #RubyOnRails
[18:15:27] milesmatthias: has joined #RubyOnRails
[18:17:10] jnollette: has joined #RubyOnRails
[18:18:03] s2013: has joined #RubyOnRails
[18:25:09] Rodya_: has joined #RubyOnRails
[18:25:33] lxsameer: has joined #RubyOnRails
[18:25:36] ivanskie: how can I run an instance method from inside view?
[18:25:49] ivanskie: i tried <%= link_to 'Get Sensors', @device, method: :get_sensors %> but it doesnt work
[18:26:11] ivanskie: i have a model method get_sensors. and get_sensors defined in controller as well.
[18:27:42] ivanskie: im just trying to have a button on Show page, that queues up an activejob
[18:28:09] Maakuth: have you guys ever run into this sort of issue: this has_many through -association doesn't seem to first have nothing, but after adding, there is two items
[18:28:52] Maakuth: ivanskie, you need a route and a controller method there
[18:30:56] Maakuth: it's possible that there's automatic routing to controller methods, you can see those by rake routes
[18:33:22] Maakuth: you haven't very extensively described your situation, but model method can't really cut it in this case, as the view probably doesn't know what instance of that model to call
[18:33:40] tbuehlmann_: Maakuth: have an example of your problem?
[18:35:33] andruxnet: has joined #RubyOnRails
[18:35:34] Maakuth: tbuehlmann_, i think i'm going to figure it out while trying to write a clean example :)
[18:36:01] ivanskie: the view knows @device
[18:37:06] ivanskie: so i think i need to have a post /devices/:id route to devices#get_sensors
[18:37:38] Maakuth: tbuehlmann_, basically it's about this has_many model_bs through join_model -relationship first returning [], but then after <<'ing another ModelB there, returning two of them, first being something added before getting that []
[18:38:35] Maakuth: ivanskie, I think you'll be happier using a GET route, that way you don't need to be messing around with post data to try it out in browser for example
[18:39:02] ivanskie: well get_sensors doesn't return anything
[18:39:47] ivanskie: it executes GetSensorsForDeviceJob with (instance of Device).id
[18:40:10] ivanskie: adn that just gets data from soap api and populates my db
[18:40:46] ivanskie: i dont really 'need' to have this button on the view. so meh
[18:41:26] ivanskie: too much hastel
[18:41:49] ivanskie: there's just a few million records that i need to pull from the api.
[18:42:06] ivanskie: and running activejob simultaniously seems to choke up my local sqlite
[18:42:45] ivanskie: keep seeing database is locked scrolling by in the console when i was happy_mashing the up arrow and enter keys in console to run the activejob a few times
[18:43:12] ivanskie: its a default queue, but seems to be executing it as if it was urgent
[18:44:05] ivanskie: long story short i can't have postgres on localmachine at the moment.
[18:47:27] srinidhi: has joined #RubyOnRails
[18:48:11] ivanskie: so having a few million records in sqlite is uhm probably a bad idea
[18:49:29] ivanskie: waiting for them to give me a proper dev env.
[18:49:55] Maakuth: tbuehlmann_, okay, more info. ModelA instance's modelb_ids returns [] at first, but after mobelbs() is called, modelb_ids also finds stuff :)
[18:50:33] daydreamm: has joined #RubyOnRails
[18:50:40] Maakuth: ivanskie, i think sqlite can handle it, but if you access it concurrently, trouble
[18:51:31] ivanskie: yeah and thats the issue im running into. but its a non-issue because its just local thing that i dont care about right now
[18:52:19] ivanskie: should have brought my macbook with me. oh well
[18:53:45] ivanskie: windows 4 the win
[18:53:47] ivanskie: ACTION chokes
[18:55:08] ivanskie: made it a pretty decent dev env actually. cmder, msys2, got everything working as it should.
[18:56:08] Maakuth: hmm. i've never tried ruby development with windows, just virtualbox if I have windows machine
[18:56:53] ivanskie: personally i think it's light years ahead compared to even like 3 years ago.
[18:57:32] ivanskie: and now ubuntu on windows if you've got windows 10. its not bad. of course i'd prefer mac or linux. but if not an option, its still doable.
[18:57:37] Maakuth: the linux subsystem seems promising
[18:57:42] Maakuth: yeah, that one
[18:58:18] ivanskie: but now u get a choice. ubuntu / centos / suse
[18:58:29] ivanskie: neat stuff.
[18:58:37] Maakuth: i switched to ubuntu on my working machine, but it works badly with my thinkpad docks :( i basically shut down the machine while i'm changing between work and home office
[18:59:56] ivanskie: the only thing i don't like about ubuntu desktop is the console experience. its just different enough from the rest of them that just feels like a speed bump.
[19:01:41] ivanskie: just havent found the right combo of default console , fish, or zsh and config to make it right yet. dont know if its just gnome overall or what
[19:02:08] Maakuth: this issue of mine is weird. if i'm checking modela.modelbs through pry, i'm getting the correct data and then my asserts are correct. but without the breakpoint and manual checking that model, it doesn't work
[19:02:38] ivanskie: you mhow do you mean
[19:02:42] ivanskie: how do you mean*
[19:03:00] ivanskie: i found earlier that i have look up the model first before doing a lot of methods on it in the console
[19:03:32] Maakuth: i have a "has_many modelbs through join_model" association in my ModelA
[19:03:40] ivanskie: if i load rails.console i have to do Device.first or what have you first before i can do Device.first.do_other_stuff
[19:03:59] ivanskie: so works in console, but not outside of it?
[19:04:28] Maakuth: if my test checks from ModelA instance for modelb_ids, it's 0. but if I check modelbs through pry before the assertions, i'm getting correct number of results
[19:05:14] Maakuth: i've juggled a bit with autosave parameters for the associations, but that hasn't helped yet
[19:06:53] ivanskie: did you try reloading spring?
[19:07:06] ivanskie: and getting out of console and going back and checking again?
[19:07:24] Maakuth: no spring here on northern hemisphere... i mean rails 4
[19:07:42] Maakuth: yeah, i'm starting from empty state with the test runner
[19:09:23] tycoon177: ivanskie: update on my issue lol. i did try it and the extensions (.pdf.erb vs .pdf.prawn) was enough to use both together in my application :)
[19:09:35] tycoon177: i got sidetracked with other work since it's a short day today
[19:09:47] ivanskie: tycoon177 sweet
[19:10:12] tycoon177: not sure if you were wondering, but i wanted to prove that i could answer it myself lol
[19:10:31] ivanskie: tycoon177 thats usually an awesoune route.
[19:10:36] ivanskie: becomes a learning experience
[19:10:44] tycoon177: well i was just being lazy earlier
[19:10:55] tycoon177: i should've just gone and tested it instead of asking
[19:11:00] ivanskie: like earlier i was ready to bang my head against the wall until i realized i already fixed the issue but forgot to reload my rails console
[19:11:29] tycoon177: is basically muscle memory for me lol
[19:11:39] ivanskie: i just learned of that command today
[19:11:52] ivanskie: i was like there's got to be an easier way than exit and rails c again
[19:13:02] orbyt_: has joined #RubyOnRails
[19:15:00] funkytwig: has joined #RubyOnRails
[19:16:43] funkytwig: Hi, I am thinking of using 'rails runner' to run batch jobs to populate a database but I will have around 40 .rb scripts and am worried about the resource overhead...
[19:17:24] funkytwig: So wondering what the resource overhead of running 40 rails environments is?
[19:18:28] ivanskie: good question
[19:18:41] opekktar: has joined #RubyOnRails
[19:18:43] ivanskie: 1 rails_environment * 40?
[19:20:19] ivanskie: why would you run 40 rails environments? i dont understand
[19:20:38] ivanskie: is this activejobs you are talking about batching with runner?
[19:22:19] funkytwig: ivanskie, each script is a web scraper that gets events from a different music venue. I want to scrape very slowly so to be nice to the servers...
[19:22:48] ivanskie: what about running it as a delayed job?
[19:23:22] funkytwig: So doing it very slowly (o.e. a http request every 20 seconds) seemed the best way to go. however this meant if I run them sxequentialy is would take a verry long time, so I run them concurently...
[19:24:02] funkytwig: LOL, sexquentialy, must look that up;). sequensialy
[19:24:12] ivanskie: i just saw something earlier.. that you could do every 20.minutes {runner your_task} with a gem
[19:24:31] funkytwig: ivanskie, 'delayed job'?
[19:25:06] ivanskie: ahem. i guess
[19:25:12] ivanskie: i haven't done delayed job before so
[19:25:20] ivanskie: saw this: https://stackoverflow.com/questions/41259678/rails-delayed-jobs-with-whenever-and-delayed-job-active-record
[19:25:34] ivanskie: so not sure if ."save_daily_detail" is the whenever part. or what
[19:25:41] Maakuth: maybe just try to run 40 scripts simultaneously :)
[19:25:49] funkytwig: ivanskie, I only run them once a day
[19:25:54] ivanskie: hit 'em with everything you've got
[19:26:37] ivanskie: saw a kid trying to get at my cat first with a butterlfy catcher thing, that failed, so he started throwing stuff at at.
[19:26:45] funkytwig: I think suck it and see is probably the best way to go, I will try it on the dev server and see what resources it used.
[19:27:21] ivanskie: i dont see why you'd have a probelm running 40 scripts once a day
[19:27:44] Maakuth: running simultaneously might be the problem?
[19:27:47] funkytwig: ivanskie, probably not, they are run in the early houres
[19:28:25] ivanskie: well if he's running sqlite as his database like i was and trying to write a few thousand records simultamiously. then yah.
[19:29:11] ivanskie: whats the difference a few thousand user requests coming in to your server, or running 40 scripts getting stuff from the interwebs and writing to database
[19:29:32] funkytwig: ivanskie, also I have only written 9 so far and they will be slowly added so I can keep an eye on resource usage.
[19:30:09] funkytwig: ivanskie, that’s a VERY good point.
[19:30:09] ivanskie: if your hardware is on ssd. you should be okay. you might run into bottleneck if its hdd based server
[19:31:05] ivanskie: run out of hdd resource and you start getting into ram
[19:31:41] funkytwig: ivanskie, actualy I will test it on my i5 laptop with a HD. Ime a great fan of not having a very powerful dev environment. that way if you write stuff that uses lost of resources you soon know.
[19:32:08] ivanskie: not the best way to guage performance.
[19:32:30] bronson: has joined #RubyOnRails
[19:32:48] ivanskie: you will have significant difference between bus clocks between laptop and server machines (speed of data going between hdd/ssd to proc to mem. and vice versa)
[19:33:34] ivanskie: but in general yah
[19:34:26] cagomez: has joined #RubyOnRails
[19:35:19] funkytwig: ivanskie, don't know much about testing performance, apart grom looking at resource monitor, but the scripts are only around 70 lines of code each and the lib methods are fairly simple.
[19:35:47] ivanskie: lines of code is fine. but how much data are you getting back
[19:36:07] ivanskie: and how long does it take to process
[19:37:21] funkytwig: ivanskie, its events listings so got a great deal. If I just run them unthrottled, on lmy laptop, the longest is under 30 secs.
[19:37:43] funkytwig: OK, ime convinced, it wont be a problem
[19:38:36] funkytwig: ivanskie, always a pleasure, got to go out and do some boring stuff for my boss.
[19:39:28] karmayogi23: has joined #RubyOnRails
[19:39:30] funkytwig: ivanskie, then come back and refactor all my stand alone .rb scripts into rails.
[19:39:51] ivanskie: :) good luck
[19:40:28] Maakuth: crap, my association stuff is still broken
[19:40:34] funkytwig: ivanskie, danka
[19:41:05] Maakuth: time to sleep I think
[19:44:00] ivanskie: > Sleep.good?
[19:52:41] dviola: has joined #RubyOnRails
[19:54:02] sandstrom: has joined #RubyOnRails
[20:03:19] gusrub: has joined #RubyOnRails
[20:05:18] segy: has joined #RubyOnRails
[20:17:35] cagomez: has joined #RubyOnRails
[20:22:44] kies: has joined #RubyOnRails
[20:24:45] cagomez: has joined #RubyOnRails
[20:35:57] jmay: has joined #RubyOnRails
[20:36:12] bronson: has joined #RubyOnRails
[20:40:24] orbyt_: has joined #RubyOnRails
[20:41:33] jottr_: has joined #RubyOnRails
[20:46:11] arBmind: has joined #RubyOnRails
[20:46:22] cagomez: has joined #RubyOnRails
[20:49:32] jottr_: has joined #RubyOnRails
[21:07:01] DTZUZO: has joined #RubyOnRails
[21:12:07] shilon: has joined #RubyOnRails
[21:13:29] DTZUZO: has joined #RubyOnRails
[21:18:15] openstruct: has joined #RubyOnRails
[21:19:50] Rodya_: has joined #RubyOnRails
[21:20:41] openstruct: I'm working on a service to upload User data to an API. I need to construct a CSV that's specific to this API and figured that a Gateway object might be the best route to do that since it's outside the scope of the User model. Is there a better convention for this task?
[21:32:26] desnudopenguino: has joined #RubyOnRails
[21:34:03] desnudopenguino: i have a simple create form set up for one of my models. every now and then the form won't submit. i can hit enter or click the button and nothing happens, no js events triggered, no form data sent or pages requested or anything. any ideas what is going on?
[21:36:21] jottr_: has joined #RubyOnRails
[21:43:07] jmay: has joined #RubyOnRails
[21:48:56] gusrub: has joined #RubyOnRails
[21:51:30] jackhum: has joined #RubyOnRails
[22:02:15] funkytwig: Hi, ime trying to create a new app with a postgres database. When I run 'rake db:setup' I get 'PG::ConnectionBad: could not connect to server: Connection timed out'
[22:02:52] rafadc: has joined #RubyOnRails
[22:02:58] funkytwig: Is the server running on host "localhsot" ( and accepting
[22:02:58] funkytwig: TCP/IP connections on port 5432?
[22:04:23] funkytwig: which seems odd as ping localhost returns
[22:05:12] weaksauce: has joined #RubyOnRails
[22:06:12] funkytwig: sorry, mean
[22:17:53] gusrub: has joined #RubyOnRails
[22:53:20] gusrub: has joined #RubyOnRails
[23:05:46] jmay: has joined #RubyOnRails
[23:06:15] tenderlove: has joined #RubyOnRails
[23:08:46] orbyt_: has joined #RubyOnRails
[23:19:18] milesmatthias: has joined #RubyOnRails
[23:22:16] bruno-: has joined #RubyOnRails
[23:25:14] ResidentBiscuit: has joined #RubyOnRails
[23:32:48] dopie: has joined #RubyOnRails
[23:37:59] jmay: has joined #RubyOnRails