« Back to channel list

#RubyOnRails - 05 October 2015

« Back 1 day Forward 1 day »
[00:01:03] alan_andrade: has joined #RubyOnRails
[00:02:20] jun_: has joined #RubyOnRails
[00:06:02] imp4t: has joined #RubyOnRails
[00:06:18] ramfjord: has joined #RubyOnRails
[00:06:32] darrencauthon: has joined #RubyOnRails
[00:07:30] darrenca_: has joined #RubyOnRails
[00:10:11] mheld: has joined #RubyOnRails
[00:17:34] Lytol: has joined #RubyOnRails
[00:21:41] ramfjord: has joined #RubyOnRails
[00:24:01] deavid: has joined #RubyOnRails
[00:24:48] rubyonrailed: has joined #RubyOnRails
[00:25:09] ankhers: has joined #RubyOnRails
[00:25:24] annlewis: has joined #RubyOnRails
[00:26:08] lasker85: has joined #RubyOnRails
[00:27:14] TheNet: has joined #RubyOnRails
[00:28:19] ankhers: has joined #RubyOnRails
[00:28:28] TheNet: does it make sense to have around 30 different models for similar records that have slightly different activerecord relations?
[00:29:44] michael_mbp: has joined #RubyOnRails
[00:33:15] imp4t: has joined #RubyOnRails
[00:33:52] TheNet: Radar: I have a lot of different types of events that I want to store that each have different criteria.
[00:34:03] TheNet: I want to display them all together though
[00:34:11] Radar: TheNet: Getting closer to a better example :)
[00:34:19] sevenseacat: has joined #RubyOnRails
[00:35:17] TheNet: Radar: In a game different events can happen, such as a player kills a player, a player kills an npc, a certain number of points is reached, etc.
[00:35:36] TheNet: I want to store all the events and display them together in a table
[00:35:57] TheNet: I don't want to save them as simple text because I also want to track stats
[00:36:07] Radar: TheNet: Can you not store them as a generic event? i.e. "Player X kills player Y"?
[00:36:41] TheNet: The way I see it is I can create a separate model for each of them, or I could store them as json
[00:36:46] Radar: Sounds like you want to have events which then relate polymorphically to these other events.
[00:36:55] ankhers: has joined #RubyOnRails
[00:37:28] Radar: I don't know the right names for that
[00:37:53] ankhers: has joined #RubyOnRails
[00:38:01] Aeyrix: I think sevenseacat explained this to me only a few weeks ago.
[00:38:03] bronson: has joined #RubyOnRails
[00:38:05] Aeyrix: With regards to flags / reporting.
[00:38:08] htmldrum: has joined #RubyOnRails
[00:38:41] TheNet: Radar: do you think that would be better than just having a different model for each event?
[00:39:13] Radar: TheNet: I am not sure how to structure this, to be honest.
[00:39:20] Radar: I would have to tinker
[00:39:43] TheNet: Is there any downside to having lots of models? I'd probably namespace them
[00:41:19] workmad3: has joined #RubyOnRails
[00:41:30] huck5: Hey sevenseacat, what was that Rails book you contributed to and recommend? I want to purchase myself a copy.
[00:41:40] 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
[00:41:53] huck5: Thanks! Adding that to my Amazon wishlist for later :).
[00:42:03] sevenseacat: awesome :) hope you like it!
[00:42:20] sevenseacat: ACTION resumes reading Programming Phoenix
[00:42:31] huck5: Yeah! I'm sure I will. Not sure if I'll get to it right away, I really want to read up on some OO design patterns as well. Is purchasing through Amazon the most profitable for you and the other authors?
[00:42:38] Radar: TheNet: The loading of your application will take *slightly* longer
[00:42:43] Radar: TheNet: I'm talking milliseconds.
[00:42:53] sevenseacat: tbh there is no profitable for us authors
[00:43:13] huck5: sevenseacat, I find that highly dissappointing.
[00:43:25] huck5: I'll just get it at abe books then :\
[00:43:33] TheNet: Radar: alright, that doesn't sound that bad.
[00:43:44] QKO: has joined #RubyOnRails
[00:43:54] Radar: huck5: I have graphs which show how much publishers get vs how much we get in this post: http://ryanbigg.com/2015/08/my-self-publishing-success-story/
[00:44:04] huck5: I mean... Besides the personal satisfaction of sharing your knowledge with the world, you should really get something for your time.
[00:44:06] ankhers: has joined #RubyOnRails
[00:44:07] Aeyrix: Spoiler: It's fucking awful.
[00:44:16] huck5: Aeyrix, :(
[00:44:19] Aeyrix: Not the book, the amount the people who did the actual hard work get.
[00:44:32] Aeyrix: Seriously I didn't even contribute to the book and I was pissed when I found out.
[00:44:32] Radar: TL;DR: Publisher gets 69%, we get 31%.
[00:44:47] Radar: We did 90% of the work.
[00:44:56] Radar: hash-tag-capitalisim
[00:44:56] arooni: has joined #RubyOnRails
[00:44:57] Aeyrix: Isn't it 12.5% for print?
[00:45:08] Radar: Aeyrix: Yes, but most people don't buy print :P
[00:45:24] huck5: I will :)
[00:45:31] huck5: Or is that worse :P
[00:45:31] nathanjo: has joined #RubyOnRails
[00:46:52] huck5: Anyway, I find that pretty crappy. I haven't even read it, never mind contributed, and it pisses me off.
[00:47:17] sevenseacat: huck5: all good :) we've learned our lessons
[00:47:18] one_zero: has joined #RubyOnRails
[00:47:45] oflannabhra: has joined #RubyOnRails
[00:48:08] RockLee: has joined #RubyOnRails
[00:48:20] huck5: I guess that's the important thing (...?)
[00:48:51] huck5: Anyways, I'll pick that up soon here and have a read through. Atleast you'll know I'll be appreciating your efforts. Have a good evening all!
[00:50:05] TheNet: Radar: actually I'm not sure multiple models will work for me. I don't think I have an elegant way of distinguishing between the first player in an event, and the second. I.e. who killed who
[00:50:21] Aeyrix: TheNet: What's this for?
[00:50:22] Radar: TheNet: If it's a KillEvent
[00:50:27] Radar: Then it's player_1, and player_2
[00:50:31] Radar: player_1 killed player_2?
[00:50:42] TheNet: Aeyrix: scroll up :P
[00:50:48] Aeyrix: TheNet: Is it Minecraft?
[00:50:52] TheNet: Aeyrix: actually yes
[00:51:06] Aeyrix: I have a DB schema for a plugin I wrote for the reddit servers a long time ago.
[00:51:08] Aeyrix: It does exactly that.
[00:51:19] TheNet: oh could I have a look at it? :)
[00:51:21] Aeyrix: Tracks pretty much all events, might be useful for you. I'll see if I can find it.
[00:51:35] Aeyrix: I'll have to page a tech admin on those servers on Facebook when I can.
[00:51:37] p1k: has joined #RubyOnRails
[00:51:52] RockLee: Anybody have any good ideas for a 5-man rail project to work on for about 8wks? The only requirement is that it must be database driven and be enough to keep a 5-man team busy for that time period.
[00:51:58] TheNet: Radar: could I declare a relationship that way? or would they just be fields in the table?
[00:52:07] Aeyrix: RockLee: That sounds like a university assignment.
[00:52:12] Radar: TheNet: the event would just link to two separate players
[00:52:37] Radar: RockLee: Forum system.
[00:52:43] Radar: RockLee: alt: Stack Overflow clone
[00:52:47] Radar: RockLee: alt: E-commerce system
[00:53:09] Aeyrix: TheNet: IIRC I had an EntityKillEvent table -- type / killer name (so if the type is an NPC the name is "Skeleton", etc.) / victim name (same here if the 'victim' is an NPC)
[00:53:13] TheNet: Radar: so just fields in the table? I couldn't do has_many :player_1s
[00:53:18] FailBit: forum system would only take me a day, Radar
[00:53:19] Radar: TheNet: wat
[00:53:25] Aeyrix: TheNet: also time
[00:53:31] Radar: FailBit: You fail to estimate what a good forum system requires ;)
[00:53:41] FailBit: what does it require.
[00:53:42] Radar: TheNet: KillEvent would have belongs_to :player_1, belongs_to :player_2
[00:53:45] FailBit: enlighten me
[00:53:55] Radar: FailBit: https://github.com/radar/forem#features
[00:54:00] Radar: FailBit: + a moderation system
[00:54:05] Radar: RockLee: !rule12
[00:54:05] helpa: RockLee: Do not PM members of the channel without first asking if that is OK.
[00:54:26] TheNet: Radar: this might sound stupid but... how will rails know what's player_1 and what's player_2?
[00:54:26] nya: has joined #RubyOnRails
[00:54:28] FailBit: besides the CMS integration stuff, that's not exactly challenging
[00:54:36] Radar: TheNet: how do you mean?
[00:54:50] Aeyrix: TheNet: It, and you, don't care about that.
[00:54:59] Aeyrix: You'll belong to player_1 as kills
[00:55:03] FailBit: moderation tools goes along with a user/ip/ua framework
[00:55:03] Aeyrix: and belong to player_2 as deaths
[00:55:37] TheNet: I thought belongs_to references a model
[00:55:45] TheNet: so wouldn't I have to have player_1 as a model?
[00:55:56] Radar: belongs_to :player_1, class_name: "Player"
[00:56:08] Radar: I think you can work out what belongs_to :player_2 is.
[00:56:13] TheNet: well my mind has been blown
[00:56:15] nathanjo: has left #RubyOnRails: ()
[00:56:37] TheNet: that's exactly what I needed
[00:57:13] seank_: has joined #RubyOnRails
[00:57:23] Aeyrix: Please name them better than player 1 / player 2
[00:57:25] Aeyrix: killer / victim
[00:57:25] TheNet: Aeyrix, Radar: thanks so much, you have no idea how much help people like you are
[00:58:59] sarink: has joined #RubyOnRails
[00:59:19] RockLee: @Radar @Aeyrix, thank you guys for your input
[01:00:35] imp4t: has joined #RubyOnRails
[01:00:49] lasker85: has joined #RubyOnRails
[01:01:50] blackmesa: has joined #RubyOnRails
[01:03:35] sarink: has joined #RubyOnRails
[01:08:12] darrencauthon: has joined #RubyOnRails
[01:08:27] moeabdol: Does anyone know how to test haml views in rspec3?
[01:08:36] moeabdol: I'v tried adding the haml-rails gem
[01:08:46] moeabdol: but still rspec complains of a missing template
[01:09:20] rhizome: views, as in not integration tests?
[01:09:53] lasker85: has joined #RubyOnRails
[01:10:42] moeabdol: rhizome: views as in spec/views/
[01:10:58] deavid: has joined #RubyOnRails
[01:11:11] moeabdol: rhizome: yes! not integration test
[01:12:26] craysiii: has joined #RubyOnRails
[01:13:26] stardiviner: has joined #RubyOnRails
[01:14:02] moeabdol: sevenseacat: i'm making a gist right now
[01:15:03] moeabdol: https://gist.github.com/moeabdol/ed7840bbaa6fab2d53cc
[01:15:30] sevenseacat: moeabdol: "RSpec.describe "home/index.html.erb"" ?
[01:15:39] sevenseacat: thats not HAML
[01:16:21] moeabdol: sevenseacat: you're awesome :)
[01:19:17] imp4t: has joined #RubyOnRails
[01:19:34] Radar: ACTION will one day be as smart as sevenseacat 
[01:21:07] helpa-bot: has joined #RubyOnRails
[01:21:49] moeabdol: sevenseacat: suppose my index.html.haml is rendered inside the application layout. I have a piece of text on the layout which I want to test in the index view. I don't seem to be able to grab the text even though I'm sure it's there in the layout. Probably its because rspec only renders the index view without the containing layout. Do you have any idea how I would test for the text?
[01:22:26] sevenseacat: moeabdol: write a view test for the layout.
[01:22:36] johnflux: has joined #RubyOnRails
[01:22:44] sevenseacat: rspec does only render the individual view, not inside the layout
[01:22:57] moeabdol: sevenseacat: yeah! probably that's the right way to go. I see
[01:24:05] johnflux: has joined #RubyOnRails
[01:26:09] annlewis: has joined #RubyOnRails
[01:27:07] Maletor: has joined #RubyOnRails
[01:28:45] chipotle: has joined #RubyOnRails
[01:30:09] Grundell: has joined #RubyOnRails
[01:31:40] msyvich: has joined #RubyOnRails
[01:33:59] gadavid-helpa: has joined #RubyOnRails
[01:34:19] apow: has joined #RubyOnRails
[01:35:07] bruno-: has joined #RubyOnRails
[01:38:58] bronson: has joined #RubyOnRails
[01:40:23] pydave6367: has joined #RubyOnRails
[01:45:59] imp4t: has joined #RubyOnRails
[01:46:06] GnuYawk: has joined #RubyOnRails
[01:48:02] smathy: has joined #RubyOnRails
[01:48:52] nickenchuggets: has joined #RubyOnRails
[01:53:11] wildlander: has joined #RubyOnRails
[01:54:21] wildlander: has joined #RubyOnRails
[01:55:14] wildlander: has joined #RubyOnRails
[01:58:12] ericjphillips: has joined #RubyOnRails
[01:58:47] aruntomar: has joined #RubyOnRails
[01:58:57] seank_: has joined #RubyOnRails
[02:00:35] crdpink2: has joined #RubyOnRails
[02:01:34] pwnd_nsfw: has joined #RubyOnRails
[02:02:36] stardiviner: has joined #RubyOnRails
[02:03:43] blackmesa: has joined #RubyOnRails
[02:04:31] imp4t: has joined #RubyOnRails
[02:05:14] A124: has joined #RubyOnRails
[02:06:57] scott0101: has joined #RubyOnRails
[02:07:29] Maletor: has joined #RubyOnRails
[02:07:53] scott0101: looking to implement rabbit, I have a server running and publishing to an exchange, am I correct in saying I can use a js client to read from the queue? e.g. socket.io, rabbit-stomp etc...
[02:08:09] scott0101: how otherwise do messages get from the server to the dom?
[02:08:59] darrencauthon: has joined #RubyOnRails
[02:11:29] Oog: has joined #RubyOnRails
[02:11:36] Oog: do you recommend postgres array type if i am using it or serialize with an array?
[02:12:45] PhantomS_: has joined #RubyOnRails
[02:17:22] DmitryBochkarev: has joined #RubyOnRails
[02:18:53] disl: has joined #RubyOnRails
[02:20:12] havenwood: has joined #RubyOnRails
[02:20:29] sankaber: has joined #RubyOnRails
[02:21:08] scott0101: has left #RubyOnRails: ()
[02:21:55] htmldrum: has joined #RubyOnRails
[02:23:00] imp4t: has joined #RubyOnRails
[02:24:30] darrencauthon: has joined #RubyOnRails
[02:26:39] chills42: has joined #RubyOnRails
[02:26:57] annlewis: has joined #RubyOnRails
[02:27:50] TheNet: has joined #RubyOnRails
[02:29:24] workmad3: has joined #RubyOnRails
[02:32:28] TheNet: has joined #RubyOnRails
[02:35:39] baweaver: has joined #RubyOnRails
[02:39:50] oflannabhra: has joined #RubyOnRails
[02:39:58] bronson: has joined #RubyOnRails
[02:41:10] nathanjo: has joined #RubyOnRails
[02:41:23] mloy: Oog, use postgres hstore if you want to query the array in the db
[02:41:37] Aeyrix: hstore is hashes, not arrays
[02:41:38] rushed: has joined #RubyOnRails
[02:41:42] Aeyrix: {"A" => "B"}
[02:41:47] Aeyrix: versus ['A', 'B']
[02:42:00] mloy: Yeah but, hmm
[02:42:16] Oog: i went with serialize i dont need to query it
[02:42:24] Oog: hstore looks interesting though
[02:42:36] mloy: Aeyrix, if you serialize a string as an array then you can't query it inside the DB
[02:42:42] mloy: but you can use hstore as a workaround
[02:42:59] Oog: you just assume every key and value is an array item?
[02:42:59] mloy: that's something I came across recently, arup_r gave me the idea iirc
[02:43:25] sevenseacat: thats a worry
[02:44:57] junior: has joined #RubyOnRails
[02:45:01] cih: has joined #RubyOnRails
[02:45:49] TheNet_: has joined #RubyOnRails
[02:48:06] arooni: has joined #RubyOnRails
[02:49:36] imp4t: has joined #RubyOnRails
[02:50:11] ahmgeek: has joined #RubyOnRails
[02:55:30] nya: has joined #RubyOnRails
[02:56:00] ahmgeek: can I return an array of strings to an ajax get request ?
[02:56:50] Radar: HELPA IS WRONG. SAVE US.
[02:57:14] ahmgeek: pew pew pew
[02:58:05] Radar: ahmgeek: The answer to your question: yes
[02:59:02] Meow-J: has joined #RubyOnRails
[02:59:16] ahmgeek: when I do it like: https://gist.github.com/ahmgeek/09e4adcd2b34dc570bf9
[02:59:42] Radar: https://gist.github.com/ahmgeek/09e4adcd2b34dc570bf9#file-mails-rb-L7 the return here is superflous
[02:59:47] Radar: superfluous
[02:59:58] User458764: has joined #RubyOnRails
[03:01:05] ahmgeek: ook, here's the response https://gist.github.com/ahmgeek/09e4adcd2b34dc570bf9#file-method-response-L1
[03:01:11] mrtomme: has joined #RubyOnRails
[03:01:40] Radar: render json: mails.to_json
[03:01:44] Radar: you don't need to the .to_json
[03:01:51] Radar: render json already converts it to json
[03:02:21] ahmgeek: Radar: I just want to return a pure sting array :(
[03:02:47] Radar: ahmgeek: Did you try what I suggested already? That was quick. Please explain to me how removing .to_json from the render call does not fix your problem. Thanks.
[03:02:58] bendangelo: has joined #RubyOnRails
[03:04:05] ahmgeek: Radar: updated: https://gist.github.com/ahmgeek/09e4adcd2b34dc570bf9
[03:04:25] rickmasta: has joined #RubyOnRails
[03:04:26] Radar: interesting.
[03:04:35] Radar: ahmgeek: https://gist.github.com/ahmgeek/09e4adcd2b34dc570bf9#file-mails-rb-L4
[03:04:38] Radar: What is this line doing?
[03:05:05] Radar: Why is that whole method not just session[:mails] = params[:all_emails].split(',') ?
[03:05:36] ahmgeek: appending every string element to the array, I also convert it to a string element in case it's not a string.
[03:06:10] ahmgeek: Radar: well, I am still trying to learn both rails and ruby :D so I do it in a little noobs way.
[03:06:31] Radar: ahmgeek: You're converting the array there to a stirng.
[03:06:43] Radar: I'm pretty certain that all you need to do is to split the incoming param.
[03:06:53] ahmgeek: let me try it and get back to you.
[03:08:03] imp4t: has joined #RubyOnRails
[03:08:06] ahmgeek: Radar: *MAD HUGS*
[03:08:54] ahmgeek: ok, I still don't know why my code was broken :( can you tell me ?
[03:09:47] Radar: You were converting the array to a string
[03:10:05] Radar: "email1, email2".split(",").to_s
[03:10:15] Radar: Run that in the console, then remove the .to_s and observe the difference
[03:10:19] braincrash: has joined #RubyOnRails
[03:11:11] ahmgeek: Radar: got it, many thanks. EGYPT LOVE YA
[03:11:54] Hyperfocal: has joined #RubyOnRails
[03:23:44] moeabdol: has joined #RubyOnRails
[03:24:27] w0rd-driven: has joined #RubyOnRails
[03:25:19] darrencauthon: has joined #RubyOnRails
[03:27:43] annlewis: has joined #RubyOnRails
[03:30:56] Grundell: has joined #RubyOnRails
[03:33:46] Wixy: has joined #RubyOnRails
[03:34:18] Wixy: Hey guys! Rails (develop environment) is appending a hash code to my assets. as if it is compiling (and even caching) them
[03:34:31] Wixy: what config should I be looking for in order to disable this?
[03:34:38] juliojulio_: has joined #RubyOnRails
[03:34:52] Wixy: I can't find what is wrong, I'll gist my config in a moment
[03:34:55] imp4t: has joined #RubyOnRails
[03:35:03] sevenseacat: if I was a guy, I could tell you that you're looking for the config.assets.digest option
[03:35:12] apow: has joined #RubyOnRails
[03:35:40] disl_: has joined #RubyOnRails
[03:36:09] Wixy: Rails v4.2.1, config: https://gist.github.com/anonymous/e524861596bfef8e570d
[03:36:49] Wixy: should I put config.assets.digest = false ?
[03:37:07] sevenseacat: if you want to disable digesting (not sure why you would, but anyway), then sure.
[03:37:56] Wixy: not sure, I don't know if "digest" is causing the hash at the end of the assets or what
[03:39:18] Wixy: right now I'm getting this error: Asset filtered out and will not be served: add `Rails.application.config.assets.precompile += %w( delete.png )` to `config/initializers/assets.rb`
[03:39:29] Wixy: but I have this: Rails.application.config.assets.precompile += %w( vendor )
[03:39:30] sevenseacat: did you do that?
[03:39:31] Wixy: weeeeird!
[03:39:33] pontiki: has joined #RubyOnRails
[03:39:43] sevenseacat: follow the directions, and you'll be fine.
[03:39:50] Wixy: sevenseacat, I put digest = false but I'm getting the error above, so I couldn't check if it fixed the problem
[03:40:03] sevenseacat: Wixy: restart your server after changing your config.
[03:40:19] Wixy: sevenseacat, it shouldn't be needed to add delete.png to precompile, I added the whole vendor dir!
[03:40:26] sevenseacat: you can't do that.
[03:40:45] sevenseacat: you precompile files, not folders.
[03:40:52] bronson: has joined #RubyOnRails
[03:40:55] Wixy: do I really need to add EVERY image in my vendor folder? crazy
[03:41:10] sevenseacat: every image individually? no
[03:41:41] Wixy: I guess I can add the folder to the precompile path or something?
[03:43:07] sevenseacat: images are precompiled by default.
[03:43:26] Wixy: it seems vendor images are not
[03:44:08] sevenseacat: sorry for trying to help :)
[03:44:36] Wixy: I didn't get it
[03:46:47] eyck: has joined #RubyOnRails
[03:47:56] pontiki: has joined #RubyOnRails
[03:48:32] hfp_work: has joined #RubyOnRails
[03:49:29] Maletor: has joined #RubyOnRails
[03:53:41] imp4t: has joined #RubyOnRails
[03:54:08] MarkTR: has joined #RubyOnRails
[03:55:33] hfp_work: has joined #RubyOnRails
[03:55:57] EminenceHC: has joined #RubyOnRails
[03:57:03] junior: has joined #RubyOnRails
[03:58:05] tawaffan: has joined #RubyOnRails
[04:03:48] krz: has joined #RubyOnRails
[04:04:29] blackmesa: has joined #RubyOnRails
[04:04:32] pydave6367: has joined #RubyOnRails
[04:06:05] iateadonut: has joined #RubyOnRails
[04:10:34] wethu: has joined #RubyOnRails
[04:17:34] workmad3: has joined #RubyOnRails
[04:17:37] pwnd_nsfw: has joined #RubyOnRails
[04:19:50] sarink: has joined #RubyOnRails
[04:20:24] imp4t: has joined #RubyOnRails
[04:20:38] mondongo: has joined #RubyOnRails
[04:25:59] darrencauthon: has joined #RubyOnRails
[04:27:05] kp666: has joined #RubyOnRails
[04:27:06] hfp_work: has joined #RubyOnRails
[04:28:30] annlewis: has joined #RubyOnRails
[04:29:33] harisamin: has joined #RubyOnRails
[04:31:40] ashleyw: has joined #RubyOnRails
[04:33:05] Maletor: has joined #RubyOnRails
[04:36:36] hfp_work: has joined #RubyOnRails
[04:40:33] LBRapid: has joined #RubyOnRails
[04:41:52] bronson: has joined #RubyOnRails
[04:43:37] hfp_work: has joined #RubyOnRails
[04:44:31] EminenceHC: has joined #RubyOnRails
[04:45:40] lasker85: has joined #RubyOnRails
[04:47:36] iliketurtles: has joined #RubyOnRails
[04:47:48] Lytol: has joined #RubyOnRails
[04:50:06] w0rd-driven: has joined #RubyOnRails
[04:51:04] rickmasta: has joined #RubyOnRails
[04:55:10] kies^: has joined #RubyOnRails
[04:55:16] wethu: has joined #RubyOnRails
[05:01:04] zpe: has joined #RubyOnRails
[05:02:37] w0rd-driven: has joined #RubyOnRails
[05:02:58] svkurowski: has joined #RubyOnRails
[05:04:10] EminenceHC: has joined #RubyOnRails
[05:04:47] hephaestus_rg: has joined #RubyOnRails
[05:05:09] hephaestus_rg: im havinga a bizarre error with a seemingly unhelpful error message (will post in 1 sec)
[05:05:54] hephaestus_rg: this is the error: https://gist.github.com/anonymous/0c5c1a239bcf272d0d49
[05:06:16] Radar: Tests save the day again! (for me)
[05:06:37] Radar: hephaestus_rg: steps to reproduce in new app plzkthx
[05:07:44] hephaestus_rg: im not even sure how i got here
[05:07:55] hephaestus_rg: mongolab updated my mongo db
[05:08:01] hephaestus_rg: i hadto update my driver
[05:08:02] Radar: does it happen locally?
[05:08:13] hephaestus_rg: let me try to run it
[05:08:46] hephaestus_rg: nope locally it's fine
[05:09:07] hephaestus_rg: is there some way to get a more informative log from that?
[05:09:15] hephaestus_rg: it sounds like some kind of infinite loop
[05:09:25] Radar: Try running your app in production env localyl
[05:10:42] hephaestus_rg: this line number is not quite useful... https://github.com/rails/rails/blob/4-0-stable/activesupport/lib/active_support/notifications/instrumenter.rb#L23
[05:10:54] hephaestus_rg: let me point it at the production database
[05:11:02] pydave6377: has joined #RubyOnRails
[05:12:54] Radar: It's happening depper somewhere
[05:13:42] hephaestus_rg: hmm seems like it's timing out when it tries to connect to the database
[05:13:49] hephaestus_rg: let me see if i can connect directly
[05:13:52] hephaestus_rg: outside of rails
[05:14:48] quazimodo: has joined #RubyOnRails
[05:16:09] hephaestus_rg: hmm i can't even do that
[05:17:23] dhjondoh: has joined #RubyOnRails
[05:19:59] rubyonrailed: has joined #RubyOnRails
[05:23:03] aganov: has joined #RubyOnRails
[05:24:07] mary5030: has joined #RubyOnRails
[05:24:36] jojo_: has joined #RubyOnRails
[05:25:35] htmldrum: has joined #RubyOnRails
[05:26:45] darrencauthon: has joined #RubyOnRails
[05:27:24] sanjayu: has joined #RubyOnRails
[05:27:45] pawnbox: has joined #RubyOnRails
[05:29:09] iliketurtles: has joined #RubyOnRails
[05:29:15] annlewis: has joined #RubyOnRails
[05:31:23] JusticeFries: has joined #RubyOnRails
[05:31:36] JusticeFries: is there a release date yet for Rails 5?
[05:31:47] charliesome: has joined #RubyOnRails
[05:31:54] Grundell: has joined #RubyOnRails
[05:33:21] quazimodo: has joined #RubyOnRails
[05:34:48] harisamin: has joined #RubyOnRails
[05:35:08] mloy: has joined #RubyOnRails
[05:36:03] apow: has joined #RubyOnRails
[05:37:37] bruno-: has joined #RubyOnRails
[05:38:01] baweaver: has joined #RubyOnRails
[05:38:03] Radar: wow that's... a closeish time. Well done helpa!
[05:38:05] Radar: !botsnack
[05:38:05] helpa: Nom nom. Thanks, Radar!
[05:40:54] disl: has joined #RubyOnRails
[05:41:24] imp4t: has joined #RubyOnRails
[05:41:42] pontiki: has joined #RubyOnRails
[05:42:04] netzfisch: has joined #RubyOnRails
[05:42:49] bronson: has joined #RubyOnRails
[05:43:16] bendangelo: has joined #RubyOnRails
[05:45:01] Pharaoh2: has joined #RubyOnRails
[05:46:29] tagrudev: has joined #RubyOnRails
[05:46:40] Pharaoh2: has joined #RubyOnRails
[05:47:16] acti0nman: has joined #RubyOnRails
[05:50:13] JusticeFries: yeah, that's fairly/scarily exact. hah.
[05:50:25] Radar: helpa has been getting more and more like that
[05:50:31] Radar: the 8ball command is where it started
[05:50:44] Radar: it picks from a list randomly, but the answers it gives are like 95% accurate
[05:53:07] Radar: justicefries: But a more serious answer: earlier in the year people were predicting a September release date but... well, it's obvious how unlikely that is now.
[05:53:25] JusticeFries: yeah, I remember that, and then well, been doing too much Elixir. ;)
[05:53:34] Radar: They still have quite a lot of issues open in the milestone: https://github.com/rails/rails/issues?q=is%3Aopen+is%3Aissue+milestone%3A5.0.0
[05:54:15] sevenseacat: one of us one of us
[05:54:44] srinidhi: has joined #RubyOnRails
[05:55:03] Radar: Elixir is a nice break from Ruby and Go.
[05:55:17] Radar: Go I never really got into that much. I programmed in it, but never liked programming in it.
[05:55:22] Radar: Too much like C.
[05:55:37] JusticeFries: I couldn't really *enjoy* Go.
[05:55:56] JusticeFries: Elixir is the first language I've had fun with since Ruby, and solves some nice problems where Ruby might not.
[05:56:18] JusticeFries: gave me that deja vu from like 2008 where I re-discovered my love for programming.
[05:58:18] liquid-silence: has joined #RubyOnRails
[06:00:27] liquid-silence: is there a way to render an action mailer template to a text area?
[06:02:28] dionysus69: has joined #RubyOnRails
[06:02:33] IFrank00: has joined #RubyOnRails
[06:04:24] p1k: has joined #RubyOnRails
[06:05:38] workmad3: has joined #RubyOnRails
[06:06:22] IFrank00: Hi I got a Events a recurrences of the event I have a method to generate next month events_recurrences this method is on my event model. Im looking for a way to running that method on the 1st of each month
[06:06:28] blackmesa: has joined #RubyOnRails
[06:07:05] IFrank00: I was looking at cron jobs with whenever gem but dont know how to call the method that is in my Event Model
[06:07:10] SteenJobs: has joined #RubyOnRails
[06:07:36] IFrank00: maybe a rake task??? and call it on the cron job ??
[06:08:02] rushed: IFrank00: you probably just want to drop a job into whatever you use for a job queue
[06:08:24] RockLee: has joined #RubyOnRails
[06:08:56] IFrank00: I dont have a job queue
[06:08:59] t3rm: has joined #RubyOnRails
[06:09:26] IFrank00: any info on buiding a Job queue ??
[06:09:50] sadaf2606: has joined #RubyOnRails
[06:10:00] IFrank00: oh maybe explain the term so I can get a better point of what I have to do
[06:10:06] rushed: IFrank00: checkout resque or one of the other alternatives https://www.ruby-toolbox.com/categories/Background_Jobs
[06:10:11] bmalum: has joined #RubyOnRails
[06:10:28] IFrank00: oh like a BGjob
[06:10:48] eGGsha: has joined #RubyOnRails
[06:11:07] darkxploit: has joined #RubyOnRails
[06:11:48] rushed: IFrank00: that said you can do whatever you want in your whenever schedule, don't have to use a queue :)
[06:12:08] IFrank00: Im using a Multenant sistem I saw that its better to use resque
[06:12:40] rushed: IFrank00: those don't seem related but maybe :)
[06:13:41] IFrank00: I was using Delayed job but didn't work with multi tenant apps
[06:13:57] rushed: IFrank00: if you say so~
[06:15:34] IFrank00: rushed, so if I need a quick functioning method doing the rake task with the whenever gem will do the job for the moment until I can setup a job queue system ??
[06:15:49] Radar: IFrank00: Look also at the ice_cube gem.
[06:16:03] IFrank00: im using the ice_cube gem
[06:16:13] rushed: IFrank00: sure
[06:16:25] IFrank00: thats what im using for the recurrences
[06:16:41] IFrank00: I get a list of date
[06:16:47] lxsameer: has joined #RubyOnRails
[06:16:47] lxsameer: has joined #RubyOnRails
[06:18:35] IFrank00: jan 12, feb 11, Mar 14 and I need to generate recurrences records of the event
[06:19:26] IFrank00: so when on jan 1 the method needs to create the jan 12 record
[06:19:40] bronson: has joined #RubyOnRails
[06:20:32] IFrank00: feb 11 and Mar 14 are only display in my view and pointing to the Event but jan 12 will point to a EventReccurence record
[06:21:29] IFrank00: I need each month to create the record for the current month
[06:22:21] Radar: Run a job each day to see if there is an event that already exists for the next date
[06:22:24] Radar: if it doesn't exist, create one
[06:23:20] riotjones: has joined #RubyOnRails
[06:23:48] jgt: has joined #RubyOnRails
[06:25:05] emilkarl: has joined #RubyOnRails
[06:27:36] darrencauthon: has joined #RubyOnRails
[06:27:54] herbst: has joined #RubyOnRails
[06:28:55] harisamin: has joined #RubyOnRails
[06:30:08] rvanlieshout: has joined #RubyOnRails
[06:30:21] cih: has joined #RubyOnRails
[06:30:26] annlewis: has joined #RubyOnRails
[06:30:59] bmalum: has joined #RubyOnRails
[06:32:06] Pumukel: has joined #RubyOnRails
[06:33:19] Spami: has joined #RubyOnRails
[06:34:55] pydave6367: has joined #RubyOnRails
[06:37:47] lrocksmashtime1: has joined #RubyOnRails
[06:38:55] tetraktys: has joined #RubyOnRails
[06:40:28] artto: has joined #RubyOnRails
[06:40:29] pawnbox: has joined #RubyOnRails
[06:40:42] jas02: has joined #RubyOnRails
[06:41:58] ruurd: has joined #RubyOnRails
[06:42:30] DoubleMalt: has joined #RubyOnRails
[06:44:16] bondibox: has joined #RubyOnRails
[06:45:15] xcv: has joined #RubyOnRails
[06:46:55] arup_r: has joined #RubyOnRails
[06:48:18] spkprav: has joined #RubyOnRails
[06:50:24] comrad: has joined #RubyOnRails
[06:51:37] AzaToth: has joined #RubyOnRails
[06:51:59] bondibox: my GEM_PATH is different on my two dev machines. When I push the rvm built project to the git server and clone it on the rbenv machine the GEM_PATH breaks. I can't seem to find where in the project that path is specified.
[06:55:34] p1k: has joined #RubyOnRails
[06:56:55] rushed: bondibox: "the GEM_PATH breaks" <= ?
[06:58:12] bondibox: rake won't run b/c it can't find right gem path
[06:58:29] spkprav: has joined #RubyOnRails
[06:58:36] rushed: bondibox: maybe gist the complete error you're seeing?
[07:00:12] inanepenguin: has joined #RubyOnRails
[07:00:25] bondibox: the error and the trace are generic, rake calls a gem and `require': cannot load such file -- bundler (LoadError)
[07:01:00] sevenseacat: your project shouldnt set the GEM_PATH at all - that comes from your env
[07:01:07] sevenseacat: do you just need to bundle to get the dependencies installed?
[07:01:41] bondibox: but when I echo $GEM _PATH on the rbenv box I see the rvm paths
[07:01:58] bondibox: so that is transferiing somehow
[07:02:09] bondibox: it's part of the app, not my env
[07:03:05] bondibox: no wait, that wasn't phrased right
[07:03:29] rushed: bondibox: what is the output of "bundle"?
[07:03:33] bondibox: that is echoed in 'gem env' within the app
[07:04:28] bondibox: same error as above
[07:04:43] rushed: bondibox: the generic error you wont share with us?
[07:04:44] IFrank00: Radar, I like to have the job run 1 time at the beginning of the month as I want to add a email that sent a list of the Events and recurrences for the current month. I was think of doing a rake task and then calling it with the corn job and the whenever gem ??
[07:04:56] Cervajz: has joined #RubyOnRails
[07:05:23] sevenseacat: bondibox: do you have bundler installed?
[07:05:33] craysiii: IFrank00 i think thats a good solution.
[07:05:45] yfeldblum: has joined #RubyOnRails
[07:06:12] sevenseacat: k, then you'll need to gist the error
[07:06:41] Cervajz_: has joined #RubyOnRails
[07:06:57] IFrank00: craysiii, I only have use the rake task for creating populate dummy data
[07:07:23] blackmesa: has joined #RubyOnRails
[07:07:40] craysiii: when i used the whenever gem, i skipped the rake task and just called a model method
[07:07:50] rubyonrailed: has joined #RubyOnRails
[07:08:10] IFrank00: craysiii, you can call the model and direct method ???
[07:08:25] craysiii: yes, one sec
[07:08:51] cih: has joined #RubyOnRails
[07:09:14] IFrank00: craysiii, Like Event Model and call the create_monthly_reccurrences
[07:09:31] arBmind: has joined #RubyOnRails
[07:09:40] craysiii: https://github.com/craysiii/blocitoff/commit/20dfdaea3f3c63371590076daea4c790579989cd
[07:09:43] craysiii: an example.
[07:10:08] IFrank00: craysiii, Thank so much
[07:10:16] craysiii: you're welcome
[07:10:20] tetraktys: has joined #RubyOnRails
[07:10:51] trautwein: has joined #RubyOnRails
[07:10:55] IFrank00: craysiii, super easy
[07:11:29] craysiii: ya :) they wanted me to use a rake task, as that was a project for Bloc.io, but i said screw that and found out i could call model methods directly :P
[07:13:47] workmad3: has joined #RubyOnRails
[07:13:47] IFrank00: craysiii, one question I dont know the differences of "def self.method self.something end" and "def method self.something end"
[07:15:44] craysiii: def self.method is declaring a class method
[07:15:57] pawnbox: has joined #RubyOnRails
[07:16:45] craysiii: though if you want a really good explanation you should go to #ruby
[07:18:16] IFrank00: craysiii, oh so Event.method is for def self.method and @event.method is for def method
[07:19:03] craysiii: from what I understand, yes, but i believe under the hood they are almost synonymous. I'm still a noob and it would be nice if a ruby expert chimed in :)
[07:19:49] bondibox: if you think this will help http://pastie.org/private/cnws3vk0iaiavvyda4ivwq
[07:20:46] bondibox: it's looking for a gem in a ruby 2.2.0 build which I have never had on this box
[07:20:53] IFrank00: craysiii, thank you
[07:21:51] simplyianm: has joined #RubyOnRails
[07:22:03] bondibox: I've searched the textmate project for '.gem' and '2.2.0' but i can't find any references within the project
[07:22:57] sevenseacat: `/usr/bin/bundle` o.o
[07:23:11] minotep: has joined #RubyOnRails
[07:23:19] sevenseacat: what have you done with system packages here
[07:23:38] blackmesa: has joined #RubyOnRails
[07:24:17] bondibox: it can find the path to bundle just fine, but bundle calls for 'gem' and that revers to the 'gem env' which comes up with a stale path from the box that pushed the project
[07:24:18] craysiii: im confused lol
[07:25:00] sevenseacat: bondibox: uninstall the bundler package you installed. install the bundler gem.
[07:26:24] bondibox: omg I should be banned from coding after midnight
[07:26:53] craysiii: bondi we've all had moments like those
[07:27:44] Ropeney: has joined #RubyOnRails
[07:28:14] bondibox: thanks for the patience guys. hope I wasn't too much of a dick
[07:28:20] darrencauthon: has joined #RubyOnRails
[07:29:18] arup_r: I am using Devise .. Why it always show password is in console ? User.last.password .. But the user is able to login and does everything. Why console don't show it.. ?
[07:29:20] craysiii: next time you have an issue just open up a gist and paste the error there before you ask your question. most people are willing to help but they dont want to deal with vague language, i have even been warned of it myself, just letting you know
[07:29:43] sevenseacat: arup_r: are you asking why you don't store plaintext passwords?
[07:30:22] arup_r: No. I am asking because it is made by devise for secure stuff right.. ?
[07:30:57] sevenseacat: they're encrypted for security, yes.
[07:31:05] disl: when you set the pw on your model in devise it calculates and stores only the hash
[07:31:13] annlewis: has joined #RubyOnRails
[07:31:13] disl: you can't read the pw out
[07:31:17] sevenseacat: hashed is a better term, because there is no decrypting of them
[07:31:29] arup_r: I didn't know that, and it was causing issue in my password matching validation rule..
[07:31:30] dikaio: has joined #RubyOnRails
[07:31:36] sevenseacat: it shouldnt have.
[07:31:43] sevenseacat: unless you wrote some broken validations
[07:31:49] Balzrael: has joined #RubyOnRails
[07:31:56] arup_r: I add option like allow_nil: true and then things are working
[07:32:05] craysiii: devise salts the password right?
[07:32:17] sevenseacat: allow_nil to what?
[07:32:26] arup_r: Like them.. https://github.com/plataformatec/devise/blob/1a0192201b317d3f1bac88f5c5b4926d527b1b39/lib/devise/models/validatable.rb#L28-L35
[07:32:43] sevenseacat: that doesnt answer the question
[07:32:48] arup_r: U need to add this option. other wise any custom validation wouldn't work for password
[07:32:56] XCMer: has joined #RubyOnRails
[07:32:58] arup_r: What is your question ?
[07:33:04] sevenseacat: allow_nil to what?
[07:33:12] craysiii: show us code arup_r
[07:33:13] arup_r: I made it true
[07:33:15] sevenseacat: there is no allow_nil in that code
[07:33:22] sevenseacat: there should be no allow_nil in your code
[07:33:22] pecpec: has joined #RubyOnRails
[07:33:34] blackhuey: has joined #RubyOnRails
[07:33:48] rubyonrailed: has joined #RubyOnRails
[07:34:04] arup_r: validates :password, :format => {:with => /\A(?=.*[A-Z])(?=.*[0-9])(?=.*[\W]).{6,}\z/, message: "Should contain 1 capital letter, 1 number, and 1 special character" } # is the validation
[07:34:18] sevenseacat: there is no allow_nil in that code
[07:34:34] craysiii: they are probably talking about allow_blank
[07:34:42] arup_r: let me write... :(
[07:34:50] sevenseacat: don't write half-sentences!
[07:35:02] craysiii: okay take your time and explain :)
[07:35:08] arup_r: sevenseacat: My window is small
[07:35:13] sevenseacat: not my problem
[07:35:18] sevenseacat: !enternotspace
[07:35:18] helpa: The enter key should not be used as a space bar. Lines on IRC can be up to 400 characters long.
[07:35:47] srinidhi: has joined #RubyOnRails
[07:36:46] arup_r: With the validation I have shown, whenever try to update Account model, I am getting the password error, because of the `account.password` nil. Once I added allow_blank: true .. it worked.
[07:36:59] arup_r: sorry it is allow_balnk I used. not allow_nil
[07:37:04] apow: has joined #RubyOnRails
[07:37:38] arup_r: it worked means it is doing all tasks properly.. from sign up to everything ...
[07:37:59] arup_r: and it too time for me to figure out .. that I need to add the option.
[07:38:14] arup_r: I am done. :) Now you people can shoot me
[07:40:40] linus4: has joined #RubyOnRails
[07:41:53] yfeldblum: has joined #RubyOnRails
[07:43:16] atomical: has joined #RubyOnRails
[07:43:28] Pavster: has joined #RubyOnRails
[07:44:30] arup_r: Should I never use allow_nil, but always allow_blank ?
[07:46:09] craysiii: you should use whatever appropriate for the situation
[07:46:54] arup_r: craysiii: humm.. That is true. that is why I sued allow_nil: true. But devise own code using allow_blank: true. So I changed it like them.
[07:47:29] arup_r: Because all problem I was seeing due to nil. Anyway .. thanks all
[07:50:55] sundhell: has joined #RubyOnRails
[07:51:26] yfeldblum: has joined #RubyOnRails
[07:53:12] sininen: has joined #RubyOnRails
[07:53:19] n008f4g_: has joined #RubyOnRails
[07:53:44] Silox|: has joined #RubyOnRails
[07:54:09] Quintasan: has joined #RubyOnRails
[07:54:15] darutoko: has joined #RubyOnRails
[07:57:14] rocknrollMarc: has joined #RubyOnRails
[07:57:18] rubyonrailed: has joined #RubyOnRails
[07:58:25] rocknrollMarc: has joined #RubyOnRails
[07:59:25] Axy: has joined #RubyOnRails
[07:59:25] Axy: has joined #RubyOnRails
[07:59:52] rushed: has joined #RubyOnRails
[08:00:09] rocknrollMarc: Hey guys Im trying to get into active record more deeply and get more firm with datamodeling any on know a good grafical datamodeling app?
[08:00:15] EdwardIII: has joined #RubyOnRails
[08:01:24] XCMer: has joined #RubyOnRails
[08:04:45] KnownSyntax: has joined #RubyOnRails
[08:04:48] jsrn_: has joined #RubyOnRails
[08:05:22] Palsson_: has joined #RubyOnRails
[08:07:01] eGGsha: has joined #RubyOnRails
[08:07:59] solars: has joined #RubyOnRails
[08:09:28] nfk|laptop: has joined #RubyOnRails
[08:09:45] kies^: has joined #RubyOnRails
[08:10:54] krisquigley: has joined #RubyOnRails
[08:11:28] artto: has joined #RubyOnRails
[08:12:54] arBmind: has joined #RubyOnRails
[08:15:58] EdwardIII: hey. most of the other frameworks i use like django & symfony will have template functions to help you build forms (e.g. form_row(form) or form_widget(form) type thing) - is this common in rails? the scaffolding seems to generate the full markup which is good for the first version but maybe not for small tweaks when the scaffolding does *almost* everything you want but not quite?
[08:16:19] Radar: EdwardIII: Is simple_form what you're after?
[08:16:49] EdwardIII: yeah looks pretty close, thanks
[08:17:25] alex88: has joined #RubyOnRails
[08:17:26] harisamin: has joined #RubyOnRails
[08:18:41] rocknrollMarc: anyone know of a active record friendly data modelin app?
[08:19:27] habitullence: has joined #RubyOnRails
[08:19:35] skroon: has joined #RubyOnRails
[08:20:01] craysiii: what is it that youre trying to understand, and why does it require a UI
[08:20:15] bronson: has joined #RubyOnRails
[08:21:13] craysiii: https://github.com/voormedia/rails-erd this might help.
[08:22:42] lasker85: has joined #RubyOnRails
[08:22:52] rocknrollMarc: elps me sometimes to visualize stuff
[08:23:09] rocknrollMarc: I just want an easy app that lets me visualise tables and the attributes
[08:23:23] Ergo: has joined #RubyOnRails
[08:23:23] craysiii: okay well i know of one, but its not specific to rails or ruby
[08:23:42] craysiii: check out mysql workbench.
[08:24:57] yfeldblum: has joined #RubyOnRails
[08:25:26] skroon: has joined #RubyOnRails
[08:26:18] rocknrollMarc: craysiii: Thanks Ill take a look. Basicaly Im not very good on the database side jet and Im sometimes not sure if I should do a has_manby or blablabla
[08:26:28] rocknrollMarc: so yes something to visualise the model
[08:26:44] craysiii: i can understand that
[08:26:50] craysiii: hope it works well for you
[08:28:11] cih_: has joined #RubyOnRails
[08:28:25] rocknrollMarc: ill let you know
[08:29:06] darrencauthon: has joined #RubyOnRails
[08:29:21] craysiii: look forward to it. for now, time to hit the hay. 1:30am in not-so-sunny california
[08:29:57] yfeldblum: has joined #RubyOnRails
[08:31:52] arBmind: has joined #RubyOnRails
[08:31:57] annlewis: has joined #RubyOnRails
[08:34:10] rocknrollMarc: craysiii: thanks yes exactly what I need :)
[08:34:44] blackmesa: has joined #RubyOnRails
[08:36:24] jenrzzz: has joined #RubyOnRails
[08:37:16] qejk: has joined #RubyOnRails
[08:37:22] elsurudo: has joined #RubyOnRails
[08:38:56] lasker85: has joined #RubyOnRails
[08:42:12] Ekami: has joined #RubyOnRails
[08:45:31] linus4: has joined #RubyOnRails
[08:48:54] rocknrollMarc: craysiii: actualy i was looking more for this http://www.vertabelo.com/ very good take a look if you like
[08:49:35] craysiii: seems cool!
[08:49:41] adre: has joined #RubyOnRails
[08:49:58] mrityunjay: has joined #RubyOnRails
[08:54:58] sevenseacat: has joined #RubyOnRails
[08:56:11] defsdoor: has joined #RubyOnRails
[09:01:26] rockngo: has joined #RubyOnRails
[09:01:48] workmad3: has joined #RubyOnRails
[09:04:32] atomical: has joined #RubyOnRails
[09:05:00] artto: has joined #RubyOnRails
[09:07:55] andatche: has joined #RubyOnRails
[09:11:30] Grundell: has joined #RubyOnRails
[09:11:36] harisamin: has joined #RubyOnRails
[09:13:01] pecpec: has joined #RubyOnRails
[09:13:20] Grundell: has joined #RubyOnRails
[09:18:10] mike___1234: has joined #RubyOnRails
[09:18:25] User458764: has joined #RubyOnRails
[09:18:40] voker57: has joined #RubyOnRails
[09:18:41] eGGsha: has joined #RubyOnRails
[09:19:15] n008f4g_: has joined #RubyOnRails
[09:20:00] platzhirsch: has joined #RubyOnRails
[09:20:17] platzhirsch: What's the semantics of accessing an attribute using self[:name] and self[:name]= ?
[09:21:24] bronson: has joined #RubyOnRails
[09:21:24] sevenseacat: what do you mean, semantics?
[09:21:45] sevenseacat: if you're overriding the getter or setter of an attribute, you likely need to access its original value somehow
[09:22:08] Ropeney: has joined #RubyOnRails
[09:22:42] skroon: has joined #RubyOnRails
[09:23:39] platzhirsch: exactly that, thanks
[09:24:49] mices: for a mailer that sends mail to everyone in a table the step logic of iterating through each record and sending an email should go in the controller or the view?
[09:25:14] universa1: mices: sounds like a background job ;)
[09:25:49] mices: i just wanna click a button or link on my admin page to send solicitation emails
[09:26:07] mices: and i'll do it once a month
[09:26:23] universa1: that doesn't mean you can't do it right.
[09:26:41] rushed: mices: http://mailchimp.com
[09:27:15] elaptics: mices: it should go in neither
[09:27:32] elaptics: a background job would be the best place. Sending emails takes time
[09:27:46] elaptics: the controller should queue the background task
[09:27:57] User4587_: has joined #RubyOnRails
[09:29:48] darrencauthon: has joined #RubyOnRails
[09:31:53] nettoweb: has joined #RubyOnRails
[09:32:16] spkprav: has joined #RubyOnRails
[09:32:44] annlewis: has joined #RubyOnRails
[09:33:55] borat_borat: has joined #RubyOnRails
[09:37:55] apow: has joined #RubyOnRails
[09:39:12] artto: has joined #RubyOnRails
[09:40:54] arup_r: has joined #RubyOnRails
[09:41:29] CanTonic: has joined #RubyOnRails
[09:42:23] arup_r1: has joined #RubyOnRails
[09:44:59] koneko: has joined #RubyOnRails
[09:45:25] Guest24947: has joined #RubyOnRails
[09:49:27] skroon: has joined #RubyOnRails
[09:50:31] koneko_: has joined #RubyOnRails
[09:50:56] koneko_: has joined #RubyOnRails
[09:54:29] User458764: has joined #RubyOnRails
[09:58:59] p1k: has joined #RubyOnRails
[09:59:32] kitsuneyo: has joined #RubyOnRails
[10:01:54] kitsuneyo: i just ordered rails 4 in action :)
[10:02:08] sevenseacat: kitsuneyo: awesome :) hope you like it
[10:02:13] kitsuneyo: in case anyone else is buying, there's 40% off with code kanban40infoq
[10:02:45] kitsuneyo: thanks sevenseacat, i'm sure i will. i'm still reading well-grounded right now, and that's a great book
[10:03:13] kitsuneyo: are the print copies going out now?
[10:03:53] sevenseacat: they sure are
[10:04:24] kitsuneyo: great, hopefully i can get my copy shortly after i finish the other book. i don't like e-books much
[10:05:23] mices: since the controller for mailers is under app/mailers and not app/controllers how do i put the mailer in routes.rb
[10:05:47] harisamin: has joined #RubyOnRails
[10:06:10] wethu: has joined #RubyOnRails
[10:07:12] sevenseacat: mices: you don't link to mailers
[10:07:16] sevenseacat: you call mailers from controllers
[10:08:15] mices: so then why isn't a mailer a controller action
[10:08:51] mices: if we have the controller and view what do we need the mailer to do for us
[10:08:57] Ergo: has joined #RubyOnRails
[10:09:02] arup_r1: to do email..
[10:09:11] quazimodo: has joined #RubyOnRails
[10:09:33] arup_r1: ActionMailer has other more responsibilites
[10:10:37] arup_r1: That is why they are separate... Don't need to sum up with controller .. and routes for mailer doesn't make any sense
[10:11:05] Lycanii: has joined #RubyOnRails
[10:11:38] Lycanii: has left #RubyOnRails: ()
[10:12:17] s2013: has joined #RubyOnRails
[10:12:30] zpe: has joined #RubyOnRails
[10:12:42] mike___1234: has joined #RubyOnRails
[10:15:32] freezevee: has joined #RubyOnRails
[10:17:29] enylcanment: has joined #RubyOnRails
[10:18:39] enylcanment: has joined #RubyOnRails
[10:19:59] dideler: has joined #RubyOnRails
[10:20:21] rickmasta: has joined #RubyOnRails
[10:20:37] bronson: has joined #RubyOnRails
[10:22:43] tvw: has joined #RubyOnRails
[10:26:01] User458764: has joined #RubyOnRails
[10:26:40] yfeldblum: has joined #RubyOnRails
[10:26:51] pawnbox: has joined #RubyOnRails
[10:27:06] kitsuneyo: has joined #RubyOnRails
[10:27:39] enlycanment: has joined #RubyOnRails
[10:28:00] imp4t: has joined #RubyOnRails
[10:28:05] PhantomSpank: has joined #RubyOnRails
[10:28:07] zpe: has joined #RubyOnRails
[10:30:35] darrencauthon: has joined #RubyOnRails
[10:31:40] chrislotix: has joined #RubyOnRails
[10:32:28] trautwein: has joined #RubyOnRails
[10:33:31] annlewis: has joined #RubyOnRails
[10:34:35] dionysus69: can anyone shed some light on the role of nginx along with puma? what can nginx with puma what puma can't do alone?
[10:34:38] zpe: has joined #RubyOnRails
[10:34:40] enlycanment: has joined #RubyOnRails
[10:41:25] ddv: dionysus69: serving static content more efficiently
[10:42:26] dionysus69: hmm ok thanks ^.^
[10:43:20] stamina: has joined #RubyOnRails
[10:43:56] elsurudo: has joined #RubyOnRails
[10:44:25] elsurudo: has joined #RubyOnRails
[10:49:40] blackmesa: has joined #RubyOnRails
[10:49:57] workmad3: has joined #RubyOnRails
[10:51:30] Testo: has joined #RubyOnRails
[10:52:30] tetraktys: has joined #RubyOnRails
[10:54:38] Testo: has joined #RubyOnRails
[10:58:44] tvw: has joined #RubyOnRails
[10:59:30] yardenbar: has joined #RubyOnRails
[10:59:54] harisamin: has joined #RubyOnRails
[11:00:24] danandreasson: has joined #RubyOnRails
[11:01:40] penguinp1wernz: has joined #RubyOnRails
[11:01:58] solars: has joined #RubyOnRails
[11:03:45] mostlybadfly: has joined #RubyOnRails
[11:06:10] rodfersou: has joined #RubyOnRails
[11:06:44] kitsuneyo: has joined #RubyOnRails
[11:14:23] tallmocha: has joined #RubyOnRails
[11:15:05] workmad3: has joined #RubyOnRails
[11:18:04] nfk|laptop: has joined #RubyOnRails
[11:21:37] bronson: has joined #RubyOnRails
[11:23:36] habitullence: has joined #RubyOnRails
[11:24:08] CanTonic: has joined #RubyOnRails
[11:24:20] linus4: has joined #RubyOnRails
[11:25:40] chills42: has joined #RubyOnRails
[11:25:57] charliesome: has joined #RubyOnRails
[11:27:20] atomical: has joined #RubyOnRails
[11:28:20] tetraktys: has joined #RubyOnRails
[11:31:08] rodfersou: has joined #RubyOnRails
[11:31:20] darrencauthon: has joined #RubyOnRails
[11:31:56] voker57: has joined #RubyOnRails
[11:33:15] elsurudo: has joined #RubyOnRails
[11:33:41] elsurudo: has joined #RubyOnRails
[11:33:57] ldnunes: has joined #RubyOnRails
[11:34:14] annlewis: has joined #RubyOnRails
[11:38:52] apow: has joined #RubyOnRails
[11:39:52] skroon: has joined #RubyOnRails
[11:40:42] User458764: has joined #RubyOnRails
[11:41:19] renews: has joined #RubyOnRails
[11:42:54] marr: has joined #RubyOnRails
[11:44:03] ruurd: has joined #RubyOnRails
[11:44:10] bitkiller: has joined #RubyOnRails
[11:46:47] kitsuneyo: has joined #RubyOnRails
[11:48:57] XCMer: has joined #RubyOnRails
[11:50:18] budmc29: has joined #RubyOnRails
[11:50:21] blackmesa: has joined #RubyOnRails
[11:51:06] budmc29: I have a question about rails architecture. Is it ok to add many methods in application controller, so i can share them in all controllers or will that bloat the application?
[11:52:22] elaptics: yes, though I would hope there's not *that* many. You might instead want to place them in concerns and include them in as necessary
[11:53:24] voker57: has joined #RubyOnRails
[11:54:06] harisamin: has joined #RubyOnRails
[11:54:54] budmc29: i mostly need to add methods to return cached stuff like cached_user, in that method i get the record and cache it, then i use cached_user where i need it, and i will also need blogs caching etc
[11:55:05] IceyEC: has joined #RubyOnRails
[11:55:40] elaptics: cached how?
[11:55:53] budmc29: unsing Rails.cache.fetch
[11:56:11] towski_: has joined #RubyOnRails
[11:56:32] elaptics: wouldn't that just be user? or current_user or similar? Do you need to know it's cached or fetched from cache?
[11:56:45] elaptics: since you're fetching it and then caching it
[11:56:53] budmc29: i add cached_user to differentiate, because i can't cache on some places
[11:57:33] elaptics: why not just use the cache if you can and then fall back to uncached in places where you can't?
[11:58:00] elaptics: if you can share some code we might be able to provide more specific advice
[11:58:37] budmc29: i think it's easier to use a method in 20 places and a sorcery method in another 10 places than using conditionals in 30 places
[11:58:55] workmad3: has joined #RubyOnRails
[11:59:32] p1k: has joined #RubyOnRails
[11:59:50] budmc29: also, i have a big query with order and published and pagination, so it's better to use a method
[11:59:57] budmc29: also eager_loading
[12:00:39] sadaf2606: has joined #RubyOnRails
[12:02:14] sadaf2606: hello, I want to test my active_admin using active support, how can I make post request to active admin?
[12:03:51] spkprav: has joined #RubyOnRails
[12:04:47] darkxploit: has joined #RubyOnRails
[12:05:07] skroon: has joined #RubyOnRails
[12:05:08] lasker85: has joined #RubyOnRails
[12:05:41] XCMer: has joined #RubyOnRails
[12:06:13] pawnbox: has joined #RubyOnRails
[12:08:12] sankaber: has joined #RubyOnRails
[12:08:21] imkj: has joined #RubyOnRails
[12:09:27] jenrzzz: has joined #RubyOnRails
[12:11:07] pecpec: has joined #RubyOnRails
[12:11:50] lxsameer: has joined #RubyOnRails
[12:13:44] krisquigley: has joined #RubyOnRails
[12:14:15] artto: has joined #RubyOnRails
[12:15:41] XCMer: has joined #RubyOnRails
[12:16:03] broman: has joined #RubyOnRails
[12:16:27] dionysus69: how would I setup environmental variables for production on my own server? something like dotenv gem but for production ?
[12:17:30] raphagodoi: has joined #RubyOnRails
[12:18:56] AxonetBE: has joined #RubyOnRails
[12:19:55] AxonetBE: I want to track user information on visiting the site, my idea is to open popup and that the user need to fill in his email, after when he comes back we can track the pages he visited and add this in the database
[12:20:13] AxonetBE: is it a bad idea to store the plain email in cookie?
[12:20:56] kitsuneyo: has joined #RubyOnRails
[12:22:32] bronson: has joined #RubyOnRails
[12:22:32] mices: an email list is worth money i don't wanna use any of these services just to send 100 emails i don't want them to have my mailing list
[12:25:03] pawnbox_: has joined #RubyOnRails
[12:26:04] blackmesa: has joined #RubyOnRails
[12:27:00] lasker85: has joined #RubyOnRails
[12:28:21] bobbobbins: has joined #RubyOnRails
[12:29:48] bePolite: has joined #RubyOnRails
[12:29:53] bobbobbins: hey, I made a little cms that pulls most the content of a site from a database but I want to be able to call includes inside that content, whats the best way to do that?
[12:30:23] budmc29: sadaf2606: http://railsapps.github.io/rails-environment-variables.html
[12:31:28] bbrowning: has joined #RubyOnRails
[12:32:05] darrencauthon: has joined #RubyOnRails
[12:32:19] eikood: has joined #RubyOnRails
[12:32:52] mike___1234: has joined #RubyOnRails
[12:35:13] annlewis: has joined #RubyOnRails
[12:35:30] Testo: has joined #RubyOnRails
[12:37:19] rclanan: has joined #RubyOnRails
[12:39:16] annlewis_: has joined #RubyOnRails
[12:40:32] bobbobbins1: has joined #RubyOnRails
[12:42:41] yashinbasement: has joined #RubyOnRails
[12:43:33] ruurd: has joined #RubyOnRails
[12:44:37] Peg-leg: has joined #RubyOnRails
[12:47:30] PhantomS_: has joined #RubyOnRails
[12:48:13] PhantomSpank: has joined #RubyOnRails
[12:48:44] PhantomSpank: has joined #RubyOnRails
[12:49:24] arup_r1: bobbobbins1: includes means ?
[12:49:32] sadaf2606: I want to use Admin::PostsController in my active support controller test, but I am getting uninitialized constant error. What should I put in my require string to make it available? (active admin question)
[12:49:39] PhantomSpank: has joined #RubyOnRails
[12:50:35] budmc29: dionysus69: check this for environment variables
[12:50:36] budmc29: http://railsapps.github.io/rails-environment-variables.html
[12:51:03] dionysus69: budmc29: thanks I already set them :)
[12:51:19] budmc29: sadaf2606: i send the message to you by mistake, sorry
[12:51:43] arup_r1: err in tab completion
[12:52:06] budmc29: close enough
[12:53:58] budmc29: sadaf2606: i user rspec, but i guess you can try this: https://github.com/plataformatec/devise/wiki/How-To:-Test-controllers-with-Rails-3-and-4-%28and-RSpec%29\
[12:54:09] budmc29: and instead of using ActionController you user AdminController
[12:54:25] budmc29: class SomeControllerTest < AdminController::TestCase
[12:55:27] Pupeno: has joined #RubyOnRails
[12:55:27] Pupeno: has joined #RubyOnRails
[12:56:08] PhantomSpank: has joined #RubyOnRails
[12:56:41] IFrank00: Hi im trying ti use whenever and cron jobs
[12:56:55] IFrank00: im using rails 4.2.1
[12:57:13] jkamenik: has joined #RubyOnRails
[12:57:28] arup_r1: ok,,, then ?
[12:57:31] sanjayu: has joined #RubyOnRails
[12:57:38] IFrank00: this what I have
[12:58:23] sdwrage: has joined #RubyOnRails
[12:58:34] sanjayu: has joined #RubyOnRails
[12:58:49] xcv: has joined #RubyOnRails
[12:59:31] sanjayu: has joined #RubyOnRails
[12:59:50] ddv: IFrank00: don't leave us hanging....
[13:00:35] IFrank00: https://gist.github.com/Frank004/70a40ff171a3903b8739
[13:00:43] havenwood: has joined #RubyOnRails
[13:00:53] ddv: IFrank00: what is the problem?
[13:00:58] paolodoors: has joined #RubyOnRails
[13:01:36] IFrank00: ok the problem is not running the or getting any log
[13:01:53] User4587_: has joined #RubyOnRails
[13:02:10] IFrank00: the method work on the console and browser
[13:02:46] jgpawletko: has joined #RubyOnRails
[13:02:46] darrencauthon: has joined #RubyOnRails
[13:03:08] ddv: IFrank00: is this homework?
[13:05:08] dhjondoh: has joined #RubyOnRails
[13:06:07] IFrank00: What I want to do is on the first of each month generate recurrences of a event. I have ice_cube gem that set me that start_date for the recurrences and on my model I can run the menthol and generate the recurrences with no problem. now I was looking of a automatic way
[13:06:48] IFrank00: ddv, its my first time using cron jobs
[13:07:11] bendangelo: has joined #RubyOnRails
[13:07:26] ddv: IFrank00: cron loads up it own non-interactive environment
[13:07:30] dllama: has joined #RubyOnRails
[13:07:53] ddv: IFrank00: there is nothing in the cron log?
[13:09:37] nya: has joined #RubyOnRails
[13:09:37] Detch: has joined #RubyOnRails
[13:10:14] A124: has joined #RubyOnRails
[13:11:05] atmosx: has joined #RubyOnRails
[13:11:11] norc: has joined #RubyOnRails
[13:11:20] ddv: IFrank00: why do you think cd :path would work?
[13:11:58] IFrank00: ddv I was looking on stack
[13:12:09] norc: Hi. I have a larger Oracle production database. For historical reasons there is no seperate testing/development environment. We are considering writing a Rails application to provide some alternative access to the data beneath.
[13:12:13] IFrank00: every 2.minutes do
[13:12:13] IFrank00: runner "Task.generate_new_trans" , environment: :development
[13:12:14] ddv: IFrank00: I think you need to put an actual path there
[13:12:34] IFrank00: this was what I have before
[13:12:41] norc: Any opinions on this so far?
[13:13:25] ddv: norc: I don't see why you couldn't create a test/development
[13:13:30] ddv: environment afterwards
[13:13:47] jkamenik: has joined #RubyOnRails
[13:14:13] ddv: IFrank00: right now its just a string ':path'
[13:14:52] IFrank00: "cd :path/app/models/task.rb && bundle exec rails runner -e :environment ':task' :output"
[13:14:56] ramortegui: has joined #RubyOnRails
[13:15:10] ddv: IFrank00: try "cd #{path}/app/models etc
[13:15:11] IFrank00: ddv ? something like that ??
[13:15:27] apow: has joined #RubyOnRails
[13:15:33] norc: ddv: Im guessing I should start this by manually writing migrations to produce a schema exactly matching my production right?
[13:15:57] sadaf2606: http://stackoverflow.com/questions/32949279/how-can-i-import-active-admin-controllers-to-my-active-support-test/32949444
[13:16:19] ddv: norc: I think you should decide first what data you want to get out of the db, model that making make a nice ERD and then write some migrations/models
[13:16:25] Guest53: has joined #RubyOnRails
[13:16:28] spkprav: has joined #RubyOnRails
[13:16:37] workmad3: norc: if you've connected via a rails app already, you can start by doing 'rake db:schema:dump' to populate a schema.rb file
[13:16:39] kzsh: has joined #RubyOnRails
[13:16:46] artto: has joined #RubyOnRails
[13:16:56] workmad3: norc: and then you can initialize a new database with that schema using 'rake db:schema:load' with a different connection
[13:17:12] norc: workmad3: That is crazy simple. :)
[13:18:26] workmad3: norc: you won't get any data in that though, so you should still do ddv's suggestion of figuring out what data you want for your test environment and figuring out a way to port that across too
[13:20:27] RegulationD: has joined #RubyOnRails
[13:20:47] pecpec: has joined #RubyOnRails
[13:22:08] bobbobbins: has joined #RubyOnRails
[13:23:32] bronson: has joined #RubyOnRails
[13:23:42] PhantomSpank: has joined #RubyOnRails
[13:24:22] TPBallbag: has joined #RubyOnRails
[13:24:41] artto: has joined #RubyOnRails
[13:25:39] krz: has joined #RubyOnRails
[13:26:04] cih: has joined #RubyOnRails
[13:26:33] syath: has joined #RubyOnRails
[13:26:41] IFrank00: ddv https://gist.github.com/Frank004/70a40ff171a3903b8739#file-log-rb
[13:26:44] spkprav: has joined #RubyOnRails
[13:27:24] PhantomSpank: has joined #RubyOnRails
[13:27:37] tetraktys: has joined #RubyOnRails
[13:27:50] Guest53: has joined #RubyOnRails
[13:29:19] umgrosscol: has joined #RubyOnRails
[13:31:33] hfp_work: has joined #RubyOnRails
[13:32:17] Jet4Fire: has joined #RubyOnRails
[13:33:02] A124: has joined #RubyOnRails
[13:33:18] cazrin: has joined #RubyOnRails
[13:34:00] xcv_: has joined #RubyOnRails
[13:34:43] Palsson_: has joined #RubyOnRails
[13:36:40] norc: workmad3: Alright yeah. Will probably just write some factories for the test data.
[13:37:09] norc: I mean that particular part is the same anyway.
[13:39:20] artto: has joined #RubyOnRails
[13:39:53] FCser: has joined #RubyOnRails
[13:42:04] quazimodo: has joined #RubyOnRails
[13:43:24] devdazed: has joined #RubyOnRails
[13:45:33] bkulbida: has joined #RubyOnRails
[13:45:39] rushed: has joined #RubyOnRails
[13:45:47] dionysus69: has joined #RubyOnRails
[13:46:01] stannard: has joined #RubyOnRails
[13:47:01] sevenseacat: has joined #RubyOnRails
[13:47:49] norc: An unrelated question, how can I force rails to process a custom yml file with erb first? It seems that Rails eager loads any yml file, but only processes known files with erb.
[13:48:24] CanTonic: has joined #RubyOnRails
[13:48:25] norc: (Im talking about a yml file in config/ of course)
[13:51:23] symbol: has joined #RubyOnRails
[13:51:35] chipotle: has joined #RubyOnRails
[13:52:16] tallmocha: has joined #RubyOnRails
[13:52:52] krisquigley: has joined #RubyOnRails
[13:54:25] darrencauthon: has joined #RubyOnRails
[13:54:31] chipotle_: has joined #RubyOnRails
[13:56:58] rubyonrailed: has joined #RubyOnRails
[13:59:11] maxx88: has joined #RubyOnRails
[13:59:40] n008f4g_: has joined #RubyOnRails
[14:03:07] Testo: has joined #RubyOnRails
[14:04:37] arup_r: has joined #RubyOnRails
[14:07:07] bePolite: has joined #RubyOnRails
[14:07:52] norc: workmad3: Ah bugger. I cannot use rake db:schema:dump since my production user uses writeable views which are not recognized. :-(
[14:07:56] ariedler: has joined #RubyOnRails
[14:08:03] idd2d: has joined #RubyOnRails
[14:08:59] eikood: has joined #RubyOnRails
[14:09:35] norc: workmad3: and even if it were direct tables, some are located in different schemas.
[14:09:44] tenderlove: has joined #RubyOnRails
[14:09:54] workmad3: norc: ah, that sucks
[14:09:57] foolsh: has joined #RubyOnRails
[14:10:29] workmad3: norc: you could try changing activerecord to use the SQL schema dumper, and see if that's any better
[14:11:01] workmad3: norc: that would dump out a `db/structure.sql` file instead of a `db/schema.rb` file... something to google and investigate at least
[14:11:47] kitsuneyo: has joined #RubyOnRails
[14:11:50] norc: workmad3: Not sure whether that would work, since I need the underlying DDL rather than the views. But its an interesting idea certainly.
[14:11:51] workmad3: norc: otherwise, you're back to your original idea of creating a similar schema in your chosen db and importing it into rails either via migrations or by creating it in a separate database and dumping it out with rake
[14:12:12] norc: workmad3: Oh! That last one. That is the solution. :)
[14:13:28] workmad3: norc: just remember, if your database relies on things like writeable views, you could really do with figuring out how to replicate them in a rails schema/structure dump so that you don't inadvertantly cause behaviour differences in dev and prod
[14:14:16] norc: workmad3: They are trivial views which just have some selectivity on the columns and rename them.
[14:14:23] kitsuneyo: has joined #RubyOnRails
[14:15:17] norc: workmad3: The database itself does not rely on them, I just use them to rename tables and columns to make them play nicely with Rails.
[14:16:52] sarink: has joined #RubyOnRails
[14:18:37] highcup: has joined #RubyOnRails
[14:19:35] i: has joined #RubyOnRails
[14:20:34] RegulationD: has joined #RubyOnRails
[14:22:27] chills42: has joined #RubyOnRails
[14:23:26] foolsh: has joined #RubyOnRails
[14:24:29] bronson: has joined #RubyOnRails
[14:25:59] pawnbox: has joined #RubyOnRails
[14:26:17] chouhoulis: has joined #RubyOnRails
[14:27:03] chouhoulis: has joined #RubyOnRails
[14:27:44] jahbrewski: has joined #RubyOnRails
[14:28:53] jahbrewski: hey guys, I want to add a new validation to a model, but I only want it to apply to new records (I don't want all my old records to be invalid)
[14:29:13] universa1: jahbrewski: so add a condition, check the docs for the validations ;)
[14:30:31] pawnbox_: has joined #RubyOnRails
[14:30:31] atomical: has joined #RubyOnRails
[14:31:20] jahbrewski: universa1: ah yes. Isn't there a function to check if a record is a new record?
[14:31:40] universa1: jahbrewski: you can directly add it as an option on the validation.
[14:31:55] universa1: jahbrewski: .persisted? .new_record? ...
[14:36:36] lrocksmashtime1: has joined #RubyOnRails
[14:38:55] foolsh: has joined #RubyOnRails
[14:39:14] xcv_: has joined #RubyOnRails
[14:39:52] arup_r: jahbrewski: use context as :create and then save it ( http://api.rubyonrails.org/classes/ActiveRecord/Validations.html#method-i-valid-3F)
[14:44:48] enigmaty: has joined #RubyOnRails
[14:45:39] pwnd_nsfw: has joined #RubyOnRails
[14:46:45] platzhirsch: Is schema.rb onlyl updated in RAILS_ENV=development? Or what happens in RAILS_ENV=test?
[14:47:32] pawnbox: has joined #RubyOnRails
[14:47:49] universa1: platzhirsch: you don't manually run migrations in test.
[14:48:01] universa1: platzhirsch: therefore schema.rb will not get updated in test.
[14:48:03] platzhirsch: universa1: I have to update my test database?
[14:48:16] universa1: platzhirsch: the rails generated test helper will take care of that.
[14:49:25] platzhirsch: I see :) thanks
[14:49:31] jkamenik: has joined #RubyOnRails
[14:49:34] mary5030: has joined #RubyOnRails
[14:49:43] universa1: there should be a line with maintain_schema or alike
[14:49:58] paulcsmith: has joined #RubyOnRails
[14:50:15] EminenceHC: has joined #RubyOnRails
[14:50:37] mary5030: has joined #RubyOnRails
[14:51:01] jessemcgilallen: has joined #RubyOnRails
[14:51:56] broman: has joined #RubyOnRails
[14:52:17] dionysus69: has joined #RubyOnRails
[14:52:35] XCMer: has joined #RubyOnRails
[14:52:44] The_Ball: has joined #RubyOnRails
[14:52:54] The_Ball: How do you guys work with branches and capistrano? I have set it up so I can do cap staging deploy, but it deploys the master branch, when happy I do cap production deploy which also deploys the master branch of course
[14:53:05] broman: I have an TemplateController .. when i go to the console and try to call Template.controllerdefinedmethod it says "method missing"... what's that? rails 3.2
[14:53:42] cball: has joined #RubyOnRails
[14:54:01] universa1: broman: !code
[14:54:01] helpa: broman: We cannot help you with your problem if you don't show us your code. Please put it on http://gist.github.com and give us the URL so we can see it.
[14:55:37] fryguy: The_Ball: either override via a provided environment variable, or use the "ask" primitive to prompt you what branch you want to deploy
[14:57:00] The_Ball: fryguy, thanks
[14:57:12] Ilian: has joined #RubyOnRails
[15:00:01] The_Phoenix: has joined #RubyOnRails
[15:00:22] User458764: has joined #RubyOnRails
[15:00:27] jsrn_: has joined #RubyOnRails
[15:01:51] bmalum: has joined #RubyOnRails
[15:04:09] broman: t = [#<TipoQuestao id: 7, pai_id: 2, nome: "Pe?a", partial: "peca">] .... how can i access the attributes like t.id ??
[15:04:26] universa1: broman: t is an array
[15:04:39] universa1: broman: so you don't to access the id of the array.
[15:04:42] universa1: broman: t.first.id
[15:05:02] broman: universa1, thank you!
[15:05:21] bobbobbins: has joined #RubyOnRails
[15:05:26] universa1: *so you don't want to access
[15:09:01] DoubleMalt: has joined #RubyOnRails
[15:09:03] pwnd_nsfw: has joined #RubyOnRails
[15:10:00] CanTonic: has joined #RubyOnRails
[15:10:11] Spami_: has joined #RubyOnRails
[15:10:24] newdan: has joined #RubyOnRails
[15:10:56] blackmesa: has joined #RubyOnRails
[15:11:43] chipotle: has joined #RubyOnRails
[15:12:38] n1lo: has joined #RubyOnRails
[15:13:34] symbole: has joined #RubyOnRails
[15:14:15] Guest86944: has joined #RubyOnRails
[15:14:42] nzst: has joined #RubyOnRails
[15:16:27] nzst: has left #RubyOnRails: ()
[15:18:17] codelahoma: has joined #RubyOnRails
[15:20:17] EminenceHC: has joined #RubyOnRails
[15:21:12] annlewis: has joined #RubyOnRails
[15:21:38] smathy: has joined #RubyOnRails
[15:23:39] bobbobbins: has joined #RubyOnRails
[15:23:51] axl_: has joined #RubyOnRails
[15:24:46] m1lt0n: has joined #RubyOnRails
[15:25:29] bronson: has joined #RubyOnRails
[15:26:10] Goliathus: has joined #RubyOnRails
[15:27:16] EminenceHC: has joined #RubyOnRails
[15:28:16] ahmgeek: has joined #RubyOnRails
[15:28:37] ahmgeek: hey floks, how can I catch this with params: "members"=>{"friends_ids"=>["2"]}
[15:28:51] rails296: has joined #RubyOnRails
[15:28:57] ahmgeek: I am trying params[:members][:friends_ids].to_i without any hope
[15:29:56] nzst: has joined #RubyOnRails
[15:30:03] rails296: has left #RubyOnRails: ()
[15:30:12] disgrntld: has joined #RubyOnRails
[15:30:31] Depili: in the example friends_ids is an array, not a single number
[15:30:48] ahmgeek: yep, I am trying to catch the array
[15:30:54] ahmgeek: integer array actually.
[15:30:59] nzst: Hi, what do you think about adding a the backup gem to the vendor folder as outlined here? http://blog.glaucocustodio.com/2014/02/11/scheduled-backups-with-clockwork-and-backup-gem/ Before I was coming up with a complicated workflow with new unix users on the server, but this seems to do the job without having all of gem backups dependencies loaded in for every application instance
[15:31:11] idd2d: has joined #RubyOnRails
[15:31:24] Depili: ahmgeek: no, you are trying to typecast an array into a integer
[15:31:26] Ergo: has joined #RubyOnRails
[15:32:34] tubbo: nzst: "It isn???t recommended include Backup gem in project???s main Gemfile" didn't come with a footnote or link or anything backing up that claim. who exactly is saying this, and why?
[15:32:35] Depili: ahmgeek: http://www.linuxtopia.org/online_books/programming_books/ruby_tutorial/Ruby.new_Arrays_and_Hashes.html
[15:32:55] larissa: has joined #RubyOnRails
[15:33:04] ciree: has joined #RubyOnRails
[15:33:18] robotbrain: has joined #RubyOnRails
[15:33:28] sparr: has joined #RubyOnRails
[15:33:39] nzst: tubbo: the maintainer's of the Backup gem, see Using Bundler http://backup.github.io/backup/v4/installation/
[15:33:53] ahmgeek: well, I was trying just to catch the array like this : params[:members][:friends_ids]
[15:34:02] ahmgeek: Depili: but also didn't make it.
[15:34:32] nzst: tubbo: it has very strict dependencies, https://rubygems.org/gems/backup
[15:34:54] nzst: tubbo: if you dig into the issues on github, the maintainers lay it out like that
[15:35:27] tubbo: nzst: ah i see now...because backup really isn't a library. well, why not just install it with `gem install`, outside the scope of Bundler? why would you need Bundler for a single gem?
[15:35:58] tubbo: nzst: backup kinda sounds like an ancillary thing you'd install to the box in the provisioning process, and it would act as an entirely separate program
[15:36:00] nzst: tubbo: well, then my server starts to grow global gem dependencies
[15:36:17] xcesariox: has joined #RubyOnRails
[15:37:42] tubbo: nzst: if you have 1 version of ruby installed on the box, it's kind-of all the same thing really
[15:37:51] tubbo: nzst: i mean, everything is using the same ruby version
[15:37:56] foolsh: has joined #RubyOnRails
[15:38:28] tubbo: so it's really a difference of just using `gem install` vs. `bundle install`. Bundler's main win is that it helps you manage large sets of dependencies, so you don't get into version hell. but it's useless if you're just installing 1 gem...
[15:38:57] tubbo: the only reason we avoid global gems in development is so we can ship the entire dependency graph with our app, so that on the server you don't need to remember to install 1 or 2 little gems to make the app work
[15:39:09] tubbo: in this case, backup is to make the app back up, but it wouldn't block the app from running.
[15:39:28] jkamenik: has joined #RubyOnRails
[15:39:53] inanepenguin: has joined #RubyOnRails
[15:41:30] sininen: has joined #RubyOnRails
[15:41:31] chrislotix: has joined #RubyOnRails
[15:43:55] kitsuneyo: has joined #RubyOnRails
[15:44:58] hahuang65: has joined #RubyOnRails
[15:45:18] hfp_work: has joined #RubyOnRails
[15:45:23] loc22: has joined #RubyOnRails
[15:45:49] smathy: ahmgeek, learn (more) ruby: https://www.ruby-lang.org/en/documentation/
[15:46:29] tetraktys: has joined #RubyOnRails
[15:48:02] ahmgeek: I do learn more :(, I've caught the error, I was do it like: params[:members][:friends_ids] if params[:members][:friends_ids] with put defining the state at the end of the if condition
[15:48:05] ahmgeek: params[:members][:friends_ids].nil?
[15:48:09] ahmgeek: thanks folks.
[15:48:41] gerep: has joined #RubyOnRails
[15:49:42] gerep: I made some updates in my code where I change things like this: "belongs_to :taggable, :polymorphic => true" to "belongs_to :taggable, polymorphic: true". Now I'm curious about how should I call my commit?
[15:50:39] gerep: Is there a name for when use ":something => value" and "something: value" ?
[15:50:39] loc22: has joined #RubyOnRails
[15:50:49] Pazician: has joined #RubyOnRails
[15:51:04] tubbo: gerep: "Update to modern Ruby hash syntax"?
[15:51:19] tubbo: or maybe "rubocop made me feel bad about myself" ;)
[15:51:23] tubbo: which is typically why i need to do that
[15:51:48] Pazician: has joined #RubyOnRails
[15:52:05] gerep: tubbo: thanks
[15:52:13] gerep: I like the rubocop message :D
[15:52:37] ramortegui: has joined #RubyOnRails
[15:53:26] smathy: I still don't know what "catch the array" even means.
[15:53:48] bmalum_: has joined #RubyOnRails
[15:54:02] smathy: gerep, "Useless update of hash syntax"
[15:54:46] smathy: "Saved another two bytes!"
[15:54:46] Lytol: has joined #RubyOnRails
[15:54:57] smathy: "I wish I had an intern."
[15:55:53] jenrzzz: has joined #RubyOnRails
[15:56:49] mxrguspxrt: has joined #RubyOnRails
[15:58:43] gerep: tubbo: My English is not good, can you help me understand what ruboto is trying to say with this? "Align the elements of a hash literal if they span more than one line." This line of code: "length: { minimum: 2, maximum: 50 }, format: { with: REGEX }"
[15:58:56] gerep: smathy: haha that's an option
[16:00:01] tubbo: gerep: no idea
[16:00:08] tubbo: gerep: you'd have to post more than just that line
[16:00:24] smathy: gerep, thank god, there's a #rubocop channel.
[16:00:36] gerep: tubbo: https://gist.github.com/gerep/25124f8a16a4ade21e67
[16:00:51] gerep: smathy: I'll stop talking about it :D
[16:01:00] gerep: smathy: I was just curious
[16:01:39] tubbo: smathy: how hard is it to type <leader>h??
[16:01:59] smathy: gerep, I understand, and honestly - it's quiet right now so have at it if you must. Just that this channel has whatever, hundreds of people, and #rubocop has like 3. That's a really strong hint as to how important this is.
[16:02:29] acti0nman: has joined #RubyOnRails
[16:03:07] sarink: has joined #RubyOnRails
[16:03:29] gerep: smathy: You are correct, list of users on #rubocop: axl_
[16:04:04] sarink: when an error occurs in production, why don't i see the nice "we're sorry, something went wrong" error page? i see a stack trace like it's in the development environment? do i need to turn this on somewhere or set some config option?
[16:04:18] xcv_: has joined #RubyOnRails
[16:04:29] tubbo: gerep: way to delete the gist before i could help you :P
[16:04:51] tubbo: gerep: but yeah it's basically telling you to make that more than 2 lines, like a line for each key: :value pair
[16:04:55] xcv: has joined #RubyOnRails
[16:05:17] tubbo: you can disable that for app/models/**/* if you want to, a lot of people do given the has_many thing can get a little long and who wants a 40-line has_many in the middle of their class :)
[16:05:18] gerep: tubbo: oh! Sorry for that, really! hahaha Thanks for your time! :D
[16:05:52] gerep: Good point
[16:06:19] sonofdirt: has joined #RubyOnRails
[16:06:21] bricker: has joined #RubyOnRails
[16:06:37] moeabdol: has joined #RubyOnRails
[16:06:42] fedexo: has joined #RubyOnRails
[16:07:07] hendricius: question - when you have a foreign key - do you have to add it reciprocal to both tables?
[16:07:31] smathy: sarink, are you viewing your production site locally? Ie. at localhost ?
[16:07:50] sarink: smathy: no, i'm viewing it in production
[16:08:09] siddart: has joined #RubyOnRails
[16:08:20] smathy: hendricius, for a 1:many association you will have a single foreign key in the 1 side.
[16:08:50] smathy: sarink, in your `config/environments/production.rb` file do you have config.consider_all_requests_local set to false?
[16:09:22] sarink: smathy: nope, it's set to true. is that the problem?
[16:09:35] dici: has joined #RubyOnRails
[16:09:37] smathy: sarink, yes.
[16:09:49] Scriptonaut: has joined #RubyOnRails
[16:10:04] Maletor: has joined #RubyOnRails
[16:11:18] hendricius: https://gist.github.com/hendricius/c384b383de5e8021e2f1
[16:11:24] hendricius: smathy: thx i gisted it :)
[16:11:39] hendricius: basically what i want is - record in table A is being deleted, also delete record in B
[16:13:34] smathy: hendricius, yes, I understood your comment. You're asking multiple things here.
[16:14:43] jkamenik: has joined #RubyOnRails
[16:14:59] smathy: hendricius, deleting all related SimilarUsers when a User is deleted is as simple as adding the :dependent option to your has_many. See the has_many docs: http://devdocs.io/rails/activerecord/associations/classmethods#method-i-has_many
[16:15:29] smathy: hendricius, add_foreign_key lines in your gist are the wrong way around.
[16:15:44] smathy: hendricius, (or your associations in your models are the wrong way around).
[16:15:49] smathy: hendricius, !associations
[16:15:49] helpa: hendricius: http://guides.rubyonrails.org/association_basics.html - Active Record Association Basics by Mike Gunderloy
[16:15:54] smathy: Read that ^
[16:16:27] zendrix: has joined #RubyOnRails
[16:18:01] rickmasta: has joined #RubyOnRails
[16:20:07] DmitryBochkarev: has joined #RubyOnRails
[16:21:27] towski_: has joined #RubyOnRails
[16:21:56] zendrix: has joined #RubyOnRails
[16:21:58] annlewis: has joined #RubyOnRails
[16:22:13] safety_cut: has joined #RubyOnRails
[16:22:23] cih: has joined #RubyOnRails
[16:23:48] sarink: if post.respond_to? :newest_comment_date && !post.newest_comment_date.blank? why would this give me an "undefined method `newest_comment_date`" when the first condition is the respond_to?
[16:24:09] smathy: sarink, precedence.
[16:24:45] sarink: because of the not?
[16:26:21] bronson: has joined #RubyOnRails
[16:26:46] vmarcetic: has joined #RubyOnRails
[16:27:36] s2013: has joined #RubyOnRails
[16:29:20] smathy: sarink, no, not because of the not. There's only one way that your `post.newest_comment_date` is being called before the `post.respond_to?`
[16:29:50] xcesariox: has joined #RubyOnRails
[16:31:03] sarink: smathy: do the operations not execute in order? if the respond_to? fails, shouldn't it short-circuit and never execute the newest_comment_date.blank?
[16:31:18] sarink: i guess i realize that the respond_to isn't happening first, but i don't think i understand why
[16:32:09] shinnya: has joined #RubyOnRails
[16:32:20] istrasci: has joined #RubyOnRails
[16:32:44] benlieb: has joined #RubyOnRails
[16:33:12] istrasci: Is there any major difference between find_or_create_by and first_or_create?
[16:33:49] smathy: sarink, so yes, if the left hand side of an && fails then it'll short circuit and the right hand side won't be executed.
[16:34:14] hooper: has joined #RubyOnRails
[16:34:27] smathy: sarink, so, that's not happening, and I'm telling you it's not happening because of precedence. There's only one way that that could be true.
[16:34:37] hooper: has joined #RubyOnRails
[16:34:50] gerep: istrasci: I guess it is just the condition
[16:35:09] ismaelga: has joined #RubyOnRails
[16:35:48] sarink: so either the right side is executing first, or the respond_to? isn't failing. i assume the respond_to? can't be evaluating to true, given that the error is an undefined method... is this a trick
[16:36:36] istrasci: gerep: What condition do you mean?
[16:36:46] bitkiller: has joined #RubyOnRails
[16:37:05] zhkirill: has joined #RubyOnRails
[16:39:21] symbole: has joined #RubyOnRails
[16:40:23] krisquigley: has joined #RubyOnRails
[16:41:03] willardg: has joined #RubyOnRails
[16:41:27] smathy: istrasci, well you can use first_or_create without a scope.
[16:41:30] arup_r: has joined #RubyOnRails
[16:41:59] smathy: sarink, neither of those options is about precedence.
[16:42:38] sarink: "and I'm telling you it's not happening because of precedence" - you are confusing me
[16:42:55] smathy: sarink, do you know what precedence is?
[16:43:08] zhkirill: has joined #RubyOnRails
[16:43:10] sarink: what do you even mean by "precedence", bc i was thinking that that you meant operator precedence, ie order of operations
[16:43:22] User458764: has joined #RubyOnRails
[16:43:25] smathy: sarink, yes, that's what I mean. Order of operations.
[16:43:41] smathy: sarink, so, respond_to? isn't getting a change to run because of precedence, ie. because the post.newest_comment_date is running first. Why would that be?
[16:44:06] sarink: the only thing i can think of is because of the !, but you said it's not that.
[16:44:06] smathy: (hint: it's because of precedence :)
[16:44:37] diegoviola: has joined #RubyOnRails
[16:44:40] paulcsmith: has joined #RubyOnRails
[16:44:49] smathy: sarink, ok, so let's explore that a little. Why would the ! cause the post.newest_comment_date to be run before the respond_to?
[16:45:31] XCMer: has joined #RubyOnRails
[16:45:35] eikood: has joined #RubyOnRails
[16:47:01] Testo: has joined #RubyOnRails
[16:49:02] sarink: i would just like to point out that you tricked me, "sarink, no, not because of the not.". anyways, i've solved it now, and learned a little bit about ruby's precedence. precedence is a little different in every language
[16:49:14] sarink: thanks :)
[16:49:20] craysiii: http://stackoverflow.com/a/21060235/922669
[16:49:47] sarink: craysiii: was just reading that ;)
[16:50:16] arup_r: has joined #RubyOnRails
[16:50:26] smathy: sarink, I didn't trick you, it wasn't about the not.
[16:50:59] sarink: what? that link says that a ! has the highest precedence
[16:51:03] smathy: sarink, you'd have precisely the same problem with your code if you didn't have the ! there.
[16:51:56] 16WAAFQ45: has joined #RubyOnRails
[16:52:07] sarink: i guess i don't get it after all
[16:52:48] troyready: has joined #RubyOnRails
[16:53:26] hephaestus_rg: has joined #RubyOnRails
[16:53:36] moeabdol: has joined #RubyOnRails
[16:55:10] youngbaks: has joined #RubyOnRails
[16:55:19] tawaffan: has joined #RubyOnRails
[16:55:20] smathy: sarink, it's funny that the actual operator that's causing the problem seems invisible to you.
[16:56:08] sarink: smathy: there's only two operators, && and !, so you're saying the problem is the &&?
[16:56:40] istrasci: has left #RubyOnRails: ()
[16:57:06] jenrzzz: has joined #RubyOnRails
[16:57:15] sarink: is it trying to evaluate ":newest_comment_date && !p.newest_comment.blank?", and pass the result to the respond_to?, because i didn't use parentheses
[16:58:11] sarink: i'm a js dev so i'm used to bad languages that do things oddly
[16:58:14] dllama: has joined #RubyOnRails
[16:58:43] sarink: i'm going to just stop guessing now
[16:58:45] craysiii: i like to explicitly use parens in my ruby code most of the time because of that very problem
[17:00:11] imkj: has joined #RubyOnRails
[17:00:47] artto: has joined #RubyOnRails
[17:01:56] stannard: has joined #RubyOnRails
[17:01:57] umgrosscol: has joined #RubyOnRails
[17:01:57] mxrguspxrt: has joined #RubyOnRails
[17:02:07] _djbkd: has joined #RubyOnRails
[17:02:11] smathy: sarink, correct, && has a higher precedence than the method call.
[17:02:12] asoliman: has joined #RubyOnRails
[17:02:35] [Butch]: has joined #RubyOnRails
[17:02:38] sarink: yeah, i wasn't thinking at all about the method call
[17:03:11] bmalum: has joined #RubyOnRails
[17:03:19] sarink: well this has been fun
[17:03:20] smathy: sarink, you're slightly excused from working this out sooner because all the docs (including that SO post craysiii linked to) are unfortunately mum on the topic of where the method call falls, even the Ruby docs themselves fail to mention it: http://ruby-doc.org/core-2.2.0/doc/syntax/precedence_rdoc.html
[17:03:41] ismaelga: has joined #RubyOnRails
[17:05:01] craysiii: i think there needs to be a push for explicit parens in docs / tutorials / classes
[17:05:06] hexfet: has joined #RubyOnRails
[17:05:34] hexfet: has left #RubyOnRails: ()
[17:05:47] netzfisch: has joined #RubyOnRails
[17:06:07] Lincee: has joined #RubyOnRails
[17:06:29] petricore: has joined #RubyOnRails
[17:07:13] krisquigley: has joined #RubyOnRails
[17:07:14] hahuang61: has joined #RubyOnRails
[17:08:09] s2013: has joined #RubyOnRails
[17:09:45] Guest250: has joined #RubyOnRails
[17:11:29] Guest250: has left #RubyOnRails: ()
[17:11:52] gryph: has joined #RubyOnRails
[17:12:00] gryph: does DHH ever hang out here?
[17:12:20] smathy: sarink, :) Method calls are basically just below defined? in the precedence order.
[17:16:10] smathy: ...or just above, saying defined? is lower than = is silly anyway, x = defined? y won't evaluate the assignment first!
[17:16:44] sarink: that is silly
[17:17:38] smathy: Yeah, perhaps x = defined? y is done differently because to evaluate = first would be a syntax error.
[17:17:49] bmalum: has joined #RubyOnRails
[17:18:25] smathy: `defined? x = 1` will do the assignment first, that must be what it means.
[17:18:47] chills42: has joined #RubyOnRails
[17:19:51] Guest53: has joined #RubyOnRails
[17:21:34] greengriminal: has joined #RubyOnRails
[17:21:56] jaequery: has joined #RubyOnRails
[17:22:03] Kamui: has joined #RubyOnRails
[17:22:11] gryph: has left #RubyOnRails: ("Textual IRC Client: www.textualapp.com")
[17:22:43] annlewis: has joined #RubyOnRails
[17:22:46] EminenceHC: has joined #RubyOnRails
[17:23:38] linus4: has joined #RubyOnRails
[17:24:10] xcv: has joined #RubyOnRails
[17:24:31] sininen_: has joined #RubyOnRails
[17:24:48] dideler94: has joined #RubyOnRails
[17:26:04] rubyonrailed: has joined #RubyOnRails
[17:27:22] bronson: has joined #RubyOnRails
[17:30:06] platzhirsch: has left #RubyOnRails: ()
[17:33:49] nettoweb: has joined #RubyOnRails
[17:35:44] yaymukund: has joined #RubyOnRails
[17:36:19] havenwood: has joined #RubyOnRails
[17:36:51] craysiii: does capybara have a generator? can't find any reference to it, and i cant remember if i used one or not
[17:37:11] rushed: has joined #RubyOnRails
[17:38:26] xcesariox: has joined #RubyOnRails
[17:39:28] inanepenguin: has joined #RubyOnRails
[17:41:03] fedexo: has joined #RubyOnRails
[17:43:17] banjara: has joined #RubyOnRails
[17:43:27] linus4: has joined #RubyOnRails
[17:44:01] hfp__work: has joined #RubyOnRails
[17:44:58] idd2d: has joined #RubyOnRails
[17:45:58] rakm: has joined #RubyOnRails
[17:46:32] jgt: has joined #RubyOnRails
[17:47:08] smathy: craysiii, no.
[17:47:14] craysiii: thanks smathy
[17:47:24] craysiii: on this new project im trying trying to go TDD
[17:47:34] craysiii: really trying*
[17:47:48] lrocksmashtime1: has left #RubyOnRails: ()
[17:50:22] nettoweb: has joined #RubyOnRails
[17:50:46] hfp_work: has joined #RubyOnRails
[17:51:16] krisquigley: has joined #RubyOnRails
[17:51:47] Ismael: has joined #RubyOnRails
[17:53:09] Pupeno_: has joined #RubyOnRails
[17:54:02] smathy: I've never liked TDD, but some people seem very convincing when they say that it works for them.
[17:54:45] craysiii: its hard for me to grasp using something before it exists
[17:54:54] craysiii: but im trying to make myself marketable
[17:55:39] tubbo: it's good to write tests, but "TDD" usually means "test-first" and that's not typically how i solve problems
[17:55:58] smathy: craysiii, in my experience, most places who say TDD just mean "write tests before pushing code to our repo"
[17:56:15] dionysus69: what should my root path for nginx be for my app at lets say home/user/myapp ?
[17:56:15] craysiii: thanks for the input everyone :)
[17:56:18] herbst: has joined #RubyOnRails
[17:56:20] smathy: Actual TDD is very rare.
[17:56:46] smathy: dionysus69, the full path to the public folder of your Rails app.
[17:56:47] hfp__work: has joined #RubyOnRails
[17:57:28] dionysus69: oh lol so ngnx has access to ONLY static files?
[17:57:41] baweaver: has joined #RubyOnRails
[17:58:05] fedexo: has joined #RubyOnRails
[17:58:45] tubbo: dionysus69: you can think of it that way. that's why you have to proxy_pass to your rails app server, which handles dynamically generating HTML.
[17:58:48] smathy: dionysus69, of course, you don't want it serving up your ruby source.
[17:58:59] tubbo: but out-of-the-box, yeah, nginx is just a "normal" web server :D
[17:59:10] dideler94: has left #RubyOnRails: ()
[17:59:12] rubyonrailed: has joined #RubyOnRails
[17:59:38] pwnd_nsfw: has joined #RubyOnRails
[17:59:38] smathy: Sorry tubbo, I think that's precisely how you should think. Who would want nginx to serve any of your app/ files, or config/ files especially! You only want nginx to serve your public/* files.
[18:00:22] agit0: has joined #RubyOnRails
[18:00:25] _el_fer_: has joined #RubyOnRails
[18:00:51] tubbo: yeah but i wanted to emphasize how nginx has the capability of proxying requests to more "capable" app servers
[18:01:00] tubbo: and it's not just a static web server or whatever
[18:01:01] baweaver: has joined #RubyOnRails
[18:01:24] smathy: Yep, very important point.
[18:02:01] smathy: dionysus69, the way nginx and the app server work are that it tries to find a static file at the requested URL, and if it can't it sends the request to the app server.
[18:02:13] smathy: *are that nginx tries to find...
[18:03:32] jahbrewski: has joined #RubyOnRails
[18:04:24] _djbkd: has joined #RubyOnRails
[18:04:42] dionysus69: smathy: thanks for explaining :) sounds good
[18:04:58] ngscheurich: has joined #RubyOnRails
[18:05:20] _djbkd: has joined #RubyOnRails
[18:05:27] smathy: dionysus69, you're welcome.
[18:06:37] jenrzzz: has joined #RubyOnRails
[18:06:42] IFrank00: has joined #RubyOnRails
[18:09:29] _djbkd: has joined #RubyOnRails
[18:09:43] tvw: has joined #RubyOnRails
[18:10:10] loc22: has joined #RubyOnRails
[18:10:30] codelahoma: has joined #RubyOnRails
[18:14:19] jessemcgilallen: has joined #RubyOnRails
[18:14:31] stamina: has joined #RubyOnRails
[18:14:36] havenwood: has joined #RubyOnRails
[18:15:45] cac: has joined #RubyOnRails
[18:16:21] ismaelga: has joined #RubyOnRails
[18:16:53] EminenceHC: has joined #RubyOnRails
[18:17:08] KensoDev: has joined #RubyOnRails
[18:17:14] cih_: has joined #RubyOnRails
[18:17:25] baweaver: has joined #RubyOnRails
[18:18:40] sundhell: has joined #RubyOnRails
[18:19:51] pwnd_nsfw: has joined #RubyOnRails
[18:20:03] cornerma1: has joined #RubyOnRails
[18:20:14] Pharaoh2: has joined #RubyOnRails
[18:20:33] inanepenguin: has joined #RubyOnRails
[18:21:29] cschneid_: has joined #RubyOnRails
[18:22:40] C0L0R: has joined #RubyOnRails
[18:23:30] annlewis: has joined #RubyOnRails
[18:24:14] hendricius: smathy: thanks for the help. i rather use foreign keys for the deletion
[18:24:25] hendricius: as this is handled on a database level, not by the application. makes things a lot faster
[18:24:38] hendricius: and you avoid n+1 deletes
[18:24:54] cih: has joined #RubyOnRails
[18:25:42] smathy: hendricius, dependent: :delete_all avoids that already.
[18:25:57] smathy: hendricius, but sure, if you don't ever need any callbacks then using the DB will be fine.
[18:26:06] smathy: hendricius, not sure what your question was then.
[18:28:22] bronson: has joined #RubyOnRails
[18:28:44] pwnd_nsfw: has joined #RubyOnRails
[18:29:52] hendricius: but you helped me anyways. thanks :)
[18:31:56] smathy: hendricius, you're welcome :)
[18:32:25] hendricius: i've been developing rails for 5 years now
[18:32:32] hendricius: but really feel i know nothing about databases
[18:33:45] cih: has joined #RubyOnRails
[18:36:32] arup_r: hendricius: That is due to the hard work of Rails core team then... We don't feel what we are doing..
[18:36:42] arup_r: power of activerecord
[18:37:14] Lincee: has joined #RubyOnRails
[18:38:14] jenrzzz: has joined #RubyOnRails
[18:39:25] yaymukund: has joined #RubyOnRails
[18:40:32] Testo: has joined #RubyOnRails
[18:41:51] lasker85: has joined #RubyOnRails
[18:42:26] lasker85: https://gist.github.com/chrisbrunk/bb80592635ea81ba0859
[18:42:40] hendricius: i guess it's a bit like writing ruby
[18:42:44] lasker85: Does anyone know how I can change this task to make it only create a new brand if it is unique?
[18:42:49] hendricius: sometimes you are interested in the underlying C interpreter
[18:43:03] lasker85: I.e., if it hasn't already been added to the database?
[18:43:03] toretore: has joined #RubyOnRails
[18:43:07] _djbkd: has joined #RubyOnRails
[18:43:28] hendricius: lasker85: have you added a uniquenuess validation to the model?
[18:44:55] smathy: lasker85, why would you do [Brand].each(&:delete_all) instead of Brand.delete_all ?
[18:45:15] lasker85: because it used tobe a list but i wanted to simplify for the purpose of asking my question
[18:45:23] arup_r: delete_all is risky..
[18:45:46] smathy: lasker85, how will you determine the uniqueness, just by the row["id"] ?
[18:45:50] arup_r: it do direct SQL ro db
[18:45:58] hendricius: https://gist.github.com/hendricius/3aa10e4f4b7c2b5c9f62
[18:46:54] tbuehlmann: arup_r, everything is risky when you don't know how to use a hammer
[18:47:40] arup_r: tbuehlmann: that is true..
[18:48:04] hephaestus_rg: has joined #RubyOnRails
[18:48:10] lasker85: hmmm.. so that's the best way to do it?
[18:48:20] arup_r: But.. I don't use it if really not needed..
[18:49:01] greengriminal: has joined #RubyOnRails
[18:49:35] Maletor: has joined #RubyOnRails
[18:49:44] FailBit: engriiiish
[18:50:01] yfeldblum: has joined #RubyOnRails
[18:50:19] arup_r: FailBit: :(
[18:50:25] netzfisch: has joined #RubyOnRails
[18:50:35] tbuehlmann: but I agree, doing cascade deletes in the database can be quite nice. these days I even implement counter caches in the database
[18:50:39] tbuehlmann: postgres ol??
[18:50:48] hendricius: tbuehlmann: counter caches on the database level?
[18:50:57] FailBit: engrish is a horrible thing
[18:50:58] hendricius: tbuehlmann: that sounds sweetness. i didn't hear that before
[18:51:32] tbuehlmann: http://shuber.io/porting-activerecord-counter-cache-behavior-to-postgres/
[18:53:06] hendricius: i wonder how much of a performance gain that is
[18:53:14] pwnd_nsfw: has joined #RubyOnRails
[18:53:49] tbuehlmann: that and I don't have to deal with rails's implementation at all
[18:54:18] hendricius: how do you write migrations?
[18:54:21] hendricius: for that stuff?
[18:55:27] hendricius: then you also need stuff like DROP FUNCTION i guess
[18:55:30] hendricius: but it's good
[18:55:38] hendricius: embrace the database
[18:55:56] hendricius: rails philosophy is good, to hide the database
[18:56:06] hendricius: but on advanced topics, you should start to embrace your database
[18:56:33] zendrix: has joined #RubyOnRails
[18:56:56] mrbubbles: has joined #RubyOnRails
[18:57:09] zendrix: has left #RubyOnRails: ()
[18:57:14] mrbubbles: good evening
[18:58:11] FailBit: learned something new today
[18:58:15] FailBit: :@foo is a valid symbol
[18:58:42] FailBit: :@foo= :@foo! :@foo? :ff@ are not valid symbols
[18:58:43] arBmind: has joined #RubyOnRails
[18:59:04] smathy: FailBit, playing with RABL?
[18:59:35] tvw: has joined #RubyOnRails
[18:59:40] FailBit: https://github.com/amatsuda/kaminari/blob/master/lib/kaminari/helpers/tags.rb#L26
[19:00:42] mrbubbles: Having a bit of a brainfry. I???ve a column name stored in a variable and I???m trying to get readings where the value in that column is not 0??? I thought Reading.where(:meter_id => 3).where('? > 0', column_name) would do it but apparently not :(
[19:01:01] EminenceHC: has joined #RubyOnRails
[19:01:31] FCser: has joined #RubyOnRails
[19:01:59] smathy: Btw, anything can be a symbol, just that the :blah syntax for literal symbols has its limits.
[19:02:25] mices: anyone can tell me a guide to sending email to every row in a table without using any services i wanna send from my own server, it's not spam and only about 100 emails to send
[19:03:20] smathy: mrbubbles, no, the `?` placeholder will always be interpreted as a value in SQL, and be appropriately quoted/escaped.
[19:03:46] smathy: mrtomme, you will need to put the column_name into your string yourself, but be sure it's not tainted input.
[19:04:35] mrbubbles: has joined #RubyOnRails
[19:04:58] artto: has joined #RubyOnRails
[19:05:22] ror15: has joined #RubyOnRails
[19:05:48] ror15: Anyone here able to help with apache server? Or is there another channel better suited
[19:06:09] arup_r: Reading.where(:meter_id => 3).where("#{column_name} > 0")
[19:06:17] arup_r: mrbubbles: ^^
[19:06:27] smathy: mrtomme, sorry, wrong person.
[19:06:33] hephaestus_rg: has joined #RubyOnRails
[19:06:39] smathy: An ask and run.
[19:06:57] smathy: ror15, ask and we'll let you know.
[19:07:04] arup_r: mrtomme: better is to keep a Hash
[19:07:26] arup_r: then SQL injection wouldn't happen
[19:07:26] ror15: $ sudo a2enmod ssl
[19:07:33] mices: i wouldn't wanna give my mailing list to any of these services like mailchimp
[19:07:33] ror15: keeps returning zsh: command not found: a2enmod
[19:07:43] ror15: Can't figure it out
[19:08:05] arup_r: oh,, sorry. I meant mrbubbles
[19:08:20] smathy: arup_r, you're talking to the wrong person.
[19:08:22] smathy: arup_r, yeah :)(
[19:08:26] smathy: arup_r, he left.
[19:08:36] arup_r: Yes. I saw :)
[19:08:39] lasker85: has joined #RubyOnRails
[19:08:41] arup_r: tab completion sucks
[19:09:11] smathy: ror15, yeah, nothing to do with Rails. Sounds like your zsh doesn't have the right PATH set up, or you're using distro-specific commands in a different distro.
[19:09:23] willardg: has joined #RubyOnRails
[19:10:00] ror15: Yeah running rails app on it so I gave it a shot
[19:10:31] ror15: Seems like it would be a common issue - thanks though
[19:11:47] dionysus69: has joined #RubyOnRails
[19:12:08] craysiii: tab completion is awesome.
[19:12:20] smathy: ror15, it probably is common, just not here.
[19:13:06] C0L0R: has joined #RubyOnRails
[19:15:48] t3rm: has joined #RubyOnRails
[19:15:50] cnk: has joined #RubyOnRails
[19:16:16] d5sx43: has joined #RubyOnRails
[19:16:28] rubyonrailed: I am trying to print a string that contains a link that was saved like this: "<http://www.link.com>" how can I turn that into a functioning link in my view? Currently it does not display because it is inside of brackets.
[19:16:41] axl_: has joined #RubyOnRails
[19:16:43] tubbo: Markdown.parse() :D
[19:17:55] rubyonrailed: tubbo: Is that using a gem?
[19:18:23] banjara: has joined #RubyOnRails
[19:19:05] sanjayu: has joined #RubyOnRails
[19:22:27] Bariza: has joined #RubyOnRails
[19:23:43] arup_r: "<http://www.link.com>".tr("<>","")
[19:23:57] arup_r: will give you the link back
[19:24:09] d5sx43: has joined #RubyOnRails
[19:24:15] annlewis: has joined #RubyOnRails
[19:26:29] rubyonrailed: arup_r: But that will remove other brackets that could be in the string.
[19:27:09] arup_r: Then, you need to show more to us..
[19:29:05] rubyonrailed: Pretty much i'm taking in some text from a slack channel. If the person posts a link, slack sends it to me in brackets: <http://www.link.com>. When users post new lines in the string they are sending over, slack breaks lines with /n. In my view I am using gsub to swap /n with <br>. So when I use .tr("<>", "") it removes the brackets around <br>.
[19:29:17] Guest86944: has joined #RubyOnRails
[19:29:20] bronson: has joined #RubyOnRails
[19:29:30] baweaver: has joined #RubyOnRails
[19:29:39] tubbo: rubyonrailed: you could tr() *before* you gsub \n with <br>
[19:30:14] Guest53: has joined #RubyOnRails
[19:31:08] tubbo: rubyonrailed: but...if you're already substituting newlines for <br>, you're sort-of already doing some things markdown would help you with
[19:31:28] tubbo: i use https://github.com/vmg/redcarpet to parse markdown, it's usually pretty fast and easy
[19:31:38] rubyonrailed: tubbo: Cool, i'll look into that as well
[19:31:46] bricker: rubyonrailed: gsub(/<(http.+?)>/, "<a href='\\1'>\\1</a>")
[19:31:48] QKO: has left #RubyOnRails: ()
[19:31:56] symbol: has joined #RubyOnRails
[19:32:15] arBmind: has joined #RubyOnRails
[19:32:17] diego3: has joined #RubyOnRails
[19:32:19] diego3: has joined #RubyOnRails
[19:32:30] smathy: tubbo, but, <link> isn't markdown syntax.
[19:32:45] tubbo: smathy: it is if you set follow_urls: true in the options :D
[19:32:48] tubbo: or whatever its called
[19:32:53] tubbo: definitely part of GFM
[19:34:08] tubbo: :autolink is what it's called
[19:34:16] rhizome: what about simple_format or auto_link?
[19:34:56] smathy: rhizome, that will account for the <>s ?
[19:35:19] Testo: has joined #RubyOnRails
[19:35:21] dionysus69: when passenger_ruby is declared inside http {} in nginx conf file is it also necessary to redeclare inside server {} too?
[19:35:42] artto: has joined #RubyOnRails
[19:36:35] dstarh: has joined #RubyOnRails
[19:36:44] rushed: has joined #RubyOnRails
[19:37:16] artto: has joined #RubyOnRails
[19:37:53] IFrank00: has left #RubyOnRails: ()
[19:38:00] IFrank00: has joined #RubyOnRails
[19:38:07] acti0nman: has joined #RubyOnRails
[19:38:39] IFrank00: Hi im having some problem with cron jobs and whatever on a rails 4.2.1 app with ruby 2.1 https://gist.github.com/Frank004/70a40ff171a3903b8739
[19:38:42] smathy: dionysus69, not necessary, no.
[19:38:55] dionysus69: smathy: ok thanks :)
[19:39:54] siddart: has joined #RubyOnRails
[19:39:58] iliketurtles: has joined #RubyOnRails
[19:40:23] atmosx: has joined #RubyOnRails
[19:40:56] iliketurtles: has joined #RubyOnRails
[19:42:01] iliketurtles: has joined #RubyOnRails
[19:42:05] iliketurtles: with strong params, is it always the case that a `params.permit(:some_key)` will return a hash with all keys and values stringified?
[19:42:07] willardg: has joined #RubyOnRails
[19:42:58] dikaio: has joined #RubyOnRails
[19:43:02] arup_r: IFrank00: show the task Task.generate_new_trans
[19:45:46] IFrank00: arup_r I was testing it on the console and find out this
[19:45:59] craysiii: IFrank00 did you restart the cron service?
[19:46:37] craysiii: http://stackoverflow.com/a/13257752/922669
[19:47:12] boombadaroomba: has joined #RubyOnRails
[19:47:21] IFrank00: craysiii, hi I found out just now testing on the console my method work on a instance on Task but not in Task as self.generate_new_trans
[19:48:12] craysiii: can we see the source for Task.generate_new_trans
[19:48:41] User458764: has joined #RubyOnRails
[19:49:06] andatche: has joined #RubyOnRails
[19:49:12] rhizome: IFrank00: first of all, use */2 rather than "0,2,4,6,8,..."
[19:50:46] craysiii: im pretty sure that is generated by whenever, is it not?
[19:50:48] IFrank00: https://gist.github.com/Frank004/70a40ff171a3903b8739
[19:50:57] jgt: has joined #RubyOnRails
[19:51:01] IFrank00: craysiii, yes
[19:51:21] craysiii: IFrank00 remember our discussion last night about class methods vs instance methods? :)
[19:51:29] craysiii: def self.generate_new_trans
[19:51:35] IFrank00: rhizome, the cron is generated by whenever
[19:52:09] IFrank00: craysiii, yes that way I notices that
[19:52:09] rushed: has joined #RubyOnRails
[19:52:12] krisquigley: has joined #RubyOnRails
[19:52:26] IFrank00: I change it to def self.generate_new_trans
[19:52:30] baweaver: has joined #RubyOnRails
[19:52:35] IFrank00: I add that code to de gist
[19:52:59] craysiii: uninitialized constant Rails::Application::YAML (NameError)
[19:53:04] craysiii: pretty sure you need to fix that.
[19:53:28] dionysus69: I dont get it, I installed passenger and nginx but nginx service is missing
[19:53:47] dionysus69: how do I start it??? its in opt/nginx
[19:53:57] craysiii: what OS are you on
[19:54:23] dionysus69: systemctl start nginx doesnt exist
[19:55:02] craysiii: how did you install nginx
[19:55:10] craysiii: through yum?
[19:55:12] dionysus69: with passenger
[19:55:52] craysiii: can't help you further, beyond my knowledge scope
[19:55:56] craysiii: https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-centos-7 maybe this can help.
[19:56:02] cnk: dionysus69: I think Phusion has started distributing RPMs
[19:56:06] IFrank00: craysiii, I haven't touch that file do I need to step something there first as im using this app for developing the new feat.
[19:56:06] cnk: check their site.
[19:56:22] bronson: has joined #RubyOnRails
[19:56:34] cnk: but if not, it is super easy to install the gem and then build the binary for whichever web server you are using
[19:56:36] sundhell: has joined #RubyOnRails
[19:56:44] dionysus69: thanks craysiii, cnk I installed passenger following onsite instructions :s
[19:57:05] dionysus69: cnk thats what I did, I installed gem and followed procedure
[19:57:16] safety_cut: has joined #RubyOnRails
[19:57:21] dionysus69: cnk I am done with it but boom, how do I start nginx? :D
[19:57:31] cnk: however you did before
[19:57:39] dionysus69: i do sh /opt/nginx/sbin/nginx and nothing...
[19:57:45] dionysus69: how did I ? :D
[19:57:53] dionysus69: I never ran nginx in my life
[19:57:59] cnk: that seems like an odd location for nginix
[19:58:11] cnk: is that a change in centos 7?
[19:58:13] dionysus69: dunno thats what it offered and I agreed
[19:58:24] cnk: which it?
[19:58:32] cnk: how did you install nginx?
[19:58:33] smathy: Looks like a fairly common location to me.
[19:58:37] dionysus69: the passenger gem installation procedure
[19:58:44] cnk: smathy: it would be - but not for readhat
[19:59:06] _djbkd: has joined #RubyOnRails
[19:59:08] smathy: cnk, Phusion distribute the package.
[19:59:13] cnk: passenger install the web server too?
[19:59:19] craysiii: IFrank00 well the log you provided in your gist doesn't mention the cron job or whenever, so it's not really a useful log to look at until we can get an error that relates to your question :)
[19:59:28] rushed: has joined #RubyOnRails
[19:59:49] dionysus69: so no one knows a way to start nginx on centos ? :D
[20:00:00] smathy: dionysus69, the real answer to this is that you shouldn't need help with this stuff, and if you do you shouldn't be doing it yourself. Setting up a server isn't something you want to have a novice do.
[20:00:10] IFrank00: craysiii, ill keep looking
[20:00:13] rhizome: dionysus69: is it different than starting anything else, or different than starting nginx anywhere else?
[20:00:34] smathy: dionysus69, use heroku.
[20:01:04] dionysus69: rhizome: i am not familiar with command line that much and I am new to centos allot, I am using ubuntu myself
[20:01:13] dionysus69: i use heroku but I am doing my home server for fun :P
[20:01:18] craysiii: IFrank00 https://github.com/rails/rails/issues/19853
[20:01:20] cnk: is it hooked into systemctl? 'systemctl start nginx'
[20:01:25] dionysus69: just to know how to deploy without heroku
[20:01:41] dionysus69: yes I know that command would work if nginx.service file existed
[20:01:48] IFrank00: craysiii, Im trying to run the method on Task as self but get this error NoMethodError: undefined method `converted_schedule' for Task (call 'Task.connection' to establish a connection):Class
[20:01:49] dionysus69: but the gem installation procedure didnt create it
[20:01:56] tubbo: gem installation?
[20:02:22] dionysus69: ye I installed passenger as a gem
[20:02:50] Radar: 20 questions time :D
[20:02:50] cnk: I still think it odd that the gem installed nginx. Perhaps the nginx integration piece but the entire web server, that violates my expectations
[20:03:02] tubbo: dionysus69: why would you think that would install nginx
[20:03:06] tubbo: it doesn't
[20:03:14] tubbo: it installs passenger-standalone which is a bundled version of nginx
[20:03:21] tubbo: but AFAIK it doesn't install the "real" nginx, the one you can configure
[20:03:30] tubbo: and the one that has an init script that can be started on server boot
[20:03:47] ericjphillips: has joined #RubyOnRails
[20:03:51] dionysus69: ye, thats how noob I am lol
[20:03:56] craysiii: IFrank00 im assuming converted_schedule is an instance method, which won't work since it's working inside a class method. you need to refactor the code to account for this change.
[20:03:59] dionysus69: good shot tubbo
[20:04:36] EminenceHC: has joined #RubyOnRails
[20:04:39] IFrank00: craysiii yes the converted_schedule is a instance
[20:05:00] jaequery_: has joined #RubyOnRails
[20:05:01] jkamenik: has joined #RubyOnRails
[20:05:10] craysiii: maybe try self.all.converted_schedule...
[20:05:10] safety_cut: has joined #RubyOnRails
[20:05:11] IFrank00: ill add the code to my gist
[20:06:16] axl_: has joined #RubyOnRails
[20:07:04] bruno-: has joined #RubyOnRails
[20:07:22] tvon: has joined #RubyOnRails
[20:07:36] IFrank00: https://gist.github.com/Frank004/70a40ff171a3903b8739
[20:07:55] speakingcode: has joined #RubyOnRails
[20:07:57] annlewis: has joined #RubyOnRails
[20:08:14] craysiii: tryin self.all.converted_schedule.occurances_between...
[20:08:23] dionysus69: tubbo: so how would /opt/nginx/conf/nginx.conf file which passenger gem created be used by nginx service which I will install seperately?
[20:08:31] Helheim: has joined #RubyOnRails
[20:09:06] Testo: has joined #RubyOnRails
[20:09:40] smathy: dionysus69, if you're familiar with Ubuntu, why not use that for this server?
[20:10:01] willardg: has joined #RubyOnRails
[20:10:03] tvon: has joined #RubyOnRails
[20:10:18] dionysus69: dunno smathy centos seemed to be more stable for server option in my research
[20:10:33] IFrank00: craysiii, I add it the method to the gist
[20:10:43] dionysus69: but you are right in my case there isnt much difference and I might as well restart with ubuntu server in case of failure
[20:10:43] mices: has joined #RubyOnRails
[20:10:51] tvon: Organization question: I have an app with both xml and json serialization, any suggestions on how to organize it in /app/serializers?
[20:11:00] mices: this is a typo right? https://gist.github.com/mices/625cdf07cf8e53148aa2
[20:11:05] smathy: dionysus69, not sure what research, ubuntu is great for servers.
[20:11:13] tvon: having xml and json modules seems iffy... having a module for the model won't work.
[20:11:14] craysiii: IFrank00 i know, i saw, you didn't listen to me though :P try self.all.converted_schedule in self.generate_new_trans
[20:11:15] cnk: dionysus69: Ubuntu is so much more common in the Rails world, it will be easier in hte long run
[20:11:28] craysiii: ubuntu is love
[20:11:30] smathy: mices, no, either is fine.
[20:11:33] rushed: mices: @order and order are the same in that context
[20:11:35] havenn: has joined #RubyOnRails
[20:11:40] dionysus69: cnk, smathy: damn it I bashed my head on centos for a week in vain :D
[20:12:06] smathy: dionysus69, yup ;)
[20:12:12] cnk: I was struggling the other way - from RH to Ubuntu
[20:12:24] IFrank00: craysiii, I just post what i had before your comment
[20:12:26] cnk: for lots of things they are much of a muchness
[20:12:27] dionysus69: well I at least got this stupid experience which might be useful in general life haha
[20:12:37] willardg: has joined #RubyOnRails
[20:12:37] smathy: dionysus69, I never use yum distros - not that it's better/worse than debian, just that I'm not familiar with it - so why hurt myself?
[20:12:47] tvon: ACTION notices the docs just combine the two serializers into one clas
[20:12:53] IFrank00: now im trying it with self.all
[20:12:59] craysiii: ubuntu is life.
[20:13:04] Coldblackice_: has joined #RubyOnRails
[20:13:05] loechel: has joined #RubyOnRails
[20:13:12] dionysus69: ye i should go with that strategy, centos actually is my first yum distro, never used fedora
[20:13:19] neanderslob: has joined #RubyOnRails
[20:13:32] EminenceHC: has joined #RubyOnRails
[20:13:54] smathy: dionysus69, what you're familiar with ought to be, by far, the weightiest of your considerations for such things as distros.
[20:14:28] Testo: has joined #RubyOnRails
[20:14:52] mices: i tried to install mint on vbox under win7 didn't work out
[20:15:05] mices: all i get is a grey screen with the mint logo
[20:15:10] IFrank00: craysiii, undefined method `converted_schedule' for #<Task::ActiveRecord_Relation:0x007fcc5a48c0a0>
[20:15:10] dionysus69: hmm ye makes sense, i like complicating things, makes me think i become stronger by challenging myself with impossible tasks haha...
[20:15:32] ismaelga: has joined #RubyOnRails
[20:16:07] acti0nman: has joined #RubyOnRails
[20:16:09] craysiii: okay so you need to enumerate over the relation to access each instance, something like self.all.each { |r| r.converted_schedule... }
[20:18:41] SteenJobs: has joined #RubyOnRails
[20:20:54] orikremer: has joined #RubyOnRails
[20:21:09] IFrank00: craysiii, check code gist
[20:22:06] havenwood: has joined #RubyOnRails
[20:22:13] craysiii: did you update task.rb in the gist?
[20:22:16] craysiii: looks the same to me
[20:22:26] IFrank00: yep refresh pls
[20:22:49] IFrank00: craysiii, I add it another file
[20:23:02] IFrank00: craysiii, with the new code
[20:23:15] IFrank00: craysiii, it work great
[20:24:05] craysiii: oh it works now??
[20:24:21] naftilos76: has joined #RubyOnRails
[20:24:22] IFrank00: craysiii, Lets try the cron job again now
[20:24:34] rubyonrailed: If I wanted to have constants the held strings that were editable by a user in the web interface, where would I put them?
[20:24:45] craysiii: remember you have to update the cron through whenever gem and then restart cron service
[20:25:02] smathy: rubyonrailed, wtf? You want constants that are editable by the user in a web interface?
[20:25:15] Guest53: has joined #RubyOnRails
[20:25:22] FailBit: >changing constants
[20:25:24] smathy: I'm not sure that word means what you think it means.
[20:25:25] FailBit: >constant is in the name
[20:25:34] IFrank00: how do I restart the cron service
[20:25:52] craysiii: http://stackoverflow.com/questions/7548730/cron-job-not-working-in-whenever-gem
[20:26:01] IFrank00: craysiii, thnx
[20:26:19] rubyonrailed: Hmm, maybe there is a different way to go about it. I need a variable that is able to be used throughout the app, but changed easily without coding.
[20:26:24] smathy: rubyonrailed, maybe you mean more like a sort of config table/model in your DB.
[20:26:42] smathy: rubyonrailed, ok definitely that then.
[20:26:51] smathy: rubyonrailed, just make a lookup table, and a CRUD for it, done.
[20:26:53] rushed: rubyonrailed: what does the variable control?
[20:26:55] rubyonrailed: Didn't know if making a table for just that was the best way to go
[20:27:13] smathy: ACTION never understands people's reluctance to make tables
[20:27:19] rubyonrailed: A channel names
[20:27:31] rushed: rubyonrailed: what's a channel?
[20:27:34] IFrank00: craysiii, another thing this work local ??
[20:27:41] smathy: Do you get a higher bonus if you use fewer tables or something?
[20:27:46] craysiii: what do you mean by local?
[20:27:54] rushed: smathy: bits aren't free!
[20:28:33] xcv: has joined #RubyOnRails
[20:28:50] IFrank00: on a localmachine
[20:29:02] IFrank00: for testing that its working
[20:29:11] sdwrage: has joined #RubyOnRails
[20:29:18] craysiii: it should be working for you now
[20:29:44] craysiii: i must excuse myself for half an hour, mentor meeting. ill be back
[20:31:15] IFrank00: craysiii, thank you very mucho
[20:31:29] IFrank00: craysiii, Gracias!
[20:32:33] willardg: has joined #RubyOnRails
[20:32:53] lucasfs7: has joined #RubyOnRails
[20:33:38] lucasfs7: has left #RubyOnRails: ()
[20:35:02] Goliathus: has joined #RubyOnRails
[20:37:33] ericjphillips: has joined #RubyOnRails
[20:38:06] artto: has joined #RubyOnRails
[20:38:21] baweaver: has joined #RubyOnRails
[20:40:23] zcreative: has joined #RubyOnRails
[20:40:41] zcreative: has joined #RubyOnRails
[20:40:58] zcreative: has joined #RubyOnRails
[20:41:01] krisquigley: has joined #RubyOnRails
[20:41:33] yaymukund: has joined #RubyOnRails
[20:43:08] marr: has joined #RubyOnRails
[20:43:38] rails_officer: has joined #RubyOnRails
[20:47:55] willardg: has joined #RubyOnRails
[20:49:58] mrbubbles: has joined #RubyOnRails
[20:52:00] jgt: has joined #RubyOnRails
[20:52:10] jocuman: has joined #RubyOnRails
[20:54:57] bobbobbins: has joined #RubyOnRails
[20:55:40] xcv: has joined #RubyOnRails
[20:56:54] _djbkd: has joined #RubyOnRails
[20:56:59] zendrix: has joined #RubyOnRails
[21:00:00] baweaver: has joined #RubyOnRails
[21:00:02] Guest53: has joined #RubyOnRails
[21:01:56] ismaelga: has joined #RubyOnRails
[21:02:38] cih: has joined #RubyOnRails
[21:04:07] lasker85: has joined #RubyOnRails
[21:04:08] AxonetBE: has joined #RubyOnRails
[21:04:44] havenn: has joined #RubyOnRails
[21:04:45] jocuman: has joined #RubyOnRails
[21:05:39] _djbkd: has joined #RubyOnRails
[21:06:18] FrankD: has joined #RubyOnRails
[21:06:29] Fire-Dragon-DoL: has joined #RubyOnRails
[21:06:32] _djbkd: has joined #RubyOnRails
[21:06:58] FrankD: hi, I'm having an issue with ActiveRecord and MySQL2 when I try to save an object.. https://gist.github.com/fdimitri/f0284b7b59e785c46afa
[21:07:18] FrankD: it appears the issue may be the 'x' before the base64 data?
[21:07:23] richipargo: has joined #RubyOnRails
[21:09:07] yfeldblum: has joined #RubyOnRails
[21:09:34] netzfisch: has joined #RubyOnRails
[21:09:39] dionysus69: has joined #RubyOnRails
[21:09:49] craysiii: double single quotes? o.O
[21:11:21] Wixy: has joined #RubyOnRails
[21:11:34] FrankD: craysiii, ya got me
[21:11:41] FrankD: i just call .save! :P
[21:12:04] loglaunch: has joined #RubyOnRails
[21:12:10] Wixy: is it only here that in development mode assets paths are something like this? /assets/application-59595f88e6c6d47c223ae92f2796f864.css
[21:12:13] martinbjeldbak: has joined #RubyOnRails
[21:12:39] Wixy: I think by default in develop mode it should be /assets/application.css
[21:12:42] Wixy: can anyone confirm?
[21:12:46] Goliathus: has joined #RubyOnRails
[21:14:59] Fire-Dragon-DoL: Wixy: yes but if you by mistake precompiled locally, that might be the cause
[21:15:26] arup_r: asset precompile is not needed in dev
[21:16:29] baweaver: moreover it's not really encouraged in dev as you're likely to change them frequently.
[21:19:14] yfeldblum: has joined #RubyOnRails
[21:20:06] Wixy: I don't think I compiled my assets, but anyway, "bundle exec rake assets:clean" should fix it, doesn't it?
[21:20:13] Wixy: I'm still getting the fingerprint after the file name
[21:20:15] Wixy: any idea?
[21:21:26] ellisTAA: has joined #RubyOnRails
[21:21:55] rushed: has joined #RubyOnRails
[21:22:35] s2013: has joined #RubyOnRails
[21:23:02] yaymukund: has joined #RubyOnRails
[21:24:14] arup_r: Wixy: Just delete the files from public .. use rm
[21:24:44] Wixy: my public folder is empty apart from the 4xx.html error pages and favicon, arup_r
[21:25:43] momomomomo: has joined #RubyOnRails
[21:26:04] arup_r: clear browser cache.. ?
[21:27:09] Radar: Wixy: steps to reproduce in a new app plzkthx
[21:27:13] smathy: FrankD, the error you're getting is that your MySQL server has gone away, ie. timed out.
[21:27:51] smathy: Wixy, assets:clean does not fix it, look at: rake -T assets
[21:27:55] craysiii: http://dev.mysql.com/doc/refman/5.0/en/gone-away.html
[21:28:58] smathy: FrankD, the hex value *does* look weird, but not because of the x, that's standard hex syntax in MySQL. It looks weird because it ends in a $ and no ''s
[21:29:20] smathy: (maybe that's a syntax I'm unaware of)
[21:29:29] smathy: ...but the main issue there is that the DB connection has timed out.
[21:29:32] pecpec: has joined #RubyOnRails
[21:30:58] ducklobster: has joined #RubyOnRails
[21:32:21] jahbrewski: has joined #RubyOnRails
[21:32:24] Wixy: "config.assets.digest = false" fixed the problem, what it's weird since it is enabled by default in new rails apps
[21:32:38] Wixy: do you have digest enabled in develop? did you change it?
[21:35:23] Nuck: has joined #RubyOnRails
[21:35:32] FrankD: smathy, ah line clipped
[21:35:35] FrankD: its a .. very long line
[21:35:43] FrankD: but MariaDB doesnt like the double ''s
[21:37:37] smathy: FrankD, very weird that you're not getting a syntax error then. I actually assumed that the double ''s were just an artifact of your logging.
[21:37:56] smathy: (being the standard way to escape a ' within a string in SQL)
[21:37:59] FrankD: smathy, --- !ruby/exception:ActiveRecord::StatementInvalid
[21:38:34] FrankD: MariaDB [cstest1]> INSERT INTO `file_changes` (`changeType`, `changeData`, `startLine`, `startChar`, `DirectoryEntry_id`, `revision`, `User_id`, `created_at`, `updated_at`) VALUES (''setContents'', ''4c53307449434a63496d35764948567a5a53427a64484a7059335263496a7463626a736f5a6e5675593352706232346f64326c755a4739334b5342370a584735705a69416f64486c775a57396$'', 0, 0, 81681, 0, 1, ''2015-10-05 17:07:44'', ''2015-10-05 17:07:44'');
[21:38:34] FrankD: ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'setContents'', ''4c53307449434a63496d35764948567a5a53427a64484a7059335263496a746' at line 1
[21:38:35] smathy: FrankD, yeah, that's just the Rails wrapper.
[21:38:56] artto: has joined #RubyOnRails
[21:39:01] smathy: FrankD, yes, as I said, logging artifact.
[21:39:01] quazimodo: has joined #RubyOnRails
[21:39:33] smathy: FrankD, you saw the actual error your actual MySQL server sent back to Rails right? "MySQL server has gone away...."
[21:39:51] charliesome: has joined #RubyOnRails
[21:39:54] FrankD: smathy, yeah but what about --- !ruby/exception:ActiveRecord::StatementInvalid ?
[21:40:15] FrankD: and it always does this with the same incoming data
[21:40:24] smathy: [15:38:34] smathy: FrankD, yeah, that's just the Rails wrapper.
[21:40:48] smathy: Ie. in Rails it catches any exception from the underlying DB when it tries to execute something and it wraps it in that exception.
[21:40:49] FrankD: smathy, then why would it always happen only for the same set of input data?
[21:41:06] smathy: It quite obviously didn't parse the MySQL error text and decide that this was a syntactic error.
[21:42:02] smathy: FrankD, I don't know, maybe the DB hangs and crashes on that data for some reason.
[21:43:13] smathy: Add to your gist a rails console session showing you trying to save this data.
[21:43:40] smathy: FrankD, show something beforehand so I can see that the DB is actually connected, like just a FileChange.first or something.
[21:43:52] zhkirill: has joined #RubyOnRails
[21:44:01] nettoweb: guys, how I can count by quantity in this array: https://gist.github.com/osnysantos/1552bd67296681c241b8
[21:44:07] dionysus69: is anyone interested in creating a script for lets say ubuntu that installs full stack production / development environments for RoR?
[21:44:28] FrankD: smathy, it inserts thousands of other records
[21:44:40] smathy: nettoweb, what does "count by quantity" mean?
[21:44:51] rhizome: nettoweb: pretend like we didn't write your code
[21:44:56] smathy: FrankD, no, use a rails console to insert just one, copy and paste it into the gist.
[21:45:20] smathy: dionysus69, I've done it, dozens of times.
[21:45:25] FrankD: its not really a rails app
[21:45:39] workmad3: ACTION looks @ the channel name
[21:45:41] smathy: ...and here we go :)
[21:45:42] dionysus69: smathy: well so do you have an example script?
[21:45:47] workmad3: interesting
[21:45:55] FrankD: #ruby cries that anything ActiveRecord is Rails
[21:45:56] workmad3: it hasn't changed since I was last here :D
[21:46:12] smathy: dionysus69, not for sharing, sorry.
[21:46:14] neanderslob: has joined #RubyOnRails
[21:46:35] dionysus69: lol ok my point was for it to be shared ^.^
[21:46:35] nettoweb: smathy I have two items in this array, I want the sum of the key quantity... so I can get 4. This model is a Order that has many line items, each line item has a quantity. SO I want to get the count of all line items quantity
[21:46:44] smathy: FrankD, I don't mind active record by itself, but you really need to lead with these sorts of things next time. So, explain your situation.
[21:47:04] meoblast001: has joined #RubyOnRails
[21:47:43] yfeldblum: has joined #RubyOnRails
[21:49:22] User458764: has joined #RubyOnRails
[21:50:48] smathy: dionysus69, just set the server up, then copy your history into a script, QED.
[21:50:52] baweaver: has joined #RubyOnRails
[21:51:15] dionysus69: well its not That easy but ok :P
[21:51:27] smathy: dionysus69, the real efforts in configuration management end up with things like salt, chef, puppet, ansible, etc.
[21:51:41] simplyianm: has joined #RubyOnRails
[21:51:46] smathy: dionysus69, I know, but it's a great starting place. A few sed commands later and you're done.
[21:53:09] jgt: has joined #RubyOnRails
[21:54:37] smathy: nettoweb, arr.reduce(0) { |sum,item| sum + item.quantity }
[21:54:43] lasker85: has joined #RubyOnRails
[21:55:13] nKulo: has joined #RubyOnRails
[21:56:10] smathy: (I'm assuming Items have a .quantity method)
[21:56:28] [Butch]: has joined #RubyOnRails
[21:57:58] sdwrage: has joined #RubyOnRails
[22:00:14] banister: has joined #RubyOnRails
[22:00:46] _djbkd: has joined #RubyOnRails
[22:01:57] acti0nman: has joined #RubyOnRails
[22:02:36] rhizome: @foo.sum(:quantity)
[22:02:40] djbkd_: has joined #RubyOnRails
[22:02:47] simplyianm: has joined #RubyOnRails
[22:04:08] wethu: has joined #RubyOnRails
[22:04:33] andrew-l: has joined #RubyOnRails
[22:04:55] jahbrewski: has joined #RubyOnRails
[22:05:37] smathy: I always forget about that extension.
[22:05:53] andrew-l: hi. i'm just trying to interpret some code I'm using and don't quite get why: 'ws = nil' is required in this rack app. the code is here: https://github.com/heroku-examples/ruby-websockets-chat-demo/blob/master/middlewares/chat_backend.rb#L43
[22:06:03] andrew-l: (at that particular line)
[22:06:16] sar1nk: has joined #RubyOnRails
[22:07:37] smathy: andrew-l, because it's closing the socket, so it wants to set it to nil in case other things are testing for truthiness etc.
[22:07:55] smathy: ...and for GC too probably.
[22:08:14] andrew-l: thanks smathy. if 'ws = nil' was omitted, would it change? would the socket still close?
[22:11:07] smathy: andrew-l, not sure actually, I'd have to dig into Faye. Maybe it does nothing at all in Faye and (as you're implying) we are doing all the closing by GCing it here.
[22:11:26] diegoviola: has joined #RubyOnRails
[22:11:49] smathy: andrew-l, I had first assumed that Faye also did an actual Socket#close on the socket, and so our callback was just to do with our own store of those sockets.
[22:12:01] smathy: (that would still be my best guess btw)
[22:13:59] andrew-l: from the code, it looks like each statement is a callback setup, am i reading that right?
[22:14:21] Ropeney: has joined #RubyOnRails
[22:14:22] smathy: "each statement" ?
[22:14:36] andrew-l: ws.on :open , ws.on :close, ws.on :message
[22:15:40] willardg: has joined #RubyOnRails
[22:16:11] andrew-l: i just considered this as a case statement
[22:16:59] smathy: Oh no, those are setting up callbacks that Faye calls on those events.
[22:17:15] andrew-l: yeah, that's what i realize now.
[22:17:35] andrew-l: so without 'ws = nil' on the close message, the websocket will keep responding, won't it?
[22:17:37] aldodelgado: has joined #RubyOnRails
[22:18:25] smathy: https://github.com/faye/faye-websocket-ruby#websocket-api
[22:18:31] nKulo: has joined #RubyOnRails
[22:18:32] smathy: andrew-l, I don't think so.
[22:18:52] smathy: I think you're getting called when the socket is closed, not "to close the socket".
[22:19:22] andrew-l: ws.rack_response is called the first time to keep the socket open, right?
[22:19:27] smathy: It just has the callback so you can do cleanup because you will generally have been holding all the open web sockets in an array so you could send broadcast messages and the like.
[22:19:36] CanTonic: has joined #RubyOnRails
[22:19:48] andrew-l: aaah, like for Faye's internal house keeping?
[22:20:35] andrew-l: hmmm... maybe i should dig into the source a bit more and/or get on the faye-ruby chat...
[22:20:50] smathy: Sort of, for the internal housekeeping for the libs that use Faye.
[22:20:57] EminenceHC: has joined #RubyOnRails
[22:21:23] andrew-l: thanks for your time smathy!
[22:21:37] smathy: ...and AFAICT rack_response is just sending a proper Rack response at the end of the call method (which sets up the Faye stuff/handlers).
[22:22:06] smathy: andrew-l, you're welcome.
[22:22:07] Goliathus: has joined #RubyOnRails
[22:22:48] andrew-l: smathy: yes, that's exactly what's happening with the rack_response. i'll double check on the ws = nil part on an issue on the faye repo
[22:23:47] smathy: andrew-l, cool.
[22:24:10] rakm: am I doing a where IN clause correctly here? http://pastie.org/10462765
[22:24:13] rakm: well, i know i'm not
[22:24:19] smathy: andrew-l, you could also just adjust your code to try using the ws socket to send something in that :close handler.
[22:24:26] smathy: andrew-l, that'll error if the socket is already closed.
[22:24:33] rakm: but how do I do an OR clause with two where INs on different fields
[22:25:29] andrew-l: smathy: good idea.
[22:25:53] smathy: rakm, "queue_id IN (?) OR ..."
[22:26:23] aldodelgado: Question: I'm upgrading our rails app and upgraded rspec to 2.99 to updated all depratcated methods. However I have a model method that does not require and arrguments but getting an error of "wrong number of arguments (1 for 0)" Any suggestions?
[22:26:40] aldodelgado: BTW: If I place a debugger infront of that line and type the varible I see the object. If I do obj.method I get undefind. However if I do obj.methods I see the method
[22:27:15] mices: i'm trying to say <% if #{RAILS_ENV}==production %>
[22:27:55] aldodelgado: https://gist.github.com/aldodelgado/1e87883699e8ba01b6c2
[22:28:06] smathy: I was just about to ask aldodelgado :)
[22:28:09] BinaryMaster: has joined #RubyOnRails
[22:28:19] mices: but the block got executed in dev
[22:28:21] smathy: Add the full error to your gist in a new file.
[22:28:24] mices: what gives?
[22:28:32] mices: what kinda sh#t is this?
[22:28:34] lasker85: has joined #RubyOnRails
[22:29:01] aldodelgado: smathy: updated
[22:29:19] smathy: You tell us mices - <% if #{RAILS_ENV}==production %> is not valid in so many ways.
[22:29:51] BinaryMaster: Newbie Question: I followed the instructions from here ( https://gorails.com/setup/ubuntu/15.04 ) to install ruby and rails on my ubuntu system I started a new rails project and when I run rails server I get a stack trace that looks to be at the C level can someone point me in a direction of what I can look at to get things working?
[22:29:53] nKulo: has joined #RubyOnRails
[22:30:00] smathy: aldodelgado, !gist-usage for adding new files please.
[22:30:00] helpa: aldodelgado: How to use Gist properly: https://github.com/radar/guides/blob/master/using-gist.markdown
[22:30:29] smathy: aldodelgado, and also, please add lib/embedded_positional_update.rb as a new file.
[22:30:29] aldodelgado: smathy: got it let me update it
[22:30:59] smathy: BinaryMaster, !gist the stack trace
[22:30:59] helpa: BinaryMaster: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[22:31:07] jahbrewski: has joined #RubyOnRails
[22:32:47] jgt: has joined #RubyOnRails
[22:32:57] smathy: aldodelgado, sorry, I wanted lib/embedded_positional_update.rb not spec/embedded_positional_update_spec.rb
[22:33:00] BinaryMaster: https://gist.github.com/TheNixNinja/ca48440bae439c6b696e
[22:33:30] FrankD: smathy, basically im taking all the files in a directory, and creating a directory/file tree in the database
[22:33:35] FrankD: so i can have revision history
[22:33:52] FrankD: so right now the issue is when it initially loads the files.. some of them pop that error
[22:34:45] broman: has joined #RubyOnRails
[22:34:53] uris: has joined #RubyOnRails
[22:35:27] smathy: BinaryMaster, hmm, just make sure you have no `spring`s running, ps aux | grep spring (kill them if you do) and try again.
[22:35:45] seaworthy: has joined #RubyOnRails
[22:36:25] seaworthy: hello, i am trying to update a data parameter with rails console
[22:36:26] BinaryMaster: smathy, thank you dumb question what are springs?
[22:36:31] seaworthy: however it puts this starttime: !ruby/object:DateTime 2015-10-13 00:00:30.000000000 Z
[22:36:31] andrew-l: has left #RubyOnRails: ("ERC Version 5.3 (IRC client for Emacs)")
[22:36:48] seaworthy: and need some like this updated_at: 2015-10-05 22:19:21.429865321 Z
[22:36:58] seaworthy: have anyone had a similar issue ever?
[22:37:11] Fire-Dragon-DoL: so rails fixed: User.order(created_at: :desc).to_sql (allow desc as value) long time ago and I wasn't aware of it, still doing "created_at desc" every time? Damn me!
[22:37:15] seaworthy: this is how i update game.starttime = DateTime.new(2015,10,13,0,0,30,'0')
[22:37:25] __butch__: has joined #RubyOnRails
[22:38:59] octo2: has joined #RubyOnRails
[22:40:00] BinaryMaster: smathy, I had spring server running, I killed the process but still get the same problem
[22:40:10] rhizome: seaworthy: i don't understand
[22:40:20] quazimodo: has joined #RubyOnRails
[22:40:26] pwnd_nsfw: BinaryMaster, did you kill AND bury it? Under tons of cement?
[22:40:33] ^butch^: has joined #RubyOnRails
[22:40:56] seaworthy: rhizome: when i update a value with game.starttime = DateTime.new(2015,10,13,0,0,30,'0') i get starttime: !ruby/object:DateTime 2015-10-13 00:00:30.000000000 Z
[22:40:57] yfeldblum: has joined #RubyOnRails
[22:41:13] BinaryMaster: pwnd_nsfw, lol no but it's still not running so I think i'm okay for now ;)
[22:41:15] seaworthy: why does it add this !ruby/object:DateTime
[22:42:15] rickmasta: has joined #RubyOnRails
[22:42:54] _djbkd: has joined #RubyOnRails
[22:43:02] IFrank00: seaworthy, what do you want it to be
[22:43:02] seaworthy: game.starttime = DateTime.new(2015,10,13,0,0,30,'0').to_time
[22:43:09] seaworthy: its needs to time tag
[22:43:22] rhizome: is starttime a datetime field?
[22:43:45] chandlerbing: has joined #RubyOnRails
[22:43:58] rhizome: i assign using your DateTime thing and don't see the object notation
[22:44:06] smathy: aldodelgado, can you re-run with the -b flag in rspec, to get a full backtrace, you can do just the top spec: rspec -b spec/models/_media/media_zencodable_spec.rb:80
[22:44:07] rhizome: remember_created_at: "2015-10-13 00:00:30"
[22:44:19] rhizome: that's without saving
[22:44:30] hydrozen: has joined #RubyOnRails
[22:44:50] smathy: BinaryMaster, spring is a command line app server sort of thing, I just noticed that your backtrace showed spring in a different path from the rest of your ruby.
[22:45:26] nKulo: has joined #RubyOnRails
[22:45:35] aldodelgado: smathy: updated
[22:45:59] Maletor: has joined #RubyOnRails
[22:46:20] rubyonrailed: has joined #RubyOnRails
[22:47:05] EminenceHC: has joined #RubyOnRails
[22:47:07] rubyonrailed: has joined #RubyOnRails
[22:47:09] smathy: aldodelgado, right, so you can see the call from within Mongoid: https://github.com/mongoid/mongoid/blob/3.1.0-stable/lib/mongoid/persistence/atomic/operation.rb#L61
[22:47:13] paulcsmith: has joined #RubyOnRails
[22:47:20] smathy: aldodelgado, it expects your `path` method to accept an argument.
[22:48:10] jobewan: has joined #RubyOnRails
[22:48:16] MrJoshua: has joined #RubyOnRails
[22:48:19] smathy: aldodelgado, but the path method you provided doesn't, so it's being called with 1 argument, whereas your code expects 0, hence the 1 for 0 error.
[22:48:32] aldodelgado: smathy: makes sense
[22:48:58] paulcsmith: has joined #RubyOnRails
[22:48:58] smathy: aldodelgado, I think that changed in Mongoid 4.x - so maybe you were reading new docs when you wrote that method.
[22:49:20] aldodelgado: I'm looking now at the old
[22:49:29] smathy: aldodelgado, cool, always something to be aware of.
[22:49:32] aldodelgado: however I'm thinking maybe at this point I should do the next jump
[22:49:32] sarink: has joined #RubyOnRails
[22:50:02] smathy: aldodelgado, I have no idea about Mongoid, but generally, yeah, good to keep up to date.
[22:50:06] aldodelgado: smathy I'm at 2.99 maybe I should upgrade everything and start handling those errors? What do you think?
[22:50:13] aldodelgado: smathy: enough said thats my next move
[22:50:17] aldodelgado: smathy: thank you so much
[22:50:23] smathy: aldodelgado, you're welcome.
[22:50:35] smathy: aldodelgado, with your speed to gist and update, it was a thorough pleasure :)
[22:50:50] sonofdirt: has joined #RubyOnRails
[22:52:25] hephaestus_rg: has joined #RubyOnRails
[22:54:01] quazimod1: has joined #RubyOnRails
[22:54:25] annlewis: has joined #RubyOnRails
[22:55:34] mices: my mailer works on dev but not on production, there's nothing in log/production.log or my nginx-error.log that makes any sense to me except this is the tail of my nginx-error.log the last line App 91146 stdout:
[22:55:59] chandlerbing: has joined #RubyOnRails
[22:56:01] willardg: has joined #RubyOnRails
[22:57:44] mices: how do i tell action mailer to use nginx in production?
[22:58:02] mices: i don't think that's the problem anyway
[22:58:28] smathy: BinaryMaster, if you just start an irb session, and enter: Socket.gethostbyname("localhost") does it crash?
[22:59:07] smathy: mices, use heroku.
[22:59:35] RockLee: has joined #RubyOnRails
[23:00:16] BinaryMaster: NameError: uninitialized constant Socket
[23:00:34] mices: Soliciter.send_emails_rls(rls).deliver.to(rls.email)
[23:00:39] Aeyrix: BinaryMaster:
[23:00:40] mrbubbles: has joined #RubyOnRails
[23:00:41] mices: does that look right?
[23:00:43] Aeyrix: require 'socket'
[23:00:49] Aeyrix: mices: We
[23:00:56] Aeyrix: when you just start pasting random fucking lines
[23:00:59] Aeyrix: in to the channel
[23:00:59] paulcsmith: has joined #RubyOnRails
[23:01:08] BinaryMaster: I'm just moving to ruby I have been doing python
[23:01:18] Aeyrix: BinaryMaster: Yeah all g yo
[23:01:25] Aeyrix: So just in irb do the require first
[23:01:29] Aeyrix: followed by the thing smathy said.
[23:01:32] marcoceppi: has joined #RubyOnRails
[23:02:03] BinaryMaster: it returned a list but nothing in the list looks like an ip
[23:02:03] smathy: BinaryMaster, sorry, require "socket" first, then that.
[23:02:18] BinaryMaster: ["localhost", [], 2, "\x7F\x00\x00\x01"]
[23:02:37] Aeyrix: \x7F is 127
[23:02:40] Aeyrix: \x00 is 0
[23:02:41] Aeyrix: \x01 is 1
[23:02:53] Aeyrix: So, yes, that's correct. :)
[23:03:19] smathy: BinaryMaster, that's ok, so do: Socket.gethostbyaddr "\x00" * 15 + "\x01"
[23:03:41] jaequery: has joined #RubyOnRails
[23:03:44] montagesoftware: has joined #RubyOnRails
[23:03:54] BinaryMaster: ["ip6-localhost", ["ip6-loopback"], 10, "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01"]
[23:04:04] smathy: Damnit :(
[23:04:28] rakm: I have a "future" scope using a time column. how do i make today's times show up in the scope? I have `scope :future, -> { where('start_time >= ?', Time.zone.now ) }` right now. Basically, I want to apply the .end_of_day functionality on start_time
[23:05:13] rakm: mayeb i should just use Date.today instead of Time.zone.now
[23:05:19] smathy: ...just confirm, if you run `which irb` where's the irb?
[23:05:27] rakm: ignore me
[23:05:40] BinaryMaster: /home/mford/.rbenv/shims/irb
[23:05:53] BinaryMaster: which looks right
[23:06:08] smathy: Yes it is.
[23:06:27] willardg: has joined #RubyOnRails
[23:07:13] smathy: ...just in case (back in irb): Socket.gethostbyaddr "\x7F\x00\x00\x01"
[23:08:03] BinaryMaster: ["localhost", [], 2, "\x7F\x00\x00\x01"]
[23:09:08] mices: https://gist.github.com/mices/52e0ab400a42ee952312
[23:09:13] smathy: BinaryMaster, ok, so basically that rules out this error coming from a problem with ruby.
[23:09:21] smathy: BinaryMaster, those are the only things ruby is being asked to do.
[23:09:30] Radar: mices: https://gist.github.com/mices/52e0ab400a42ee952312#file-send_emails_rls-action-from-admin_controller-rb-L2
[23:09:30] Radar: mices: what is this
[23:09:41] BinaryMaster: is it possible that one of my python projects is conflicting
[23:09:46] Radar: @rls = RecordLabel.where(subscribed: false)
[23:09:46] smathy: BinaryMaster, maybe we'll switch from webrick to thin. Update your Gemfile to include: gem 'thin' and run `bundle`
[23:09:50] Radar: mices: and why is it not ^
[23:09:50] smathy: BinaryMaster, nope.
[23:09:56] Radar: mices: the syntax you have there for the where is invalid.
[23:10:35] smathy: BinaryMaster, and then start your server with: bundle exec thin start
[23:10:39] smathy: (instead of rails server)
[23:10:41] mices: Radar: ty
[23:10:45] mices: how should it be?
[23:10:55] Radar: mices: omg
[23:11:02] BinaryMaster: smathy, should that be under development?
[23:11:04] Radar: mices: y u no read?
[23:11:09] smathy: BinaryMaster, yes.
[23:11:17] BinaryMaster: do I keep spring?
[23:11:34] smathy: BinaryMaster, comment it out for now, just because it's a pain when starting.
[23:11:46] smathy: (with bigger projects it's worthwhile)
[23:11:49] jessemcgilallen: has joined #RubyOnRails
[23:12:10] rubyonrailed: has joined #RubyOnRails
[23:12:47] BinaryMaster: looks like that is working
[23:12:57] mices: Radar: should be [:subscribed] instead of :subscribed
[23:13:16] BinaryMaster: yeah that works
[23:13:17] Radar: mices: what should be? @rls = RecordLabel.where(subscribed: false) ?
[23:13:32] BinaryMaster: thank you smathy
[23:13:36] symbol: has joined #RubyOnRails
[23:13:57] Radar: mices: why do you think that?
[23:14:01] smathy: BinaryMaster, ok, so it shouldn't have failed, but I have seen webrick be stupid - not sure why.
[23:14:08] mices: but it's 0 or 1
[23:14:19] smathy: BinaryMaster, thin is actually a great app server, so you're good to go.
[23:14:26] Radar: mices: Please answer my question or I am going to have to ignore oyu.
[23:14:35] BinaryMaster: is it like gunicorn?
[23:14:37] Radar: mices: I am tired of playing 20 questions with you every time you want to get help.
[23:15:32] mices: the field subscribed has values of null, 0 or 1 so the select wants rows that don't have a value of 1 for the subscribed field
[23:16:08] Radar: why do they have null or 0 or 1?
[23:16:16] Radar: Why is this field not set with a default?
[23:16:22] mices: tinyint(1) in mysql table
[23:16:24] Radar: maybe I should limit it 10 qs.
[23:16:28] shinnya: has joined #RubyOnRails
[23:16:28] smathy: BinaryMaster, it's like it as in it performs the same function.
[23:16:36] Radar: mices: But why is not defaulting to true/false in the schema?
[23:16:46] BinaryMaster: again thank you very much smathy
[23:16:56] smathy: BinaryMaster, unicorn has a different sweet spot. You're welcome.
[23:17:13] mices: Radar: you mean 0 or 1 in the schema, or Rails takes 1 in a boolean as true
[23:17:33] Radar: mices: true or false in the schema will convert to 1 or 0 respectively in the database.
[23:17:51] Radar: mices: A person can either be subscribed or not. There is no null.
[23:18:03] mices: what's gonna happen to all the nulls when i save the file and restart
[23:18:31] rhizome: three way boolean
[23:18:34] mices: they're all gonna turn to 0's like me
[23:18:37] mices: i mean like magic?
[23:18:40] Radar: Change the nulls to one of true/false depending on what you want to have as the default.
[23:18:47] Radar: It's a two step migration
[23:18:49] Radar: set a default on the field
[23:18:54] Radar: change all null values to one of true/false
[23:18:55] jgt: has joined #RubyOnRails
[23:19:05] Radar: then your query is either for people who are subscribed or people who are not subscribed
[23:19:09] Radar: Model.where(subscribed: true)
[23:19:13] Radar: Model.where(subscribed: falseE)
[23:19:17] mices: it was an accidnet i forgot i wanted the nulls and i changed the to 0's
[23:19:27] Radar: Ok, ignoring now.
[23:19:32] Radar: I can't do it any more, sorry.
[23:20:06] mices: i'm gonna update the table to 0's where there's nulls and edit schema.rb like you said to default to false
[23:20:37] mices: i guess i was wrong to want the nulls
[23:21:07] mices: all that matter is if it is or isn't 1
[23:21:14] mices: 0 or null shouldn't matter
[23:23:44] techsethi: has joined #RubyOnRails
[23:24:08] marcoceppi: has joined #RubyOnRails
[23:25:33] havenn: has joined #RubyOnRails
[23:25:34] mices: Radar: so now schema.rb has this line t.boolean "subscribed", default: false
[23:25:52] lasker85: has joined #RubyOnRails
[23:26:24] willardg: has joined #RubyOnRails
[23:27:29] mices: and the line in the controller now looks like ... @pub=Publicist.where(subscribed: false)
[23:27:36] stannard: has joined #RubyOnRails
[23:27:56] workmad3: has joined #RubyOnRails
[23:28:08] rhizome: except that null vs. 0 does matter
[23:28:34] rhizome: 2.0.0-p643 :013 > nil.false?
[23:28:49] andersoldahl: has joined #RubyOnRails
[23:29:09] mices: Radar: and everything working in development
[23:29:17] mices: but it's not gonna work in production ha ha
[23:29:43] rhizome: ACTION shifts uncomfortably
[23:30:00] baweaver: has joined #RubyOnRails
[23:30:07] pwnd_nsfw: has joined #RubyOnRails
[23:33:57] mrbubbles: has joined #RubyOnRails
[23:36:41] paulcsmith: has joined #RubyOnRails
[23:37:38] FCser: has joined #RubyOnRails
[23:38:39] paulcsmith: has joined #RubyOnRails
[23:40:15] paulcsmith_: has joined #RubyOnRails
[23:44:37] FailBit: https://i.imgur.com/XIA2xVJ.gif
[23:44:38] EminenceHC: has joined #RubyOnRails
[23:47:38] hephaestus_rg: has joined #RubyOnRails
[23:48:21] paulcsmith_: has joined #RubyOnRails
[23:49:31] Scriptonaut: has left #RubyOnRails: ()
[23:50:08] User458764: has joined #RubyOnRails
[23:50:23] mices: my mailer works in development but not in production and the only thing the browser returns is we're sorry something went wrong, the tail of the nginx-error.log says App 92371 stdout:
[23:51:53] smathy: mices, can you send mail manually in prod?
[23:53:49] acti0nman: has joined #RubyOnRails
[23:54:51] ericjphillips: has joined #RubyOnRails
[23:54:51] krainboltgreene: Account.find_each(&:reset_password) on a whole ton of records is really slow, is there an easy interface for doing concurrent writes via ActiveRecord?
[23:56:24] sevenseacat: has joined #RubyOnRails