« Back to channel list

#RubyOnRails - 22 January 2018

« Back 1 day Forward 1 day »
[00:00:10] bronson: has joined #RubyOnRails
[00:08:34] mices: has joined #RubyOnRails
[00:09:07] mices: if i wanna use a blog engine to let my users create their own blogs but the engines mountable in routes not in models how do i do it?
[00:09:42] mices: sevenseascat ^
[00:25:06] chouhoulis: has joined #RubyOnRails
[00:25:46] baweaver: has joined #RubyOnRails
[00:36:49] mices: has joined #RubyOnRails
[00:37:49] chouhoulis: has joined #RubyOnRails
[00:41:34] Puffball: has joined #RubyOnRails
[00:50:15] fragamus: has joined #RubyOnRails
[01:05:51] Dreamer3_: has joined #RubyOnRails
[01:07:21] quazimodo: has joined #RubyOnRails
[01:07:57] alfiemax: has joined #RubyOnRails
[01:18:45] Puffball: has joined #RubyOnRails
[01:21:24] elcontrastador: has joined #RubyOnRails
[01:23:54] ahrs: has joined #RubyOnRails
[01:24:31] fragamus: has joined #RubyOnRails
[01:41:35] unreal: has joined #RubyOnRails
[01:44:25] alfiemax: has joined #RubyOnRails
[01:47:27] workmad3: has joined #RubyOnRails
[01:49:19] xuyuheng: has joined #RubyOnRails
[01:53:33] atrius: has joined #RubyOnRails
[02:01:05] bronson: has joined #RubyOnRails
[02:04:08] mtkd: has joined #RubyOnRails
[02:12:00] dviola: has joined #RubyOnRails
[02:26:41] ElFerna: has joined #RubyOnRails
[02:31:47] agent_white: has joined #RubyOnRails
[02:38:49] agent_white: has joined #RubyOnRails
[02:40:27] Puffball: has joined #RubyOnRails
[02:54:00] xuyuheng: has joined #RubyOnRails
[03:17:18] fragamus: has joined #RubyOnRails
[03:29:30] alfiemax: has joined #RubyOnRails
[03:48:18] workmad3: has joined #RubyOnRails
[03:52:47] Exuma: has joined #RubyOnRails
[04:02:40] bronson: has joined #RubyOnRails
[04:06:14] kapil___: has joined #RubyOnRails
[04:08:46] mtkd: has joined #RubyOnRails
[04:18:34] xuyuheng: has joined #RubyOnRails
[04:30:54] alfiemax: has joined #RubyOnRails
[04:43:44] xuyuheng: has joined #RubyOnRails
[05:24:33] alfiemax: has joined #RubyOnRails
[05:24:59] xuyuheng: has joined #RubyOnRails
[05:32:21] xuyuheng: has joined #RubyOnRails
[05:47:52] orbyt_: has joined #RubyOnRails
[05:49:01] workmad3: has joined #RubyOnRails
[05:56:00] fragamus: has joined #RubyOnRails
[06:03:29] bronson: has joined #RubyOnRails
[06:22:14] MrCrackPotBuilde: has joined #RubyOnRails
[06:36:56] darkhanb: has joined #RubyOnRails
[07:01:22] quazimodo: has joined #RubyOnRails
[07:05:29] trautwein: has joined #RubyOnRails
[07:19:59] conta: has joined #RubyOnRails
[07:24:14] beingjohnm: has joined #RubyOnRails
[07:31:05] xuyuheng: has joined #RubyOnRails
[07:44:48] dionysus69: has joined #RubyOnRails
[07:47:57] thejamespinto: has joined #RubyOnRails
[07:49:50] workmad3: has joined #RubyOnRails
[07:51:38] fragamus: has joined #RubyOnRails
[07:55:15] hammer065: has joined #RubyOnRails
[07:57:26] morfin60: has joined #RubyOnRails
[07:58:08] morfin60: what's simpliest way to get current timezone in Rails in format of tzdata? like Europe/Moskow
[08:04:33] bronson: has joined #RubyOnRails
[08:09:39] dionysus69: has joined #RubyOnRails
[08:11:36] Puffball: has joined #RubyOnRails
[08:19:27] Puffball: has joined #RubyOnRails
[08:21:22] darkhanb: has joined #RubyOnRails
[08:23:51] elcontrastador: has joined #RubyOnRails
[08:24:38] S007: has joined #RubyOnRails
[08:25:50] dionysus69: has joined #RubyOnRails
[08:26:58] defsdoor: has joined #RubyOnRails
[08:35:59] S007: has joined #RubyOnRails
[08:39:49] _aeris_: has joined #RubyOnRails
[08:46:53] sidx64: has joined #RubyOnRails
[08:56:56] sidx64: has joined #RubyOnRails
[09:01:07] Puffball: has joined #RubyOnRails
[09:05:47] _aeris_: has joined #RubyOnRails
[09:09:41] marr: has joined #RubyOnRails
[09:13:02] conta: has joined #RubyOnRails
[09:14:15] elcontrastador: has joined #RubyOnRails
[09:18:40] morfin60: how do i migrate data not just schema?
[09:35:02] ahrs: has joined #RubyOnRails
[09:39:37] agent_white: has joined #RubyOnRails
[09:46:27] KeyJoo: has joined #RubyOnRails
[09:50:44] workmad3: has joined #RubyOnRails
[09:52:14] Ergo: has joined #RubyOnRails
[09:55:57] zigzig: has joined #RubyOnRails
[09:56:53] Puffball: has joined #RubyOnRails
[10:05:46] bronson: has joined #RubyOnRails
[10:16:05] Cavallari: has joined #RubyOnRails
[10:20:03] Puffball: has joined #RubyOnRails
[10:25:51] kapil___: has joined #RubyOnRails
[10:28:53] xuyuheng: has joined #RubyOnRails
[10:35:13] hahuang61: has joined #RubyOnRails
[10:37:11] sidx64: has joined #RubyOnRails
[10:43:47] xuyuheng: has joined #RubyOnRails
[10:43:49] hahuang61: has joined #RubyOnRails
[10:49:49] mtkd: has joined #RubyOnRails
[11:02:32] sidx64: has joined #RubyOnRails
[11:14:21] fschuindt: has joined #RubyOnRails
[11:17:57] quazimodo: has joined #RubyOnRails
[11:19:41] segy: has joined #RubyOnRails
[11:20:53] roshanavand: has joined #RubyOnRails
[11:32:45] KeyJoo: has joined #RubyOnRails
[11:41:09] elcontrastador: has joined #RubyOnRails
[11:42:52] sidx64: has joined #RubyOnRails
[11:49:21] roshanavand: has left #RubyOnRails: ()
[11:51:09] thejamespinto: has joined #RubyOnRails
[11:51:34] workmad3: has joined #RubyOnRails
[11:53:49] fschuindt: has joined #RubyOnRails
[11:58:21] roshanavand: has joined #RubyOnRails
[12:06:43] bronson: has joined #RubyOnRails
[12:08:21] sidx64: has joined #RubyOnRails
[12:16:55] apparition: has joined #RubyOnRails
[12:19:32] apeiros: has joined #RubyOnRails
[12:33:14] sidx64: has joined #RubyOnRails
[12:34:25] sidx64: has joined #RubyOnRails
[12:36:36] DrYockel: has joined #RubyOnRails
[12:38:11] mauro1254: has joined #RubyOnRails
[12:38:29] mauro1254: Hi folks, I use LetterOpenerWeb engine in development. LettersController (https://github.com/fgrehm/letter_opener_web/blob/master/app/controllers/letter_opener_web/letters_controller.rb) inherits from ApplicationController (https://github.com/fgrehm/letter_opener_web/blob/master/app/controllers/letter_opener_web/application_controller.rb) defined in the gem, but filters set on ApplicationController of my app are executed... Why?
[12:41:49] jottr_: has joined #RubyOnRails
[12:42:16] za1b1tsu: has joined #RubyOnRails
[12:47:56] tcopeland: has joined #RubyOnRails
[12:54:58] mtkd: has joined #RubyOnRails
[12:57:23] fschuindt: has joined #RubyOnRails
[13:21:31] cgfbee: has joined #RubyOnRails
[13:29:29] jottr_: has joined #RubyOnRails
[13:48:37] roshanavand: has left #RubyOnRails: ()
[13:52:25] workmad3: has joined #RubyOnRails
[13:52:45] Puffball: has joined #RubyOnRails
[13:58:30] dionysus69: has joined #RubyOnRails
[14:03:08] lupine: I'm seeing a strange issue using rspec-set and database_cleaner's deletion strategy where the record is removed in postgresql, but not mysql. worse, not in all mysql versions - I see it in CI but not locally. sound familiar to anyone?
[14:04:32] JJonah: I am using the rails cache (with a file store) while developing (I have turned dev caching on with `bin/rails dev:cache`), but the cache read fails on my 2nd request to it. I set the cache as follows:
[14:04:44] JJonah: Rails.cache.fetch("#{cache_key}/search_results", expires_in: 1.hour) do
[14:04:45] JJonah: search_results
[14:05:03] JJonah: Any idea why this would be working?
[14:06:38] jottr_: has joined #RubyOnRails
[14:07:48] bronson: has joined #RubyOnRails
[14:10:55] tbuehlmann: JJonah: have you restarted the server? also, how's cache_key defined?
[14:12:02] JJonah: tbuehlmann: i don't restart between requests, but i have restarted after making my code changes.
[14:12:18] JJonah: tbuehlmann: cache_key is defined as follows:
[14:12:43] JJonah: `cache_key = Digest::MD5.hexdigest(search_results.to_json)`
[14:13:12] tbuehlmann: I assume it's always the same return value? also, can you check what object Rails.cache returns?
[14:13:13] JJonah: I have verified that the key is the same when setting and when reading. I store the cache_key in the cookie session between requests
[14:14:13] JJonah: The cache returns the correct value the first re-read (which happens after a redirect). And it returns nil on the 2nd re-read, which happens on a subsequent GET request
[14:14:58] JJonah: So this first reread is almost instant. The 2nd one is about 3 seconds later.
[14:16:03] tbuehlmann: and `Rails.cache` returns the correct cache store object?
[14:16:49] tbuehlmann: you could put a debugger right before using Rails.cache.fetch and check what's going on, trying to just read the cache instead of fetching. the setup sounds good to me up to this point
[14:19:59] JJonah: tbuehlmann: thanks, good to have a sanity check. i'll keep debugging and lyk what i find.
[14:20:15] morfin60: i have issue with enums in rails model
[14:20:43] morfin60: when i query model i get nil as enum value instead of string/int any idea why?
[14:21:05] tbuehlmann: morfin60: is database value of it null?
[14:21:36] tbuehlmann: can you paste your model, your schema and the code you're running to test it?
[14:23:13] defsdoor: has joined #RubyOnRails
[14:24:52] cgfbee: has joined #RubyOnRails
[14:25:30] morfin60: https://gist.github.com/morfin60/2d9ebfc2ae6b84ce9062d476948da083
[14:25:33] jottr_: has joined #RubyOnRails
[14:25:38] morfin60: i think i found weird rails bug?
[14:26:16] morfin60: i just rails c and then ProductInfo.first.info_type => nil
[14:27:25] tbuehlmann: I haven't seen enum string columns so far, why don't you use integers?
[14:27:42] tbuehlmann: also, I haven't seen spaces in the actual values, I'm not sure that's okay
[14:29:33] yehowyada: has joined #RubyOnRails
[14:36:10] bijan_: has joined #RubyOnRails
[14:37:21] one_zero: has joined #RubyOnRails
[14:52:23] jottr_: has joined #RubyOnRails
[14:52:46] cschneid: has joined #RubyOnRails
[15:07:59] xuyuheng: has joined #RubyOnRails
[15:13:58] za1b1tsu: When I try Session.all.includes(:ratings).where.not("ratings.score = ?", nil)
[15:14:21] za1b1tsu: ActiveRecord::StatementInvalid (PG::UndefinedTable: ERROR: missing FROM-clause entry for table "ratings"
[15:14:49] morfin60: maybe you need joins?
[15:15:02] TvL2386: hey guys, I'm using pundit. To debug I'm printing "policy(Interconnect).index?" in my view and it evaluates to false
[15:15:24] TvL2386: darn I see... I suck
[15:15:54] za1b1tsu: morfin60: thank you, joins works, but why is includes did not work? since session has many ratings
[15:16:28] morfin60: za1b1tsu, includes seems to be loading AR models using minimal queries
[15:17:04] morfin60: eager loading, when joins is used when you need build condition on other related thing - like in your case
[15:17:51] morfin: has joined #RubyOnRails
[15:18:10] morfin: i was confused first time too )
[15:19:40] za1b1tsu: I need to add references
[15:19:45] za1b1tsu: User.includes(:posts).where('posts.name = ?', 'example').references(:posts)
[15:19:47] za1b1tsu: weird stuff
[15:20:04] za1b1tsu: morfin60: cheers
[15:20:22] beingjohnm: has joined #RubyOnRails
[15:28:58] roshanavand: has joined #RubyOnRails
[15:40:25] theunraveler: has joined #RubyOnRails
[15:40:54] arathald_: has joined #RubyOnRails
[15:40:55] sonOfRa: has joined #RubyOnRails
[15:40:55] Kilo`byt-: has joined #RubyOnRails
[15:40:57] iamdevnul: has joined #RubyOnRails
[15:41:04] dnyy: has joined #RubyOnRails
[15:41:11] doesntbyte: has joined #RubyOnRails
[15:41:14] wsmoak: has joined #RubyOnRails
[15:41:37] lipoqil: has joined #RubyOnRails
[15:41:43] craysiii: has joined #RubyOnRails
[15:41:48] DukeDave: has joined #RubyOnRails
[15:41:50] manveru: has joined #RubyOnRails
[15:47:53] quirkycoders: has joined #RubyOnRails
[15:49:16] quirkycoders: So I'm trying to figure out how to write this test: https://gist.github.com/f94dfaf5852342216800205b94404a67
[15:50:43] quirkycoders: My problem is that this particular call creates a user and later uses that user as an argument to another call. However when I test the user that I would to us as an argument has not been created yet.
[15:53:14] workmad3: has joined #RubyOnRails
[16:08:51] bronson: has joined #RubyOnRails
[16:17:28] bijan_: has joined #RubyOnRails
[16:21:13] cschneid: has joined #RubyOnRails
[16:43:24] troys: has joined #RubyOnRails
[16:44:13] uks: has joined #RubyOnRails
[16:49:29] FrostCandy: has joined #RubyOnRails
[16:51:01] morfin: what is references
[16:51:16] gil_: has joined #RubyOnRails
[16:51:52] tbuehlmann: morfin: in what context?
[16:52:35] morfin: ah it adds join anyway
[16:52:48] morfin: in context of query builder
[16:54:33] AzaToth: has joined #RubyOnRails
[16:55:42] desperek: has joined #RubyOnRails
[16:56:27] dionysus69: has joined #RubyOnRails
[16:58:52] alfiemax: has joined #RubyOnRails
[16:59:05] dionysus69: has joined #RubyOnRails
[16:59:33] mtkd: has joined #RubyOnRails
[16:59:50] armyriad: has joined #RubyOnRails
[17:03:13] Dimik: has joined #RubyOnRails
[17:08:32] [Butch]: has joined #RubyOnRails
[17:08:56] NoGodDamnIdea: has joined #RubyOnRails
[17:15:25] Saukk: has joined #RubyOnRails
[17:35:11] bga57: has joined #RubyOnRails
[17:43:31] IanMalcolm: has joined #RubyOnRails
[17:45:06] IanMalcolm: guys, I'm updating an ancient app from rails 3 to rails 4, and now Iḿ getting an uninitialized constant error for all my Sidekiq workers. They're in the default path (app/workers). Did anything change from rails 3 to 4 with regards to that?
[17:49:01] darkhanb: has joined #RubyOnRails
[17:54:05] workmad3: has joined #RubyOnRails
[17:56:14] orbyt_: has joined #RubyOnRails
[18:02:20] workmad3: has joined #RubyOnRails
[18:09:57] bronson: has joined #RubyOnRails
[18:33:11] orbyt_: has joined #RubyOnRails
[18:50:08] srinidhi: has joined #RubyOnRails
[18:54:57] vichib: has joined #RubyOnRails
[19:06:57] kies: has joined #RubyOnRails
[19:12:32] alfiemax: has joined #RubyOnRails
[19:38:05] orbyt_: has joined #RubyOnRails
[19:43:56] conta: has joined #RubyOnRails
[19:50:28] keyjoo_: has joined #RubyOnRails
[19:53:35] moei: has joined #RubyOnRails
[19:59:53] choke: has joined #RubyOnRails
[20:01:03] choke: I have some rules in one of my models, https://gist.github.com/jblac/5555017313131bf5ea7dcb39e95bfc34 just wondering if there's an alternate way I should be defining these since the sub-options are identical
[20:04:12] mtkd: has joined #RubyOnRails
[20:04:55] bijan_: has joined #RubyOnRails
[20:05:13] darkhanb: has joined #RubyOnRails
[20:06:50] ur5us: has joined #RubyOnRails
[20:10:47] bronson: has joined #RubyOnRails
[20:14:52] starseed00: has joined #RubyOnRails
[20:15:04] starseed00: Are rack apps loaded before or after rails initializers?
[20:15:39] starseed00: Hrm that doesn't make sense now that I am reading it.
[20:17:06] starseed00: I guess the real question is: is a rack app that has been inserted from a gem able to be monkey patched by an initialiser in my main application.
[20:18:38] gambl0re: has joined #RubyOnRails
[20:22:44] Aherin: has joined #RubyOnRails
[20:25:22] dviola: has joined #RubyOnRails
[20:33:53] Raffy: has joined #RubyOnRails
[20:34:53] jottr_: has joined #RubyOnRails
[20:37:58] workmad3: has joined #RubyOnRails
[20:38:24] tcopeland: has joined #RubyOnRails
[20:40:01] sameerynho: has joined #RubyOnRails
[20:44:52] camfowler: has joined #RubyOnRails
[20:49:14] conta1: has joined #RubyOnRails
[20:57:48] orbyt_: has joined #RubyOnRails
[21:01:14] tcopeland: has joined #RubyOnRails
[21:09:52] jottr_: has joined #RubyOnRails
[21:11:18] jottr: has joined #RubyOnRails
[21:11:45] bronson: has joined #RubyOnRails
[21:17:58] keyjoo_: has joined #RubyOnRails
[21:18:16] IanMalcolm: has joined #RubyOnRails
[21:36:33] one_zero: has joined #RubyOnRails
[21:39:30] arBmind: has joined #RubyOnRails
[21:50:18] Radar: GOOD MORNING
[21:56:22] alfiemax: has joined #RubyOnRails
[21:56:36] quazimodo: has joined #RubyOnRails
[21:59:29] cagmz_: has joined #RubyOnRails
[21:59:31] Raffy: has joined #RubyOnRails
[22:00:57] ahrs: has joined #RubyOnRails
[22:04:57] bijan_: has joined #RubyOnRails
[22:09:25] mtkd: has joined #RubyOnRails
[22:11:12] Takumo: has joined #RubyOnRails
[22:12:37] bronson: has joined #RubyOnRails
[22:14:06] Tempesta: has joined #RubyOnRails
[22:14:40] elcontrastador: has joined #RubyOnRails
[22:38:47] workmad3: has joined #RubyOnRails
[22:38:56] orbyt_: has joined #RubyOnRails
[22:41:53] Daemen: has joined #RubyOnRails
[22:43:52] truenito: has joined #RubyOnRails
[22:49:29] Daemen: has left #RubyOnRails: ("Leaving")
[22:49:52] alfiemax: has joined #RubyOnRails
[22:56:22] alfiemax: has joined #RubyOnRails
[23:04:29] ivanskie: has joined #RubyOnRails
[23:06:09] armyriad: has joined #RubyOnRails
[23:06:25] ahrs: has joined #RubyOnRails
[23:11:15] ivanskie: I have Devices model. A seeds.rb which gets data from API.
[23:11:37] ivanskie: I'm also using Transactions, and Import, currently without validation.
[23:11:37] ivanskie: https://gist.github.com/i5okie/c75ff1aae7ce98d7c4ffe3e724f7dd98
[23:12:30] ivanskie: I'd like the script to Update if ID exists, found find_or_create / or find_or_initialize here: http://guides.rubyonrails.org/v3.2.13/active_record_querying.html#find-or-build-a-new-object
[23:12:36] ivanskie: don't know how to use it here
[23:13:29] bronson: has joined #RubyOnRails
[23:13:33] ivanskie: I'm thinking maybe leave seeds file as is, and create a UpdateDevicesJob activejob instead? just not sure how to do the update if exists thing.
[23:13:56] ivanskie: or even update if different OR create if doesn't exist.
[23:14:47] ivanskie: only have 310 devices right now so i'm not too worried about turning validation on and stuff
[23:18:35] FrostCandy: can I put a condition inside of a hash? h = { h1: => @derp['path1']['path2'] unless @derp['path1']['path2'].nil? }
[23:19:37] havenwood: FrostCandy: yes
[23:19:41] FrostCandy: or maybe a h = { h1: => '' || @derp['path'], }
[23:20:49] ivanskie: maybe i could create a staging model copy of Devices, fill it up with api request, then do a compare and update/insert into Devices
[23:24:16] FrostCandy: havenwood: didn't work I think i'll have to do something like h[:1] = this || that if nil instead of putting the conditiotns inside the hash
[23:25:17] jottr_: has joined #RubyOnRails
[23:27:05] iamdevnul: has joined #RubyOnRails
[23:27:08] sonOfRa_: has joined #RubyOnRails
[23:27:11] manveru: has joined #RubyOnRails
[23:27:15] Lloyd: has joined #RubyOnRails
[23:27:28] kanzure: has joined #RubyOnRails
[23:35:56] apeiros__: has joined #RubyOnRails
[23:36:00] roshanavand: has joined #RubyOnRails
[23:40:30] apeiros: has joined #RubyOnRails
[23:43:22] ivanskie: Model.update(params) is params a hash or array? what is it expecting?
[23:45:51] ivanskie: dunno why i asked lol
[23:46:01] alfiemax: has joined #RubyOnRails
[23:52:54] desnudopenguino: has joined #RubyOnRails
[23:54:30] hahuang61: Radar: GOOD MORNING
[23:54:37] hahuang61: 2 hours later.
[23:55:20] hahuang61: ivanskie: are you still having issues?
[23:55:37] ivanskie: yes, one sec i'll update my gist
[23:56:06] NoGodDamnIdea: has joined #RubyOnRails
[23:57:32] ivanskie: this is what I ended up doing: https://gist.github.com/i5okie/c75ff1aae7ce98d7c4ffe3e724f7dd98
[23:58:02] orbyt_: has joined #RubyOnRails
[23:58:04] ivanskie: I've created an active job, and going through each record, if exists with id then update, if not then create new one.
[23:58:09] ivanskie: not exactly efficient
[23:58:40] choke: I'm working on a rails API for a legacy app, adding in devise right now... anyone know if it's possible to change the keys for the encrypted_password so I don't have to change the schema on the database and alter all the references in the legacy app?
[23:59:51] mices: has joined #RubyOnRails