« Back to channel list

#RubyOnRails - 14 January 2019

« Back 1 day Forward 1 day »
[00:15:01] tdy2: has joined #RubyOnRails
[00:31:48] catbusters: has joined #RubyOnRails
[00:33:39] catbusters: Does Rails include jQuery out of the box?
[00:34:02] Technodrome: has joined #RubyOnRails
[00:34:36] havenwood: catbusters: Rails dropped the jQuery dep in 5.1.
[00:35:05] catbusters: I'm on Rails > 5.1
[00:35:21] catbusters: Reason I ask is I seem to have $ defined already
[00:35:36] catbusters: I think it's probably coming from ujs?
[00:50:44] tdy2: has joined #RubyOnRails
[00:51:47] catbusters: My bad, forgot that browsers define it by default
[00:54:52] sevenseacat: has joined #RubyOnRails
[01:16:26] benlieb: has joined #RubyOnRails
[01:43:02] gambl0re: has joined #RubyOnRails
[01:43:03] gambl0r3: has joined #RubyOnRails
[01:54:44] orbyt_: has joined #RubyOnRails
[01:59:02] ariedler: has joined #RubyOnRails
[02:02:56] sarink: has joined #RubyOnRails
[02:06:35] mostlybadfly: has joined #RubyOnRails
[02:06:49] uplime: has joined #RubyOnRails
[02:08:28] sarink: why does this has_many :through not work? https://dpaste.de/DuYb
[02:09:15] sevenseacat: if none of your records are persisted, things won't work
[02:10:11] sarink: hmm, the belongs-to and has-manys work without the record being persisted, is has-many-through special?
[02:10:12] tdy2: has joined #RubyOnRails
[02:10:44] sevenseacat: it uses three records not two, so yeah
[02:12:40] sarink: @sevenseacat i just called `s.save!; b.save!; t.save!` and corresponding `.persisted?` (all true) methods in my console, and `s.transactions` still doesn't work. do i need to do things in a specific order or something?
[02:15:28] sarink: updated... https://dpaste.de/A67X this still is not working for me
[02:15:54] sarink: reload! then s.clover_transactions still yields []
[02:16:11] Linuus: has joined #RubyOnRails
[02:16:22] sarink: s.buckets.first.clover_transactions, however, works great
[02:20:30] sarink: i'm not sure what rails wants from me, since the associations seem to all be in working order, except this has-many-through...
[02:22:04] sarink: @sevenseacat any ideas?
[02:45:07] Saukk: has joined #RubyOnRails
[02:53:38] dbugger_: has joined #RubyOnRails
[03:05:11] tdy2: has joined #RubyOnRails
[03:11:06] Technodrome: has joined #RubyOnRails
[03:12:20] benlieb: has joined #RubyOnRails
[03:49:12] Net: has joined #RubyOnRails
[04:00:11] ariedler: has joined #RubyOnRails
[04:03:19] orbyt_: has joined #RubyOnRails
[04:09:07] braincrash: has joined #RubyOnRails
[04:46:14] Linuus: has joined #RubyOnRails
[05:09:07] tdy2: has joined #RubyOnRails
[05:09:51] srinidhi: has joined #RubyOnRails
[05:18:51] uplime: has joined #RubyOnRails
[05:27:00] fugee: has joined #RubyOnRails
[05:27:14] fugee: anyone can help with spree 3.2.7
[05:47:30] cschneid: has joined #RubyOnRails
[05:48:19] cschneid: I have a model with belongs_to :other_model and the other_model_id is set, but when I traverse that relation, it does a SELECT .... [[id, nil]] instead. Gist - https://gist.github.com/cschneid/106718d6f72e61395a291554744715b9
[05:48:30] cschneid: Not sure why it's not using the saved value
[05:52:40] benlieb: has joined #RubyOnRails
[05:54:08] cschneid: ah, cool - it was my override of []
[06:01:05] ariedler: has joined #RubyOnRails
[06:13:58] andrew9184: has joined #RubyOnRails
[06:18:22] benlieb: has joined #RubyOnRails
[06:19:07] conta: has joined #RubyOnRails
[06:28:56] tdy2: has joined #RubyOnRails
[07:01:58] Linuus: has joined #RubyOnRails
[07:10:01] ziyadb: has joined #RubyOnRails
[07:16:24] Technodrome: has joined #RubyOnRails
[07:23:58] drale2k_: has joined #RubyOnRails
[07:42:25] beholders_eye: has joined #RubyOnRails
[07:49:04] beholders_eye: has joined #RubyOnRails
[08:01:44] ariedler: has joined #RubyOnRails
[08:02:42] benlieb: has joined #RubyOnRails
[08:25:59] status402: has joined #RubyOnRails
[08:38:15] kapil____: has joined #RubyOnRails
[08:42:12] mikecmpbll: has joined #RubyOnRails
[08:44:45] apparition: has joined #RubyOnRails
[08:57:00] mikecmpbll: has joined #RubyOnRails
[09:03:19] tdy2: has joined #RubyOnRails
[09:05:38] paranoicsan: has joined #RubyOnRails
[09:11:10] mat_bug: has joined #RubyOnRails
[09:16:53] ur5us: has joined #RubyOnRails
[09:17:26] benlieb: has joined #RubyOnRails
[09:18:27] Linuus: has joined #RubyOnRails
[09:20:04] srinidhi: has joined #RubyOnRails
[09:38:21] za1b1tsu: has joined #RubyOnRails
[09:45:40] ur5us: has joined #RubyOnRails
[09:48:27] alexterziev: has joined #RubyOnRails
[09:49:43] paranoicsan: has joined #RubyOnRails
[09:50:46] alexterziev: Hi, I have issue with getting activerecords for one of my tables (Account). If I try to run `Account.first`, I get an error (`(byebug) Account.first *** TypeError Exception: wrong argument type Hash (expected String)`)
[09:53:21] alexterziev: Here is the account model: http://paste.ubuntu.com/p/Bfv3Ckv5Rq/
[09:55:54] tbuehlmann: alexterziev: can you gist the stacktrace for that error? what line causes it?
[09:58:38] alexterziev: tbuehlmann: ok, just a min
[10:01:54] alexterziev: tbuehlmann: https://pastebin.com/CFqNnhq2
[10:03:12] uplime: has joined #RubyOnRails
[10:04:28] tbuehlmann: what's in app/controllers/application_controller.rb:214?
[10:06:59] alexterziev: tbuehlmann: `gon.accounts = current_user.accounts.inject({}) do |memo, account|`
[10:11:56] tbuehlmann: looks to me like you're calling BigDecimal.new somewhere with a hash instead of a string
[10:15:23] alexterziev: tbuehlmann: ok, I will try to debug on all places where I use BigDecimal to see if that is an issue, thanks for the hint
[10:16:18] status402: has joined #RubyOnRails
[11:09:02] gregf_: has joined #RubyOnRails
[11:10:43] Ergo: has joined #RubyOnRails
[11:18:00] rikkipitt: has joined #RubyOnRails
[11:21:23] sirensari2: has joined #RubyOnRails
[11:48:09] paranoicsan: has joined #RubyOnRails
[11:49:32] Linuus: has joined #RubyOnRails
[11:55:06] ariedler: has joined #RubyOnRails
[12:02:13] mostlybadfly: has joined #RubyOnRails
[12:14:03] Technodrome: has joined #RubyOnRails
[12:33:19] uplime: has joined #RubyOnRails
[13:10:21] jottr: has joined #RubyOnRails
[13:23:21] gregf_: has joined #RubyOnRails
[13:26:10] uplime: has joined #RubyOnRails
[13:54:47] apparition: has joined #RubyOnRails
[14:12:08] ariedler: has joined #RubyOnRails
[14:12:55] ariedler: has joined #RubyOnRails
[14:13:42] ariedler: has joined #RubyOnRails
[14:17:05] uplime: has joined #RubyOnRails
[14:19:14] Linuus: has joined #RubyOnRails
[14:22:43] alan_w: has joined #RubyOnRails
[14:25:03] konos5: has joined #RubyOnRails
[14:25:21] konos5: any clues?
[14:27:20] krawchyk: has joined #RubyOnRails
[14:32:28] kstratis_: has joined #RubyOnRails
[14:33:35] konos5: Hi, I was just wondering what @klass is and where it comes from: https://github.com/rails/rails/blob/master/activerecord/lib/active_record/relation/delegation.rb#L112
[14:44:52] arefaslani: has joined #RubyOnRails
[14:45:29] arefaslani: Hi everybody. Is it possible to translate Exception messages in Rails? For example translate ActionController::ParameterMissing error message
[15:14:43] status402: has joined #RubyOnRails
[15:18:10] chouhoulis: has joined #RubyOnRails
[15:21:04] fox_mulder_cp: arefaslani: create your own i18n dictionary and use it in i18n gem or some like it?
[15:22:26] arefaslani: @fox_mulder_cp: I want to translate ActionController::ParameterMissing error message. It's the definition:
[15:22:35] arefaslani: class ParameterMissing < KeyError
[15:22:35] arefaslani: attr_reader :param # :nodoc:
[15:22:35] arefaslani: def initialize(param) # :nodoc:
[15:22:37] arefaslani: @param = param
[15:22:39] arefaslani: super("param is missing or the value is empty: #{param}")
[15:23:11] arefaslani: How can I translate the message "param is missing or the value is empty: #{param}"? or is there any straightforward solution?
[15:23:24] fox_mulder_cp: arefaslani: i18n gem as example
[15:24:13] arefaslani: @fox_mulder_cp: Yes I use i18n gem for translation. But don't know how to use it for translating exceptions error messages
[15:24:19] fox_mulder_cp: and replace it in your super(..) line
[15:25:15] arefaslani: @fox_mulder_cp I was thinking about that :) but i was thinking is there any simpler solution or not... Thank you. I'll do that :)
[15:29:29] fox_mulder_cp: arefaslani: no. create your own dictionary for gem like i18n and override all like exeptions
[15:32:05] arefaslani: @fox_mulder_cp: Can you give me a link for further helping?
[15:34:00] fox_mulder_cp: arefaslani: https://guides.rubyonrails.org/i18n.html
[15:34:20] arefaslani: @fox_mulder_cp: Thanks
[15:35:14] status402: has joined #RubyOnRails
[15:52:34] _axx: has left #RubyOnRails: ("I Must Go, My Planet Needs Me")
[16:01:58] conta: has joined #RubyOnRails
[16:05:19] gambl0r3: has joined #RubyOnRails
[16:05:20] gambl0re: has joined #RubyOnRails
[16:13:30] catbusters: has joined #RubyOnRails
[16:14:56] ariedler: has joined #RubyOnRails
[16:15:35] catbusters: How can I get the URL for a certain route in a .js.erb file? In .html.erb files I can just do `<% posts_path %>`, but it raises `NameError` in my `.js.erb` files
[16:28:18] elcontrastador: has joined #RubyOnRails
[16:32:55] ams__: has joined #RubyOnRails
[16:49:12] Linuus: has joined #RubyOnRails
[16:52:05] Sylario: has joined #RubyOnRails
[16:56:11] srinidhi: has joined #RubyOnRails
[17:02:12] sirensari2: has joined #RubyOnRails
[17:04:29] aidanh010: has joined #RubyOnRails
[17:09:38] DylanJ: catbusters: been a while but maybe use _url instead of path?
[17:12:47] orbyt_: has joined #RubyOnRails
[17:12:57] paranoicsan[Away: has joined #RubyOnRails
[17:14:44] uks: has joined #RubyOnRails
[17:14:45] conta: has joined #RubyOnRails
[17:20:59] catbusters: DylanJ: You mean like `posts_url`? Still get the same error with that
[17:21:35] catbusters: `undefined local variable or method `posts_url' for #<#<Class:0x007fbc43abb7e0>:0x007fbc3fcffde8>`
[17:22:59] DylanJ: catbusters: https://stackoverflow.com/questions/6725629/route-helpers-in-asset-pipeline answers explains it
[17:25:33] planigan: has joined #RubyOnRails
[17:36:43] fcser_: has joined #RubyOnRails
[17:37:31] catbusters: DylanJ: That worked! Thanks :)
[17:41:01] conta: has joined #RubyOnRails
[17:43:59] gambl0re: has joined #RubyOnRails
[17:44:00] gambl0r3: has joined #RubyOnRails
[17:44:24] paranoicsan: has joined #RubyOnRails
[17:45:26] krkb: has joined #RubyOnRails
[17:45:52] krkb: does anyone know if Rails 5 support multiple primary keys?
[17:46:31] krkb: I have been using composite-primary-keys before but I remembered I read somewhere saying that Rails 5 supports it so I won't need the gem anymore.
[18:01:32] orbyt_: has joined #RubyOnRails
[18:03:25] conta2: has joined #RubyOnRails
[18:17:05] benlieb: has joined #RubyOnRails
[18:30:31] defsdoor: has joined #RubyOnRails
[18:41:35] reber: has joined #RubyOnRails
[18:44:05] grvgr: has joined #RubyOnRails
[18:47:07] lxsameer: has joined #RubyOnRails
[19:09:17] [Butch]: has joined #RubyOnRails
[19:12:40] mikecmpbll: has joined #RubyOnRails
[19:19:19] Linuus: has joined #RubyOnRails
[19:22:48] reber: has joined #RubyOnRails
[19:23:58] orbyt_: has joined #RubyOnRails
[19:53:59] conta: has joined #RubyOnRails
[19:54:48] beholders_eye: has joined #RubyOnRails
[20:00:30] beholders_eye: has joined #RubyOnRails
[20:04:11] nickjj: has joined #RubyOnRails
[20:40:40] ur5us: has joined #RubyOnRails
[20:45:57] Linuus: has joined #RubyOnRails
[21:03:47] Dbugger: has joined #RubyOnRails
[21:04:57] nOgAnOo_: has joined #RubyOnRails
[21:06:13] Quintasan: has joined #RubyOnRails
[21:06:28] tdy3: has joined #RubyOnRails
[21:12:31] DylanJ: has joined #RubyOnRails
[21:15:00] michael_mbp: has joined #RubyOnRails
[21:19:26] ghormoon: has joined #RubyOnRails
[22:11:01] dviola: has joined #RubyOnRails
[22:18:52] tdy3: has joined #RubyOnRails
[22:29:15] gambl0r3: has joined #RubyOnRails
[22:29:16] gambl0re: has joined #RubyOnRails
[22:39:32] orbyt_: has joined #RubyOnRails
[22:46:45] chouhoulis: has joined #RubyOnRails
[23:11:58] mikecmpbll: has joined #RubyOnRails
[23:20:06] benlieb: has joined #RubyOnRails
[23:32:36] alexhartley: has joined #RubyOnRails
[23:33:51] benlieb: has joined #RubyOnRails
[23:36:19] orbyt_: has joined #RubyOnRails
[23:49:19] ellcs: has joined #RubyOnRails