« Back to channel list

#RubyOnRails - 22 February 2018

« Back 1 day Forward 1 day »
[00:03:08] tcopeland: has joined #RubyOnRails
[00:03:36] mikecmpbll: has joined #RubyOnRails
[00:03:41] ebsen: has joined #RubyOnRails
[00:07:22] blackcross: Which one is considered an app? rails new NAME or rails generate scaffold NAME ?
[00:09:11] hndk: has joined #RubyOnRails
[00:09:23] blackcross: A better question would be, "How do I generate a app inside of an already existing project that only has a JSON index?" The database would be populated through rails console and never be updated through the JSON.
[00:15:12] havenwood: blackcross: `rails new` creates a new app. `rails g scaffold` "scaffolds" a resource in an existing app - creating model/migration/controller/tests for the current app
[00:15:31] alfiemax: has joined #RubyOnRails
[00:15:36] havenwood: blackcross: You can't run `rails generate` outside of an app. it makes no sense to run `rails new` inside an app.
[00:16:01] havenwood: blackcross: see: rails generate scaffold --help
[00:17:29] havenwood: blackcross: TL;DR: "Generating an app" means creating a new app. It's fine to generate new resources in the app that exists.
[00:18:17] havenwood: I'd suggest reading a few tutorials showing how to add resources to an existing app.
[00:21:42] MrPunkin: has joined #RubyOnRails
[00:30:04] ebsen: has joined #RubyOnRails
[00:30:05] mrbubbles: Hmm trying to run a Spree installer... getting a weird error: append public/robots.txt The file /Users/joe/.rbenv/versions/2.4.3/lib/ruby/gems/2.4.0/bundler/gems/alchemy-solidus-0906127071ca/public/robots.txt does not appear to exist
[00:30:19] mrbubbles: It's like it's looking inside another gem folder rather than in the root of the project :(
[00:31:03] elcontrastador: has joined #RubyOnRails
[00:33:05] MrPunkin: Trying to upgrade from rails 4.2 to rails 5 but I’m getting an odd “TypeError: can't quote Hash” error in one of my unit tests. The full blocktrace makes it seem as though it’s an issue with quoting some of the arel / to_sql stuff perhaps but never takes me further into my own code than just the line in my unit test where I call the class method:
[00:33:05] MrPunkin: https://gist.github.com/mrpunkin/107459f95c4e97125a1bcb4004df00f0
[00:34:02] MrPunkin: If I replace the assertions with any sort of thing such as even just “puts to_reconcile.count “ I get the same error. But I can call Product::to_reconcile within console just fine with valid output and it returns a valid AR::Relation
[00:40:09] LightStalker: has joined #RubyOnRails
[00:47:33] safetypin: has joined #RubyOnRails
[00:48:27] cagomez: has joined #RubyOnRails
[00:55:23] alfiemax: has joined #RubyOnRails
[01:07:10] sunrunner20: has joined #RubyOnRails
[01:07:25] sevenseacat: has joined #RubyOnRails
[01:07:53] ebsen: has joined #RubyOnRails
[01:08:32] orbyt_: has joined #RubyOnRails
[01:19:09] cagomez: has joined #RubyOnRails
[01:21:33] Rodya_: has joined #RubyOnRails
[01:21:40] cagomez: has joined #RubyOnRails
[01:27:54] Rodya_: has joined #RubyOnRails
[01:28:25] cagomez: has joined #RubyOnRails
[01:32:06] emachnic: has joined #RubyOnRails
[01:32:19] Rodya_: has joined #RubyOnRails
[01:35:16] orbyt_: has joined #RubyOnRails
[01:38:09] quazimodo: has joined #RubyOnRails
[01:43:12] Rodya_: has joined #RubyOnRails
[01:47:31] cagomez: has joined #RubyOnRails
[01:51:42] Rodya_: has joined #RubyOnRails
[01:53:03] STYNC: has joined #RubyOnRails
[01:59:19] alfiemax: has joined #RubyOnRails
[02:01:13] ome: has joined #RubyOnRails
[02:02:21] Rodya_: has joined #RubyOnRails
[02:11:52] Rodya_: has joined #RubyOnRails
[02:16:12] lupine: has joined #RubyOnRails
[02:17:20] ebsen: has joined #RubyOnRails
[02:20:24] Rodya_: has joined #RubyOnRails
[02:21:10] kanzure: has joined #RubyOnRails
[02:38:12] EXCHGR: has joined #RubyOnRails
[02:40:33] orbyt_: has joined #RubyOnRails
[02:44:22] Rodya_: has joined #RubyOnRails
[02:48:34] fragamus: has joined #RubyOnRails
[02:48:54] Rodya_: has joined #RubyOnRails
[02:50:01] ebsen: has joined #RubyOnRails
[02:50:23] alfiemax: has joined #RubyOnRails
[02:53:16] lupine: has joined #RubyOnRails
[02:54:51] cagomez: has joined #RubyOnRails
[03:00:05] AntiSpamMeta2: has joined #RubyOnRails
[03:01:04] nef_learner: has joined #RubyOnRails
[03:01:24] nef_learner: Question: what is the difference between helper files, and controller files?
[03:01:53] nef_learner: I figure, controller files, having been generated by RoR, serve a lot of backend purposes.
[03:02:15] nef_learner: where as, helper files/functions, are called by that specific controller
[03:02:22] nef_learner: and then used in scope
[03:02:41] sevenseacat: helper functions are used to extract common logic from views into reusable functions
[03:03:37] nef_learner: when you define a function in the controller, what does it actually do?
[03:03:38] nef_learner: https://www.railstutorial.org/book/sign_up#sec-rails_environments
[03:03:46] nef_learner: im using this tutorial, for reference
[03:03:47] sevenseacat: by itself, nothing
[03:04:21] sevenseacat: unless you call it
[03:09:57] kapil___: has joined #RubyOnRails
[03:11:19] alfiemax: has joined #RubyOnRails
[03:13:43] srinidhi: has joined #RubyOnRails
[03:16:38] Radar: nef_learner: doesn't the book explain what an action is?
[03:17:39] Radar: oh no, it doesn't. Around Listing 1.7 it does the classic tech book trope of "just write this code and it will work glhf"
[03:17:51] sevenseacat: I hateeeee that trope
[03:18:01] Radar: If only there was a better book out there. Oh well.
[03:18:08] helpa: Rails 4 in Action - http://manning.com/bigg2 - An excellent book combining Rails and TDD/BDD development. Written by Rebecca Skinner, Steve Klabnik, Ryan Bigg, Yehuda Katz
[03:18:57] darkhanb: has joined #RubyOnRails
[03:19:18] sevenseacat: I'm not a fan of recommending it anymore, given its getting a bit out of date
[03:19:24] Radar: Time to update it?
[03:20:05] sevenseacat: maybe I should aim a new one for Rails 6
[03:22:31] hive-mind: has joined #RubyOnRails
[03:26:54] ebsen: has joined #RubyOnRails
[03:35:33] alfiemax: has joined #RubyOnRails
[03:52:50] nef_learner: any other resources
[03:52:58] nef_learner: Thank you for the recommendation by the way
[03:53:10] nef_learner: I'm also trying to dive into Javascript (react/node)
[04:01:50] Radar: nef_learner: I'd recommend learning one thing at a time. Way easier to manage.
[04:01:53] Radar: nef_learner: !guides
[04:01:53] helpa: nef_learner: http://guides.rubyonrails.org/ - Ruby on Rails guides. Recommended reading.
[04:16:00] Saukk: has joined #RubyOnRails
[04:25:16] trautwein: has joined #RubyOnRails
[04:27:48] kies: has joined #RubyOnRails
[04:29:56] ghormoon: has joined #RubyOnRails
[04:30:52] cagomez: has joined #RubyOnRails
[04:49:36] zacts: has joined #RubyOnRails
[05:08:09] alfiemax: has joined #RubyOnRails
[05:37:55] fragamus: has joined #RubyOnRails
[05:38:44] aguestuser: has joined #RubyOnRails
[05:40:26] sidx64: has joined #RubyOnRails
[05:46:06] emachnic: has joined #RubyOnRails
[06:11:25] conta: has joined #RubyOnRails
[06:26:54] hd1: has joined #RubyOnRails
[06:27:34] fp-: has joined #RubyOnRails
[06:42:10] mtkd: has joined #RubyOnRails
[06:54:54] emachnic: has joined #RubyOnRails
[06:57:35] darkhanb: has joined #RubyOnRails
[07:01:09] darkhanb: has joined #RubyOnRails
[07:02:58] aiguuu: has joined #RubyOnRails
[07:11:40] darkhanb: has joined #RubyOnRails
[07:11:41] aiguuu: has joined #RubyOnRails
[07:11:59] sidx64_: has joined #RubyOnRails
[07:12:55] srinidhi: has joined #RubyOnRails
[07:13:44] srinidhi: has joined #RubyOnRails
[07:15:10] sidx64: has joined #RubyOnRails
[07:30:20] Tempesta: has joined #RubyOnRails
[07:37:21] apeiros: has joined #RubyOnRails
[07:42:05] chuchiperriman: has joined #RubyOnRails
[07:59:12] bijan_: has joined #RubyOnRails
[08:08:11] emachnic: has joined #RubyOnRails
[08:11:30] darkhanb: has joined #RubyOnRails
[08:14:21] defsdoor: has joined #RubyOnRails
[08:17:49] darkhanb: has joined #RubyOnRails
[08:28:05] dionysus69: has joined #RubyOnRails
[08:39:12] mtkd: has joined #RubyOnRails
[08:41:32] sidx64: has joined #RubyOnRails
[08:42:37] gambl0re: has joined #RubyOnRails
[08:42:41] Rodya_: has joined #RubyOnRails
[08:47:47] emachnic: has joined #RubyOnRails
[08:48:18] marr: has joined #RubyOnRails
[08:54:50] rorymckinley: has joined #RubyOnRails
[08:56:17] rorymckinley: Hello - has anybody ever come across a thread deadlock scenario when ActiveRecord::ConnectionAdapters::ConnectionPool#checkin runs?
[08:56:58] rorymckinley: From the code it looks as if it is the connection itself that is deadlocking, rather than the ConnectionPool - but I am rather in the dark at this point
[09:02:59] rietta: has joined #RubyOnRails
[09:03:18] srinidhi: has joined #RubyOnRails
[09:06:02] dminuoso: rorymckinley: Can you explain more about the deadlock? Do you have a stack trace? Are we talking about driver or database deadlocks?
[09:12:01] mikecmpbll: has joined #RubyOnRails
[09:19:44] mitt3ns: has joined #RubyOnRails
[09:25:22] Ergo: has joined #RubyOnRails
[09:28:44] rorymckinley: diminuoso: https://gist.github.com/rorymckinley/8d56d79d73c71c3a35a0dcef5a02d516
[09:29:57] rorymckinley: It is a deadlock on a Mutex on the connection - in a codebase that I have a total of about 3 hours exposure to (thanks to this issue).
[09:32:20] dminuoso: rorymckinley: At this point please tell us a bit more about your general setup.
[09:32:52] dminuoso: What database adapter are you using? How is it configured? What application server are you using? How is that configured? Do you use any exotic gems?
[09:37:36] dminuoso: rorymckinley: I would at this point start debugging all current threads to determine how the deadlock arises.
[09:38:19] dminuoso: rorymckinley: In order to do that you can simply call the C function `rb_backtrace()` from gdb.
[09:41:43] morantron: has joined #RubyOnRails
[09:42:07] morantron: hi! is there a way to store enum values as a string when using ActiveRecord::Enum?
[09:42:14] dminuoso: morantron: Yes.
[09:43:00] dminuoso: morantron: You just specifiy: enum status: { active: "ReallyActive", inactive: "KindOfInactive" }
[09:43:26] rorymckinley: dminuoso, thanks - I am lacking a lot of data (still) at this point - but will take a look at `rb_backtrace()`.
[09:43:36] morantron: dminuoso: key and value must be different?
[09:43:45] dminuoso: morantron: No.
[09:43:56] dminuoso: morantron: the key is just how its mapped to rails, and the value is how its represented.
[09:44:00] riotjones: has joined #RubyOnRails
[09:44:02] morantron: i'm trying something similar to that
[09:44:19] dminuoso: morantron: So you can pick whatever you want (as long as it fits in the database column somehow)
[09:44:28] dminuoso: active: "active", inactive: "inactive" is fine
[09:44:37] morantron: hmmm, i'm using symbols instead of strings, dunno if that's the problem
[09:44:40] morantron: gonna try again
[09:44:43] morantron: thanks dminuoso
[09:45:02] Rodya_: has joined #RubyOnRails
[09:45:07] dminuoso: morantron: What is the problem you are experiencing?
[09:45:28] dminuoso: rorymckinley: It wont help you necessarily directly solve the problem, but it will help you identify what the problem is.
[09:45:30] morantron: oh, that was the problem!
[09:45:58] morantron: dminuoso: a was using a hash with this form {active: :active, inactive: :inactive}
[09:46:01] dminuoso: rorymckinley: If its a real deadlock then you will have two or more threads all blocking on some locks.
[09:46:39] dminuoso: So it'd be important to identify those threads and the stack traces to understand how the deadlock arises.
[09:47:01] morantron: scopes where working ( Thing.active, Thing.inactive ), but instance methods werent ( thing_instance.active?, thing_instance.inactive? ) all returned false, and thing_instance.status just returned nil
[09:47:19] dminuoso: morantron: strictly speaking they are not scopes
[09:47:37] morantron: static methods then
[09:47:42] morantron: well, that thing
[09:47:51] dminuoso: morantron: No they are scopes.
[09:48:09] morantron: thank you for your help dminuoso
[09:48:41] emachnic: has joined #RubyOnRails
[09:49:53] mtkd: has joined #RubyOnRails
[10:18:22] Fusselgesicht: has joined #RubyOnRails
[10:45:43] Rodya_: has joined #RubyOnRails
[10:49:51] alfiemax: has joined #RubyOnRails
[10:49:54] reber: has joined #RubyOnRails
[10:50:16] kapil___: has joined #RubyOnRails
[10:58:10] helpa-bot: has joined #RubyOnRails
[10:58:55] Kilo`byt-: has joined #RubyOnRails
[11:00:04] codelahoma: has joined #RubyOnRails
[11:00:06] cgfbee: has joined #RubyOnRails
[11:00:30] helpa: has joined #RubyOnRails
[11:00:31] Alchemical: has joined #RubyOnRails
[11:03:08] arBmind: has joined #RubyOnRails
[11:04:01] LenPayne: has joined #RubyOnRails
[11:11:50] hfp_work: has joined #RubyOnRails
[11:17:04] conta: has joined #RubyOnRails
[11:18:05] emachnic: has joined #RubyOnRails
[11:21:07] helpa: has joined #RubyOnRails
[11:25:16] helpa-bot: has joined #RubyOnRails
[11:29:24] helpa-bot: has joined #RubyOnRails
[11:31:10] prooftechnique_: has joined #RubyOnRails
[11:31:26] helpa-bot: has joined #RubyOnRails
[11:35:26] helpa: has joined #RubyOnRails
[11:36:51] DrYockel: has joined #RubyOnRails
[11:37:34] Alchemic: has joined #RubyOnRails
[11:46:27] Rodya_: has joined #RubyOnRails
[12:01:44] snickers: has joined #RubyOnRails
[12:03:56] roshanavand: has joined #RubyOnRails
[12:10:01] S007: has joined #RubyOnRails
[12:15:21] sidx64: has joined #RubyOnRails
[12:17:18] mtkd: has joined #RubyOnRails
[12:26:28] mostlybadfly: has joined #RubyOnRails
[12:31:14] emachnic: has joined #RubyOnRails
[12:36:19] emachnic: has joined #RubyOnRails
[12:41:57] apparition: has joined #RubyOnRails
[12:47:09] Rodya_: has joined #RubyOnRails
[12:53:26] Travis-42: has joined #RubyOnRails
[12:54:52] pfg: has joined #RubyOnRails
[12:56:38] LyndsySimon: has joined #RubyOnRails
[12:58:18] alfiemax: has joined #RubyOnRails
[13:00:58] emachnic: has joined #RubyOnRails
[13:02:48] mtkd: has joined #RubyOnRails
[13:11:20] alfiemax: has joined #RubyOnRails
[13:14:28] emachnic: has joined #RubyOnRails
[13:25:05] lxsameer: has joined #RubyOnRails
[13:28:56] alfiemax: has joined #RubyOnRails
[13:46:21] catphish: has joined #RubyOnRails
[13:47:50] mikecmpbll: has joined #RubyOnRails
[13:47:56] Rodya_: has joined #RubyOnRails
[13:48:04] hmaronon: has joined #RubyOnRails
[13:55:23] agent_white: has joined #RubyOnRails
[13:56:43] arpu: has joined #RubyOnRails
[14:00:08] micmus: has joined #RubyOnRails
[14:00:46] alfiemax: has joined #RubyOnRails
[14:03:33] naztharune: has joined #RubyOnRails
[14:09:20] alfie: has joined #RubyOnRails
[14:09:59] mtkd: has joined #RubyOnRails
[14:13:55] alfiemax: has joined #RubyOnRails
[14:18:02] tcopeland: has joined #RubyOnRails
[14:24:04] bijan_: has joined #RubyOnRails
[14:41:16] safetypin: has joined #RubyOnRails
[14:42:00] lxsameer: has joined #RubyOnRails
[14:48:42] Rodya_: has joined #RubyOnRails
[14:49:35] mtkd: has joined #RubyOnRails
[15:05:17] arBmind: has joined #RubyOnRails
[15:05:36] [Butch]: has joined #RubyOnRails
[15:10:29] lxsameer: has joined #RubyOnRails
[15:16:23] tcopeland: has joined #RubyOnRails
[15:36:20] kapil___: has joined #RubyOnRails
[15:44:32] snickers: has joined #RubyOnRails
[15:44:55] mikecmpbll: has joined #RubyOnRails
[15:55:58] krawchyk: has joined #RubyOnRails
[15:58:17] dviola: has joined #RubyOnRails
[15:58:17] mikecmpbll: has joined #RubyOnRails
[16:13:28] choke: has joined #RubyOnRails
[16:31:09] choke: has joined #RubyOnRails
[16:32:01] LateralOctober: has joined #RubyOnRails
[16:43:54] snickers: has joined #RubyOnRails
[16:43:55] orbyt_: has joined #RubyOnRails
[16:45:10] RougeR: has joined #RubyOnRails
[16:46:17] crankharder: has joined #RubyOnRails
[16:47:03] Rodya_: has joined #RubyOnRails
[16:53:55] uks: has joined #RubyOnRails
[16:54:49] mtkd: has joined #RubyOnRails
[16:55:32] cagomez: has joined #RubyOnRails
[16:56:49] [Butch]: has joined #RubyOnRails
[17:01:16] xibalba: has joined #RubyOnRails
[17:02:36] apeiros_: has joined #RubyOnRails
[17:09:16] fryguy: has joined #RubyOnRails
[17:13:14] desperek: has joined #RubyOnRails
[17:15:02] one_zero: has joined #RubyOnRails
[17:21:17] troys: has joined #RubyOnRails
[17:23:49] jnollette: has joined #RubyOnRails
[17:25:43] mtkd: has joined #RubyOnRails
[17:30:21] Cache_Money: has joined #RubyOnRails
[17:38:16] darkhanb: has joined #RubyOnRails
[17:41:47] Rodya_: has joined #RubyOnRails
[18:01:07] Cavallari: has joined #RubyOnRails
[18:02:12] krawchyk_: has joined #RubyOnRails
[18:03:38] Rodya_: has joined #RubyOnRails
[18:10:01] m_utley: has joined #RubyOnRails
[18:17:30] Saukk: has joined #RubyOnRails
[18:19:40] kies: has joined #RubyOnRails
[18:26:35] fl4sh_: has joined #RubyOnRails
[18:29:49] one_zero: has joined #RubyOnRails
[18:40:44] alfiemax: has joined #RubyOnRails
[18:41:08] _aeris_: has joined #RubyOnRails
[18:46:20] espressocannon: has joined #RubyOnRails
[18:46:29] emachnic: has joined #RubyOnRails
[18:46:36] espressocannon: h. I am the newest to rails
[18:46:56] espressocannon: I got a question about a reference for database table ummm... column? types
[18:47:11] espressocannon: that is. I can't seem to find a reference
[18:47:55] jnollette: has joined #RubyOnRails
[18:49:04] _aeris_: has joined #RubyOnRails
[18:52:10] riotjoe: has joined #RubyOnRails
[18:53:16] marr: has joined #RubyOnRails
[18:55:08] espressocannon: am i crazy or is the only refrence from a prev version
[18:55:09] espressocannon: http://guides.rubyonrails.org/v3.2/migrations.html
[18:57:31] espressocannon: im sure it hasn't changed, but, I just spent like an hour carefully reading the current active record documentation searching for it. (im a slow reader so that doesn't help)
[18:57:46] cagomez: has joined #RubyOnRails
[18:57:48] dionysus69: has joined #RubyOnRails
[18:58:09] apeiros: espressocannon: you're not crazy. it is 2 versions ago.
[18:58:33] apeiros: types might be database dependent. I spend a minute or two before when you asked in #ruby and found nothing on the rails guides.
[18:58:39] apeiros: so… which db are you using?
[18:58:49] espressocannon: built in sqlite
[18:58:54] espressocannon: i am also a database noob
[18:58:57] fryguy: http://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/SchemaStatements.html#method-i-add_column
[18:59:35] espressocannon: just in more of a reference material instaed of the guide
[18:59:37] cagomez: has joined #RubyOnRails
[19:00:05] espressocannon: so it's dependent on the database type is it
[19:01:17] guacamole: has joined #RubyOnRails
[19:03:00] krawchyk: has joined #RubyOnRails
[19:04:19] uksio: has joined #RubyOnRails
[19:05:01] aguestuser: has joined #RubyOnRails
[19:05:17] sameerynho: has joined #RubyOnRails
[19:06:35] contradictioned: has joined #RubyOnRails
[19:07:55] contradictioned: Where's the best place to report text issues in the guides?
[19:08:09] cagomez: has joined #RubyOnRails
[19:09:33] mikecmpbll: has joined #RubyOnRails
[19:09:53] tvon: has joined #RubyOnRails
[19:12:39] dviola: has joined #RubyOnRails
[19:13:57] riotjones: has joined #RubyOnRails
[19:16:58] Cache_Money: has joined #RubyOnRails
[19:25:55] Rodya_: has joined #RubyOnRails
[19:27:27] bonhoeffer: has joined #RubyOnRails
[19:30:52] mtkd: has joined #RubyOnRails
[19:31:54] cagomez: has joined #RubyOnRails
[19:34:21] bonhoeffer: has left #RubyOnRails: ()
[19:40:04] morenoh149: has joined #RubyOnRails
[19:40:52] tvon: has left #RubyOnRails: ("Peace out, y'all!")
[19:43:07] aguestuser: has joined #RubyOnRails
[19:48:33] Cache_Money: has joined #RubyOnRails
[19:49:04] havenwood: contradictioned: http://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#contributing-to-the-rails-documentation
[19:50:37] dtzuzu: has joined #RubyOnRails
[19:53:01] Cavallari1: has joined #RubyOnRails
[19:54:31] sidx64: has joined #RubyOnRails
[19:56:55] cagomez: has joined #RubyOnRails
[19:58:11] cagomez: has joined #RubyOnRails
[20:09:16] Cavallari1: has joined #RubyOnRails
[20:19:41] havenwood: has joined #RubyOnRails
[20:40:49] cagomez: has joined #RubyOnRails
[20:41:58] reber: has joined #RubyOnRails
[20:45:41] rikkipitt: has joined #RubyOnRails
[20:48:53] sameerynho: has joined #RubyOnRails
[20:52:07] rikkipitt: has joined #RubyOnRails
[20:52:41] nef_learner: has joined #RubyOnRails
[20:53:37] Rodya_: has joined #RubyOnRails
[20:56:43] cagomez: has joined #RubyOnRails
[20:57:14] dviola: has joined #RubyOnRails
[20:57:26] rikkipitt: has joined #RubyOnRails
[20:57:29] Andr3as: hello everyone.. i've got a strange issue and dont know whats wrong
[20:58:02] Andr3as: i have a js file with 2 functions.. one of em will be executed when i load the page, the other will not, for some reason
[20:58:27] Andr3as: if i copy it from the js file into the browser console, i can execute it jsut fine
[20:58:41] Andr3as: anyone an idea?
[20:59:35] rikkipitt: has joined #RubyOnRails
[21:00:15] rikkipitt: has joined #RubyOnRails
[21:00:35] rikkipitt: has joined #RubyOnRails
[21:01:57] tycoon177: Andr3as: yeah, on line 3 you have a syntax error
[21:02:19] Andr3as: right, thatswhy it works when i paste it into the console
[21:02:21] morenoh149: has joined #RubyOnRails
[21:02:38] Andr3as: i think i found the issue.. it was another js file
[21:02:43] tycoon177: Andr3as: no, i can see it right on line 3, it's blatantly obvious
[21:02:48] tycoon177: no, i'm wrong
[21:02:53] tycoon177: you didn't give us ANY CODE
[21:02:59] tycoon177: how are we supposed to tell you what's wrong?
[21:03:43] Andr3as: how can a working code help in that case? but hey, nvm
[21:03:45] rikkipitt: hey folks, what's the best way to handle contextual sidebars according to resource and user type? should i use different layouts or is there an efficient way of using content_for?/yield?
[21:04:42] rikkipitt: there's a few combinations and i can't decide the best way to achieve this
[21:06:11] tycoon177: Andr3as: i have a problem with my controller. it's not executing the code on line 12 but if i put it in the rails console, it runs just fine. what's wrong?
[21:06:41] tycoon177: see how that is full of no useful information without code?
[21:06:55] tycoon177: we need context to answer questions
[21:07:02] Andr3as: that might be a bit different from a js function
[21:07:12] tycoon177: okay, let me rephrase.
[21:07:17] tycoon177: Andr3as: i have a problem with my js. it's not executing the code on line 12 but if i put it in the rails console, it runs just fine. what's wrong?
[21:07:46] Radar: !botsnack
[21:07:46] helpa: Nom nom. Thanks, Radar!
[21:08:02] tycoon177: good job feeding the bot. it was getting hungry
[21:08:26] Radar: Andr3as: !rule3
[21:08:26] helpa: Andr3as: 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.
[21:08:34] Radar: Andr3as: You've been here plenty long to know the rules.
[21:08:38] Dimik: has joined #RubyOnRails
[21:09:15] Andr3as: man, what the actual f is going on...? look for another victim if you wanna screw someone
[21:09:15] Radar: Andr3as: Essentially, it boils down to this: you know the rules, and so do I. We're no strangers to [helping you]
[21:09:31] Radar: Andr3as: Care to continue?
[21:09:36] Radar: I can mute you for a week if you'd like.
[21:09:55] Radar: Andr3as: The rules are there for a very good reason: to ensure that we can give you the best possible help.
[21:10:00] Andr3as: do that.. as long as you guys leave me alone now
[21:10:09] Radar: If you're asking for help with code, it's totally 100% sensible to provide the cod.e
[21:10:37] Radar: Andr3as: Did you want help or not? Did you just want to vent? Was that it?
[21:11:08] Andr3as: Radar: i already said i've found it, that it was another js file whats causing it.. but you guys just didnt stop
[21:11:29] Radar: Andr3as: Because I'd like to really drive that point home before you ask a question next time. And I know there'll be a next time.
[21:11:42] Radar: Andr3as: If I see you ask a question about code again without providing any code it's going to be a straight up mute.
[21:11:57] Radar: You've been here for 2 years. You should know better. End of story.
[21:12:44] cagomez: has joined #RubyOnRails
[21:25:26] gambl0re: has joined #RubyOnRails
[21:26:20] workmad3: has joined #RubyOnRails
[21:29:02] cagomez: has joined #RubyOnRails
[21:31:12] cagomez_: has joined #RubyOnRails
[21:32:51] cagomez: has joined #RubyOnRails
[21:36:02] mtkd: has joined #RubyOnRails
[21:36:43] orbyt_: has joined #RubyOnRails
[22:03:51] Intii: has joined #RubyOnRails
[22:04:17] Intii: Hi everyone, I'm wondering if there is a better way to do this: https://gist.github.com/dsarhadian/4e7437fb057d303b90e764973678dd25
[22:05:00] Intii: "drivers" is an array of drivers that have been pulled from a different API. I loop through each driver and then find all orders belonging to that driver and put everything into one CSV file
[22:06:27] morenoh149: has joined #RubyOnRails
[22:11:50] Radar: Intii: Yes I think there is a better way. I'll see what I can come up with for oyu.
[22:12:34] Intii: Thanks Radar!
[22:12:42] Intii: I always appreciate your help. You teach me a lot!
[22:17:25] tycoon177: Intii: this is nit-picky, but you could probably change your where to `where(swift_driver: driver["identifier"], created_at: @date_from..@date_to)` to make it slightly more readable
[22:17:36] tycoon177: it should generate the same code though
[22:18:11] Radar: Intii: https://gist.github.com/radar/819b0fba6d460163b63078d92d888a15
[22:18:42] Intii: tycoon177: I'll do that! My only concern is that @date_to..@date_from doe > ? AND < ? instead of >= ? and <= ?
[22:19:06] tycoon177: Intii: ... might fix that, but look at Radar's response. I like it a lot more than mine!
[22:19:18] Radar: p.s. the by_star gem is awesome because I wrote it
[22:20:23] Intii: Radar: Cool I'll go through this right now. The by_star gem... does it work without mongoid? The drivers are pulled through an API of a third-party service
[22:20:37] Radar: Intii: by_star works with both mongoid and activerecord
[22:22:32] Intii: Radar: My fault! I completely misunderstood what by_star did. I thought it was a link between mongoid and activerecord, not a gem that helps do time queries. I'll definitely integrate this in my project. Thanks!
[22:42:40] Intii: Radar: I fkin love you man! That change took my request time from 40 seconds to 2
[22:43:52] wethu: has joined #RubyOnRails
[22:46:01] alfiemax: has joined #RubyOnRails
[22:47:19] tycoon177: Radar: if you aren't going to be using order_data in more than one place why not just build the array right into a concat on the csv object? is there some overhead that i'm not thinking of?
[22:49:54] Intii: has joined #RubyOnRails
[22:50:33] Intii: tycoon177: Do you think I should just concat straight to the csv array?
[22:51:17] tycoon177: i'm not sure that there will be much difference. I was mainly wondering what i might be overlooking
[22:51:30] tycoon177: maybe it's just for readability
[22:52:39] Intii: I've just always done it this way... makes reading it easier for me... Not sure of the memory implications though
[22:53:20] tycoon177: i doubt they're big concerns if anything
[22:55:04] alfie: has joined #RubyOnRails
[22:55:47] workmad3: has joined #RubyOnRails
[22:57:08] lupine: has joined #RubyOnRails
[22:57:36] hmaronon: has joined #RubyOnRails
[22:58:17] qyliss_: has joined #RubyOnRails
[22:58:20] guacamole: has joined #RubyOnRails
[22:59:56] roshanavand: has joined #RubyOnRails
[23:00:21] cagomez: has joined #RubyOnRails
[23:04:22] Radar: Intii: Request time is faster probably because it doesn't run so many orders queries. You should probably check to see if you might be able to add indexes to the database to speed it up ... if you have a lot of orders records.
[23:04:27] Radar: p.s. my paypal is paypal.me/ryanbigg
[23:04:39] quazimodo: has joined #RubyOnRails
[23:05:13] cagomez: has joined #RubyOnRails
[23:07:49] Intii: Radar: That's next on my list. Just dn't know which columns to index... I promise, next week I'll shoot some over to you :)
[23:08:56] alfiemax: has joined #RubyOnRails
[23:16:38] one_zero: has joined #RubyOnRails
[23:26:21] cagomez: has joined #RubyOnRails
[23:26:36] Psy-Q: has joined #RubyOnRails
[23:27:41] cagomez: has joined #RubyOnRails
[23:28:26] cagomez: has joined #RubyOnRails
[23:30:02] Intii: I have one more nasty query that I need to fix that I'm stuck on. https://gist.github.com/dsarhadian/be83636f62568a8ef06b25b141933839
[23:30:26] Intii: I tried to do it in the same way as you described earlier Radar, but I kept getting messed up results
[23:30:57] Intii: I can do it with SQL like so: SELECT swift_driver, count(orders.id) as order_count, sum(orders.service_charge) as total_service_charge,sum(orders.total) as order_total FROM "orders" WHERE created_at >= '2018-02-12' AND created_at <= '2018-02-18' GROUP BY swift_driver
[23:31:10] Intii: but that doesn't give me all the drivers who didn't deliver an order
[23:31:25] Intii: Only the ones that did. I still need to list all the drivers and put '0' if they don't have any orders done
[23:36:33] kapil___: has joined #RubyOnRails
[23:38:09] alfiemax: has joined #RubyOnRails
[23:46:24] chouhoulis: has joined #RubyOnRails
[23:51:26] mroutis: has joined #RubyOnRails
[23:51:44] chouhoulis: has joined #RubyOnRails
[23:52:55] espressocannon: has joined #RubyOnRails
[23:53:13] espressocannon: is there a way to check in templates if
[23:53:23] Radar: espressocannon: !enternotspace
[23:53:23] helpa: espressocannon: The enter key should not be used as a space bar. Lines on IRC can be up to 400 characters long.
[23:54:43] espressocannon: if <%= render @posting %> is going to render a single item or iterate thru a list? Currently I wanted to have a partial that would render "show more" if {posting} was an iterate
[23:55:16] espressocannon: should have named it job_posting
[23:57:31] chouhoulis: has joined #RubyOnRails
[23:59:27] mroutis: espressocannon: did you try <%= render @posting.first %> and then checking if @posting.size > 1, then render the "show more" component?