« Back to channel list

#RubyOnRails - 27 June 2017

« Back 1 day Forward 1 day »
[00:03:36] jhfisc: has joined #RubyOnRails
[00:11:10] jgpawletko: has joined #RubyOnRails
[00:11:55] jhfisc: has joined #RubyOnRails
[00:17:42] jhfisc: has joined #RubyOnRails
[00:22:35] umaaji: has joined #RubyOnRails
[00:23:34] jhfisc: has joined #RubyOnRails
[00:27:53] jimms: has joined #RubyOnRails
[00:28:57] jhfisc: has joined #RubyOnRails
[00:41:08] r3vDev: has joined #RubyOnRails
[00:41:45] jhfisc: has joined #RubyOnRails
[00:47:41] jhfisc: has joined #RubyOnRails
[00:49:39] Technodrome: has joined #RubyOnRails
[00:53:31] jhfisc: has joined #RubyOnRails
[01:00:36] quazimodo: has joined #RubyOnRails
[01:01:48] jhfisc: has joined #RubyOnRails
[01:14:05] jhfisc: has joined #RubyOnRails
[01:19:14] jhfisc: has joined #RubyOnRails
[01:21:34] sevenseacat: has joined #RubyOnRails
[01:21:58] brent__: has joined #RubyOnRails
[01:24:39] fourcolors: has joined #RubyOnRails
[01:24:39] irishfromua: has joined #RubyOnRails
[01:24:50] fourcolors: Hey, I'm trying to require multiple strong params but rails seems to force me to test my params but I don't want to do that
[01:25:04] fourcolors: having flat params is a hard requirement
[01:25:45] jhfisc: has joined #RubyOnRails
[01:27:10] ResidentBiscuit: has joined #RubyOnRails
[01:36:35] harfangk: has joined #RubyOnRails
[01:38:52] jhfisc: has joined #RubyOnRails
[01:42:36] EPic_Null: has joined #RubyOnRails
[01:44:44] jhfisc: has joined #RubyOnRails
[01:44:51] quirkycoders: has joined #RubyOnRails
[01:50:29] workmad3: has joined #RubyOnRails
[01:50:57] jhfisc: has joined #RubyOnRails
[01:54:56] mostlybadfly: has joined #RubyOnRails
[01:55:41] jhfisc: has joined #RubyOnRails
[01:56:54] chimkan: has joined #RubyOnRails
[01:59:01] fourcolors: how can I created a non persistant model in rails 5?
[01:59:25] Jayson_Virissimo: fourcolors: you mean a plain old Ruby object?
[01:59:34] fourcolors: yeah, but I want to do validations on it
[01:59:43] fourcolors: like Foo.valid?
[02:00:28] Jayson_Virissimo: Don't subclass ActiveRecord, but include ActiveModel::Validations.
[02:00:28] fourcolors: I want to put an email validator i the model
[02:00:55] fourcolors: is it "ActiveModel" or "ActiveRecord" ?
[02:01:05] fourcolors: Cause, rails 5 generates ActiveRecord for some reason
[02:01:13] fourcolors: I'm also doing rails --api mode
[02:01:58] Jayson_Virissimo: Ah, yeah. Rails 5 doesn't sublass ActiveRecord::Base directly anymore.
[02:02:19] Jayson_Virissimo: Most of my projects are still on Rails 4.
[02:04:33] Jayson_Virissimo: Still should work. Depending on what you are doing with your validations, you might be able to just include ActiveModel::Model and attr_accessors, then validates :email, presence: true, etc...
[02:05:05] Jayson_Virissimo: Don't remember if you need to def persisted?; false; end
[02:05:11] Jayson_Virissimo: I'd try it without first.
[02:05:49] fourcolors: so, it seems to work however... I'm not getting the "valid?" method for some reason. I yells at me undefined "new_record?"
[02:06:50] Jayson_Virissimo: Hmmm....don't remember ever running into that.
[02:11:54] jhfisc: has joined #RubyOnRails
[02:14:40] guacamole: has joined #RubyOnRails
[02:19:37] Jameser: has joined #RubyOnRails
[02:20:45] jhfisc: has joined #RubyOnRails
[02:42:16] chimkan: has joined #RubyOnRails
[02:43:45] jhfisc: has joined #RubyOnRails
[02:44:05] Trynemjoel: has joined #RubyOnRails
[02:50:52] wethu: has joined #RubyOnRails
[02:52:28] jhfisc: has joined #RubyOnRails
[03:03:41] jhfisc: has joined #RubyOnRails
[03:04:39] ascarter: has joined #RubyOnRails
[03:15:18] jhfisc: has joined #RubyOnRails
[03:32:28] alfiemax: has joined #RubyOnRails
[03:33:03] quirkycoders: has joined #RubyOnRails
[03:45:25] jhfisc: has joined #RubyOnRails
[03:51:41] jhfisc: has joined #RubyOnRails
[03:56:15] Kilo`byte: has joined #RubyOnRails
[04:00:17] hahuang65: has joined #RubyOnRails
[04:03:46] jhfisc: has joined #RubyOnRails
[04:09:02] jhfisc: has joined #RubyOnRails
[04:10:51] aperkins81: has joined #RubyOnRails
[04:10:59] ascarter: has joined #RubyOnRails
[04:12:04] EPic_Null: Hi. I have no idea what I did wrong but it's clearly done wrong... I'm doing a (modified) version of the site's tutorial. My code is here: https://github.com/engineer-pearl/Learning-Rails and something went wrong with the comments.
[04:12:39] jhfisc: has joined #RubyOnRails
[04:12:42] sevenseacat: 'something went wrong'? you might have to clarify
[04:13:33] patarr: has joined #RubyOnRails
[04:14:21] EPic_Null: erm... sort of like several small loops where loops shoud not be and a variable showing as (nil) in a part that I have no idea where it's there, yet showing corectly in the part below it (which is also looping)
[04:14:45] EPic_Null: Hold on I'll coppy the html
[04:16:52] EPic_Null: http://pastebin.ubuntu.com/24961268/
[04:18:37] EPic_Null: erm... well I changed the size and the commenter disapeared
[04:19:30] EPic_Null: but only for the first one?
[04:19:33] EPic_Null: I am really confused
[04:20:13] sevenseacat: you may have to slow down and break down the problem. which view is generating HTML that isnt what you expect?
[04:21:36] EPic_Null: It's a nested view. It's happening in articles/show.html.erb , but the loop involves contents of _comments.html.erb
[04:21:57] sevenseacat: and what HTML are you getting that you don't expect?
[04:22:39] EPic_Null: there's a dump and then the content is repeating six times before moving on to the next comment.
[04:23:15] EPic_Null: the dump seems to show ... hmm I wonder if I just guessed what caused the dump
[04:23:15] sevenseacat: if you're talking about https://github.com/engineer-pearl/Learning-Rails/blob/master/app/views/comments/_comment.html.erb, this is supposed to be the view for a single comment
[04:23:39] sevenseacat: line 2 also shouldn't have a = in it, as that will print out the return value
[04:26:14] EPic_Null: wait so it loops automatically there?
[04:26:45] sevenseacat: https://github.com/engineer-pearl/Learning-Rails/blob/master/app/views/articles/show.html.erb#L11 this will call that template once for each comment in the list, yes
[04:27:26] EPic_Null: Is that because it was pluralized or because of the "has_many :comments" in the other file?
[04:27:50] sevenseacat: http://guides.rubyonrails.org/layouts_and_rendering.html#using-partials see 3.4.5
[04:28:25] sevenseacat: neither, its because you passed a collection of objects to render
[04:28:57] EPic_Null: Oh. Thanks for the lesson.
[04:29:16] EPic_Null: And the assist
[04:32:34] Technodrome: has joined #RubyOnRails
[04:32:52] hahuang65: has joined #RubyOnRails
[04:36:46] fourcolors: Why do HTTParty's docs suck so bad
[04:36:58] fourcolors: is there a better lib that HTTParty?
[04:37:33] Rodya_: has joined #RubyOnRails
[04:43:47] jhfisc: has joined #RubyOnRails
[04:45:50] Rodya_: has joined #RubyOnRails
[04:47:29] fourcolors: ok, rest-client is soooo much better
[04:50:17] ur5us: has joined #RubyOnRails
[04:51:19] mices: has joined #RubyOnRails
[04:51:55] mices: if i pass a collection to render partial but the collection is empty then the partial won't be rendered at all?
[04:52:37] mices: so if i have some static html in the partial it won't be rendered because the partial is rendered once for each iteration of the collection or not at all?
[04:54:52] krmela: has joined #RubyOnRails
[05:03:23] helpa-bot: has joined #RubyOnRails
[05:05:22] helpa: has joined #RubyOnRails
[05:07:08] Radar: mices: !try
[05:07:08] helpa: mices: Why don't you try it and find out for yourself?
[05:08:02] helpa-bot: has joined #RubyOnRails
[05:09:44] ChanServ: +o baweaver
[05:09:49] baweaver: I HAVE THE POWER
[05:10:00] ChanServ: -o baweaver
[05:10:14] baweaver: http://weblog.rubyonrails.org/2017/6/26/Rails-5-1-2-has-been-released/
[05:13:00] helpa: has joined #RubyOnRails
[05:15:31] helpa: has joined #RubyOnRails
[05:15:32] ascarter: has joined #RubyOnRails
[05:15:37] Radar: krmela: !whypbsucks
[05:15:37] helpa: krmela: Pastebin sucks because it loads slowly, has ads which are distracting and has terrible formatting. Please use Gist (http://gist.github.com) or Pastie (http://pastie.org).
[05:15:38] Radar: !botsnack
[05:15:38] helpa: Nom nom. Thanks, Radar!
[05:15:42] Radar: krmela: !whypbsucks
[05:15:42] helpa: krmela: Pastebin sucks because it loads slowly, has ads which are distracting and has terrible formatting. Please use Gist (http://gist.github.com) or Pastie (http://pastie.org).
[05:17:39] CustosLimen: has joined #RubyOnRails
[05:18:10] ankhers: has joined #RubyOnRails
[05:18:49] mices: Radar sevenseacat: my _comment partial doesn;t get rendered :( https://gist.github.com/mices/020e3ca195c4c4ff0a243048f71d2ba1
[05:19:12] Radar: mices: is the collection empty
[05:19:14] Psy-Q: has joined #RubyOnRails
[05:19:16] jhfisc: has joined #RubyOnRails
[05:19:16] noodle: has joined #RubyOnRails
[05:19:41] sevenseacat: and it if did, i have no idea what would render in it given @comments isnt defined anywhere
[05:19:44] mices: Radar post.comments isn't empty
[05:21:08] quirkycoders: has joined #RubyOnRails
[05:21:09] Radar: mices: what do the logs output for that request?
[05:21:11] AntiSpamMeta: has joined #RubyOnRails
[05:22:05] sevenseacat: also, what is `content_tag_for`? :/
[05:22:13] Radar: A Rails helper.
[05:22:49] sevenseacat: thats what I guessed, but googling it isnt turning anything up
[05:22:55] sevenseacat: nothing recent, anyway
[05:23:22] Radar: https://github.com/rails/rails/blob/01e94ef3b12922b77e55a067866d7a1fa62f1759/actionview/lib/action_view/helpers/record_tag_helper.rb#L12
[05:23:41] sevenseacat: ah hah, extracted out to a gem, thats why
[05:24:03] krmela: Radar: Sorry but pastie,org is now for me offline at least cloudfare reports that
[05:24:09] Radar: krmela: gist.github.com
[05:24:28] planigan: has joined #RubyOnRails
[05:24:46] coffeejunk: has joined #RubyOnRails
[05:25:43] mices: rails is rejecting as undefined the comment variable in the _comment.html.erb partial, i thought that variable automatically exists by the name of the partial _comment.html.erb
[05:25:45] jhfisc: has joined #RubyOnRails
[05:29:45] krmela: well here is gist https://gist.github.com/netmoleCBA/d4cfb56507cf2d8a9e25af709349bab9 very shortly class shall generate from given date workdays monday to friday just asking if this is effective way or another way is possible ?
[05:30:34] jhfisc: has joined #RubyOnRails
[05:35:18] ferdroid__: has joined #RubyOnRails
[05:38:11] brent__: has joined #RubyOnRails
[05:39:27] Paradox: has joined #RubyOnRails
[05:39:32] bazzy: has joined #RubyOnRails
[05:40:23] biox: has joined #RubyOnRails
[05:40:30] fl4sh_: has joined #RubyOnRails
[05:41:41] kt: has joined #RubyOnRails
[05:41:58] quirkycoders: has joined #RubyOnRails
[05:42:31] Radar: has joined #RubyOnRails
[05:44:09] codelahoma: has joined #RubyOnRails
[05:44:36] xMopxShell: has joined #RubyOnRails
[05:45:11] tercenya: has joined #RubyOnRails
[05:46:42] dionysus69: has joined #RubyOnRails
[05:48:47] krmela: hello there i have question , exist some reccomended way how to get from date range of day monday-friday in same week as is give date i am optionally wish give it as object to partial my last try is on https://gist.github.com/netmoleCBA/d4cfb56507cf2d8a9e25af709349bab9
[05:49:01] DoubleMalt: has joined #RubyOnRails
[05:53:27] Radar: [15:34:29] <Radar> krmela: what is the intention for this code?
[05:56:00] krmela: Radar: i have like order food for canteen and i need render simple calendar monday to fryday as well detect if isi not holiday i have our holidays and lockeddays in Lockedday model
[05:56:18] Radar: ok this is definitely in my too hard basket. I hope someone else helps youi.
[05:57:46] krmela: @days_from_this_week = (day.at_beginning_of_week..day.at_end_of_week) i find some code just now thinking how to remove last two elements of range
[05:57:53] jhfisc: has joined #RubyOnRails
[06:00:05] krmela: Radar: anyway ty for try
[06:02:24] jhfisc: has joined #RubyOnRails
[06:06:34] bios: has joined #RubyOnRails
[06:06:39] bios: hey *.. can anyone point me in the right direction to invalidate a user session from a controller when using devise?
[06:07:17] bios: it's been driving me nutty
[06:08:30] jhfisc: has joined #RubyOnRails
[06:13:24] krmela: bios: redirect_to signout_path and return
[06:13:58] krmela: bios: make sure u have this path declared
[06:14:09] krmela: bios:devise_scope :user do
[06:14:09] krmela: get '/signout', to: 'devise/sessions#destroy', as: :signout
[06:14:26] patarr: has joined #RubyOnRails
[06:15:00] bios: krmela: I am trying to do it from an administrative standpoint.. so the user himself is not clicking on a sign_out link or anything
[06:15:56] krmela: yes u can use that in controller
[06:16:44] bios: Radar: input?
[06:16:45] Radar: I don't think you can do that krmela
[06:17:37] Radar: bios: I don't know how to do that. I would think Devise would have a flag or something that like...
[06:17:41] Radar: like that*
[06:17:54] Radar: What about adding a field to the user where if it's present it logs them out?
[06:17:54] bios: I would think so too..
[06:18:00] bios: how are sessions stored?
[06:18:13] bios: can I search sessions for the user id ?
[06:18:16] bios: somehow?
[06:18:21] fourcolors: So, I have raw Ruby object and I'd like to basically have two things. 1. validations and 2. the ability to do Email.new(email_params) and that's it. What do I need to include to get this working?
[06:18:26] Radar: Not likely. Cookies are indistinguishable between users.
[06:18:34] Radar: fourcolors: what isn't working?
[06:18:42] fourcolors: I get this error
[06:19:06] fourcolors: ArgumentError (wrong number of arguments (given 1, expected 0)):
[06:19:25] ascarter: has joined #RubyOnRails
[06:19:39] krmela: bios> maybe another way is @user.update_attributes(current_sign_in_token: "")
[06:19:45] fourcolors: https://gist.github.com/fourcolors/e1014e8d4ec30eb4325fd6ef8a0f52e2
[06:20:29] Radar: fourcolors: Perhaps you meant to use ActiveModel::Model instead? http://api.rubyonrails.org/classes/ActiveModel/Model.html
[06:20:33] krmela: bios> as u erase token rails kick him automaticallz
[06:21:26] Radar: krmela: current_sign_in_token does not exist in Devise.
[06:21:41] fourcolors: @Radar you're a legend man, Thats spot on. I need a non persistant model. Also, it was a pleasure meeting you in SLC a few years back. Thanks man.
[06:21:55] fourcolors: Radar: ^^ oops
[06:26:59] Radar: fourcolors: :wave:
[06:28:03] Radar: That was many years ago now
[06:28:16] srinidhi: has joined #RubyOnRails
[06:28:19] Radar: 2012 iirc
[06:28:36] baweaver: Oh look, you're on his radar
[06:28:42] sevenseacat: aaaaaaaaages ago
[06:28:49] Radar: It was my only time visiting SLC
[06:29:20] Radar: And one of the only places that I stayed in a hotel and didn't crash on someone's couch / spare bed when I was travelling through america for two and a half months
[06:29:32] Radar: Sleeping on a proper hotel bed felt SO GOOD
[06:30:03] fourcolors: haha right on
[06:30:04] sevenseacat: hotels kinda suck though
[06:30:17] fourcolors: hotels > couches
[06:30:25] sevenseacat: this is true, i dont do couches
[06:31:15] roshanavand: has joined #RubyOnRails
[06:31:31] dminuoso: Radar: You know what, Im gonna add a new model "Radar" to my current rails app and fill it up with so many callbacks that you have to use Radar.suppress all over the code base.
[06:31:35] dminuoso: Then Ill do my best to have HR send you juicy offers.
[06:31:47] Radar: dminuoso: naw thanks
[06:32:15] dminuoso: I think it could produce a neat smile on my face
[06:33:04] liquid-silence: has joined #RubyOnRails
[06:33:04] Radar: Well I don't think they know what a Radar is so I think it'll be OK
[06:34:36] Radar: Your HR people
[06:34:42] dminuoso: Why would they care?
[06:34:49] Radar: [16:31:35] <dminuoso> Then Ill do my best to have HR send you juicy offers.
[06:35:53] conta: has joined #RubyOnRails
[07:01:18] jhfisc: has joined #RubyOnRails
[07:04:05] alfiemax: has joined #RubyOnRails
[07:05:03] alfiemax: this issue is really getting in the way of development : after every code change i have to restart my rails server
[07:05:15] alfiemax: https://github.com/rails/rails/issues/29542
[07:05:20] alfiemax: anyone... pls help ... :(
[07:06:24] sevenseacat: I tried, but couldnt replicate the problem
[07:06:58] dminuoso: alfiemax: The frequency of you repeatedy helping suggests that you need this urgently fixed.
[07:06:59] dminuoso: Hire a consultant
[07:07:18] dminuoso: The hilarious thing is, according to the ticket a bug cause has even been identified.
[07:07:34] alfiemax: i doubt it's an issue in my code..
[07:07:43] sevenseacat: last bug report I submitted for rails didnt get fixed for six months, so
[07:07:56] dminuoso: alfiemax: You did not even bother to look at the replies, did you?
[07:08:14] alfiemax: i did, i had a direct chat with that guy, i know him personally
[07:08:32] dminuoso: So why did you not share your conclusions in the bug tracker?
[07:09:01] alfiemax: there is nothing more to add, conclusion is that there is something fishy going on in the rails caching..
[07:10:00] alfiemax: and i dnt know where else to dig deeper into rails regarding the caching issue
[07:10:28] dminuoso: alfiemax: The described ticket seems to make a lot of sense.
[07:11:31] jhfisc: has joined #RubyOnRails
[07:14:10] alfiemax: yes it does to an extent, but i have no clue on how to fix it :(
[07:14:30] dminuoso: alfiemax: Dont use spring?
[07:14:48] dminuoso: Oh wait this is just the code reloader between requests
[07:14:54] alfiemax: yes, exactly
[07:15:09] dminuoso: alfiemax: Do you need a proper solution or just a hack?
[07:15:29] alfiemax: i prefer a proper solution
[07:15:54] alfiemax: but just a hack to make my team work faster is acceptable
[07:17:21] dminuoso: alfiemax: Can you share your models?
[07:17:37] alfiemax: the entire app is shared in a repo
[07:17:45] alfiemax: https://bitbucket.org/alfiemax/traderapp
[07:18:12] sevenseacat: (who didn't read things now dminuoso ? ;)
[07:18:12] alfiemax: made this repo with minimal code to reproduce the issue
[07:20:27] jhfisc: has joined #RubyOnRails
[07:23:02] dminuoso: sevenseacat: :(
[07:23:35] ascarter: has joined #RubyOnRails
[07:26:07] alfiemax: has joined #RubyOnRails
[07:27:52] ferr: has joined #RubyOnRails
[07:36:46] alfiemax: has joined #RubyOnRails
[07:37:36] jhfisc: has joined #RubyOnRails
[07:44:49] wethu: has joined #RubyOnRails
[07:45:06] alfiemax: dminuoso: saw the code?
[07:45:41] jhfisc: has joined #RubyOnRails
[07:47:28] alfiemax: on a different matter, a client recently approached me for upgrading their rails app, running on rails 2.3 to latest rails 5
[07:47:39] kruppm: has joined #RubyOnRails
[07:47:58] sevenseacat: that'll be fun
[07:48:03] alfiemax: would you recommend me doing the upgrade (i'm only familiar with rails 4+) or rebuilding the app from scratch, with the same existing db?
[07:48:49] sevenseacat: get someone with more experience to do the upgrade.
[07:49:40] alfiemax: is it worth it? the time spent in the upgrade? there are alot of stable rails releases between 2.3 and 5
[07:49:54] sevenseacat: thats for you to determine, its your client
[07:49:57] alfiemax: as i believe the proper way to upgrade is to go up step by step
[07:50:20] sevenseacat: they're paying you to do the work, not us
[07:51:11] dminuoso: Whether the upgrade is worth it, depends on a) your hourly rate, b) your expertise (this has an influence on how long it takes you) and c) your self-worth.
[07:52:20] alfiemax: yea, i think i would turn this down, since spending time on the upgrade wouldn't help me in any way
[07:56:56] tomwyatt: has joined #RubyOnRails
[07:59:15] dminuoso: There's also the part that it helps generate further tasks. :-)
[08:03:46] mauro1254: has joined #RubyOnRails
[08:03:57] alfiemax: has joined #RubyOnRails
[08:04:14] DoubleMalt: has joined #RubyOnRails
[08:06:09] mauro1254: Hi folks! Is rails app:update task required when upgrading patch version of rails? According to http://edgeguides.rubyonrails.org/upgrading_ruby_on_rails.html : "Patch versions only include bug fixes, and don't change any public API."
[08:06:42] sevenseacat: thats correct, so it doesnt.
[08:10:55] mauro1254: sevenseacat : thx!
[08:13:54] jhfisc: has joined #RubyOnRails
[08:15:13] patarr: has joined #RubyOnRails
[08:16:27] helpa: has joined #RubyOnRails
[08:17:02] jhfisc1: has joined #RubyOnRails
[08:21:54] mikecmpbll: has joined #RubyOnRails
[08:22:45] jhfisc: has joined #RubyOnRails
[08:28:47] jhfisc: has joined #RubyOnRails
[08:31:31] jhfisc: has joined #RubyOnRails
[08:36:40] jhfisc: has joined #RubyOnRails
[08:38:14] srinidhi: has joined #RubyOnRails
[08:40:23] lxsameer: has joined #RubyOnRails
[08:42:35] jhfisc: has joined #RubyOnRails
[08:45:54] arBmind: has joined #RubyOnRails
[08:51:42] jhfisc: has joined #RubyOnRails
[08:52:09] roshanavand: has joined #RubyOnRails
[08:52:50] wethu: has joined #RubyOnRails
[08:54:04] aperkins81: has joined #RubyOnRails
[08:55:31] r3vDev: has joined #RubyOnRails
[08:57:27] jhfisc: has joined #RubyOnRails
[08:58:57] tercenya: has joined #RubyOnRails
[09:02:35] Rodya_: has joined #RubyOnRails
[09:03:03] jhfisc: has joined #RubyOnRails
[09:09:41] jhfisc: has joined #RubyOnRails
[09:14:41] cbuchler: has joined #RubyOnRails
[09:16:02] jhfisc: has joined #RubyOnRails
[09:20:04] marr: has joined #RubyOnRails
[09:25:27] nickjj_: has joined #RubyOnRails
[09:26:27] uks: has joined #RubyOnRails
[09:27:46] notem: has joined #RubyOnRails
[09:28:12] jhfisc: has joined #RubyOnRails
[09:30:00] guacamol1: has joined #RubyOnRails
[09:30:45] planigan_: has joined #RubyOnRails
[09:32:38] netwoodle: has joined #RubyOnRails
[09:35:20] Tempesta: has joined #RubyOnRails
[09:35:55] Exagone314: has joined #RubyOnRails
[09:39:47] webdestroya: has joined #RubyOnRails
[09:40:23] zacts: has joined #RubyOnRails
[09:42:07] jhfisc: has joined #RubyOnRails
[09:43:40] srinidhi: has joined #RubyOnRails
[09:46:01] shotbug: has joined #RubyOnRails
[09:47:12] jhfisc: has joined #RubyOnRails
[09:53:39] jhfisc: has joined #RubyOnRails
[10:03:54] Rodya_: has joined #RubyOnRails
[10:05:31] dionysus69: what's wrong with this line ? alert(#{"asd"}); doesn't get rendered in js.haml and returns no errors neither on server nor in js console
[10:06:19] dminuoso: dionysus69: It produces invalid javascript probably.
[10:06:26] dminuoso: dionysus69: unless you happen to have a window.asd floating around.
[10:06:46] dminuoso: See, you are discovering more and more reasons why this js.erb/js.haml stuff is silly!
[10:06:53] dionysus69: oohh I need extra quotes around it maybe
[10:07:24] dionysus69: ok that was the problem :D dminuoso
[10:07:49] dminuoso: dionysus69: You should have still gotten an error.
[10:07:56] dionysus69: dminuoso: if you have couple minutes, could you please help me implement your approach?
[10:08:05] dminuoso: dionysus69: But because of how browsers work, that JS injection probably does give you real shit debugging capabilities.
[10:08:06] dionysus69: dunno console was silent
[10:08:44] dminuoso: dionysus69: Change the controller/view to return json (or whatever format you like) data.
[10:08:46] mr-spoon: has joined #RubyOnRails
[10:09:30] dionysus69: ok lets say I return json with jbuilder, some text ["asd"]
[10:09:44] dionysus69: I have saved your snippet
[10:09:47] dionysus69: $(() => { $('#refreshButton').on('click', (e) => { fetch('/posts').then(response_ok).then(as_json).then((data) => {updatePosts(data); }) }) })
[10:09:49] dminuoso: dionysus69: probably rather as a string primtive itself "asd" but sure
[10:10:05] dminuoso: dionysus69: Then you just need those response_ok and as_json helpers
[10:10:30] dminuoso: Dunno if you have fetch available, so either relace that with jQuery.ajax, or whatever you want to use
[10:10:36] dminuoso: (or polyfill fetch in)
[10:10:42] dionysus69: right now it seems like a lot of extra work, but I will give it a shot, i wanna see how it works :D
[10:10:51] DrYockel1: has joined #RubyOnRails
[10:11:31] dminuoso: dionysus69: With jQuery you probably dont need those response_ok and as_json either.
[10:11:38] dminuoso: So its perhaps easiest to just use jQuery.aax
[10:11:50] dionysus69: I am using jquery ajax to send request
[10:12:02] dionysus69: let me setup controller json response first
[10:12:15] dionysus69: and i ll be back soon so I then get to fetching part
[10:14:39] dminuoso: dionysus69: $(() => { $('#refreshButton').on('click', (e) => { jQuery.ajax('/posts.json').then((data) => {updatePosts(data); }) }) })
[10:14:41] dminuoso: something along those lines then
[10:15:19] deur-: has joined #RubyOnRails
[10:16:09] patarr: has joined #RubyOnRails
[10:17:30] dionysus69: ok so my no_js_view_action.json returns { "data": "aasd" }
[10:18:12] dminuoso: dionysus69: You might as well skip the object. strings are submissible json objects too
[10:18:39] dionysus69: this is the snippet I use to send ajax req https://gist.github.com/anonymous/cbbc94df83f87a918a50eb9951c2c8f2
[10:18:44] dminuoso: I've seen this sad pattern of returning an object for the sake of returning an object, and putting the actual data into a property called data far too often. It pains me to see this.
[10:19:11] dionysus69: ok I ll remove data xD
[10:19:54] jhfisc: has joined #RubyOnRails
[10:20:18] dionysus69: this throws syntax error json @user json.someObjectName @user doesnt
[10:22:12] dminuoso: dionysus69: Interesting, this could be a jbuilder issue/question I guess.
[10:22:36] dionysus69: json [@user]
[10:22:36] dionysus69: this works but then "[]" is the object name
[10:23:13] dminuoso: dionysus69: I guess in the end it wont matter. If you ever needed to return a string primitive, you wouldnt use jbuilder anyway but just call render foo.to_json
[10:23:39] dminuoso: or render json: foo
[10:23:43] dminuoso: ACTION shrugs
[10:23:46] dminuoso: anyway, its not that relevant.
[10:23:58] dionysus69: well ye :P but I prefer views for scalability reasons, I wont have to add it later if i am rendering some larger data
[10:26:37] arup_r: has joined #RubyOnRails
[10:28:11] jhfisc: has joined #RubyOnRails
[10:28:26] arup_r: My redis setup in heroku is started giving me an error OOM command not allowed when used memory > 'maxmemory' .. Any idea about how can I fix it. I did ask this https://www.reddit.com/r/rails/comments/6jr6q2/error_heartbeat_oom_command_not_allowed_when_used/ .So if anyone faced the similar issues and know how to solve it, please help me. :)
[10:28:50] dionysus69: so far I have made only this > then work https://gist.github.com/anonymous/01d76334fe57842e7364c6340c15315a
[10:30:34] dminuoso: ACTION slaps dionysus69
[10:30:38] dminuoso: dionysus69: Do not use "var" anymore.
[10:30:52] dminuoso: Forget var ever existed.
[10:30:59] dminuoso: And no, not let.
[10:31:06] dminuoso: const should be your default all the time.
[10:31:11] dionysus69: trust me on my javascript is not on the level that using var will create problems for me :D
[10:31:30] dminuoso: No reason not to use `const` then :p
[10:31:55] dionysus69: ok fine, changed it to const xD
[10:32:29] dionysus69: and so what about "then" ? how do I get data back from that json route?
[10:32:49] dminuoso: dionysus69: then takes a callback...
[10:33:05] dminuoso: dionysus69: so .then((response) => {...})
[10:33:19] dminuoso: or idk what jQuery puts in there
[10:33:22] dminuoso: look up the documentation
[10:35:41] jhfisc: has joined #RubyOnRails
[10:37:17] ascarter: has joined #RubyOnRails
[10:38:12] Fernando-Basso: has joined #RubyOnRails
[10:38:21] jhfisc: has joined #RubyOnRails
[10:39:37] dionysus69: dminuoso: ok this is full code of ajax with request.done instead of then https://gist.github.com/anonymous/2f29bc58dc94f9cbaaa4dbe25f5c351f
[10:40:37] dionysus69: that fetches json response and puts back in .response-div
[10:41:13] dminuoso: Give me a moment.
[10:41:40] dionysus69: if you dont want to define dataType: "json" you could just append .json to the request url
[10:44:59] dminuoso: dionysus69: FTFY https://gist.github.com/dminuoso/15ba3ebff7f9b92b0495fbd5ccf3790c
[10:45:57] dionysus69: https://gist.github.com/anonymous/ff64af9ca4302f5171fcced0f422fd41
[10:46:09] dionysus69: wait let me understand whats going on in that es6? js?
[10:46:29] dminuoso: dionysus69: (...) => {} is almost the same as function(...) => {}
[10:47:06] dminuoso: Except a) its more readable (alphanumeric characters smell like identifiers, the function keyword is just noise), and more importantly b) it has no "context" of its own, it assumes the this from the context it was defined in.
[10:47:07] dionysus69: cool, I have done that actually when I was doing ember but forgot with no practice :D
[10:47:11] dminuoso: That last bit is extremely useful. :)
[10:47:39] dionysus69: which last bit? meaning?
[10:47:47] dminuoso: it has no "context" of its own, it assumes the this from the context it was defined in.
[10:49:19] futilegames: has joined #RubyOnRails
[10:49:55] dionysus69: yep now I see this approach is cooler, you will get a nice json object and then you can do anything with it. or define other js actions within .done .fail or .always callbacks
[10:50:57] dminuoso: dionysus69: Just hope you don't ever need to treat 4xx errors as success. ;-)
[10:51:09] dminuoso: Because jQuery is so nice that it will invoke the fail handler for you.
[10:51:48] dionysus69: whats 4xx? I dont know response codes by-heart
[10:53:20] dminuoso: dionysus69: client errors. 404 for example. ;-)
[10:53:54] dionysus69: https://gist.github.com/webzorg/81edcd0e6a66b666de977c69fef5477f nice :P :D
[10:54:13] dionysus69: yes so what do you mean what can go wrong with it
[10:54:32] dionysus69: i dont understand what did you mean by jquery handling success in which case :D
[10:54:59] dminuoso: Jason: nevermind then.
[10:56:31] dionysus69: ok :D thanks again :) ill try stick with json response approach x)
[11:04:43] dionysus69: this is better respond_to :json, only: [:no_js_view_action]
[11:04:53] Rodya_: has joined #RubyOnRails
[11:04:59] dionysus69: then respond_to do |format| format.json end within action?
[11:05:17] dionysus69: let's say I have only one format
[11:06:59] catphish: has joined #RubyOnRails
[11:07:54] catphish: does rails support using a custom primary key on an activerecord model?
[11:08:27] catphish: i see one can remove the id column in a migration, but i'm not sure what else is needed
[11:10:01] matthewd: catphish: I just literally copy and pasted your question into Google and it gave me the answer
[11:10:35] catphish: thanks, please can you paste said answer here
[11:10:49] catphish: ie the one you believe to be correct
[11:12:10] jhfisc: has joined #RubyOnRails
[11:12:12] catphish: after some digging, the most attractive answer is that one can pass :primary_key to create_table, and also specify it in the model, i'll try that
[11:12:12] matthewd: Do you believe the answer it's giving you is incorrect?
[11:12:37] catphish: matthewd: i've read at least 3 different answers
[11:13:03] catphish: ranging from "no" through "only this hacky way" through to "yes, easy"
[11:13:14] catphish: matthewd: so yes, at least one of those answers is incorrect
[11:13:40] catphish: however it's clear you'd rather be rude than assist me, so i shall bid you farewell and hope you change your attitude soon
[11:13:48] catphish: anyone else know?
[11:14:01] patarr: has joined #RubyOnRails
[11:16:09] arBmind: has joined #RubyOnRails
[11:16:28] catphish: actually, i need a composite key, looks like that's much less likely to be supported out of the box anyway
[11:16:44] matthewd: Yeah, that's not supported
[11:17:17] catphish: shame, what i need is so simple i'm sure i can do it without AR though, thanks for comfirming
[11:18:10] jhfisc: has joined #RubyOnRails
[11:18:18] matthewd: (If you're having trouble implementing something, I'm always happy to help. If being uninterested in regurgitating the documentation is rude, there's not much I can do about that.)
[11:18:36] matthewd: There may be a 3rd party library that supports composite keys? I'm not sure, tbh.
[11:19:26] catphish: sorry for being a dick, just got so many answers from google, hoped someone would know which was correct for current rails, but since i need composite keys that point is moot anyway
[11:20:05] catphish: i did find a third party library, but all seems a bit messy, what i want is extremely simple, i just want to store a (very large) list of integers that belong to a model
[11:20:55] catphish: i don't want to have to store a 64 bit integer ID along with every one, seems wasteful
[11:21:25] catphish: so the table will need to be indexed primary on [model_id, value]
[11:21:50] catphish: this will also produce the most efficient lookups
[11:22:43] matthewd: I wonder if you could fake it with habtm
[11:23:01] unreal: has joined #RubyOnRails
[11:23:05] catphish: lol, i just ran my migration and raisl itself gave me my answer: WARNING: Active Record does not support composite primary key.
[11:23:07] matthewd: If you never called something that actually tried to modelify the RHS...
[11:24:17] catphish: my schema looks like this: https://paste.ubuntu.com/24962806/
[11:25:18] jhfisc: has joined #RubyOnRails
[11:25:35] r3vDev: has joined #RubyOnRails
[11:26:33] catphish: annoyingly my integer column size doesn't seem to have made it into the schema
[11:28:49] catphish: oh, yes it has
[11:29:01] catphish: it's just expressed as bigint not instead of length: 8
[11:30:11] catphish: anyway, thanks, i'm sure i can put somehthing together
[11:32:26] jhfisc: has joined #RubyOnRails
[11:38:36] futilegames: has joined #RubyOnRails
[11:39:44] ascarter: has joined #RubyOnRails
[11:40:14] catphish: has left #RubyOnRails: ("Leaving")
[11:40:35] jhfisc: has joined #RubyOnRails
[11:42:10] francuz: has joined #RubyOnRails
[11:42:40] quazimodo: has joined #RubyOnRails
[11:46:24] alfiemax: has joined #RubyOnRails
[11:46:29] srinidhi: has joined #RubyOnRails
[11:47:00] roshanavand: has joined #RubyOnRails
[11:50:43] francuz: hello everyone, how do you use conditional css in rails 5? the css that should be included only for IE8 for example? all the post i find on the subject are about older rails version, and i think(and hope) that rails implemented a cleaner solution by now
[11:51:53] alfiemax: francuz: can you show a few of those old posts, and where it's mentioned it's related to a particular rails version?
[11:53:52] francuz: https://stackoverflow.com/questions/13392126/how-do-you-properly-include-a-conditional-css-file-for-ie-in-rails-3-1-asset-p for example, proposed solution probably would work on rails 5, i'm just wondering if there is no "cleaner" solution
[11:54:31] francuz: wait ...nothing,
[11:54:42] francuz: found other solutions, and didn't read the one that is clena
[11:54:48] francuz: that is the one i sent you...
[11:55:26] matthewd: francuz: The modern solution is to not support IE8
[11:56:54] francuz: the solution is requires me to compile sass separatly nevertheless... but better than other solutions I found,
[11:58:16] matthewd: alfiemax: I suspect your reloading issue involves the devise-jwt gem. Can you reproduce without it?
[11:59:46] AzaToth: has joined #RubyOnRails
[12:04:30] Mihal: has joined #RubyOnRails
[12:04:35] alfiemax: matthewd: ok, let me give it a try
[12:04:47] bpmedley: has joined #RubyOnRails
[12:05:27] Rodya_: has joined #RubyOnRails
[12:06:24] jhfisc: has joined #RubyOnRails
[12:08:18] krmela: has joined #RubyOnRails
[12:17:07] krmela: good day , iam rendering simple work day calendar and i have strange error on line where i am compare wday https://gist.github.com/anonymous/e6f14807182d4b38da13d72787a5ef95
[12:18:10] alfiemax: krmela: which line is it? what is the error, please add the error stack trace
[12:19:22] krmela: it is <%=if (day.wday == actualday.wday)%> in index.html.erb
[12:22:24] mahloun_: has joined #RubyOnRails
[12:24:32] Ericx2x: has joined #RubyOnRails
[12:26:53] dminuoso: matthewd: I distinctly remember a very early talk by DHH calling people who even consider composite primary keys insane, stating that he purposefully kept them out of ActiveRecord.
[12:26:55] dminuoso: It was a bit silly.
[12:28:42] workmad3: has joined #RubyOnRails
[12:29:51] dminuoso: 2006 it was I think?
[12:29:53] alfiemax: matthewd: yes, it seems the User class is not reloaded inside the devise-jwt gem
[12:29:54] dminuoso: At railsconf?
[12:30:04] alfiemax: i've created a issue with them
[12:30:17] shtirlic: has joined #RubyOnRails
[12:30:46] alfiemax: but can anyone help me fix this issue in devise-jwt ?
[12:31:40] matthewd: alfiemax: First guess would be the 'self' in the options. Can you try a different value there, at least for testing?
[12:32:15] alfiemax: `jwt_revocation_strategy: self` ?
[12:32:31] alfiemax: hmm, ok i'll try a different one
[12:33:34] jhfisc: has joined #RubyOnRails
[12:34:06] matthewd: dminuoso: Plausible; AR has always taken a pretty hard line on the "right" way to design your DB
[12:34:58] dminuoso: matthewd: It just becomes a real issue if you start interfacing with an existing database that has been operating on composite primary keys for a long time. Rails would like me to refactor the database to keep a single surrogate key.
[12:35:37] dminuoso: But I guess in the end what this means, is just that rails is a very opinionated framework.
[12:35:56] matthewd: Yeah.. we're flexible on most other points, but that one requires a fair bit more than some name mappings
[12:38:57] alfiemax: matthewd: that didn;t help. i tried `jwt_revocation_strategy: Devise::JWT::RevocationStrategies::Null`
[12:39:37] chimkan: has joined #RubyOnRails
[12:43:04] ascarter: has joined #RubyOnRails
[12:55:48] jhfisc: has joined #RubyOnRails
[12:58:57] DrYockel: has joined #RubyOnRails
[13:01:43] jhfisc: has joined #RubyOnRails
[13:01:44] jphase: has joined #RubyOnRails
[13:02:56] mostlybadfly: has joined #RubyOnRails
[13:13:43] jhfisc: has joined #RubyOnRails
[13:14:50] tanuki: has joined #RubyOnRails
[13:18:48] jhfisc: has joined #RubyOnRails
[13:19:30] dionysus69: any ideas what's wrong with my script ? https://gist.github.com/anonymous/6469b384a1938410a82fa920d7d245a6
[13:19:49] dionysus69: I am trying to consume soap API for the first time and I am lacking basic knowledge :S
[13:20:08] Jameser: has joined #RubyOnRails
[13:20:21] dionysus69: i am using savon and get error about some cookie#domain
[13:21:28] dminuoso: dionysus69: Error?
[13:21:44] dminuoso: dionysus69: It's just a warning emitted by httpclient which savon uses.
[13:22:09] dionysus69: `load_from_remote': Error: 500 for url http://127.0.0.1/satesto/ws/WebSiteExchange.1cws?wsdl (Wasabi::Resolver::HTTPError)
[13:22:12] dionysus69: this is following
[13:22:18] dionysus69: but I thought that first one was more important
[13:22:35] dminuoso: Before I continue, any other errors, warnings, and things you like to share?
[13:22:49] dminuoso: You know, just to make sure you are not hiding anything further because you think this is more improtant.
[13:23:01] dionysus69: nope that's the point when output becomes generic crash
[13:23:08] dminuoso: Good. 500 meant server side error.
[13:23:09] helpa: Next question, please!
[13:23:55] dionysus69: from what I understood every wsdl api should support "operations" :)
[13:24:53] jhfisc: has joined #RubyOnRails
[13:29:05] jhfisc: has joined #RubyOnRails
[13:32:54] rfoust: has joined #RubyOnRails
[13:35:49] quirkycoders: has joined #RubyOnRails
[13:36:49] quirkycoders: has joined #RubyOnRails
[13:36:50] Technodrome: has joined #RubyOnRails
[13:39:10] jhfisc: has joined #RubyOnRails
[13:43:04] quirkycoders: has joined #RubyOnRails
[13:45:33] lxsameer: has joined #RubyOnRails
[13:47:19] quirkycoders: has joined #RubyOnRails
[13:47:37] ascarter: has joined #RubyOnRails
[13:47:57] r3vDev: has joined #RubyOnRails
[13:49:46] jhfisc: has joined #RubyOnRails
[13:50:16] chouhoulis: has joined #RubyOnRails
[13:52:38] mr-spoon: has joined #RubyOnRails
[13:55:41] jhfisc: has joined #RubyOnRails
[14:03:40] jhfisc: has joined #RubyOnRails
[14:03:42] conta: has joined #RubyOnRails
[14:09:16] r3vDev: has joined #RubyOnRails
[14:09:52] mikecmpbll: has joined #RubyOnRails
[14:21:04] futilegames: has joined #RubyOnRails
[14:21:11] GodFather: has joined #RubyOnRails
[14:24:43] shotbug: has joined #RubyOnRails
[14:26:51] patarr: has joined #RubyOnRails
[14:27:44] Chernobuk: has joined #RubyOnRails
[14:29:55] dionysus69: anyone here has experience with soap api and savon?
[14:30:16] dionysus69: I finally got client.operations to output possible operations
[14:30:25] dionysus69: but I am still unable to send any .call messages
[14:30:45] dionysus69: soap tells me "~not enough parameters"
[14:31:30] dionysus69: this is the action with all its parameters https://gist.github.com/91d33b7485490b35a018ca3e51ee5000
[14:31:47] dionysus69: how would I translate this to a savon call? so far I have this ... client.call(:get_currencies)
[14:32:03] jphase: has joined #RubyOnRails
[14:35:17] jhfisc: has joined #RubyOnRails
[14:38:38] r3vDev: has joined #RubyOnRails
[14:41:09] ResidentBiscuit: has joined #RubyOnRails
[14:46:11] pLaTo0n: has joined #RubyOnRails
[14:50:15] ascarter: has joined #RubyOnRails
[14:52:54] jhfisc: has joined #RubyOnRails
[14:53:30] DoubleMalt: has joined #RubyOnRails
[14:55:34] jgpawletko: has joined #RubyOnRails
[15:00:25] rikkipitt: has joined #RubyOnRails
[15:01:24] profsimm: has joined #RubyOnRails
[15:01:26] profsimm: Question: why the logo of Ruby on Rails, isn't rails, but a movie film strip?
[15:01:57] mokiwis: has joined #RubyOnRails
[15:03:03] jhfisc: has joined #RubyOnRails
[15:04:50] theunraveler: has joined #RubyOnRails
[15:05:08] matthewd: profsimm: It's an artistic device, but it is supposed to be representative of rails
[15:07:42] Rodya_: has joined #RubyOnRails
[15:07:45] profsimm: matthewd: I mean it's best one rail.
[15:08:05] profsimm: matthewd: maybe one very thick rail?
[15:12:39] jhfisc: has joined #RubyOnRails
[15:12:52] futilegames: has joined #RubyOnRails
[15:13:38] havenwood: profsimm: Multiple monorails.
[15:13:56] havenwood: profsimm: Multiple-monorail majestic monolith.
[15:16:43] jhfisc: has joined #RubyOnRails
[15:16:44] emerson: has joined #RubyOnRails
[15:18:50] pLaToOn: has joined #RubyOnRails
[15:23:46] irishfromua: has joined #RubyOnRails
[15:26:49] ElektroBug: has joined #RubyOnRails
[15:27:48] ElektroBug: i am making my blog in rails, there will be blogs, tutorials and projects which have same details i.e. title and content
[15:28:33] ElektroBug: should i make blog, tutorial and projects different models or same identify it with some value in one model?
[15:31:04] platoon23: has joined #RubyOnRails
[15:31:04] fryguy: separate models
[15:31:38] ElektroBug: fryguy: thanks for help
[15:31:47] havenwood: ElektroBug: How much do they share and how much do they differ? Those seem like different things.
[15:33:04] jhfisc: has joined #RubyOnRails
[15:38:43] ChanServ: +o baweaver
[15:39:09] ChanServ: -o baweaver
[15:39:43] jhfisc: has joined #RubyOnRails
[15:42:33] mikecmpbll: has joined #RubyOnRails
[15:42:35] Rodya_: has joined #RubyOnRails
[15:43:36] pLaTo0n: has joined #RubyOnRails
[15:43:49] brent__: has joined #RubyOnRails
[15:47:37] pLaToOn: has joined #RubyOnRails
[15:52:42] Chernobuk: has joined #RubyOnRails
[15:54:37] jhfisc: has joined #RubyOnRails
[15:54:48] ascarter: has joined #RubyOnRails
[15:57:41] jhfisc: has joined #RubyOnRails
[15:58:10] Junaos: has left #RubyOnRails: ()
[16:00:42] jhfisc: has joined #RubyOnRails
[16:04:00] [Butch]: has joined #RubyOnRails
[16:04:18] Chernobuk: has joined #RubyOnRails
[16:05:56] jhfisc: has joined #RubyOnRails
[16:07:32] Chernobuk: has joined #RubyOnRails
[16:19:39] futilegames: has joined #RubyOnRails
[16:20:22] tbuehlmann: is there any pub/sub solution built into rails that I should know? I have a need for one that is suited for short-living subscribers (hint: the docs say AS::Notifications is not suited)
[16:20:22] jhfisc: has joined #RubyOnRails
[16:20:26] r3vDev: has joined #RubyOnRails
[16:21:14] quirkycoders: has joined #RubyOnRails
[16:26:34] defsdoor: has joined #RubyOnRails
[16:27:47] Chernobuk: has joined #RubyOnRails
[16:28:26] xx00__: has joined #RubyOnRails
[16:29:07] gusrub: has joined #RubyOnRails
[16:33:55] ElektroBug: has joined #RubyOnRails
[16:35:01] hahuang65: has joined #RubyOnRails
[16:35:51] shotbug: has joined #RubyOnRails
[16:40:10] tfitts: has joined #RubyOnRails
[16:42:02] jhfisc: has joined #RubyOnRails
[16:49:47] hahuang65: has joined #RubyOnRails
[17:02:10] jhfisc: has joined #RubyOnRails
[17:04:45] arup_r: has joined #RubyOnRails
[17:05:24] tercenya: has joined #RubyOnRails
[17:06:10] arup_r: Hi. I am looking for a way to delete completed jobs from redis. I am using sidekiq. I was looking into this doc https://github.com/mperham/sidekiq/wiki/API , but didn't see any such method to check if the jobs is processed or not. Any idea if there is a way?
[17:08:06] jhfisc: has joined #RubyOnRails
[17:12:56] beingjohnm: arup_r: to save disk space?
[17:13:05] arup_r: beingjohnm: yes
[17:13:25] beingjohnm: When you do what is outlined on that page I believe it only returns anything that has not been completed
[17:14:14] beingjohnm: Can you connect ot Redis directly?
[17:14:30] arup_r: using sidekiq I can.
[17:14:58] beingjohnm: I meant outside of Sidekiq
[17:15:07] arup_r: beingjohnm: I saw this https://github.com/mperham/sidekiq/wiki/API#stats-history and trying to think how it counts which are processed. Seems the method does this is not a public API
[17:15:21] beingjohnm: yeah, I saw that too
[17:15:25] arup_r: beingjohnm: yes I can. I am using Heroku, so I can open CLI
[17:15:40] Pumukel: has joined #RubyOnRails
[17:16:29] arup_r: I thought sidekiq does it, but as my Redis server exploded, it seems sidekiq doesn't do it. I need to do it manually
[17:17:47] dionysus69: has joined #RubyOnRails
[17:17:55] mikecmpbll: has joined #RubyOnRails
[17:19:41] jhfisc: has joined #RubyOnRails
[17:24:36] jhfisc: has joined #RubyOnRails
[17:27:35] kies: has joined #RubyOnRails
[17:31:14] jhfisc: has joined #RubyOnRails
[17:34:16] jhfisc: has joined #RubyOnRails
[17:38:05] alfiemax: has joined #RubyOnRails
[17:41:37] conta: has joined #RubyOnRails
[17:41:59] hahuang65: has joined #RubyOnRails
[17:42:02] conta: has joined #RubyOnRails
[17:42:28] arup_r: has joined #RubyOnRails
[17:44:10] jhfisc: has joined #RubyOnRails
[17:45:01] arup_r: beingjohnm: I will delete programatically .. this is how I will access the key https://github.com/mperham/sidekiq/blob/976bef7d066ac2bb98422efe62605b7a91da6354/lib/sidekiq/api.rb#L54
[17:48:09] shotbug: has joined #RubyOnRails
[17:49:19] arup_r: but I don't think that will be good approach though.. because the key can be used by other processes
[17:50:02] arup_r: What is best approach to handle such things https://www.reddit.com/r/rails/comments/6jr6q2/error_heartbeat_oom_command_not_allowed_when_used/
[17:53:57] jhfisc: has joined #RubyOnRails
[17:57:10] arup_r: has joined #RubyOnRails
[17:58:13] apofis: has joined #RubyOnRails
[17:59:09] ascarter: has joined #RubyOnRails
[17:59:11] jhfisc: has joined #RubyOnRails
[18:00:20] mrbubbles: has joined #RubyOnRails
[18:04:48] jhfisc: has joined #RubyOnRails
[18:07:11] loechel: has joined #RubyOnRails
[18:10:16] rietta: has joined #RubyOnRails
[18:10:26] jhfisc: has joined #RubyOnRails
[18:14:40] jcutrell: has joined #RubyOnRails
[18:15:39] gusrub: has joined #RubyOnRails
[18:16:38] jcutrell: Hi folks. I've got a quick question regarding the Webpacker update released wtih 5.1 - our app depends on a few gem-based JavaScript resources that we have been including using the sprocket requiring syntax (the `//= require` syntax, to be more explicit). However, when using webpack in tandem, those resources are not pulled in. Is there a webpacker/sprockets bridge that I'm missing out on?
[18:17:41] jhfisc: has joined #RubyOnRails
[18:21:02] gusrub: has joined #RubyOnRails
[18:24:24] jhfisc: has joined #RubyOnRails
[18:28:12] futilegames: has joined #RubyOnRails
[18:33:00] dionysus69: has joined #RubyOnRails
[18:33:07] jhfisc: has joined #RubyOnRails
[18:35:13] Quintasan: has joined #RubyOnRails
[18:38:55] Zinefer: has joined #RubyOnRails
[18:39:39] Zinefer: hello everyone, i have a class that i created in lib/ ... i want to get the current controller name ... like will_paginate does it: https://github.com/mislav/will_paginate/blob/master/lib/will_paginate/view_helpers/action_view.rb#L92
[18:39:51] Zinefer: when i do that i get undefined variable/method errors
[18:39:55] Zinefer: i must be missing something...
[18:41:24] havenwood: Zinefer: Where are you trying to use #controller_name? What is `class.self` from where you're trying?
[18:41:45] havenwood: self.class***
[18:43:25] arup_r: has joined #RubyOnRails
[18:44:07] jhfisc: has joined #RubyOnRails
[18:45:49] Zinefer: im a bit new to both ruby and rails, i apologize in advance... in lib/list_view.rb i have the following: class ListView def initialize() end def render controller.inspect end end in my controller i initialize listview and pass it to a partial that calls render
[18:46:07] Zinefer: then the result is
[18:46:14] Zinefer: undefined local variable or method `controller'
[18:46:19] Zinefer: brb, very sorry :(
[18:47:41] jhfisc: has joined #RubyOnRails
[18:49:52] gusrub: has joined #RubyOnRails
[18:50:22] jhfisc: has joined #RubyOnRails
[18:54:54] arup_r: Zinefer: inside lib u don't have access to the controller method
[18:55:52] jhfisc: has joined #RubyOnRails
[19:01:52] jhfisc: has joined #RubyOnRails
[19:04:19] gusrub: has joined #RubyOnRails
[19:05:22] Uranio: has joined #RubyOnRails
[19:13:45] beingjohnm: Anybody know how to merge two I18n yml files inside of rails? I have my default en file and then client specific yml files that replace certain strings in the en.yml.
[19:15:02] KeyJoo: has joined #RubyOnRails
[19:15:37] arup_r: beingjohnm: this is how I planned to clear processed keys for now. https://gist.github.com/aruprakshit/8c180187401aa7091f8193777435d27d :) Just thought to show you.
[19:16:08] arup_r: beingjohnm: are they both :en ?
[19:17:46] jane_booty_doe: has joined #RubyOnRails
[19:20:55] ur5us: has joined #RubyOnRails
[19:25:56] jhfisc: has joined #RubyOnRails
[19:26:36] lxsameer: has joined #RubyOnRails
[19:34:47] gusrub_: has joined #RubyOnRails
[19:35:24] hahuang65: has joined #RubyOnRails
[19:36:00] lbrewington: has joined #RubyOnRails
[19:36:34] lbrewington: i can't seem to remember the best way to print out complex objects for debugging , obviously puts just outputsthe pointer reference, what should i do to output the object for detailed inspection?
[19:38:16] duderonomy: has joined #RubyOnRails
[19:39:49] ur5us: has joined #RubyOnRails
[19:41:57] jhfisc: has joined #RubyOnRails
[19:42:45] tbuehlmann: lbrewington: do you mean object.inspect?
[19:42:54] lbrewington: i am using that kinda
[19:43:06] lbrewington: but even that doesn't do a very good job of pretty printing out the object
[19:43:08] lbrewington: it's just all inline
[19:48:21] jhfisc: has joined #RubyOnRails
[19:49:04] Coldblackice: has joined #RubyOnRails
[19:49:43] tbuehlmann: what are you inspecting exactly?
[19:53:46] lbrewington: inspecting this http://www.rubydoc.info/github/alexreisner/geocoder/Geocoder/Result/Freegeoip
[19:54:03] lbrewington: [#<Geocoder::Result::Freegeoip:0x007fa0950a90a0 @data={"ip"=>"204.57.220.1", "country_code"=>"US", "country_name"=>"United States", "region_code"=>"WA", "region_name"=>"Washington", "city"=>"Redmond", "zip_code"=>"98052", "time_zone"=>"America/Los_Angeles", "latitude"=>47.6801, "longitude"=>-122.1206, "metro_code"=>819}, @cache_hit=nil>]
[19:54:39] Coldblackice_: has joined #RubyOnRails
[19:55:50] Aytan72: has joined #RubyOnRails
[19:56:23] lbrewington: howdy partner
[19:58:09] lbrewington: if i wanted to output the city in that data, how would i do that with a puts statement, totally at a loss with something so simple
[19:59:42] Coldblackice_: has joined #RubyOnRails
[20:02:56] lbrewington: the .to_yaml outputs some weirdness with new lines expressed as \n which makes it pretty useless. maybe it looks better with byebug or something, but i'm currently using debase with rdebug_ide
[20:03:23] lbrewington: "---\n- !ruby/object:Geocoder::Result::Freegeoip\n data:\n ip: 204.57.220.1\n country_code: US\n country_name: United States\n region_code: WA\n region_name: Washington\n city: Redmond\n zip_code: '98052'\n time_zone: America/Los_Angeles\n latitude: 47.6801\n longitude: -122.1206\n metro_code: 819\n cache_hit: \n"
[20:03:41] lbrewington: i mean is the data stacked under or inline with the rest?
[20:03:45] lbrewington: pretty impossible to tell
[20:04:23] lbrewington: i type location.data and it says undefined method `data' for #<Array:0x007fa095640c48>
[20:04:34] lbrewington: and location['data'] return no implicit conversion of String into Integer
[20:05:06] gusrub: has joined #RubyOnRails
[20:06:35] chimkan: has joined #RubyOnRails
[20:07:31] baweaver: lbrewington: it's an array
[20:07:38] baweaver: try location.first
[20:07:57] Coldblackice: has joined #RubyOnRails
[20:08:04] baweaver: really a better name for it would be locations
[20:08:31] lbrewington: but let's say location.first returns the same exact thing
[20:08:55] lbrewington: bamweaver: okay okay i get it
[20:09:04] baweaver: ACTION hits backspace
[20:09:04] lbrewington: bamweaver: we making progress now, thanks so much!
[20:09:25] baweaver: ACTION wonders where the "m" is coming from
[20:09:36] lbrewington: ACTION facepalms
[20:09:44] lbrewington: baweaver: thanks for the help lol
[20:12:17] josefrichter: has joined #RubyOnRails
[20:14:06] lbrewington: so is there a way to pretty print these output? Trying to output request of a ApplicationControler (looks to be a Rack:Request object???) and it is many many many many lines all together, but it would e really nice to be able to read what is in the object
[20:15:08] lbrewington: i am use to having access to a pretty robust debugger, so switching into this Ruby environment is really making me struggle because I can not see
[20:15:42] jhfisc: has joined #RubyOnRails
[20:16:26] lbrewington: do you use a debugger?
[20:17:03] lbrewington: lol, pp works alright, also scrolls my terminal for about 10 seconds
[20:17:30] baweaver: Then only output part of it. If you type in only the variable name then pry will page it.
[20:17:44] baweaver: normally using less unless you've done something odd or you're on Windows.
[20:17:45] lbrewington: so you use pry_byebug?
[20:18:07] baweaver: pry-rails, but essentially yes.
[20:18:20] lbrewington: i'm using vs_code with the rdebug_ide / debase extension and I had to disable byebug because it was causing errors
[20:18:34] baweaver: https://www.youtube.com/watch?v=jDXsEzOHb2M
[20:18:37] lbrewington: think i'm just going to try ruby mine at this point
[20:19:30] baweaver: A lot tend to use Sublime or Vim, but to each their own
[20:19:35] baweaver: I can't really speak to Rubymine
[20:19:43] baweaver: never used it so I don't really have an opinion on it.
[20:20:17] lbrewington: does submline have a byebug extension? i would assume who ever programmed the extension for it is using rdebug-ide as well
[20:20:22] lbrewington: no way am i going to use vim
[20:21:02] baweaver: hence to each their own
[20:21:56] baweaver: It may, I just keep a commandline open on another screen most times.
[20:22:27] lbrewington: well thanks for you help
[20:22:28] Zinefer: alright ... i was in here earlier asking questions poorly before i had to run off ... i should have plenty of time to see this through this time
[20:23:05] Zinefer: i am inside a class in my lib directory ... how can i reference the controller name like will_paginate does here: https://github.com/mislav/will_paginate/blob/master/lib/will_paginate/view_helpers/action_view.rb#L92 ?
[20:23:21] Zinefer: my code keeps throwing undefined errors for the controller variable
[20:23:30] baweaver: havenwood may still be around.
[20:23:38] Zinefer: is that will_paginate class extended from something that i'm not seeing?
[20:23:42] baweaver: ACTION is about to head to coffee before he falls asleep again
[20:25:08] futilegames: has joined #RubyOnRails
[20:27:56] hahuang65: has joined #RubyOnRails
[20:31:35] mordof: has joined #RubyOnRails
[20:32:38] mordof: I'm trying to take a hash passed in a variable for my view, and use a tag helper (tag :div, class: 'foo', data: @my_obj) with nested hashes. is anyone familiar with how i would accomplish this? the nesting is casting the hash to a string and then escaping it...
[20:32:44] gusrub: has joined #RubyOnRails
[20:32:52] jhfisc: has joined #RubyOnRails
[20:32:53] Aherin: has joined #RubyOnRails
[20:33:50] srinidhi: has joined #RubyOnRails
[20:35:20] gusrub_: has joined #RubyOnRails
[20:38:28] ascarter: has joined #RubyOnRails
[20:40:23] harfangk: has joined #RubyOnRails
[20:41:52] jhfisc: has joined #RubyOnRails
[20:42:35] hahuang65: has joined #RubyOnRails
[20:42:58] mordof: nevermind.. it's json serialised. i find that to be rather strange, but it still works
[20:45:06] Pumukel_: has joined #RubyOnRails
[20:46:37] S1kx: has joined #RubyOnRails
[20:50:46] chrisgopher: has joined #RubyOnRails
[20:54:09] jhfisc: has joined #RubyOnRails
[20:55:07] Zinefer: is this what i am missing? https://github.com/mislav/will_paginate/blob/master/lib/will_paginate/view_helpers/action_view.rb#L149
[20:55:27] Zinefer: how can i use this in a class definition ... maybe i need to figure out what the difference between a class and a module are :s
[20:58:52] Rodya_: has joined #RubyOnRails
[20:59:55] mr-spoon: has joined #RubyOnRails
[21:01:54] Coldblackice_: has joined #RubyOnRails
[21:08:14] brent__: has joined #RubyOnRails
[21:09:52] jhfisc: has joined #RubyOnRails
[21:15:47] jhfisc: has joined #RubyOnRails
[21:21:46] jhfisc: has joined #RubyOnRails
[21:24:23] Zinefer: class ListView < ActionView::Base
[21:24:24] Zinefer: include ActionView::Helpers, ActionView::Context
[21:24:39] Zinefer: adding these to my class has gotten me farther ... but
[21:25:10] Zinefer: now i get this error: ctionView::Helpers::ControllerHelper#controller_name delegated to controller.controller_name, but controller is nil
[21:26:34] arup_r: has joined #RubyOnRails
[21:26:40] guacamole: has joined #RubyOnRails
[21:27:36] ur5us: has joined #RubyOnRails
[21:33:32] jhfisc: has joined #RubyOnRails
[21:38:55] jhfisc: has joined #RubyOnRails
[21:45:46] br0d1n: has joined #RubyOnRails
[21:54:38] uksio: has joined #RubyOnRails
[21:59:10] tercenya: has joined #RubyOnRails
[22:06:32] GodFather: has joined #RubyOnRails
[22:18:37] quirkycoders: has joined #RubyOnRails
[22:20:34] Jason: what's the naming convention for project names?
[22:20:40] Jason: TodoList? todolist? todo_list? etc
[22:23:00] Radar: GOOD MORNING
[22:23:48] Aytan72: Jason: I believe camelcase is the way to go. todo_list
[22:23:59] Aytan72: Radar: Mornin'!
[22:24:11] Radar: Jason: whatever your heart desires.
[22:26:13] Radar: Jason: Seems like you haven't read Chapter 1 of Rails 4 in Action yet. tsk tsk tsk
[22:26:44] Radar: And I thought you loved me :sad_party_parrot:
[22:27:08] roshanavand: has joined #RubyOnRails
[22:36:35] jphase_: has joined #RubyOnRails
[22:37:02] workmad3: has joined #RubyOnRails
[22:43:22] agent_white: has joined #RubyOnRails
[22:43:31] FCser: has joined #RubyOnRails
[23:01:11] Technodrome: has joined #RubyOnRails
[23:04:12] patarr: has joined #RubyOnRails
[23:20:10] xx00__: has joined #RubyOnRails
[23:24:14] Jason: 22:26:13 < Radar> Jason: Seems like you haven't read Chapter 1 of Rails 4 in action yet
[23:24:30] Jason: Radar: guilty :P
[23:24:34] 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
[23:24:37] Radar: There's a way to fix this.
[23:26:12] Jason: Radar: wow, that book looks solid. sold!
[23:26:28] Radar: Can confirm it is solid. It's ~600 pages of deadtree.
[23:26:34] Radar: You can get the electronic copy too if you'd like
[23:27:02] Jason: i prefer ebooks anyway, kindle <3
[23:29:42] Jason: Radar: is there a particular IDE that you're partial to? I've been playing with RubyMine and i'm not crazy with it
[23:29:50] Radar: Jason: I like Sublime Text 3.
[23:30:00] Radar: With Vintage mode enabled (vim key bindings)
[23:30:09] Jason: i never got into vim, hah
[23:30:18] Jason: i'll take a look
[23:31:21] Jameser: has joined #RubyOnRails
[23:31:34] Jason: Radar: wow, looks promising. VERY quick and light
[23:36:40] Jason: Radar: time to do some reading! :) thank you again
[23:37:29] Maletor: has joined #RubyOnRails
[23:38:31] Maletor: how come ActionDispath::Request.new({}) doesn't have a cookie_jar object while my gemspec requires actiondispatch > 5
[23:41:18] zacts: has joined #RubyOnRails
[23:48:40] Radar: maletor: what happens when you call that method?
[23:49:17] mwlang: has joined #RubyOnRails
[23:50:54] mwlang: ok, dumb question: Is it possible for a Rails 4 app to work with authenticity token checking active for browsers that have disabled cookies? After all, if I understand it correctly, sessions are just cookies with a little rails sugar thrown in.
[23:51:16] mwlang: …and IIRC, authenticity token checking is tied to sessions
[23:55:51] Ericx2x: has joined #RubyOnRails
[23:56:53] Maletor: Radar: no method error
[23:57:21] Maletor: Radar: calling from a rails app via console is fine
[23:57:33] Radar: maletor: probably missing a middleware require
[23:57:41] Maletor: but calling .new({}) from a gem with only actionpack won't work
[23:57:44] Maletor: ya, probably
[23:57:47] Maletor: how do i go about that?
[23:57:56] Radar: that method comes from here: https://github.com/rails/rails/blob/master/actionpack/lib/action_dispatch/middleware/cookies.rb
[23:58:02] Radar: Did you look for the method in the Rails source/
[23:58:34] Maletor: and i found that
[23:58:42] Maletor: but i'm just not 100% on how to make that go in my gem
[23:58:57] Radar: require 'action_dispatch/middleware/cookies'?
[23:59:13] Radar: Because it's from the actionpack gem, and its lib dir would be added to the load path
[23:59:24] Radar: so you can require any path from that dir