« Back to channel list

#RubyOnRails - 11 January 2018

« Back 1 day Forward 1 day »
[00:09:00] conceivably: has joined #RubyOnRails
[00:12:37] l_tonz: has joined #RubyOnRails
[00:12:43] bronson: has joined #RubyOnRails
[00:27:19] mtkd: has joined #RubyOnRails
[00:28:29] alfiemax: has joined #RubyOnRails
[00:38:21] sevenseacat: has joined #RubyOnRails
[00:52:47] srruby: Anyone using docker in production ?
[00:56:40] l_tonz: has joined #RubyOnRails
[01:06:42] alfiemax: has joined #RubyOnRails
[01:13:40] bronson: has joined #RubyOnRails
[01:33:13] alfiemax: has joined #RubyOnRails
[01:46:14] l_tonz: has joined #RubyOnRails
[01:54:27] creature: has joined #RubyOnRails
[01:55:14] Jameser: has joined #RubyOnRails
[02:14:03] dviola: has joined #RubyOnRails
[02:15:05] bronson: has joined #RubyOnRails
[02:24:54] alfiemax: has joined #RubyOnRails
[02:51:59] l_tonz: has joined #RubyOnRails
[02:57:20] xco: has joined #RubyOnRails
[02:58:34] SteenJobs: has joined #RubyOnRails
[03:03:55] dcope: why would rake db:seed try to recreate the database? it looks like it is trying to drop tables and recreate.
[03:15:41] bronson: has joined #RubyOnRails
[03:16:32] alfiemax: has joined #RubyOnRails
[03:27:36] willardg: has joined #RubyOnRails
[03:29:04] willardg: Hey guys. I have a rake task that prompts a user for input before running. Are you sure? [Y/N] but I want to update the seed file to automatically run this task and answer that question. Is there a way you can write the task to autofill the prompt?
[03:29:45] willardg: I would just modify the original task to accept an arg to run without prompt, but the original task is brought in from an outside gem... :(
[03:30:53] starseed00: has joined #RubyOnRails
[03:31:18] starseed00: Can anyone tell my why I might be getting all of my requests logged in unicorn.stderr.log?
[03:31:19] starseed00: 10.0.131.135 - - [11/Jan/2018:03:29:31 +0000] "GET /heartbeat HTTP/1.0" 200 10 0.0053
[03:31:27] darkhanb: has joined #RubyOnRails
[03:31:36] starseed00: All requests are going there even if they aren't erroring
[03:44:51] raz: has joined #RubyOnRails
[03:45:11] raz: anyone know if the latest sql injection exploits also affect postgresql? https://kay-malwarebenchmark.github.io/blog/ruby-on-rails-arbitrary-sql-injection/
[03:45:14] Radar: starseed00: Did you configure the server to log to unicorn.stderr.log?
[03:46:10] starseed00: stderr_path "#{app_path}/log/unicorn.stderr.log"
[03:46:10] starseed00: stdout_path "#{app_path}/log/unicorn.stdout.log"
[03:46:17] Radar: starseed00: Then I have no idea.
[03:47:46] Radar: raz: MUTLI_STATEMENTS is a mysql2 gem only feature, so I think it only works for mysql2.
[03:48:16] raz: Radar: ah thanks, that's good to know. the exploit description is unfortunately vague in that part
[03:48:37] Radar: raz: yeah it isn't very clear
[04:13:17] za1b1tsu: has joined #RubyOnRails
[04:14:06] Jameser: has joined #RubyOnRails
[04:16:04] blindMoe: has joined #RubyOnRails
[04:16:36] bronson: has joined #RubyOnRails
[04:16:57] blindMoe: Anyone have experience with jsonapi-resources that can help me with callbacks? I want to grab the params data inside the before_update callback but can't seem to get it. Can only access @model and context
[04:24:55] Saukk: has joined #RubyOnRails
[04:34:21] l_tonz: has joined #RubyOnRails
[04:35:31] orbyt_: has joined #RubyOnRails
[04:40:15] l_tonz: has joined #RubyOnRails
[04:43:39] sevenseacat: has joined #RubyOnRails
[04:49:53] DTZUZO: has joined #RubyOnRails
[04:59:50] kies: has joined #RubyOnRails
[05:06:39] srinidhi: has joined #RubyOnRails
[05:06:49] alfiemax: has joined #RubyOnRails
[05:07:48] starseed00: In case I am crazy - a regular request with a response 200 shouldn't be logging to unicorn.stderr.log should it?
[05:17:23] bronson: has joined #RubyOnRails
[05:17:40] ur5us: has joined #RubyOnRails
[05:19:26] za1b1tsu: has joined #RubyOnRails
[05:22:12] iamarun: has joined #RubyOnRails
[05:23:40] aiguuu: has joined #RubyOnRails
[05:32:08] brent__: has joined #RubyOnRails
[05:37:30] orbyt_: has joined #RubyOnRails
[05:37:41] kapil___: has joined #RubyOnRails
[05:38:24] starseed00: has joined #RubyOnRails
[05:42:08] Disavowed: has joined #RubyOnRails
[05:54:57] za1b1tsu: has joined #RubyOnRails
[06:09:45] starseed00: has joined #RubyOnRails
[06:13:47] srinidhi: has joined #RubyOnRails
[06:15:01] cschneid_: has joined #RubyOnRails
[06:18:09] bronson: has joined #RubyOnRails
[06:48:25] KeyJoo: has joined #RubyOnRails
[06:51:54] aiguuu: has joined #RubyOnRails
[07:04:08] apeiros: has joined #RubyOnRails
[07:14:26] ur5us: has joined #RubyOnRails
[07:15:26] tectonic: has joined #RubyOnRails
[07:16:40] conta: has joined #RubyOnRails
[07:18:55] bronson: has joined #RubyOnRails
[07:21:41] dionysus69: has joined #RubyOnRails
[07:30:29] darkhanb: has joined #RubyOnRails
[07:36:31] mudyc: has left #RubyOnRails: ()
[07:45:06] gambl0re: has joined #RubyOnRails
[07:50:10] JusticeFries: has joined #RubyOnRails
[07:50:32] jdeen_: has joined #RubyOnRails
[07:52:40] jdeen_: Hay... I am making a Rails engine, but I don't want to define auth in it. Rather I would like the app that mounts the engine lets say define some methods like `#current_user`. In an engine, how is it possible to access methods defined in lets say in ApplicationController of the host app?
[07:56:57] AzaToth: has joined #RubyOnRails
[07:59:09] apeiros: has joined #RubyOnRails
[08:01:41] Dimik: has joined #RubyOnRails
[08:07:28] arBmind: has joined #RubyOnRails
[08:11:44] jackhum: has joined #RubyOnRails
[08:12:52] jackhum: has joined #RubyOnRails
[08:14:34] aiguuu: has joined #RubyOnRails
[08:18:38] iamarun: has joined #RubyOnRails
[08:20:08] bronson: has joined #RubyOnRails
[08:28:57] noob_on_rails: has joined #RubyOnRails
[08:37:01] juggler: has joined #RubyOnRails
[08:40:23] morfin60: has joined #RubyOnRails
[08:42:30] morfin60: why can `l @news.news_date, format: "%Y %B %d %H:%M:%S"` give "2018 r 24 20:09:00" with I18n.locale = :ru?
[08:44:23] morfin60: i should install rails-i18n gem i guess?
[08:46:18] srinidhi: has joined #RubyOnRails
[08:52:16] aiguuu: has joined #RubyOnRails
[09:08:53] alfiemax: has joined #RubyOnRails
[09:19:14] ams__: has joined #RubyOnRails
[09:22:08] jnollette: has joined #RubyOnRails
[09:23:17] tectonic_: has joined #RubyOnRails
[09:25:17] marr: has joined #RubyOnRails
[09:28:46] aiguuu: has joined #RubyOnRails
[09:44:51] iamarun: has joined #RubyOnRails
[09:50:06] Andr3as: morning guys
[09:51:01] Andr3as: fwiw, if you get a "SyntaxError: Unexpected token ," error after you did a bundle update, its the "therubyracer" gem which throws it in version 7.2.4 - rollback to 7.2.3 and you're good to go
[09:56:05] tectonic_: has joined #RubyOnRails
[10:04:00] kiffpowerss: has joined #RubyOnRails
[10:05:19] aiguuu: has joined #RubyOnRails
[10:14:42] tectonic: has joined #RubyOnRails
[10:18:53] dminuoso: Andr3as: Huh.
[10:21:37] bronson: has joined #RubyOnRails
[10:33:30] arBmind: has joined #RubyOnRails
[10:33:48] dminuoso: Andr3as: Can you make a testcase repo?
[10:35:00] dminuoso: Im a bit unsure what version "7.2.4" is supposed to be here, but if a minor version creates syntax errors in node there's something seriously wrong.
[10:49:59] iamarun: has joined #RubyOnRails
[11:00:19] JusticeFries: has joined #RubyOnRails
[11:03:35] Ergo: has joined #RubyOnRails
[11:13:31] apparition: has joined #RubyOnRails
[11:13:45] jottr: has joined #RubyOnRails
[11:19:40] zwliew: has joined #RubyOnRails
[11:22:36] bronson: has joined #RubyOnRails
[11:23:11] fschuindt: has joined #RubyOnRails
[11:26:15] Jameser: has joined #RubyOnRails
[11:34:31] morfin60: therubyracer use own v8 as i remember - no?
[11:39:54] mtkd: has joined #RubyOnRails
[11:49:34] aiguuu: has joined #RubyOnRails
[11:52:33] hammer065: has joined #RubyOnRails
[11:55:24] mtkd: has joined #RubyOnRails
[11:56:34] za1b1tsu: has joined #RubyOnRails
[11:57:09] morfin60: i personally prefer using execjs and nodejs
[11:59:13] ElFerna: has joined #RubyOnRails
[12:02:16] lxkm: has joined #RubyOnRails
[12:07:23] KeyJoo: has joined #RubyOnRails
[12:09:35] jottr: has joined #RubyOnRails
[12:22:37] ElFerna: has joined #RubyOnRails
[12:23:17] bronson: has joined #RubyOnRails
[12:24:47] LyndsySimon: has joined #RubyOnRails
[12:25:19] _aeris_: has joined #RubyOnRails
[12:27:24] et09: has joined #RubyOnRails
[12:31:57] za1b1tsu: Does factory bot have a problem with loading files that don't have factories for models?
[12:32:28] za1b1tsu: it refuses to load this https://gist.github.com/bbtdev/cc70b83f5ea5f173023ec7ef0e663975
[12:32:41] za1b1tsu: all the other factories that are models np
[12:32:48] aiguuu: has joined #RubyOnRails
[12:33:40] fschuindt: za1b1tsu: try to use OpenStruct instead of hash, it's the way FactoryBot assigns the values lile name "Sebastian", it's trying to use a attr_accessor/writer
[12:35:52] za1b1tsu: fschuindt: thanks but still does not work
[12:37:57] fschuindt: za1b1tsu: use FactoryBot.build instead of :create if you're using OpenStruct
[12:38:07] fschuindt: create will invoke ActiveRecord
[12:38:28] fschuindt: build will invoke the class constructor
[12:38:47] za1b1tsu: aaaaaaaaaaaaaaa
[12:39:52] za1b1tsu: fschuindt: that was a nice touch, but still does;t work
[12:40:19] za1b1tsu: ArgumentError (Factory not registered: chicken)
[12:44:08] fschuindt: za1b1tsu: if you're using factory :chicken, class: OpenStruct do inside a FactoryBot.define do block, it shouldn't fail like this
[12:44:28] fschuindt: check if you are indeed loading the factories dir
[12:44:36] za1b1tsu: but all other factories work
[12:45:00] fschuindt: tryo to remove favorites and initialize_with
[12:45:07] fschuindt: see if it works
[12:47:15] dminuoso: morfin60: wel that then.
[12:47:17] ElFerna: has joined #RubyOnRails
[12:47:29] za1b1tsu: fschuindt: it doesn't same error
[12:47:33] morfin60: i guess that error happens because of trailing comma
[12:47:46] fschuindt: za1b1tsu: ouch :/
[12:48:29] dminuoso: morfin60: Perhaps, but how does that relate to an _upgrade_?
[12:48:35] za1b1tsu: yeah, it is in the right folder, the filed in same after the factory, I have factory_bot_rails
[12:48:43] fschuindt: za1b1tsu: https://robots.thoughtbot.com/mind-bending-factories
[12:48:55] fschuindt: maybe it give you a light
[12:49:02] dminuoso: morfin60: The only relevant recent change is in ES2017 allowing them in fun params. Micro versions dont make a habit of removing features.
[12:49:31] za1b1tsu: fschuindt: I got the chicken from there
[12:51:12] Jameser: has joined #RubyOnRails
[12:56:05] xco: has joined #RubyOnRails
[13:01:11] ElFerna: has joined #RubyOnRails
[13:02:09] za1b1tsu: fschuindt: FactoryBot was not reloading in the console, on reload! ?! Why is that
[13:02:59] za1b1tsu: damn I need to use FactoryBot.reload
[13:08:39] ShalokShalom: has joined #RubyOnRails
[13:11:50] morfin60: still can't used to new gem name )
[13:12:01] morfin60: *can't get used
[13:12:33] morfin60: dminuoso, what is version 7.2.4 btw?
[13:14:12] crst: has joined #RubyOnRails
[13:14:17] morfin60: i look at therubyracer versions and they start from 0
[13:14:23] aiguuu: has joined #RubyOnRails
[13:14:27] morfin60: last one is 0.12.3
[13:16:49] dminuoso: morfin60: I asked the same thing.
[13:18:38] morfin60: btw i am looking at ExecJS readme and it says next thing "ExecJS provides a lowest common denominator interface to any JavaScript runtime"
[13:19:23] morfin60: also it can't ES5 because crappy JScript and Apple JavaScriptCore are ES3 only
[13:19:52] morfin60: ACTION used JScript in context of one CRM it was PITA
[13:20:15] dminuoso: ACTION shrugs
[13:20:49] dminuoso: morfin60: https://ro-che.info/ccc/20
[13:21:37] morfin60: ES3 can't even Array.map
[13:21:52] morfin60: you have to use shims for it
[13:23:32] dminuoso: morfin60: I barely use standard prototype functions either anymore.
[13:23:39] dminuoso: Ramda all the way.
[13:23:52] dminuoso: Even though it kind of screws up flow, but oh well the language is shit anyway.
[13:24:20] bronson: has joined #RubyOnRails
[13:25:46] morfin60: why so? new standard is not that bad
[13:26:45] bluesmonk: has joined #RubyOnRails
[13:28:21] dminuoso: morfin60: Because broken features are kept in the language, and you are forced to use a linter to make sure you dont use idiotic features like `var` or `==`
[13:29:20] dminuoso: morfin60: Lack of a real module system.
[13:29:35] dminuoso: Crazily weakly typed
[13:29:46] dminuoso: late binding..
[13:31:18] dminuoso: And before you mention ES6 modules, keep in mind that ES6 has not specified a full module system, just the syntax and some preliminary semantics. The entire _loader_ semantics were left unspecified.
[13:31:31] dminuoso: Which is why we have this crazy mess with CommonJS
[13:35:02] morfin60: how do you think is Lua better :)
[13:35:25] dminuoso: I dont, but at least Lua is not forced down every web developers throat one way or another.
[13:36:01] dminuoso: Unless you happen to have actually static sites
[13:36:44] dminuoso: But I guess there's WA on the horizon.
[13:36:59] morfin60: i used Lua a bit some concepts as example prototype based object model
[13:43:32] Andr3as: argh, what was i thinking.. it isnt therubyracer, it was autoprefixer-rails
[13:43:34] Andr3as: i am sorry
[13:43:47] JusticeFries: has joined #RubyOnRails
[13:43:48] Andr3as: and here's the issue https://github.com/ai/autoprefixer-rails/issues/130
[13:46:23] morfin60: and it's weakly typed BUT it do not have such thing as var/const/let(also var in JS behave weird because declaration of variable being moved as i remember), locals are local, correct context(if you call myobject:somemethod self is myobject) etc etc
[13:47:09] crst: Hi, I'm using 'ajax-datatables-rails' and in the records.map do |record| there's buying_cost: record.supplier_fuel_total_price which relies on def supplier_fuel_total_price; supplier_fuel_price * (invoice_order_amount || order_amount); end This particular columns is not sortable on click when I have buying_cost: { source: "FuelQuote.supplier_fuel_total_price" }, in view_columns Anybody
[13:47:09] crst: an idea why?
[13:51:47] dminuoso: Andr3as: I love ExecJS. You get to have invisible assets, produce invisible intermediate JS, without any source maps, compilation then fails
[13:51:58] dminuoso: With a completely useless "SyntaxError: Unexpected token ..."
[13:52:16] Andr3as: yeah, took me a while to figure it out
[13:52:39] morfin60: why even use sprockets?
[13:52:52] dminuoso: morfin60: Because most libraries have not switched to webpack yet.
[13:53:05] morfin60: what libraries?
[13:53:19] dminuoso: morfin60: Any that have assets?
[13:54:04] morfin60: i mean is not that simplier to build "frontend" separately?
[13:54:31] dminuoso: morfin60: Technically yes, but it requires a lot more development time because most reflection is lost.
[13:54:53] dminuoso: simple_form can offer extremely rapid prototyping because of its ability to directly reflect on attributes and validations
[13:55:49] crst: Mhm, maybe it's because I'm getting => #<Money fractional:2934558.0 currency:USD> for FuelQuote.first.supplier_fuel_total_price
[13:56:18] dminuoso: morfin60: = simple_form_for @model do |f|; =f.input :title; =f.input :comment; =f.submit end;
[13:56:48] dminuoso: morfin60: You cant trivially do this in JS because client side you dont have AR objects/validations.
[13:57:25] dminuoso: morfin60: It starts with simple things like "how does it know what url to generate" (this could be tackled by producing a JSON route manifest at least)
[13:59:18] DTZUZO: has joined #RubyOnRails
[14:01:04] mtkd: has joined #RubyOnRails
[14:03:49] morfin60: what JS simpleform register?
[14:08:58] JusticeFries: has joined #RubyOnRails
[14:09:50] laekur: has joined #RubyOnRails
[14:11:19] morfin60: i do not exactly understand what is WebAssembl
[14:11:31] Puffball: has joined #RubyOnRails
[14:11:44] morfin60: but seems like it's being compiled from C(++) trought LLVM =)
[14:15:32] morfin60: emscripten again(probably)
[14:22:17] JusticeFries: has joined #RubyOnRails
[14:25:17] bronson: has joined #RubyOnRails
[14:25:27] NoGodDamnIdea: has joined #RubyOnRails
[14:25:36] za1b1tsu: Active Record Relations are always lazy loaded, right?
[14:26:11] za1b1tsu: Every time you call them, a query is performed right?
[14:27:50] morfin60: hmm i remember you could eager load
[14:29:07] za1b1tsu: like intentionally eager load? I'm making something that using the same variable assign to an active record and I want it to change, if there is a new entry that fits the query
[14:31:02] morfin60: what do you mean?
[14:31:45] za1b1tsu: like x = Subject.where(blabla)
[14:32:06] za1b1tsu: every time I call x, use x, a query is performed
[14:33:08] morfin60: i thought you meant something like User has Address and User.first.address going to do 2 queries
[14:33:09] tbuehlmann: za1b1tsu: it should load the query just once and then the relation is "loaded"
[14:34:43] za1b1tsu: tbuehmann: so what happens if an entry in that relations, gets deleted from the db
[14:34:58] morfin60: well i just tested
[14:35:19] za1b1tsu: how would the relation know?
[14:35:33] sawdustofmind: has joined #RubyOnRails
[14:35:34] morfin60: it seems like performing query every time you access this "relation"
[14:36:42] tbuehlmann: za1b1tsu: it wouldn't. if the relation is loaded, it's loaded
[14:37:05] tbuehlmann: if you want to reload the relation, call relation.reload
[14:37:10] morfin60: tbuehlmann, not exactly btw
[14:37:21] mustmodify: has joined #RubyOnRails
[14:37:49] morfin60: slider_item = SliderItem.where(id: 1) #performs query and fill relation
[14:38:08] za1b1tsu: do things work differently in the rails console? Since in the console it performs the query all the time
[14:38:31] sawdustofmind: Hello everybody. What is the best way to require 2 params that don't belong to any model?
[14:38:43] morfin60: SliderItem.first.delete and then i access slider_item and get empty result
[14:40:19] jottr: has joined #RubyOnRails
[14:40:23] tbuehlmann: za1b1tsu: slightly. when you let the console inspect a relation, it gets loaded. that's not the case in a line of code when your server runs it
[14:40:47] tbuehlmann: morfin60: I don't believe you
[14:41:45] morfin60: well, i was talking about rails c
[14:44:24] mustmodify: has left #RubyOnRails: ()
[14:48:11] morfin60: seems like in context of application relation once populated never repopulate
[14:48:18] morfin60: *web application
[14:48:53] dblessing: has joined #RubyOnRails
[14:49:01] jobewan: has joined #RubyOnRails
[14:50:14] morfin60: so there is whole model stored in that relation?
[14:50:19] morfin60: and i can even resave it
[14:51:53] JusticeFries: has joined #RubyOnRails
[14:52:02] dminuoso: rails console is not special.
[14:52:32] dminuoso: if you do: `a = Foo.where(...)` without suppressing the inspect echo, then the inspect will force the relation to materialize.
[14:52:53] dminuoso: so in `pry` at least you could do: `a = Foo.where(...);` if you wanted to build up a relation
[14:53:04] morfin60: well, i can't resave :(
[14:55:08] morfin60: why saving deleted model just start transaction and instantly commit?
[14:55:23] morfin60: because new_record? is false?
[14:56:42] beingjohnm: I'm looking to implement custom fields (user can create new fields for a model) and it sounds like I can either use a custom fields table or the hstore feature of of postgres. Anybody have any experience with this? My first question is with the custom fields table method. If I want to offer the user the choice of either creating a text or a number field that seems to change the key/value paradigm. I'll need to do key/value_type/value_tex
[14:58:20] morfin60: EAV? hstore?
[14:58:36] morfin60: or maybe even json?
[14:59:44] beingjohnm: json might work. hadnt considered that. Is it relatively fast with active record?
[14:59:59] Jameser: has joined #RubyOnRails
[15:00:39] morfin60: no idea =) but as i know you don't need plugin for it in PostgreSQL
[15:02:37] morfin60: and it use own gem..i guess
[15:07:41] jottr: has joined #RubyOnRails
[15:08:26] Torrone: has joined #RubyOnRails
[15:11:45] apeiros__: has joined #RubyOnRails
[15:14:15] NoGodDamnIdea: has joined #RubyOnRails
[15:19:40] safetypin: has joined #RubyOnRails
[15:24:04] dviola: has joined #RubyOnRails
[15:26:04] bronson: has joined #RubyOnRails
[15:32:38] jottr: has joined #RubyOnRails
[15:50:35] SteenJobs: has joined #RubyOnRails
[15:52:40] troys: has joined #RubyOnRails
[15:59:18] za1b1tsu: in Factory Bot can I make a factory that creates only lists? For example: I have a factory for a model called ice cream, I need to return 10 of a flavour, 5 of another flavour etc
[15:59:34] za1b1tsu: Can I do this in the factory directly? Return a list from the factory
[16:05:41] mtkd: has joined #RubyOnRails
[16:09:53] one_zero: has joined #RubyOnRails
[16:12:32] tbuehlmann: za1b1tsu: for regular list there's FactoryBot.build_list(:ice_cream, 3), you can build around that
[16:12:54] za1b1tsu: I know, I need to create a whole database, to test a service object
[16:13:24] za1b1tsu: I just don't want to throw a lot of creates lists in my spec, I'm trying to find an elegant way to do it
[16:14:17] za1b1tsu: https://gist.github.com/bbtdev/4881f8a1749a05cd42b116a7f605ddac
[16:14:40] za1b1tsu: I was thinking something like this, using traits
[16:14:54] za1b1tsu: but now I have to create a list for an object that belongs to sessions and subjects
[16:17:49] jottr: has joined #RubyOnRails
[16:20:36] Saukk: has joined #RubyOnRails
[16:27:03] bronson: has joined #RubyOnRails
[16:41:22] FrostCandy: has joined #RubyOnRails
[16:46:18] jottr: has joined #RubyOnRails
[16:48:51] [Butch]: has joined #RubyOnRails
[17:02:53] universa1: has joined #RubyOnRails
[17:03:54] reber: has joined #RubyOnRails
[17:04:31] Puffball: has joined #RubyOnRails
[17:09:36] lostapathy: has joined #RubyOnRails
[17:10:42] lostapathy: Has anybody seen activestorage throwing ActiveSupport::MessageVerifier::InvalidSignature on any request to get the attachment?
[17:10:46] morfin: nothing changed except name in FactoryBot right =)
[17:11:56] lostapathy: I get that on 5.2.0beta2, but I get a 404 if I run off edge.
[17:18:36] starseed00: has left #RubyOnRails: ()
[17:18:37] starseed00: has joined #RubyOnRails
[17:19:02] NoGodDamnIdea: has joined #RubyOnRails
[17:19:29] starseed00: Can anyone give me any hints as to why my unicorn would be logging all requests (even 200 responses) to my unicorn.stderr.log? I do *not* have stdout_path set to stderr.log
[17:19:53] starseed00: Or has unicorn always logged all requests to stderr and I just never noticed? Seems silly to me for it to be doing that...
[17:27:46] bronson: has joined #RubyOnRails
[17:29:02] fmcgeough: has joined #RubyOnRails
[17:30:38] darkhanb: has joined #RubyOnRails
[17:33:42] DTZUZO: has joined #RubyOnRails
[17:34:39] alfiemax: has joined #RubyOnRails
[17:36:08] marr: has joined #RubyOnRails
[17:38:02] JusticeFries: has joined #RubyOnRails
[17:41:52] dionysus69: has joined #RubyOnRails
[17:42:23] orbyt_: has joined #RubyOnRails
[17:52:02] za1b1tsu: has joined #RubyOnRails
[17:53:05] JusticeFries: has joined #RubyOnRails
[17:56:14] apeiros: has joined #RubyOnRails
[18:05:18] alfiemax: has joined #RubyOnRails
[18:11:05] za1b1tsu: I'm looking for some info about creating cleanly multiple models to test a service object found this answer:
[18:11:06] za1b1tsu: you can generate helper methods, where you separate your factory girl code, for example def generate_project_with_indexes ... end def generate_project_with_companies .. end, and so on. through this you minimize your code.. but if your app grows, your test code also grows, that´s normal. so you are not doing things false
[18:11:24] za1b1tsu: but can't find anywhere an example about using helper methods with factorybot
[18:11:30] za1b1tsu: anyone has an example?
[18:21:47] apeiros: has joined #RubyOnRails
[18:26:34] dblessing: has joined #RubyOnRails
[18:27:55] chouhoulis: has joined #RubyOnRails
[18:28:06] JusticeFries: has joined #RubyOnRails
[18:28:33] bronson: has joined #RubyOnRails
[18:36:01] DoubleMalt: has joined #RubyOnRails
[18:36:51] mcr: has joined #RubyOnRails
[18:39:49] desperek: has joined #RubyOnRails
[18:45:04] jscheel: has joined #RubyOnRails
[18:47:58] amperry: has joined #RubyOnRails
[18:48:40] DTZUZO: has joined #RubyOnRails
[18:49:06] amperry: hi folks, got a question about the most efficient way to get a set of results by association value and their counts. I can do it in a loop, but it's horribly inefficient. Gist here: https://gist.github.com/amp108/c2c21b5cc7d78f659b137d73c7290234
[18:54:35] aiguuu: has joined #RubyOnRails
[18:54:59] srinidhi: has joined #RubyOnRails
[19:01:23] orbyt_: has joined #RubyOnRails
[19:02:33] sameerynho: has joined #RubyOnRails
[19:04:12] ur5us: has joined #RubyOnRails
[19:27:44] safetypin: has joined #RubyOnRails
[19:29:23] bronson: has joined #RubyOnRails
[19:29:27] hfp_work: has joined #RubyOnRails
[19:34:17] defsdoor: has joined #RubyOnRails
[19:39:08] srinidhi: has joined #RubyOnRails
[19:54:34] crst: What is the terminology of having a method in the model file like this: `def test; "AAA" ;end` what gives: `Model.last.test => "AAA"`
[19:58:25] havenwood: crst: An instance method.
[20:02:12] crst: Ah ok, thanks. I can call the instance method this way and get a result in the console, but when I use ajax-datatables-rails I get: PG::UndefinedColumn ERROR: column Model.test does not exist I think that's because it's not really a column of the model. Is there a way to attach the instance method that it behaves like a virtual column?
[20:05:16] brent__: has joined #RubyOnRails
[20:05:40] crst: My current query is like this: Model.includes(:client_company).where(status: 'paid').references(:client_company).distinct
[20:05:46] KeyJoo: has joined #RubyOnRails
[20:08:30] DTZUZO: has joined #RubyOnRails
[20:10:29] ur5us: has joined #RubyOnRails
[20:10:32] brent__: I'm having a bing scraper cause throw a COR error
[20:11:17] mtkd: has joined #RubyOnRails
[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 }`
[20:12:00] vulgrin: has joined #RubyOnRails
[20:12:16] ur5us: has joined #RubyOnRails
[20:13:19] darkhanb: has joined #RubyOnRails
[20:15:08] sameerynho: has joined #RubyOnRails
[20:19:40] darkhanb: has joined #RubyOnRails
[20:22:19] sameerynho: has joined #RubyOnRails
[20:26:05] darkhanb: has joined #RubyOnRails
[20:31:06] bronson: has joined #RubyOnRails
[20:31:07] darkhanb_: has joined #RubyOnRails
[20:33:10] gambl0re: has joined #RubyOnRails
[20:38:03] orbyt_: has joined #RubyOnRails
[20:39:23] desperek: could someone advise me how do i do these migrations correctly?
[20:39:34] desperek: i am struggling with references (because i write them by hand)
[20:43:04] desperek: db:migrate stopped working ;-;
[20:45:55] fl4sh_: has joined #RubyOnRails
[20:46:16] desperek: and nothing works now
[20:46:24] desperek: since i deleted schema.rb in order to recreate things
[20:48:02] desperek: for nnow, i have a problem with creating tables - db:migrate refuses to do that
[20:48:36] DoubleMalt: has joined #RubyOnRails
[20:57:09] desperek: ah, works now
[21:02:39] jottr: has joined #RubyOnRails
[21:10:35] w0rd-driven: has joined #RubyOnRails
[21:14:54] jrp93: has joined #RubyOnRails
[21:23:51] amperry: If I have a Lease object with many MonthlyChare associations and I want to create a new lease with the same or very similar charges, would I do something like "lease.monthly_charges.each do |mc|; new_charge = mc.dup; new_charge.lease_id = new_lease; end"?
[21:24:45] amperry: or, if the new_lease weren't saved, would that just be new_charge.lease = new_lease?
[21:31:51] bronson: has joined #RubyOnRails
[21:37:07] tycoon177: is there a way to have rails include the count of a relationship in a query? i know you can say Model.includes(:relation) to have the full relation model be loaded, but lets say i just need the count of :relation for many Model objects. Is there a built in way to pre-fetch this?
[21:40:08] amperry: tycoon177: I think you want to use the "belongs_to ... counter_cache: true" option
[21:40:42] sawdustofmind: has left #RubyOnRails: ()
[21:40:42] tycoon177: amperry: ah, so a counter cache is the best way to do this? which would require a column to be added :/ hmm, i'm not sure if it's worth it
[21:41:22] amperry: I have no idea if it's the best way :P, but it's *a* way
[21:41:58] amperry: you can add counts to your query, but I always end up struggling with the syntax on that
[21:47:05] Cache_Money: has joined #RubyOnRails
[21:53:13] Cache_Money: has joined #RubyOnRails
[21:53:24] SteenJobs: has joined #RubyOnRails
[21:56:30] JusticeFries: has joined #RubyOnRails
[21:59:45] orbyt_: has joined #RubyOnRails
[22:02:18] Cache_Money: has joined #RubyOnRails
[22:09:42] weathermaker: has joined #RubyOnRails
[22:15:55] mtkd: has joined #RubyOnRails
[22:16:22] fmcgeough: has joined #RubyOnRails
[22:18:07] JusticeFries: has joined #RubyOnRails
[22:18:09] npgm: has joined #RubyOnRails
[22:19:17] Derperperd: has joined #RubyOnRails
[22:26:22] FastJack: has joined #RubyOnRails
[22:31:52] Cache_Money: has joined #RubyOnRails
[22:31:57] uks: has joined #RubyOnRails
[22:32:39] bronson: has joined #RubyOnRails
[22:32:45] baweaver: has left #RubyOnRails: ("Textual IRC Client: www.textualapp.com")
[22:32:47] baweaver: has joined #RubyOnRails
[22:35:04] alfiemax: has joined #RubyOnRails
[22:37:27] zwliew: has joined #RubyOnRails
[22:37:56] orbyt_: has joined #RubyOnRails
[22:41:58] amperry: hey folks, I'm trying to copy a bunch of associations from an existing object to a new one: "placement.monthly_charges.each do |mc|; new_charge = mc.clone; new_charge.placement = new_placement; end"
[22:42:50] amperry: placement has_one :lease, and has_many :monthly_charges, but when I try to save it, I get the error: "Validation failed: Lease monthly charges placement must exist"
[22:43:31] amperry: and I think I see what I forgot to do... hrm
[22:47:57] DTZUZO: has joined #RubyOnRails
[22:48:50] krawchyk: has joined #RubyOnRails
[22:49:15] amperry: nope... question: how do you dup a bunch of associations into a new object, in general?
[22:52:31] ahrs: has joined #RubyOnRails
[22:52:41] loglaunch: has joined #RubyOnRails
[22:53:16] Kilobyte22: has joined #RubyOnRails
[22:53:21] Scient: has joined #RubyOnRails
[22:53:47] Radar: amperry: can you gist the full code please?
[22:57:09] Axsuul: has joined #RubyOnRails
[22:57:24] desperek: has joined #RubyOnRails
[22:57:26] arBmind: has joined #RubyOnRails
[22:59:24] amperry: Radar: sure, it'll be a moment
[23:18:21] amperry: Radar: here it is: https://gist.github.com/amp108/8e923c2e38399375a28d6fee75070e8e
[23:22:20] Radar: https://gist.github.com/amp108/8e923c2e38399375a28d6fee75070e8e#file-transfer_residents-rb-L39-L41
[23:22:22] Radar: Guessing it is this?
[23:22:41] Radar: What do the MonthlyCharge objects look like after that call?
[23:22:49] Radar: p new_placement.monthly_charges
[23:25:46] alfiemax: has joined #RubyOnRails
[23:25:46] amperry: it's actually on the new_placement.save! line, but let me take a look at the charges before that point.
[23:26:08] amperry: I'll add the output to the gist.
[23:27:25] amperry: Radar: https://gist.github.com/amp108/8e923c2e38399375a28d6fee75070e8e#file-ap_monthly_charges-txt
[23:27:50] Radar: Do those look valid to you?
[23:28:19] Radar: I don't know enough about the app to tell.
[23:29:07] Cache_Money: has joined #RubyOnRails
[23:29:08] amperry: they look *mostly* fine, although I see they have a placement_id and a lease_id (the latter of which they shouldn't need), and the lease_id is for the old lease.
[23:33:23] bronson: has joined #RubyOnRails
[23:35:07] JusticeFries: has joined #RubyOnRails
[23:36:32] amperry: I really don't understand what that HasManyThroughCantAssociateThroughHasOneOrManyReflection error means, though.
[23:36:40] Radar: me either :D
[23:41:35] Smedley_: has joined #RubyOnRails
[23:42:57] Smedley_: is anyone here, this is my first time ?
[23:45:05] zacts: has joined #RubyOnRails
[23:47:20] amperry: Smedley_: people are here
[23:47:34] amperry: don't know if any of us can help you, but some are here
[23:49:47] Smedley_: Does anyone know how to best practices for speeding up rails in producting the rendering of my images are slow for my website: http://psychowarfare.com/
[23:52:21] sdrew: has joined #RubyOnRails
[23:54:53] orbyt_: has joined #RubyOnRails
[23:59:06] fryguy: how are you rendering the images now?