« Back to channel list

#RubyOnRails - 15 January 2016

« Back 1 day Forward 1 day »
[00:02:17] bronson: has joined #RubyOnRails
[00:06:06] aloneintheworld: has joined #RubyOnRails
[00:08:19] ja: hurr durr
[00:08:55] LambdaSource: has joined #RubyOnRails
[00:11:11] pyemkey: has joined #RubyOnRails
[00:12:36] bfrog: has joined #RubyOnRails
[00:12:36] jowiar: has joined #RubyOnRails
[00:12:41] lacrymology: can someone explain why isn't start_message available here? http://dpaste.com/2VW3XFT
[00:12:52] mustmodify: has left #RubyOnRails: ()
[00:12:53] bfrog: has left #RubyOnRails: ("WeeChat 1.3")
[00:13:00] dirkdiiggler: has joined #RubyOnRails
[00:14:24] jowiar: has joined #RubyOnRails
[00:14:52] Cohedrin: lacrymology, belongs_to :message is the problem here
[00:14:54] rhizome: you have two associations with the same name. i bet the second one works
[00:15:05] Cohedrin: belongs_to :name_here
[00:15:05] lacrymology: I tried changing the foreign_key: value to 'start_message_id'
[00:15:15] Cohedrin: the name_here part is the name of the method that you need to call to get the object
[00:15:24] lacrymology: belongs_to: start_message, belongs_to: end_message, with classnames, then
[00:15:32] jgt1: has joined #RubyOnRails
[00:15:33] Cohedrin: if you do belongs_to :start_message
[00:15:41] Cohedrin: then you don't need the foreign_key anymore either
[00:16:05] rhizome: you should just associate with Message, and start and end are methods
[00:16:13] ornerymoose: has joined #RubyOnRails
[00:16:27] lacrymology: rhizome: what?
[00:16:31] Cohedrin: they're different objects in his db I think rhizome
[00:16:52] Cohedrin: lacrmology do you have two models, one named start_message and another named end_message
[00:17:03] nerfando: has joined #RubyOnRails
[00:17:05] kies^: has joined #RubyOnRails
[00:17:38] lacrymology: yes, 'course. Two FKs to Message
[00:17:43] Cohedrin: http://eewang.github.io/blog/2013/03/12/how-and-when-to-use-single-table-inheritance-in-rails/
[00:17:52] Cohedrin: you should check out single table inheritance
[00:18:07] Cohedrin: it will let you have one table called messages, and you can have as many sub message types as you want
[00:18:31] Cohedrin: So instead of having two tables named start_messages and end_messages
[00:18:40] Cohedrin: you would just have a table called messages
[00:18:44] lacrymology: Cohedrin: but that's not semantically correct in my usecase
[00:18:47] pawnbox: has joined #RubyOnRails
[00:18:58] rhizome: separate tables for end and start messages would be weird
[00:18:59] lacrymology: I don't have two "types" of messages (even if they're structurally the same)
[00:19:06] Cohedrin: they're both messages are they not?
[00:19:25] Cohedrin: then sti is the way to go
[00:19:34] Cohedrin: you can implement whatever logic you want in the sub models
[00:19:36] lacrymology: I agree that IF I was to use some kind of inheritance, single table would be the way to go
[00:19:44] lacrymology: I don't agree using inheritance at all is the way to go
[00:19:54] lacrymology: I don't have two "kinds" of messages.
[00:19:56] rhizome: i don't think i know exactly what's going on
[00:20:22] lacrymology: rhizome: an event is a thing that starts, and ends. At the beginning it activates a message (start_message) and at the end it activates another (end_message)
[00:20:40] lacrymology: the messages themselves aren't even conceptually different
[00:20:41] Cohedrin: yeah this sounds like a case for single table inheritance lol
[00:21:11] lacrymology: I might not be hot on rails, but I know my semantics
[00:21:21] Cohedrin: I mean you can do whatever you want, I'm just telling you, in this case, the rails way would be to use sti
[00:21:29] DigitalDarwin: has joined #RubyOnRails
[00:21:44] lacrymology: Cohedrin: for the only purpose of having two references in one other model? because the only thing I'd be gaining is htat
[00:21:50] lacrymology: it's the only case where it'd be used
[00:21:55] edj979: has joined #RubyOnRails
[00:22:07] Cohedrin: no, I don't think you're undrstanding sti completely
[00:22:11] Cohedrin: you should read that page I linked you
[00:22:16] edj979: can you make a hybrid app with rails ?
[00:22:49] lacrymology: Cohedrin: I read it. It makes no sense
[00:22:50] blackmesa: has joined #RubyOnRails
[00:22:54] DigitalDarwin: has joined #RubyOnRails
[00:23:14] lacrymology: Cohedrin: In Rails, adding a ???type??? column in a database migration is sufficient (after writing the models) to let Rails know that you???re planning to implement STI << I do not need different "types" of messages
[00:23:25] lacrymology: the same message can be start_message for one event and end_message for another
[00:23:30] `aspiRe: has joined #RubyOnRails
[00:23:43] Cohedrin: im not going to argue with you. that guide is detailed and explains the use cases well. If you don't want to use it thats fine. I was just suggesting what the "rails" way would be in this use case
[00:23:57] ascarter: has joined #RubyOnRails
[00:25:28] lacrymology: Cohedrin: I've read it, and I don't see any of those "use cases" that look like mine. If you care to and want to explain why, or point to which one of the use cases explained in the article looks like mine to you, I'd be happy to learn
[00:25:31] sinkensabe: has joined #RubyOnRails
[00:26:43] ascarter_: has joined #RubyOnRails
[00:27:50] lacrymology: Cohedrin: at least explain to me how do you think this 'type' would enter my use-case because as far as I can see it's a necessary part of using STI
[00:29:11] Rodya_: has joined #RubyOnRails
[00:29:35] _Tariq: has joined #RubyOnRails
[00:29:55] Cohedrin: ok: You have two messages yes? Start and end. One message is made when the object is started, the other is made when it ends. They do the exact same thing, and have the same logic. The only difference is that they are made at different times, and they represent different things. This is exacttly where sti is useful
[00:30:03] Cohedrin: if I had two games
[00:30:09] Cohedrin: I wouldnt make a table for each game
[00:30:17] Cohedrin: I would make a table called games
[00:30:34] Cohedrin: and my models would be Game::Poker and Game::BlackJack
[00:30:40] Cohedrin: then if I want to add another game later
[00:31:00] Cohedrin: its just a matter of addign a new file called roulete.rb
[00:31:49] voidDotClass: is this the right way to define a decimal column in a migration? t.decimal :price, :precision => 30, :scale => 10
[00:32:41] janebootydoe: has joined #RubyOnRails
[00:32:50] Cohedrin: yes, just make sure you understand what precision and scale are for
[00:33:04] Radar: edj979: a what
[00:33:25] voidDotClass: or t.decimal :price, {:precision => 30, :scale => 10} ?
[00:34:21] edj979: i want to make a cross platform app that uses location for some features
[00:34:56] Cohedrin: voidDotClass t.decimal :price, precision: 30, scale: 10
[00:35:03] Cohedrin: assuming you're on ruby > 2
[00:35:12] voidDotClass: the hash worked
[00:35:15] voidDotClass: so keeping that
[00:35:22] Cohedrin: they're both hashes
[00:35:32] voidDotClass: yeah, i'm stupid
[00:35:33] edj979: would have similar mechanics to uber
[00:35:40] Cohedrin: its an implicit hash if you leave the braces of
[00:36:59] shibabu: has joined #RubyOnRails
[00:38:51] jeanre: has joined #RubyOnRails
[00:40:00] Deft: has joined #RubyOnRails
[00:46:20] Radar: edj979: Ok, then you'll want to learn iOS dev, and probably how to build an API in Rails
[00:46:33] judetucker: has joined #RubyOnRails
[00:47:35] kies^: has joined #RubyOnRails
[00:48:51] edj979: can i use ruby motion to make the ios part?
[00:49:03] edj979: radar: can i use rubymotion to make the ios part?
[00:49:09] pawnbox: has joined #RubyOnRails
[00:49:16] Radar: edj979: !shrug
[00:49:16] helpa: edj979: ¯\_(ツ)_/¯ Sorry, Radar is not able to help you any further as they do not know.
[00:49:26] Radar: I'm all about the Rails, not about the iDevices and the whatnots.
[00:51:24] felixdd: has joined #RubyOnRails
[00:51:27] _Tariq: has joined #RubyOnRails
[00:52:22] zpe: has joined #RubyOnRails
[00:52:34] _Tariq: has joined #RubyOnRails
[00:53:14] DLSteve: has joined #RubyOnRails
[00:53:34] safety_cut: has joined #RubyOnRails
[00:54:46] edj979: where does the rubymotion community congregate ?
[00:56:01] atomical_: has joined #RubyOnRails
[00:59:18] sankaber: has joined #RubyOnRails
[01:00:07] northfurr: has joined #RubyOnRails
[01:00:37] Radar: edj979: #rubymotion?
[01:01:10] edj979: radar: i stayed in that chat for 24 hours and no one else talked at all
[01:01:30] Radar: edj979: Did you read the topic at all?
[01:03:10] sevenseacat: has joined #RubyOnRails
[01:03:54] voidDotClass: can you have an array of integer column in your table, and use that to establish a has_many relationship? e.g in an event table, have a guest_ids column which is integer[], and do has_many :guest thru that column?
[01:04:02] El3ktra: has joined #RubyOnRails
[01:04:02] El3ktra: has joined #RubyOnRails
[01:04:17] edj979: radar: topic?
[01:04:25] Radar: edj979: The topic in the #rubymotion channel
[01:04:33] Radar: edj979: Go onto their Gitter.
[01:04:34] edj979: no they arent there either
[01:04:39] atomical: has joined #RubyOnRails
[01:04:42] edj979: the last post was forever ago
[01:04:46] Radar: so maybe that convinces you of whether or not you should use Rubymotion?
[01:05:13] apneic: has joined #RubyOnRails
[01:05:21] edj979: well i know ruby and some rails and i want to make an app using location
[01:05:54] Seich: has joined #RubyOnRails
[01:06:09] baweaver: has joined #RubyOnRails
[01:06:10] edj979: oh wow they were actually talking yesterday a little bit
[01:06:15] edj979: on gitter
[01:07:13] one_zero: has joined #RubyOnRails
[01:07:43] atomical_: has joined #RubyOnRails
[01:08:31] alphaatom: has joined #RubyOnRails
[01:12:02] LambdaSource: has joined #RubyOnRails
[01:12:09] jowiar: has joined #RubyOnRails
[01:20:05] djbkd: has joined #RubyOnRails
[01:20:53] bricker: edj979: Just learn Swift, it will take you just as long as learning RubyMotion and Swift is a much more marketable skill to have
[01:20:58] bricker: not many people are hiring RubyMotion developers
[01:21:16] edj979: bricker:I'm not trying to get hired
[01:21:46] edj979: edj979: i want to learn a languages so i can make cross platform apps for my startup
[01:21:58] bricker: edj979: the hardest part of iOS development isn't the language (eg. Ruby, Swift, Obj-C), it's the framework, and you absolutely must know the framework no matter which language you choose, so you may as well choose a language native to the iOS development environment
[01:22:23] bricker: edj979: does RubyMotion do cross-platform? Last time I used it, it was iOS only
[01:22:39] edj979: thats true i coldnt find an andriod book
[01:22:56] bricker: the website says it does both now *shrug*
[01:22:57] edj979: hold long does it take to learn swift?
[01:23:16] edj979: yea it does do both but theres no books on motion for andriod
[01:23:51] bricker: edj979: There's nothing particularly special about Swift, if you're familiar with Ruby then you won't have trouble with it
[01:24:27] bricker: however, don't get that confused with learning the iOS framework, which will take you years to master and changes constantly.
[01:24:51] edj979: bricker: all i want to do is make this app.
[01:24:51] rhizome: smart money is in just making a responsive website
[01:24:55] aloneintheworld: you can also try #RubyEnthusiastsTryingToLearnSwift
[01:25:11] edj979: bricker: any book recommendations?
[01:25:22] lethjakman: has joined #RubyOnRails
[01:25:37] rhizome: reddit.com/r/swift probably
[01:25:50] rhizome: and by "probably," i mean maybe.
[01:25:51] blackmesa: has joined #RubyOnRails
[01:26:02] bricker: edj979: sorry, I haven't used any books on mobile development, I rely heavily on the official guides for the respective platforms
[01:26:50] edj979: bricker: do you know swift?
[01:28:00] nerfando: has joined #RubyOnRails
[01:28:05] edj979: bricker: where might i start?
[01:28:30] edj979: bricker: and where is the community?
[01:28:47] baweaver: has joined #RubyOnRails
[01:28:58] bricker: edj979: https://swift.org/
[01:29:12] nerfando: has joined #RubyOnRails
[01:29:34] bricker: gotta jet, good luck
[01:29:49] Rodya_: has joined #RubyOnRails
[01:30:02] edj979: has left #RubyOnRails: ()
[01:30:20] nerfando: has joined #RubyOnRails
[01:31:29] nerfando: has joined #RubyOnRails
[01:35:54] janebootydoe: has joined #RubyOnRails
[01:38:21] krz: has joined #RubyOnRails
[01:39:10] voidDotClass: say you have an 'account' model, and you have an 'order' table, anyone with an account can make an order. but i don't want to store account_id in the table since that's confusing. how would i map the table to use e.g customer_id and have that an alias for account_id?
[01:39:15] shibabu: has joined #RubyOnRails
[01:39:31] voidDotClass: normally i'd do account:references when generating the model for Order, what would i do in this case?
[01:40:01] jeanre: has joined #RubyOnRails
[01:41:40] ja: voidDotClass: In your `Account` model: `has_many :orders, foreign_key: :customer_id`
[01:41:58] voidDotClass: ja, thanks, what about in the Order model?
[01:42:37] ja: voidDotClass: `belongs_to :customer, class_name: Account`
[01:42:50] ja: In this specific instance, why not just rename your `Account` model to `Customer` though? ???????
[01:43:07] voidDotClass: ja, because admins, and other types of users also have an 'account'
[01:43:13] ja: That'd be least confusing, I think, personally, but maybe this was a hypothetical example.
[01:43:21] ja: Ah, I see. That makes sense then.
[01:43:34] voidDotClass: yeah.. so, in db, customer_id?
[01:43:56] ja: `t.references :customer`
[01:44:05] chipotle: has joined #RubyOnRails
[01:44:45] ja: the downside to this is that you can't simply use `foreign_key: true` in your migrations
[01:45:41] dirk_diiggler: has joined #RubyOnRails
[01:47:38] apneic: has joined #RubyOnRails
[01:48:40] pawnbox: has joined #RubyOnRails
[01:48:40] superlou: has joined #RubyOnRails
[01:48:56] ja: but outside your `create_table :orders` call you can do `add_foreign_key :orders, :accounts, column: :customer_id`
[01:49:40] n00bDev: has joined #RubyOnRails
[01:49:54] apneic: has joined #RubyOnRails
[01:53:49] bronson: gotta say, fragmenting tests like this seems really weird: http://apionrails.icalialabs.com/book/chapter_four
[01:54:03] bronson: it also looks unnecessarily slow
[01:54:42] bronson: recreate all the factories, re-run the request, just to check the status code?
[01:55:35] arthurix: has joined #RubyOnRails
[01:55:38] kt2: has joined #RubyOnRails
[01:58:12] FailBit: programming C++ in a nutshell:
[01:58:15] FailBit: >tfw you go to fix a bug that you already fixed a year ago
[01:58:17] DLSteve: has joined #RubyOnRails
[01:58:32] Seich: has joined #RubyOnRails
[01:58:35] threeminutemonta: has joined #RubyOnRails
[01:59:01] mostlybadfly: has joined #RubyOnRails
[01:59:59] b2zeldafreak: has joined #RubyOnRails
[02:00:55] EXCHGR: has joined #RubyOnRails
[02:02:13] adamscott: has joined #RubyOnRails
[02:02:40] dirkdiiggler: has joined #RubyOnRails
[02:03:52] crdpink: has joined #RubyOnRails
[02:04:04] LambdaSource: has joined #RubyOnRails
[02:05:17] b2zeldafreak: has joined #RubyOnRails
[02:06:57] TheDracle: has joined #RubyOnRails
[02:07:17] b2zeldafreak: has joined #RubyOnRails
[02:07:41] gambl0re: has joined #RubyOnRails
[02:08:42] jkamenik: has joined #RubyOnRails
[02:08:46] _Tariq: has joined #RubyOnRails
[02:08:47] b2zeldafreak: Hi, can anyone point me to a good example (or tutorial) for using Hexagonal or Clean architecture with Rails?
[02:10:25] kt2: has joined #RubyOnRails
[02:11:45] capin: im using refile for image uploading, and would like to submit the upload without having a submit button, any idea what i should be googling for?
[02:14:13] voidDotClass: is it possible to have two different asset pipelines, so e.g all admin area js goes to admin.js, everything else goes to application.js?
[02:14:19] sevenseacat: capin: "submit form without submit button" might be a good start.
[02:14:28] pyemkey: has joined #RubyOnRails
[02:14:39] sevenseacat: voidDotClass: you can have more than one manifest file, yes. you just need to add your separate admin.js file to the precompile array.
[02:16:09] voidDotClass: sevenseacat, and can you then conditionally load either application.js or admin.js in your application.html file?
[02:16:20] harly: i hope everyone's patched their OpenSSH
[02:16:31] sevenseacat: I would typically have a separate layout file for admin if its really going to be that different.
[02:16:52] voidDotClass: its a spa, i don't know on page load whether he's admin or not
[02:17:05] capin: sevenseacat: i take it this is going to be more of a JS thing then a ruby thing
[02:17:09] voidDotClass: Can i conditionally include files in the application.js manifest?
[02:17:16] sevenseacat: capin: correct.
[02:17:16] voidDotClass: no, its a rails thing
[02:17:18] sevenseacat: voidDotClass: no.
[02:17:25] voidDotClass: to conditionally include either of the precompiled js files
[02:17:54] capin: harly: what's going on with OpenSSH?
[02:18:06] ornerymoose: has joined #RubyOnRails
[02:18:10] sevenseacat: voidDotClass: if its a SPA, then having two manifests doesnt make sense, loading everything into one does.
[02:18:30] harly: OpenSSH: client bugs CVE-2016-0777 and CVE-2016-0778 http://undeadly.org/cgi?action=article&sid=20160114142733
[02:18:44] pawnbox: has joined #RubyOnRails
[02:18:57] voidDotClass: sevenseacat, yeah, but if its a regular user then he wont need to load the admin js and vice versa
[02:19:11] sevenseacat: voidDotClass: and you just said you have no way of knowing on page load what type of user it is
[02:19:29] sevenseacat: so how can you load different JS files based on the user's role
[02:19:31] voidDotClass: well, i could know in application.html.erb and include either of the js files
[02:19:40] atomical: has joined #RubyOnRails
[02:19:48] sevenseacat: "I don't know.... actually, I do know"
[02:20:05] voidDotClass: What I don't know is how to tell rails to include either js1 or js2
[02:20:38] voidDotClass: oh, so <%= javascript_include_tag "application"
[02:20:50] voidDotClass: if i replace application with e.g admin, then it'll load admin.js?
[02:20:53] sevenseacat: it's just a ruby conditional.
[02:21:57] _Tariq: has joined #RubyOnRails
[02:26:07] harly: is using thoughtbot/shoulda-matchers for unit testing viwed positively? (the should syntax i thought was frowned upon in rspec, so i'm hesitant...)
[02:26:36] sevenseacat: you dont have to use the should syntax
[02:26:42] _Tariq: has joined #RubyOnRails
[02:26:47] harly: with thoughtbut?
[02:26:48] LambdaSource: has joined #RubyOnRails
[02:27:02] sevenseacat: https://github.com/thoughtbot/shoulda-matchers#should-vs-is_expectedto
[02:27:41] harly: ah i see. so no should and using them is not going to get people frowning? :)
[02:28:10] stannard: has joined #RubyOnRails
[02:28:11] sevenseacat: no-one's going to tell you what gems to use in your own projects. if you want to use it, use it.
[02:28:31] rubyonrailed: has joined #RubyOnRails
[02:28:34] sevenseacat: i think most of the gem is fucking horrible, but is that going to stop you using it if you want to? probably not.
[02:28:55] harly: well. i'm just doing some learning on best practises in unit testing in ruby. so i don't want to pick up bad habits.
[02:30:51] Rodya_: has joined #RubyOnRails
[02:38:00] jgt1: has joined #RubyOnRails
[02:40:50] jeanre: has joined #RubyOnRails
[02:48:24] pawnbox: has joined #RubyOnRails
[02:51:48] sdwrage: has joined #RubyOnRails
[02:53:18] a1fa: is there a way to run .valid? and find out why it's not valid?
[02:53:27] peeja: has joined #RubyOnRails
[02:53:55] FailBit: model.errors.first unless model.valid?
[02:54:14] sevenseacat: not just `first`, check out all the errors
[02:54:48] a1fa: my model is returning valid? = false, but i can save it and update it just fine
[02:55:00] helpa: You have not provided enough information to debug your problem. Please provide this information: https://gist.github.com/radar/5384431
[02:55:10] a1fa: sevenseacat: getting there
[02:56:02] Axsuul: has joined #RubyOnRails
[03:01:58] B1n4r10: has joined #RubyOnRails
[03:03:03] eljimmy: has joined #RubyOnRails
[03:03:49] yfeldblum: has joined #RubyOnRails
[03:04:47] atomical_: has joined #RubyOnRails
[03:05:09] bronson: has joined #RubyOnRails
[03:06:20] brycesenz: has joined #RubyOnRails
[03:06:57] baweaver: has joined #RubyOnRails
[03:07:35] sevenseacat: a1fa: are you?
[03:07:43] atomical_: has joined #RubyOnRails
[03:11:36] ss_much: has joined #RubyOnRails
[03:13:16] threeminutemonta: has joined #RubyOnRails
[03:13:26] peeja: has joined #RubyOnRails
[03:14:27] wethu: has joined #RubyOnRails
[03:18:42] pawnbox: has joined #RubyOnRails
[03:25:16] LambdaSource: has joined #RubyOnRails
[03:26:04] Radar: This is ground control to Major a1fa.
[03:26:40] BradenBraden: has joined #RubyOnRails
[03:27:02] ewilliam: has joined #RubyOnRails
[03:29:50] rubyonrailed: has joined #RubyOnRails
[03:31:33] Rodya_: has joined #RubyOnRails
[03:32:48] bronson: has joined #RubyOnRails
[03:34:18] lethjakman: has joined #RubyOnRails
[03:38:10] adamscott: has joined #RubyOnRails
[03:41:53] moei: has joined #RubyOnRails
[03:41:57] jeanre: has joined #RubyOnRails
[03:42:04] shibabu: has joined #RubyOnRails
[03:42:47] Seich: has joined #RubyOnRails
[03:45:52] jscheel: has joined #RubyOnRails
[03:49:40] voidDotClass: what's the recommended setup for testing angularjs with rails?
[03:50:26] sevenseacat: thats.... a vague topic.
[03:51:55] northfurr: has joined #RubyOnRails
[03:53:39] sankaber: has joined #RubyOnRails
[03:53:51] bronson: has joined #RubyOnRails
[03:55:36] kies: has joined #RubyOnRails
[03:55:36] brycesenz: voidDotClass - I believe that angular has its own framework for writing unit tests for its code
[03:55:57] brycesenz: voidDotClass - and then feature specs would just work the same I suppose
[03:57:31] sankaber: has joined #RubyOnRails
[03:58:32] dirkdiiggler: has left #RubyOnRails: ()
[03:59:31] n00bDev: has joined #RubyOnRails
[04:00:32] Graphettion: has joined #RubyOnRails
[04:02:36] voidDotClass: yeah feature specs are weird
[04:02:46] voidDotClass: i have one test basically doing this:
[04:03:01] voidDotClass: feature "Login", js:true do scenario "Home" do visit '/'
[04:03:18] voidDotClass: when i run that, it opens firefox, but it opens on the 'new firefox, bla bla' page from mozilla, and it just gets stuck
[04:03:20] voidDotClass: nothing happens
[04:06:22] yfeldblum: has joined #RubyOnRails
[04:06:50] helpa: You have not provided enough information to debug your problem. Please provide this information: https://gist.github.com/radar/5384431
[04:07:40] baweaver: has joined #RubyOnRails
[04:07:48] shibabu: has joined #RubyOnRails
[04:09:36] harly: voiddotclass: you might want to switch to poltergeist/phantomjs or capybara-webkit for headless testing. (no browser being opened etc).
[04:09:58] braincrash: has joined #RubyOnRails
[04:10:01] sevenseacat: has phantomjs fixed that stupid file upload bug yet
[04:11:12] voidDotClass: harly, how do i switch to chromium
[04:11:35] harly: google says there's a fix in master with a milestone of release 2.1 (23 days ago)! so for something raised in 2014, yay! :)
[04:12:03] harly: voiddotclass no ideasorry. i use the headless ones.
[04:14:12] jgt1: has joined #RubyOnRails
[04:15:12] Radar: harly: !tabcomplete
[04:15:12] helpa: harly: If you type a few letters of another user's name and then press tab, if you have a proper client, it'll autocomplete towards their name. You might have to press tab more than once to get there though.
[04:15:19] joshkovach: has joined #RubyOnRails
[04:15:36] Malgorath: how would you guys go about incrementing an integer each time you load a record? (View Counter) I'm trying this: https://gist.github.com/malgorath/e952a785380c178cd819 and its doing the error I show there
[04:15:37] harly: Radar, (tabbed) thanks for the tip.
[04:16:11] sevenseacat: I wonder how guys go about fixing that, indeed
[04:16:28] JohnT: has joined #RubyOnRails
[04:16:34] pyemkey: has joined #RubyOnRails
[04:16:34] sevenseacat: would it be different to how women go about fixing it?
[04:16:50] kp666: has joined #RubyOnRails
[04:16:56] Radar: sevenseacat: Women would probably approach it thoughtfully and logically.
[04:17:14] Radar: Men would be like <?= echo "lol" ?> or whatever the syntax is
[04:17:30] kp666: has joined #RubyOnRails
[04:17:31] Radar: https://gist.github.com/malgorath/e952a785380c178cd819#file-blogs_controller-rb-L3
[04:17:32] Radar: Why is this line here
[04:17:33] Radar: What is the purpose of this line
[04:17:34] Radar: is it lost
[04:17:36] Radar: Where are its parents?
[04:18:08] Radar: Malgorath: Perhaps you meant increment! instead of increment!
[04:18:09] elnur: has left #RubyOnRails: ("Leaving")
[04:18:15] Radar: One of those ! is unintentional. Guess which one
[04:18:48] pawnbox: has joined #RubyOnRails
[04:18:57] Malgorath: trying to save the updated thanks was just I needed to remove l3 and use the !
[04:20:16] Radar: Malgorath: Did you try .save or did you just .update(blog_params) because it's all you know?
[04:21:26] Malgorath: I thought of using .save but as I have only seen it in def create and .update is in def update... I thought... hey update looks like th ebest answer
[04:23:06] AntiSpamMeta: has joined #RubyOnRails
[04:24:35] threeminutemonta: has joined #RubyOnRails
[04:26:17] allcentury: has joined #RubyOnRails
[04:26:31] AntiSpamMeta: has joined #RubyOnRails
[04:27:43] LambdaSource: has joined #RubyOnRails
[04:30:28] kknight: has joined #RubyOnRails
[04:30:31] gambl0re: hi guys, long time no see. how difficult is it to create an api endpoint in rails?
[04:30:44] kknight: Gem::LoadError: You have already activated rake 10.5.0, but your Gemfile requires rake 10.4.2. Prepending `bundle exec` to your command may solve this.
[04:30:50] kknight: please solve it
[04:31:00] Radar: kknight: Did you try prepending bundle exec to your command to solve it?
[04:31:26] Radar: gambl0re: Are you confident that you can create an action in a controller, a route in the routes file and a view in the views directory? If so, then it's really easy.
[04:31:45] kknight: Radar: Yes i have executed bundle install
[04:31:51] Radar: kknight: That's not what I asked.
[04:32:01] Radar: kknight: You're trying to run a command. What command are you trying to run?
[04:32:07] gambl0re: shouldnt be a problem if there is a tutorial out there...you have any guides?
[04:32:09] kknight: rake db:seed
[04:32:19] brycesenz: has joined #RubyOnRails
[04:32:22] Radar: kknight: The error message suggests prefixing that with 'bundle exec'
[04:32:31] Radar: kknight: Did you try 'bundle exec rake db:seed'?
[04:32:35] Rodya_: has joined #RubyOnRails
[04:32:38] Radar: gambl0re: I have given you all the information you need.
[04:33:03] lethjakman: has joined #RubyOnRails
[04:33:07] kknight: bundle exec command needed to be run?
[04:33:24] Radar: kknight: It's really difficult for you to follow instructions, isn't it?
[04:33:26] Radar: [15:32:29] <Radar> kknight: Did you try 'bundle exec rake db:seed'?
[04:33:33] AntiSpamMeta: has joined #RubyOnRails
[04:34:06] gambl0re: well, just wondering if you guys have any tutorials that shows how to do this
[04:34:13] Radar: gambl0re: !gettingstarted
[04:34:13] helpa: gambl0re: http://guides.rubyonrails.org/getting_started.html - Getting started with Ruby on Rails guide written by Mike Gunderloy and Ryan Bigg
[04:34:23] Radar: gambl0re: That shows how to create a route, and a controller and (I'm pretty sure) a view too.
[04:34:38] Radar: gambl0re: If you want to create json, use jbuilder. The docs are great for that.
[04:34:47] srinidhi: has joined #RubyOnRails
[04:34:51] Radar: gambl0re: And since you use IRC I'm pretty sure you can read.
[04:35:04] baweaver: has joined #RubyOnRails
[04:35:07] gambl0re: i forgot, Radar likes to use sarcasm a lot
[04:35:15] gambl0re: thanks for the resources
[04:35:26] Radar: gambl0re likes to depend on the work of others instead of trying and experimenting for himself.
[04:35:37] Malgorath: I can't read, I just guess at wut all them swiggly lines mean
[04:35:39] Radar: Are we going to keep stating #truefacts or is that time now pass?
[04:35:54] sevenseacat: sevenseacat: is hungry. #truefacts
[04:36:22] Radar: gambl0re: I am trying to encourage you to go out and learn for yourself. Vague questions like what you asked really show that you have put 0 effort into trying anything yourself. Without trying anything by yourself you will not grow as a developer.
[04:36:33] Radar: gambl0re: You will be the same noob developer you are today in 5yrs time if you keep this up.
[04:36:37] grassass: has joined #RubyOnRails
[04:37:05] Radar: gambl0re: A better question would be: "I have a controller but I don't know how to get it to render JSON. Here's what I've tried <gist link>"
[04:37:18] tvw: has joined #RubyOnRails
[04:37:26] Radar: gambl0re: But no, there was nothing of the sort. No effort at all on your behalf, and yet you expect effort from us? Buddy: that's not how this channel works.
[04:37:27] eljimmy: has joined #RubyOnRails
[04:37:58] gambl0re: i agree...ill try myself first and ask if i have further questions.
[04:38:16] Malgorath: Radar, should there be a #ROR-4-Carebears channel?
[04:38:21] gambl0re: see you around my aussie brohter and sisters..
[04:38:26] Radar: gambl0re: !rule1
[04:38:26] helpa: gambl0re: Do your research before hand. Your question may be answerable with a quick Google search or by simply experimenting. If you're using a method in Rails, look it up in the API Docs or in the Official Guides.
[04:38:52] Radar: First rule of the channel. Do your research before hand. Your question may be answerable ... by simply experimenting.
[04:38:54] Radar: gambl0re: !rule2
[04:38:54] helpa: gambl0re: If you've tried Googling, explain what terms you've tried to use so people can better help you.
[04:38:59] Radar: gambl0re: !rule3
[04:38:59] helpa: gambl0re: Clearly explain what is happening and create a Gist (http://gist.github.com), (formatted neatly please: http://bit.ly/1q75oia) of the code that is causing the problem you are encountering, as well as any useful output like stacktraces.
[04:39:08] Radar: This is exactly why these rules exist in the first place.
[04:39:16] Radar: Malgorath: This is the channel.
[04:39:17] brycesenz: gambl0re - everyone here is super awesome if you come prepared. Please don't be turned off! Helping is super fun, but only if you're putting in legwork too!
[04:39:50] Malgorath: Radar, I wuz attemptin' sum dat sarkarizm
[04:39:56] gambl0re: brycesenz, i use to be in this channel a lot. havent been here in a while though
[04:40:01] Radar: Malgorath: Helluva drug.
[04:40:10] Malgorath: Radar, yeaup
[04:40:30] Malgorath: ooh wonder how long I been here
[04:40:47] brycesenz: gambl0re - ok, no worries. I just wanted to make sure no one was being scared away. Look forward to seeing you around!
[04:41:16] Radar: brycesenz: FTR: I am only this harsh with those who have been in the channel longer than 100 days.
[04:41:19] lethjakman-l: has joined #RubyOnRails
[04:41:24] kt2: has joined #RubyOnRails
[04:41:30] Malgorath: Lol I think that was back when Radar was friendly :p j/k i <3 Radar
[04:41:31] brycesenz: real talk - for the first month I was on this channel, I just assumed helpa was a real person who was kind of a dick about the rules
[04:41:32] Radar: Anyone "younger" than that is still learning.
[04:41:40] Radar: brycesenz: hah
[04:42:15] Malgorath: I do have learning disabilities Radar, do I get a 'special' break?
[04:42:16] brycesenz: Radar - fair. It was a great speech FWIW
[04:42:32] Radar: Malgorath: Probably.
[04:42:35] JohnT: has joined #RubyOnRails
[04:42:44] jeanre: has joined #RubyOnRails
[04:44:20] Malgorath: Radar, do you think devise is a good package to go with for setting up users(and potientially roles) or can you suggest something butter?
[04:44:32] Radar: Malgorath: !r4ia
[04:44:32] helpa: Malgorath: 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
[04:44:38] Radar: Malgorath: Chapters 6, 7 and 8.
[04:45:33] rubyonrailed: has joined #RubyOnRails
[04:45:42] Malgorath: lol I swear I think I own that back...
[04:46:57] Radar: Why not buy it again? :P
[04:47:26] Malgorath: Actually I have R3IA and R4IA
[04:47:30] herbst: has joined #RubyOnRails
[04:47:30] herbst: has joined #RubyOnRails
[04:47:42] d0nn1e: has joined #RubyOnRails
[04:48:32] Malgorath: I bought a few other Rails books back a while ago now too, just for about them
[04:49:32] brycesenz: Malgorath - have you read Metaprogramming Ruby? It's a really fun book.
[04:52:05] exadeci: has joined #RubyOnRails
[04:52:46] exadeci: Hey, I have weird issue with my user factory in FactoryGirl, I'm forced to use .reload on it or it fails to see that it has updated. Any clue of what could cause that ?
[04:53:03] krz: has joined #RubyOnRails
[04:53:15] Radar: exadeci: !rule0
[04:53:16] helpa: exadeci: Show rather than tell. Explaining your problem with code, stacktraces or errors is always preferred to explaining it with just text. Show us what's happening, rather than telling us. Put the code on https://gist.github.com and then give us the HTTP link to the Gist.
[04:53:53] Malgorath: brycesenz, honestly I came here, asked about books, got about 4 links to good ones and bought them, stored them on my backup raid and moved on to dealing with IRL stuff and forgot about them
[04:55:00] brycesenz: Malgorath - haha, it happens to us all! I had to quit my local hacker-book-club out of shame because I kept falling too far behind in the books
[04:56:14] yfeldblum: has joined #RubyOnRails
[04:56:41] northfurr: has joined #RubyOnRails
[04:57:32] benlieb: has joined #RubyOnRails
[04:59:57] arup_r: has joined #RubyOnRails
[05:01:06] smoitra: has joined #RubyOnRails
[05:01:38] northfurr: has joined #RubyOnRails
[05:02:26] iateadonut: has joined #RubyOnRails
[05:02:53] pawnbox: has joined #RubyOnRails
[05:02:56] aloneintheworld: current_user.save! will invoke after_create callback on User model ?
[05:02:57] cornerma1: has joined #RubyOnRails
[05:03:13] aloneintheworld: if current_user is an already existing user
[05:03:25] aloneintheworld: why could it be invoking after_create
[05:03:27] exadeci: Radar: Not much to see https://gist.github.com/exadeci/5e7d8aaa67d3326c0592
[05:03:53] chipotle: has joined #RubyOnRails
[05:04:07] arup_r: aloneintheworld: it shouldn't. Are you sure ?
[05:04:11] Radar: aloneintheworld: !rule0
[05:04:11] helpa: aloneintheworld: Show rather than tell. Explaining your problem with code, stacktraces or errors is always preferred to explaining it with just text. Show us what's happening, rather than telling us. Put the code on https://gist.github.com and then give us the HTTP link to the Gist.
[05:04:38] Radar: exadeci: what is line 258 of user_spec.rb?
[05:04:50] Bloomer: has joined #RubyOnRails
[05:05:04] exadeci: Radar: the part I wrote in user_spec.rb
[05:05:17] Radar: exadeci: which line specifically though
[05:05:52] Radar: Ok. Why is user.email not set there? It looks like it is in the factory.
[05:05:56] Radar: put a binding.pry above the user.save!
[05:06:09] pawnbox_: has joined #RubyOnRails
[05:06:26] sevenseacat: is settings a field on the model? or something more?
[05:06:45] _Tariq: has joined #RubyOnRails
[05:07:03] brycesenz: exadeci - could you show the full User model as well?
[05:07:20] Radar: brycesenz: I think if user_spec is at least 258 lines long then it's probably quite massive.
[05:08:07] brycesenz: Radar - true. But if he has some weird after_save hooks or validations, it could explain where things are going screwy. To your point, email is *in* the factory, so if it's blank, something else is going on
[05:09:33] Radar: exadeci: Can you reproduce this issue in another application?
[05:11:49] _Tariq: has joined #RubyOnRails
[05:13:45] exadeci: I think I'm something apparently there is a unconfirmed_email attribute to witch email gets set on instead of email (for some reason). I'm looking at that.
[05:13:56] sankaber: has joined #RubyOnRails
[05:14:33] Radar: exadeci: because you are using the confirmable module in Devise and you're not confirming the user in the factory. You'll need to set confirmed_at in your factory. Oh and by the way my paypal address is radarlistener@gmail.com.
[05:16:11] brycesenz: exadeci - if you're using confirmations, you also may have to set "email_confirmation" in your factory
[05:20:53] pawnbox: has joined #RubyOnRails
[05:23:49] kknight: has joined #RubyOnRails
[05:24:46] Rodya_: has joined #RubyOnRails
[05:25:07] kknight: i want to add search tab in my app any good link for that?
[05:25:42] exadeci: :) What is weird is that the spec and factories are from the Rails 3, Rspec2 version of the project and it has no issue with it.
[05:28:44] baash05: has joined #RubyOnRails
[05:31:02] baash05: Hey all.. I have seen another rspec'er type something like rspec -next-failure... does anyone know what the actual command is? I can't seem to trigger it.
[05:31:44] kknight: sevenseacat?
[05:32:33] baash05: Woot.. got it.
[05:32:44] baash05: rspec spec --next-failure
[05:33:04] baash05: I just kept guessing.
[05:33:13] kknight: i want to add search tab in my app any good link for that?
[05:33:16] rvanlieshout: has joined #RubyOnRails
[05:34:25] jeanre: has joined #RubyOnRails
[05:34:59] mbreedlove: has joined #RubyOnRails
[05:36:57] threeminutemonta: has joined #RubyOnRails
[05:37:37] Limix: has joined #RubyOnRails
[05:37:40] sevenseacat: kknight: http://www.google.com, with a description that vague
[05:38:37] Cohedrin: google is a really good search tab
[05:38:39] Cohedrin: can confirm
[05:42:20] jeanre: has joined #RubyOnRails
[05:42:27] jeanre: hello arup_r
[05:43:30] arup_r: jeanre: good morning
[05:43:38] northfurr: has joined #RubyOnRails
[05:44:50] jgt1: has joined #RubyOnRails
[05:44:57] kknight: has joined #RubyOnRails
[05:45:39] Vintila: has joined #RubyOnRails
[05:46:35] jeanre: morning arup_r
[05:47:18] Kneecaps: has joined #RubyOnRails
[05:47:59] ewnd9: has joined #RubyOnRails
[05:48:43] ewnd9: has joined #RubyOnRails
[05:50:53] srinidhi: has joined #RubyOnRails
[05:51:47] ewnd9: has joined #RubyOnRails
[05:51:51] wethu: has joined #RubyOnRails
[05:52:01] jowiar: has joined #RubyOnRails
[05:52:59] ewnd9: has joined #RubyOnRails
[05:59:52] ornerymoose: has joined #RubyOnRails
[06:01:41] bronson: has joined #RubyOnRails
[06:02:13] nerium: has joined #RubyOnRails
[06:05:15] EXCHGR: has joined #RubyOnRails
[06:07:44] j0llyr0tten: has joined #RubyOnRails
[06:08:08] zpe: has joined #RubyOnRails
[06:15:46] EXCHGR: has joined #RubyOnRails
[06:17:11] yfeldblum: has joined #RubyOnRails
[06:18:14] pyemkey: has joined #RubyOnRails
[06:18:45] rickmasta: has joined #RubyOnRails
[06:19:18] pawnbox: has joined #RubyOnRails
[06:19:38] ericfreese: has joined #RubyOnRails
[06:27:44] allcentury: has joined #RubyOnRails
[06:28:03] bronson: has joined #RubyOnRails
[06:30:04] stannard: has joined #RubyOnRails
[06:34:18] rubyonrailed: has joined #RubyOnRails
[06:36:05] aganov: has joined #RubyOnRails
[06:37:02] yfeldblum: has joined #RubyOnRails
[06:37:07] DEA7TH: has joined #RubyOnRails
[06:48:56] herbst: has joined #RubyOnRails
[06:50:45] arup_r: has joined #RubyOnRails
[06:51:26] qejk: has joined #RubyOnRails
[06:53:41] LambdaSource: has joined #RubyOnRails
[06:53:44] kerunaru: has joined #RubyOnRails
[06:54:31] rodfersou: has joined #RubyOnRails
[06:55:04] Yomero3: has joined #RubyOnRails
[06:57:16] Hexter: has joined #RubyOnRails
[06:58:46] Rodya_: has joined #RubyOnRails
[07:00:53] DirtyFInn: has joined #RubyOnRails
[07:03:02] Macaveli: has joined #RubyOnRails
[07:03:31] riddled: has joined #RubyOnRails
[07:03:54] _3dwardsharp: has joined #RubyOnRails
[07:05:15] rodferso1: has joined #RubyOnRails
[07:05:32] DirtyFInn: has left #RubyOnRails: ()
[07:05:47] djbkd: has joined #RubyOnRails
[07:09:11] RandomNickname: has joined #RubyOnRails
[07:12:21] dopie: has joined #RubyOnRails
[07:13:44] Yomero2: has joined #RubyOnRails
[07:14:34] tibra: has joined #RubyOnRails
[07:15:09] dionysus69: has joined #RubyOnRails
[07:17:11] AntiSpamMeta: has joined #RubyOnRails
[07:17:17] LambdaSource: has joined #RubyOnRails
[07:17:27] joshkovach: has joined #RubyOnRails
[07:17:52] akemrir: has joined #RubyOnRails
[07:19:27] tibra: has joined #RubyOnRails
[07:21:24] herbst: has joined #RubyOnRails
[07:22:31] argentdrake: has joined #RubyOnRails
[07:23:48] zpe: has joined #RubyOnRails
[07:25:30] nacho_: has joined #RubyOnRails
[07:26:16] smoitra_: has joined #RubyOnRails
[07:26:44] argentdrake: Hello fellow rubysmiths
[07:28:10] Pazician: has joined #RubyOnRails
[07:28:56] smoitra__: has joined #RubyOnRails
[07:29:10] arup_r: yes.. argentdrake
[07:29:22] smoitra__: has joined #RubyOnRails
[07:29:29] argentdrake: arup_r: Sorry, trying to add my details to make it clear
[07:29:50] AntiSpamMeta: has joined #RubyOnRails
[07:30:38] rvanlieshout: hi argentdrake
[07:30:44] argentdrake: I was hoping to get a quick answer on something. I've been given orders by the bossman asking me to get a project going in rails, and i'd really like to deploy the use of puphpet so that we can have this set up for all of us with as little hassle as possible. I attempted to use it without rails installed by default, then installed vers 3.2.0. I was making a standard demo app to say hello world but it refuses to connect to
[07:30:45] argentdrake: localhost:3000. So basically, any quick way to install rails?
[07:30:57] argentdrake: I followed this guide, word for word https://gorails.com/guides/using-vagrant-for-rails-development
[07:31:31] StaticVoid: has joined #RubyOnRails
[07:31:34] rvanlieshout: argentdrake: deploy using puppet
[07:31:40] rvanlieshout: or local dev using vagrant + puppet
[07:31:51] argentdrake: its a local vserv ya
[07:32:04] rvanlieshout: and what's the issue there?
[07:32:22] argentdrake: When I previously used puppet, I couldn't connect to localhost:3000
[07:32:29] rvanlieshout: why would you?
[07:32:34] rvanlieshout: did you add something for it in the manifest
[07:32:43] rvanlieshout: why would you be able to do so i mean
[07:33:35] argentdrake: let me clarify really quick. puppet is the same as puphpet?
[07:34:04] rvanlieshout: puphet is a online gui configurator for puppet & vagrant
[07:34:25] craysiii: has joined #RubyOnRails
[07:35:00] argentdrake: ahh ok, thats what i'm trying to say. I used puphpet to package everything I wanted. I'm guessing its not going to do what I want though
[07:35:01] craysiii: has joined #RubyOnRails
[07:35:01] rvanlieshout: a quick google led me to https://gist.github.com/imranismail/8fd9f17ca595efd234d5
[07:35:03] rubyonrailed: has joined #RubyOnRails
[07:35:11] arup_r: My attempt to use the name of a polymorphic assoc seems not acceptable in Rails. getting error https://gist.github.com/aruprakshit/edf202e12b073df838b0 "NameError: uninitialized constant Notification::Notifiable"
[07:35:18] arup_r: then how should I use it ?
[07:36:19] rvanlieshout: arup_r: there is no sane way to join polymorphic associations
[07:36:48] PedramT: has joined #RubyOnRails
[07:37:13] arup_r: rvanlieshout: is this sane? http://stackoverflow.com/a/31913902
[07:37:31] sinkensabe: has joined #RubyOnRails
[07:37:45] rvanlieshout: it'll only join 1 kind
[07:38:44] arup_r: I need one kind.. I can keep there one assoc for each table.. or it would be good, If i can use a shared scope, really.. but dunno how.
[07:39:13] rvanlieshout: you either use a polymorphic to connect the single relationship to different things
[07:39:20] rvanlieshout: or you make separate relationships
[07:39:33] arup_r: ^^ looks ok
[07:39:43] rvanlieshout: it's weird to have a polymorphic association AND only query it for one particular type
[07:40:16] arup_r: hum. dash board has different window to show things .. that's why
[07:40:33] rvanlieshout: then you could add an association for each of the types
[07:40:46] arup_r: I mean in the same page diffrent block
[07:40:56] arup_r: rvanlieshout: yes, i am going to do it
[07:41:09] jas02: has joined #RubyOnRails
[07:41:27] arup_r: but if my first try, rails took happily, then I could be more satisfied. :)
[07:41:33] smoitra: has joined #RubyOnRails
[07:41:59] rvanlieshout: you really need to understand the impact of polymorphic associations though :)
[07:43:31] arup_r: if you tell, I am ready to listen that impact.. I really dunno what impacts it can have..
[07:44:09] rvanlieshout: a polymorphic association a) takes 2 foreign keys and b) results in different (not known in advance) types
[07:44:31] rvanlieshout: so your notification is not only for reviews
[07:44:54] rvanlieshout: if you want to know the reviews for a particular notification you could just join it like described in that SO post, using the notifiable_type
[07:45:09] rvanlieshout: but you must be aware that a notification without any reviews is possible
[07:45:12] jalnt_: has joined #RubyOnRails
[07:45:34] jgt1: has joined #RubyOnRails
[07:45:41] herbst: has joined #RubyOnRails
[07:47:08] pawnbox: has joined #RubyOnRails
[07:51:59] solars: has joined #RubyOnRails
[07:53:01] Cervajz_: has joined #RubyOnRails
[07:54:36] arup_r: rvanlieshout: still the error https://gist.github.com/aruprakshit/edf202e12b073df838b0
[07:55:55] lethjakman-l: has joined #RubyOnRails
[07:56:30] zpe: has joined #RubyOnRails
[07:56:57] allcentury: has joined #RubyOnRails
[07:57:05] dionysus69: has joined #RubyOnRails
[07:58:28] Deft: has joined #RubyOnRails
[07:58:50] wethu: has joined #RubyOnRails
[07:59:41] arup_r: any way, it seems hard to write query in the polymorphic model. I will write it in another model, which in my case is Review. From there it works.
[08:00:15] pyemkey: has joined #RubyOnRails
[08:02:14] jalnt_: has left #RubyOnRails: ()
[08:04:06] rubyonrailed: has joined #RubyOnRails
[08:05:56] nir0: has joined #RubyOnRails
[08:06:01] jas02: has joined #RubyOnRails
[08:06:56] nir0: hi guys, i've got some strange error here. i made a model named Artist, now console says: Artist.class # => Module
[08:07:12] nir0: is there such a module??? how do i find it?
[08:10:31] nir0: haven't find any Artist with grep -rn 'Artist' through gems
[08:11:00] sevenseacat: did you grep your own app for Artist/
[08:11:10] darutoko: has joined #RubyOnRails
[08:11:10] rvanlieshout: and what's the defenition of Artist?
[08:12:16] nir0: nvm my own application called Artist :D
[08:12:37] nir0: and begins with module Artist
[08:12:48] rubyonrailed: has joined #RubyOnRails
[08:13:25] sevenseacat: I suspected that.
[08:13:42] yfeldblum: has joined #RubyOnRails
[08:14:42] hahuang65: has joined #RubyOnRails
[08:15:13] Macaveli: has joined #RubyOnRails
[08:15:29] mices: brycenz: https://gist.github.com/mices/6feb950ad4130e73e03f
[08:15:39] sandstrom: has joined #RubyOnRails
[08:16:57] artto: has joined #RubyOnRails
[08:18:03] yardenbar: has joined #RubyOnRails
[08:18:31] roshanavand: has joined #RubyOnRails
[08:18:47] paulodiniz: has joined #RubyOnRails
[08:20:25] roshanavand: has joined #RubyOnRails
[08:21:00] pawnbox: has joined #RubyOnRails
[08:21:11] DEA7TH: has joined #RubyOnRails
[08:21:16] roshanavand: has joined #RubyOnRails
[08:23:07] herbst: has joined #RubyOnRails
[08:24:18] ur5us: has joined #RubyOnRails
[08:24:30] PedramT: has joined #RubyOnRails
[08:25:15] roshanav_: has joined #RubyOnRails
[08:25:40] pawnbox: has joined #RubyOnRails
[08:25:47] AimlessRAven: has joined #RubyOnRails
[08:26:14] AimlessRAven: hi all, someone knows what format can write in my href facebook like button
[08:26:14] AimlessRAven: .fb-like{"data-action" => "like", "data-href" => "product_path(@product)", "data-layout" => "standard", "data-share" => "true", "data-show-faces" => "true", "data-width" => "140"}
[08:26:26] Rodya_: has joined #RubyOnRails
[08:26:52] tvw: has joined #RubyOnRails
[08:26:57] AimlessRAven: how to format link..
[08:27:07] pyemkey: has joined #RubyOnRails
[08:27:15] rubyonra_: has joined #RubyOnRails
[08:27:41] rvanlieshout: .fb-like{ data: { action: :like, href: product_path(@product), layout: :standard, share: :true, 'show-faces' => true, width: 140 }}
[08:28:01] rvanlieshout: AimlessRaven: you really don't give much about learning proper rails, right?
[08:28:08] jeanre: has joined #RubyOnRails
[08:29:22] paulodiniz: has joined #RubyOnRails
[08:29:33] AimlessRAven: rvanlieshout: this dont work
[08:29:46] mark1: has joined #RubyOnRails
[08:29:49] rvanlieshout: could be.. it's just a guide in the right direction
[08:30:47] ericfreese: has joined #RubyOnRails
[08:32:40] arup_r: has joined #RubyOnRails
[08:32:52] Drewch: has joined #RubyOnRails
[08:33:36] rubyonrailed: has joined #RubyOnRails
[08:34:09] PedramT: has joined #RubyOnRails
[08:35:31] antgel: has joined #RubyOnRails
[08:36:55] fox_mulder_cp: wow, wow. somebody remember old schoold soft? old school design site https://www.facebook.com/photo.php?fbid=909091215812014&set=a.248552751865867.65906.100001334325847&type=3&theater
[08:37:57] rvanlieshout: i love it how images @facebook have proper ACL :)
[08:38:05] PedramT: has joined #RubyOnRails
[08:42:31] sandstrom: has joined #RubyOnRails
[08:42:54] Ergo: has joined #RubyOnRails
[08:45:33] riddled: has joined #RubyOnRails
[08:46:00] fox_mulder_cp: borland dos interface style, such as norton commander
[08:46:48] herbst: has joined #RubyOnRails
[08:46:56] herbst: has joined #RubyOnRails
[08:46:56] Sylario: has joined #RubyOnRails
[08:47:47] fox_mulder_cp: hm, may be remake my own site https://kristopolous.github.io/BOOTSTRA.386/
[08:49:46] craysiii: has joined #RubyOnRails
[08:50:27] craysiii: has joined #RubyOnRails
[08:50:52] theod: has joined #RubyOnRails
[08:50:58] PedramT: has joined #RubyOnRails
[08:51:37] zpe: has joined #RubyOnRails
[08:53:00] AzaToth: has joined #RubyOnRails
[08:53:49] jas02: has joined #RubyOnRails
[08:54:50] avril14th: has joined #RubyOnRails
[08:55:33] avril14th: Hello, I need to write a validation that checks in database that an attribute has not already been sent by another process. Is there a way to do that?
[08:56:43] lethjakman-l: has joined #RubyOnRails
[08:57:03] fox_mulder_cp: hmmm.... use gist.github.com for your code, please
[08:57:11] rvanlieshout: avril14th: define 'sent by another process'
[08:57:19] tbuehlmann: are you talking about a simple uniqueness validation?
[08:58:01] sevenseacat: has joined #RubyOnRails
[08:58:30] avril14th: rvanlieshout: I have a couple users that edit the same record at the same time. I want only one of them to be able to save the record if an attribute (pending_review) was set to false by another user.
[08:58:34] allcentury: has joined #RubyOnRails
[08:59:01] rvanlieshout: avril14th: http://api.rubyonrails.org/classes/ActiveRecord/Locking/Optimistic.html
[09:00:30] avril14th: rvanlieshout: that looks good, let me read that. I may be back :) thanks
[09:00:57] pyemkey: has joined #RubyOnRails
[09:01:46] mices: https://gist.github.com/mices/6feb950ad4130e73e03f
[09:02:07] AimlessRAven: rvanlieshout: .fb-like{ data: { action: :like, href: product_url(@product), layout: :standard, share: :true, 'show-faces' => true, width: 140 }}
[09:02:22] AimlessRAven: this work when i set "http://"
[09:02:23] mices: anyone can help with this ^
[09:02:25] AimlessRAven: but for product_path dont
[09:02:27] rvanlieshout: mices: include the full trace
[09:02:50] rvanlieshout: AimlessRaven: don't what?
[09:02:53] tbuehlmann: I'd take a guess saying @conversation is nil, but who am I to guess code that's not in the gist
[09:03:12] mices: rvanlieshout: refresh
[09:04:06] rvanlieshout: that's not the full trace
[09:05:01] mices: rvanlieshout: refresh
[09:05:27] mikecmpbll: has joined #RubyOnRails
[09:05:35] AntiSpamMeta: has joined #RubyOnRails
[09:05:39] pyemkey: has joined #RubyOnRails
[09:05:40] sevenseacat: tbuehlmann: spot on
[09:06:03] AntiSpamMeta: has joined #RubyOnRails
[09:06:12] rvanlieshout: mices: raise @conversation.inspect on line 14
[09:08:35] mices: rvanlieshout: insert that line of code at line 14 in conversations_controller.rb ?
[09:08:43] AntiSpamMeta: has joined #RubyOnRails
[09:09:08] edwinvdgraaf: has joined #RubyOnRails
[09:09:13] mices: it returned nil
[09:09:20] mices: rvanlieshout: ^
[09:09:54] mikecmpbll: eugh, this rails bug has been plaguing me for ages: has_and_belongs_to_many :special_groups, -> { joins(:group_type).where(special: true) }, class_name: "Group"
[09:09:54] rvanlieshout: so the winner is tbuehlmann :)
[09:10:10] mices: i knew that but i dont know why
[09:10:16] mikecmpbll: that association scope works fine, except for if you try to do includes(:special_groups)
[09:10:24] tbuehlmann: have a look at the before_action
[09:10:27] AntiSpamMeta: has joined #RubyOnRails
[09:10:47] mikecmpbll: where the join gets tossed away and it causes a SQL error, can't find table group_types in from clause
[09:10:51] tbuehlmann: mices, you knew that?!
[09:11:25] mices: yes, i know @conversation was nil
[09:11:31] mices: s/know/knew/
[09:11:44] avril14th: rvanlieshout: wouldn't be easier to just have a "around save" callback that checks the value in database? The locking looks great. Just overkill.
[09:11:48] mices: i didn't realize it was because of my before_action restrictions
[09:11:54] edwinvdgraaf: has joined #RubyOnRails
[09:11:57] mices: tbuehlmann: ty
[09:12:04] mices: rvanlieshout: ty
[09:12:35] jsrn_: has joined #RubyOnRails
[09:13:12] mices: wow it works
[09:13:32] avril14th: damn, around callbacks are not in the transaction
[09:13:41] mices: but where's the comprensive listing of methods in mailboxer
[09:14:16] mices: why do i have to read all these how to's by other developers
[09:14:52] AntiSpamMeta: has joined #RubyOnRails
[09:15:02] mices: to read the mailboxer github page you would never know about most of the methods i'm using already
[09:15:50] sevenseacat: are you serious? why do you have to read documentation to know how something works?
[09:16:16] jgt1: has joined #RubyOnRails
[09:17:02] Cervajz_: has joined #RubyOnRails
[09:17:21] edwinvdg_: has joined #RubyOnRails
[09:20:10] sevenseacat: mices: you better improve your telepathy skills if you dont want to have to read about things
[09:20:19] herbst: has joined #RubyOnRails
[09:21:20] mices: i'm looking for the documentation, i have to read tutorials written by other developers because i can't find them
[09:21:49] mices: i don't mind they don't teach me how, but they should at least give me all the methods
[09:21:50] sandstrom: has joined #RubyOnRails
[09:22:22] mices: i mean i dont mind they don't teach me how to write all my methods and views
[09:22:44] zotherstupidguy: has joined #RubyOnRails
[09:24:54] sevenseacat: mices: so you know, I'm on the verge of muting you again.
[09:25:13] rvanlieshout: avril14th: that locking is quite an easy thing
[09:25:18] rvanlieshout: and works really well
[09:27:52] lilster: has joined #RubyOnRails
[09:28:02] avril14th: rvanlieshout: actually you are right
[09:28:11] avril14th: I'll do that
[09:28:19] avril14th: I first thought that would mess up my workers too
[09:28:30] avril14th: I have 10 sidekiq running on the same record too
[09:28:34] rvanlieshout: if they try to save an outdated object it'll will
[09:28:38] rvanlieshout: but that's a good thing
[09:29:07] avril14th: well, actually I just mind about one field, only used by users and not workers
[09:29:16] avril14th: that's why it seemed overkill to lock the full objet
[09:30:05] rvanlieshout: maybe that locking thing has a config to lock only a few objects
[09:30:11] rvanlieshout: but in a way it makes sense to lock the full thing
[09:30:31] avril14th: yes it does
[09:30:36] tbuehlmann: btw, I recently had a case where I really wanted to ensure only one worker has access to stuff in order to avoid race conditions. as it wasn't runtime critical, I just threw in https://github.com/heroku/pg_lock and it worked right away
[09:30:51] rvanlieshout: tbuehlmann: true, rails also has locking built in for that
[09:30:53] avril14th: tbuehlmann: I don't use PG
[09:30:54] rvanlieshout: no need for a gem
[09:31:07] rvanlieshout: but db locking isn't really possible if a form render comes in between
[09:31:18] rvanlieshout: rails supports both optimistic and pessimistic locking
[09:32:00] pyemkey: has joined #RubyOnRails
[09:34:07] avril14th: actually the pessimistic looks simpler
[09:34:12] avril14th: than the optimistic
[09:34:22] rvanlieshout: but it won't work when you have a gap in your transaction
[09:34:39] rvanlieshout: as you when the user uses the form
[09:35:48] silverdust: I get an extra empty option tag with this : <%= f.select(:collection_id, options_for_select([['- Select -', 0, disabled: 'true']] + @collections, 0) ,{}, { required: 'true', class: 'form__input'}) %>
[09:35:53] nettoweb: has joined #RubyOnRails
[09:35:56] silverdust: why is that?
[09:36:10] sevenseacat: silverdust: because you didnt tell it not to.
[09:36:42] silverdust: how do you mean?
[09:37:14] sevenseacat: http://api.rubyonrails.org/classes/ActionView/Helpers/FormOptionsHelper.html
[09:37:20] silverdust: I thought I'd get the one - Select - option and the ones from my @collections array
[09:37:31] avril14th: rvanlieshout: right. didn't see that. thx.
[09:38:21] snowy: has joined #RubyOnRails
[09:38:36] avril14th: alright, there is a girl model shooting downstairs. time for a cigarette
[09:39:16] silverdust: oh I see. Thanks sevenseacat . I should have used prompt for what I was doing with - Select - there too
[09:40:08] tibra: has joined #RubyOnRails
[09:45:43] DoubleMalt: has joined #RubyOnRails
[09:47:18] Tempesta: has joined #RubyOnRails
[09:47:35] akshat: has joined #RubyOnRails
[09:48:34] chipotle: has joined #RubyOnRails
[09:50:37] pydave6367: has joined #RubyOnRails
[09:52:22] Vintila: has joined #RubyOnRails
[09:53:21] paulodiniz: has joined #RubyOnRails
[09:53:52] mikecmpbll: is rails 4.2 compatible with ruby 2.0? i always find it difficult to find this kind of information
[09:53:56] peeja: has joined #RubyOnRails
[09:54:45] adaedra: https://rubygems.org/gems/rails/versions/4.2.5 => Required Ruby version: >= 1.9.3
[09:55:11] mikecmpbll: damn, forgot that bit existed.
[09:55:13] rodfersou: has joined #RubyOnRails
[09:56:27] supergeek: has joined #RubyOnRails
[09:56:57] arup_r: has joined #RubyOnRails
[09:58:23] curses: has joined #RubyOnRails
[09:59:51] grasshopper: has joined #RubyOnRails
[09:59:54] defsdoor: has joined #RubyOnRails
[10:01:20] srinidhi: has joined #RubyOnRails
[10:02:08] The_Phoenix: has joined #RubyOnRails
[10:03:06] herbst: has joined #RubyOnRails
[10:03:31] craysiii: has joined #RubyOnRails
[10:03:51] craysiii: has joined #RubyOnRails
[10:04:01] yfeldblum: has joined #RubyOnRails
[10:04:04] ziyadb: has joined #RubyOnRails
[10:05:32] craysiii: has joined #RubyOnRails
[10:06:18] craysiii: has joined #RubyOnRails
[10:11:29] GreekFreak: has joined #RubyOnRails
[10:12:04] pyemkey: has joined #RubyOnRails
[10:13:22] mclee: has joined #RubyOnRails
[10:14:08] marr: has joined #RubyOnRails
[10:14:47] GreekFreak: I have an app that uses MySQL. I need to access a view from a MS SQL database, which means I'll need the 'activerecord-sqlserver-adapter' as well as the 'mysql2' gem. I would like to know if there is a conflict from having 2 DB gems
[10:14:47] GreekFreak: *DB adapters
[10:15:47] cullenb: has joined #RubyOnRails
[10:15:57] rvanlieshout: do you need to acces that mssql view from activerecord?
[10:22:21] cullenb: has left #RubyOnRails: ()
[10:22:53] cullenb_: has joined #RubyOnRails
[10:23:36] artto: has joined #RubyOnRails
[10:27:07] craysiii: has joined #RubyOnRails
[10:29:05] Rodya_: has joined #RubyOnRails
[10:30:30] quazimodo: has joined #RubyOnRails
[10:31:34] stannard: has joined #RubyOnRails
[10:31:51] pyemkey: has joined #RubyOnRails
[10:32:46] DaniG2k: has joined #RubyOnRails
[10:34:49] DaniG2k: has left #RubyOnRails: ()
[10:37:30] ldnunes: has joined #RubyOnRails
[10:39:13] gbgdev_: has joined #RubyOnRails
[10:42:07] techsethi: has joined #RubyOnRails
[10:42:32] lethjakman-l: has joined #RubyOnRails
[10:48:08] PedramT: has joined #RubyOnRails
[10:48:08] techsethi: Hi Folks, I had pow running on my machine & it doesn???t show up the applications that I had linked earlier. I have tried re-installing POW and it fails with the following error: *** Installing Pow 0.5.0...
[10:48:08] techsethi: *** Installing local configuration files...
[10:48:08] techsethi: *** Starting the Pow server...
[10:48:08] techsethi: (23) Failed writing body. what am I doing wrong, have spent so much time but am not able to figure it out. Thanks in advance
[10:48:10] herbst: has joined #RubyOnRails
[10:48:10] El3ktra: has joined #RubyOnRails
[10:48:10] FooMunki: has joined #RubyOnRails
[10:48:11] Snowy_: has joined #RubyOnRails
[10:48:11] AntiSpamMeta: has joined #RubyOnRails
[10:49:04] edwinvdgraaf: has joined #RubyOnRails
[10:49:05] sheepman: has joined #RubyOnRails
[10:50:26] felixdd: has joined #RubyOnRails
[10:50:51] mbreedlove: has joined #RubyOnRails
[10:51:01] GreekFreak: rvanlieshout, well I'll need to extract the info and import it in my database
[10:51:06] Cork: assets:precompile crashes with "NoMethodError: undefined method `[]' for nil:NilClass" in "sprockets-3.5.2/lib/sprockets/sass_processor.rb:278:in `sprockets_context'"
[10:51:14] Cork: anyone know how to debug what is going on?
[10:51:30] PedramT: has joined #RubyOnRails
[10:57:13] yos7ph: has joined #RubyOnRails
[11:01:17] quazimodo: has joined #RubyOnRails
[11:01:19] pyemkey_: has joined #RubyOnRails
[11:02:07] PedramT: has joined #RubyOnRails
[11:02:44] RandomNi_: has joined #RubyOnRails
[11:03:32] RandomNi_: has left #RubyOnRails: ()
[11:04:08] qejk: has joined #RubyOnRails
[11:05:38] kerunaru: has joined #RubyOnRails
[11:07:26] wethu: has joined #RubyOnRails
[11:09:36] jeanre: has joined #RubyOnRails
[11:11:12] fox_mulder_cp: rails 2.4.5, 'Puma caught this error: Missing `secret_token` and `secret_key_base` for 'development' environment, set these values in `config/secrets.yml`, but in secrets i say: ecret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
[11:11:52] tbuehlmann: fox_mulder_cp, do you set the environment variable?
[11:14:07] kerunaru: You must to set that environment variable in your system. It's done this way for security reasons.
[11:15:31] fox_mulder_cp: has joined #RubyOnRails
[11:15:37] kerunaru: Anyway, I don't set the secret from the env var for development, but only for production (the default rails configuration)
[11:16:02] pawnbox: has joined #RubyOnRails
[11:16:05] fox_mulder_cp: kerunaru: you answer on my question?
[11:16:23] craysiii: has joined #RubyOnRails
[11:16:36] blackchalk: has joined #RubyOnRails
[11:17:01] fox_mulder_cp: irssi crashed, so i read only your last msg (
[11:17:17] kerunaru: You must to set that environment variable in your system. It's done this way for security reasons.
[11:17:24] kerunaru: That's the previous message
[11:18:06] fox_mulder_cp: yes, i do it SECRET_KEY_BASE=`rake secret`; rails server -b 0.0.0.0 -p 8000 and set RAILS_ENV=development \
[11:18:34] fox_mulder_cp: before puma starts, yes
[11:18:58] astrofog: has joined #RubyOnRails
[11:19:00] konsolebox: has joined #RubyOnRails
[11:20:13] fox_mulder_cp: i think, that hardcoded secret keys - bad idea, after restart app with updated code users must auto-relogon
[11:21:26] blackchalk: ACTION tests 1 2 3
[11:21:59] craysiii: has joined #RubyOnRails
[11:22:50] craysiii: has joined #RubyOnRails
[11:25:26] adaedra: fox_mulder_cp: because you must have a fixed secret key, which you put into this environment variable.
[11:25:59] adaedra: If you change it (regenerating one with rake secret), all sessions become invalid.
[11:26:34] mrbubbles: has joined #RubyOnRails
[11:28:43] Dimka: has joined #RubyOnRails
[11:28:54] Brando753: has joined #RubyOnRails
[11:30:13] Rodya_: has joined #RubyOnRails
[11:30:36] ishamo: has joined #RubyOnRails
[11:30:54] riddled: has joined #RubyOnRails
[11:33:27] pyemkey: has joined #RubyOnRails
[11:33:28] ericfreese: has joined #RubyOnRails
[11:34:20] arup_r: blackchalk: 4 5 6 ( Yes we can see you )
[11:37:26] blackchalk: arup_r: thanks for the heads-up!
[11:37:42] mbreedlove: has joined #RubyOnRails
[11:37:52] arup_r: blackchalk: yeah, my head is very strong. Like a bull! :p
[11:41:15] blackchalk: hello to all rails newbie here! decided to learn using rails a week ago. Now doing my first rails server cmd. :) gl to me.
[11:43:06] Dimka: has left #RubyOnRails: ()
[11:43:07] tbuehlmann: blackchalk, good to hear!
[11:44:19] herbst: has joined #RubyOnRails
[11:44:45] Macaveli: has joined #RubyOnRails
[11:46:33] StaticVoid: Hello All, if I have a nested hash, is it possible to access the nested elements direct? Or do I first need to extract the nested hash?
[11:47:11] cornerman: has joined #RubyOnRails
[11:47:11] fox_mulder_cp: adaedra: i know, and i want drop sessions after reload app
[11:48:18] cornerman: has joined #RubyOnRails
[11:48:28] fox_mulder_cp: blackchalk: i recommend read rails in actions (simple task tracker), rails tutorials (simple blog) and agile web development with rails 4 (simple online store)
[11:48:51] voidDotClass: has joined #RubyOnRails
[11:48:59] voidDotClass: I have a site where most of the functionality is behind different login areas, e.g an admin area, a buyer area, a seller area, etc. how can i write rspec feature tests for it it so for all the features in admin area, it logs in as admin first, then logs out and logs back in as buyer for the buyer features, and so on?
[11:49:13] cornerman: has joined #RubyOnRails
[11:49:34] fox_mulder_cp: voidDotClass: capybara + rspec, as example.
[11:49:39] rvanlieshout: voidDotClass: each test is run using a new session, so you shouldn't have to sign out again
[11:50:38] oded: has joined #RubyOnRails
[11:50:50] steharro: has joined #RubyOnRails
[11:51:17] voidDotClass: rvanlieshout, so each 'feature' is in its own test? or each 'it' block?
[11:51:30] cornerman: has joined #RubyOnRails
[11:54:40] Dimka: has joined #RubyOnRails
[11:58:02] pyemkey: has joined #RubyOnRails
[11:58:15] arup_r: has joined #RubyOnRails
[11:59:16] pawnbox: has joined #RubyOnRails
[12:01:03] arup_r: has joined #RubyOnRails
[12:02:15] stamina: has joined #RubyOnRails
[12:02:19] atomical: has joined #RubyOnRails
[12:03:10] djellemah_: has joined #RubyOnRails
[12:05:46] allcentury: has joined #RubyOnRails
[12:05:47] mices: does anyone know the methods of the participants method in mailboxer
[12:06:07] rvanlieshout: the methods of a method?
[12:06:12] artto: has joined #RubyOnRails
[12:06:16] mices: i can't just print participant because it's an array and i don't know what's in it
[12:06:21] fox_mulder_cp: mices: i think about api site :)
[12:06:41] pawnbox: has joined #RubyOnRails
[12:06:48] mices: conversation.participants.each do |participant|
[12:07:01] mices: then i can't just print participant, its a hash
[12:07:25] mices: i tried participant.name and it still printed a hash
[12:07:32] rvanlieshout: what is participant.class.inspect
[12:08:04] jeanre: has joined #RubyOnRails
[12:09:44] Cohedrin: has joined #RubyOnRails
[12:09:51] chrisarcand: voidDotClass: You've asked a ton of very broad questions in multiple channels; I'm not saying 'don't ask questions', but my advice is that you should look up some resources on Ruby and RSpec a bit more before you start asking here. Many of the questions you have are easily found in the READMEs for the various tools you're using and/or very common stackoverflow answers for your error messages.
[12:10:03] pyemkey: has joined #RubyOnRails
[12:10:27] chrisarcand: I think you'd find it would serve you better and faster, really.
[12:10:32] voidDotClass: chrisarcand, i have actually read all the docs & didn't find this info
[12:10:40] voidDotClass: my question is pretty specific
[12:11:19] voidDotClass: how would i have gotten this far from not knowing ruby 3 days ago without reading docs?
[12:12:04] astrofog: has joined #RubyOnRails
[12:12:10] rvanlieshout: copy paste :)
[12:12:16] rvanlieshout: but each test starts over with a fresh db and fresh session
[12:12:19] chrisarcand: voidDotClass: http://stackoverflow.com/questions/4229756/adding-controller-macros-in-rspec
[12:12:20] sinkensabe: has joined #RubyOnRails
[12:12:21] rvanlieshout: so you'll have to login for each test
[12:12:43] chrisarcand: voidDotClass: http://stackoverflow.com/questions/15479924/rspec-controller-macro-not-working
[12:13:14] chrisarcand: tldr: Make a method that logs in your user. Call that method in appropriate tests
[12:13:32] rodfersou: has joined #RubyOnRails
[12:13:45] Papierkorb: if you're using a authentication gem, like Devise, there is probably already something built for you
[12:14:03] hannelita: has joined #RubyOnRails
[12:14:26] chrisarcand: voidDotClass: You're welcome. Good luck!
[12:15:32] chrisarcand: voidDotClass: And yes, note that when I said 'make a method', if you're using something common like devise that method should use helpers that devise provides +1 Papierkorb
[12:15:56] kitsuneyo: has joined #RubyOnRails
[12:16:11] voidDotClass: yeah i have a helper setup. i'm jw if it'd break stuff if it has to login for *every* test
[12:16:14] avril14th: Hey, guys, I have 2 after_commit callbacks but I really can't figure out why the second is never called. https://gist.github.com/muichkine/f515f9baccbb339c376a
[12:17:20] kitsuneyo: what's with date_select? how do i control the individual year, month and day fields ?
[12:17:23] rvanlieshout: avril14th: because the first returns false?
[12:17:50] jeanre: has joined #RubyOnRails
[12:18:01] herbst: has joined #RubyOnRails
[12:18:02] herbst: has joined #RubyOnRails
[12:18:13] avril14th: hmm, let me try forcing true
[12:18:15] avril14th: one the firstr
[12:20:05] chrisarcand: avril14th: I don't recall exactly but after_commit might be in LIFO order? Are you sure they just aren't in the order you expect? Might try adding prepend: true to the second one and seeing what happens.
[12:20:37] bronson: has joined #RubyOnRails
[12:20:43] paulodiniz: has joined #RubyOnRails
[12:20:58] avril14th: rvanlieshout: the first one returns true (forced) and still second is not called
[12:21:04] FooMunki: has joined #RubyOnRails
[12:21:15] avril14th: chrisarcand: OMG! where did you read that?!
[12:23:30] techsethi: has joined #RubyOnRails
[12:23:34] avril14th: chrisarcand: doc seems to say it's in the order its declared
[12:23:56] chrisarcand: I just remember having some ordering issue in the past, quite a while ago. It might have been changed since then, but thought I'd mention anyway. Good!
[12:24:01] jeanre: has joined #RubyOnRails
[12:24:15] arup_r: avril14th: see the order http://api.rubyonrails.org/classes/ActiveRecord/Callbacks.html
[12:24:48] kitsuneyo: i read about select_year etc but i can't seem to get those to work xxxx
[12:25:10] avril14th: okay, I found my mistake. Some random crap throw it some meta programming stuff was overriding the method.
[12:25:33] avril14th: ACTION auto greets for writing the bug and the fix
[12:25:44] herbst: has joined #RubyOnRails
[12:27:37] yfeldblum: has joined #RubyOnRails
[12:27:49] quazimodo: has joined #RubyOnRails
[12:27:51] quazimod1: has joined #RubyOnRails
[12:28:52] pyemkey: has joined #RubyOnRails
[12:28:56] pydave6367: has joined #RubyOnRails
[12:29:40] jeanre: has joined #RubyOnRails
[12:29:53] arBmind: has joined #RubyOnRails
[12:29:54] avril14th: btw after commit are all run whatever happens, same for rollbacks
[12:30:50] pyemkey_: has joined #RubyOnRails
[12:30:56] Rodya_: has joined #RubyOnRails
[12:32:40] StaticVoid: has joined #RubyOnRails
[12:32:52] lethjakman-l: has joined #RubyOnRails
[12:33:28] Meow-J: has joined #RubyOnRails
[12:39:56] myntcake: has joined #RubyOnRails
[12:40:31] Moeh: has joined #RubyOnRails
[12:41:02] nfk: has joined #RubyOnRails
[12:42:15] Moeh: What is the rails best practice to store configuration data that can regularly change for an entity. Say I have a Chart entity and would like to store its configuration where I would often add or remove fields. Shall I serialize chart.configuration and store it to a "configuration" database column? Or should the configuration be an ActiveModel? Would be great to get some guidance.
[12:42:45] ql6wlld: has joined #RubyOnRails
[12:43:06] rvanlieshout: who changes it?
[12:43:24] Moeh: The user
[12:45:36] wethu: has joined #RubyOnRails
[12:45:42] pyemkey: has joined #RubyOnRails
[12:47:06] SanguineAnomaly: has joined #RubyOnRails
[12:47:37] rvanlieshout: how much config is it?
[12:47:40] rvanlieshout: using postgres?
[12:49:21] Moeh: rvanlieshout: Probably between 5-20 fields. Yes, we are using postgres.
[12:49:29] rvanlieshout: you could consider a json or hstore field then
[12:50:11] steharro: has joined #RubyOnRails
[12:50:16] Papierkorb: I'd also use a JSONB column for that
[12:50:17] rvanlieshout: no need to serialize
[12:50:22] Jasaka|NA: has joined #RubyOnRails
[12:50:30] paulodiniz: has joined #RubyOnRails
[12:50:40] Moeh: I though about that. However, that would require me to write all value validation myself, correct? If I use ActiveModel, I could use the built in rails validations.
[12:51:21] Papierkorb: If you can do that, you could as well use a column for each configuration in that Chart model
[12:51:32] Papierkorb: (or w/e you have)
[12:52:38] Moeh: Yes, that is the current configuration. One column for each field. However it seems to be quite clunky if the fields change from time to time.
[12:53:35] Papierkorb: But that's not much different from outsourcing the config into its own table? Not to mention that yes indeed, the (unneccessary) second SELECT adds time. Not significantly, but to me it's splitting stuff that belongs together
[12:53:54] arup_r: Moeh: witj JSONB and store_acessor method in together, you can take benefits of Rails own validations..
[12:54:08] arup_r: JSONB/Hstore any
[12:55:11] Papierkorb: I'd skip HSTORE tbh. JSON is superior, it supports any data types without additional serialization or other string scocery
[12:56:06] Moeh: arup_r: Yes, I am looking at http://nandovieira.com/using-postgresql-and-jsonb-with-ruby-on-rails right now and that seems quite exactly matching what we want. So I would create a JSONB column and use store_accessor to access the fields.
[12:56:55] herbst: has joined #RubyOnRails
[12:57:23] arup_r: " that would require me to write all value validation myself," - your this line forced me to say, you can do it and you need an extra tool :D
[12:57:43] arup_r: which is store_acessor
[12:58:00] jvanbaarsen: has joined #RubyOnRails
[13:00:11] Moeh: Jep, sounds very good.
[13:00:24] Moeh: Will try that
[13:00:44] Moeh: Thanks a lot for your help guys. Always appreciated :)
[13:01:31] paulodiniz: has joined #RubyOnRails
[13:02:07] northfurr: has joined #RubyOnRails
[13:03:04] arup_r: now, I have one question though. What mental reasoning you people employ when choose between JSON and Hstore ? I always picked either one randomly, without employing any reasoning.. What differences are there? Would you mind to share ?
[13:03:37] arup_r: I find both can be indexed and queired and ended up in Rails Hash
[13:04:23] StaticVoid: Hello All, if I have a nested hash, is it possible to access the nested elements direct? Or do I first need to extract the nested hash?
[13:04:59] adaedra: you can chain [] calls, i.e. a[:b][:c]
[13:05:51] StaticVoid: adaedra: thanks, let me look into that
[13:05:56] BradenBraden: has joined #RubyOnRails
[13:07:02] ornerymoose: has joined #RubyOnRails
[13:07:14] Tinyyy: has joined #RubyOnRails
[13:09:19] arup_r: StaticVoid: some examples http://stackoverflow.com/questions/5544858/accessing-elements-of-nested-hashes-in-ruby from Google :)
[13:09:28] Papierkorb: arup_r: I always choose JSON. HStore offers no benefit over JSON, especially when you consider extending the code later on. You quickly want to store stuff like integers, and with hstore, it's a string. so you'd need to serialize this, which I meant with 'string scorcery'
[13:09:59] StaticVoid: arup_r: thanks so much, checking those out!
[13:10:06] Papierkorb: arup_r: With JSON this is a non-issue. Does not solve issues with e.g. Timestamps of course, but where JSON is not perfect for this, HStore is worse :)
[13:10:34] Papierkorb: StaticVoid, arup_r, Ruby 2.3 has the #dig method for that
[13:11:02] arup_r: yes, about to say the #dig. Just remembered it
[13:11:11] krz: has joined #RubyOnRails
[13:11:26] Papierkorb: arup_r, StaticVoid, try this in Ruby2.3: { foo: [ 4, 5, 6 ] }.dig :foo, 2 #=> 6
[13:11:30] Jasaka: has joined #RubyOnRails
[13:11:58] StaticVoid: Papierkorb: thx
[13:14:50] kitsuneyo: how do i get a js script to grab a field from an active model record? say i have a js script selector.js running on an edit form for @profile records. how do i get @profile.name in selector.js?
[13:14:52] arup_r: so if I store {a: 1, b: 'me' } to a JSONB column, and then fetch it back, I will get value of a as `1` not `'1'` .. ? This is you meant right ?
[13:14:56] arup_r: Papierkorb: ^^
[13:15:04] pyemkey: has joined #RubyOnRails
[13:15:16] Pazician: has joined #RubyOnRails
[13:15:16] arup_r: If so, this is the nice thing I was not aware of.
[13:15:58] srinidhi: has joined #RubyOnRails
[13:16:03] Papierkorb: arup_r: Correct, as it's just good-old JSON to you. You send a JSON serialized document to the DB while writing (or, AR does it for you :) ), and the DB sends you a JSON serialized document back on SELECTing (Again, AR does the transformation for you here)
[13:17:31] Papierkorb: People in #postgresql (Good channel btw too) always tell you, when asked, to prefer JSONB over JSON columns, as the increased storage and read times are neglibible compared to the benefits you gain.
[13:18:12] Papierkorb: I don't have to use a NoSQL DBMS because that stuff in PSQL handles all use-cases I have
[13:18:52] Papierkorb: (Note that of course, you could always store JSON in a TEXT column, but JSONB allows you to also search for stuff in JSON documents, including indexing the data and so on)
[13:19:29] arup_r: Papierkorb: you convinced me.. thanks :)
[13:19:34] Limix: has joined #RubyOnRails
[13:19:40] paulodiniz: has joined #RubyOnRails
[13:20:36] arup_r: I was using them alternately .. without any reasoning .. Haha
[13:21:44] BradenBraden: has left #RubyOnRails: ("Leaving")
[13:22:55] Madmanden: has joined #RubyOnRails
[13:23:47] Ergo^: has joined #RubyOnRails
[13:30:30] jeanre: has joined #RubyOnRails
[13:30:36] hanneli: has joined #RubyOnRails
[13:31:42] jkamenik: has joined #RubyOnRails
[13:31:44] Rodya_: has joined #RubyOnRails
[13:32:20] hannelita: has joined #RubyOnRails
[13:34:32] techsethi: has joined #RubyOnRails
[13:35:07] ericfreese: has joined #RubyOnRails
[13:42:03] pvertenten: has joined #RubyOnRails
[13:42:27] allcentury: has joined #RubyOnRails
[13:46:23] solars: anyone got an idea: if I use pluck(:col_a, :col_b) what's the fastest way to convert this nested array into a hash {res_a: res_b}?
[13:46:36] cullen: has joined #RubyOnRails
[13:47:22] pyemkey: has joined #RubyOnRails
[13:48:37] Papierkorb: solars: #to_h
[13:48:42] arup_r: has joined #RubyOnRails
[13:48:47] Papierkorb: solars: as in .pluck(:a, :b).to_h
[13:48:56] Papierkorb: four letters. I think that's pretty fast :P
[13:49:23] lethjakman-l: has joined #RubyOnRails
[13:50:26] solars: ha I knew there is something, but only tried .to_hash :)
[13:50:41] stannard: has joined #RubyOnRails
[13:53:10] solars: one more thing related to pluck, if I pluck a lot of results, is there something I can do it in batches too? to avoid memory problems
[13:53:24] solars: I think find_each and pluck cannot be combined
[13:54:20] arup_r: solars: but http://api.rubyonrails.org/classes/ActiveRecord/Batches.html#method-i-find_in_batches and pluck :)
[13:56:01] lipoqil: has joined #RubyOnRails
[13:56:34] mbreedlove: has joined #RubyOnRails
[13:56:38] solars: arup_r, hmmm how?
[13:57:12] peeja: has joined #RubyOnRails
[13:58:58] arup_r: solars: sorry `.map` .. User.find_in_batches { |u| p u.map(&:id) } # [1, 4, 9, 13, 17]
[14:00:08] solars: ah yes, that of course, I just thought I can skip the instantiation as with pluck
[14:00:11] atomical: has joined #RubyOnRails
[14:00:15] arup_r: yes, I have only 5 users in my DB :p local db that is.. don't think my app is not popular ;)
[14:00:45] tbuehlmann: solars, are you working things off or what are you doing?
[14:00:52] arup_r: .find_in_batches gives inside the block Array, so `.pluck` can't be there
[14:00:53] solars: arup_r, haha
[14:01:01] solars: arup_r, yes
[14:01:07] solars: tbuehlmann, how do you mean off?
[14:01:13] solars: it's an export
[14:02:07] tbuehlmann: don't see why you would use find_in_batches then
[14:02:49] solars: rather pluck_in_batches
[14:03:31] solars: it's a lot of results, I thought it could cause problems if I use .pluck
[14:03:41] solars: tbuehlmann, ^
[14:04:01] dionysus69: has joined #RubyOnRails
[14:04:09] tbuehlmann: that stuff is in memory, one way or another
[14:05:21] joshkovach: has joined #RubyOnRails
[14:05:40] solars: hmm why? you mean because it would only be relevant when instantiating?
[14:05:58] avril14th: rvanlieshout: optimistic locking works like a charm, thx. I finally did find my bug, it was in ActiveRecord and already reported: after_commit don't run in the proper order
[14:06:05] solars: I'm not sure if it is, if I write to a file directly
[14:06:18] rvanlieshout: avril14th: awesome
[14:06:25] rvanlieshout: avril14th: do the docs say that it should run in a particular order?
[14:06:48] avril14th: rvanlieshout: it's expected to run in the order of declaration. just like any other callback
[14:06:56] solars: tbuehlmann, or can you enlighten me
[14:07:03] avril14th: rvanlieshout: https://github.com/rails/rails/issues/20911
[14:07:07] rvanlieshout: avril14th: agreed, but the docs don't say anything about it?
[14:07:33] avril14th: rvanlieshout: docs don't specify anything special for after_commit, except that all are run be there exceptions or whatever
[14:07:35] tbuehlmann: solars, different story when you save in a file
[14:08:12] arup_r: solars: what RDBMS you are using btw ?
[14:08:13] avril14th: that also makes me think I should really opensource my worker chain gem.
[14:08:41] solars: arup_r, pgsql
[14:08:50] solars: tbuehlmann, sorry, that's what I meant with export
[14:08:53] arup_r: solars: you want to export that's it right ?
[14:09:19] solars: it's not really an issue, I just wondered if there is something like pluck_in_batches - according to google people were looking for it
[14:09:23] arup_r: please check the native `copy` command of the Psql and you will be amazed by it
[14:09:44] solars: I know it, but in this project cannot rely on the db :)
[14:09:53] arup_r: oh, I see :(
[14:09:58] solars: thanks though
[14:09:58] wethu: has joined #RubyOnRails
[14:10:12] hannelita: has joined #RubyOnRails
[14:10:47] peeja: has joined #RubyOnRails
[14:10:59] weckl: has joined #RubyOnRails
[14:11:14] kt2: has joined #RubyOnRails
[14:13:03] nettoweb: has joined #RubyOnRails
[14:16:35] aaronr: has joined #RubyOnRails
[14:16:42] pyemkey: has joined #RubyOnRails
[14:18:26] pvertenten: has joined #RubyOnRails
[14:21:08] mrgreenfur: has joined #RubyOnRails
[14:21:42] puria: has joined #RubyOnRails
[14:21:47] tvw: has joined #RubyOnRails
[14:23:28] zpe: has joined #RubyOnRails
[14:24:58] sdwrage: has joined #RubyOnRails
[14:25:12] pydave6367: has joined #RubyOnRails
[14:25:48] zpe: has joined #RubyOnRails
[14:26:09] mbreedlove: has joined #RubyOnRails
[14:27:57] jeanre: has joined #RubyOnRails
[14:30:20] B1n4r10: has joined #RubyOnRails
[14:30:38] pyemkey: has joined #RubyOnRails
[14:32:52] Rodya_: has joined #RubyOnRails
[14:32:55] pyemkey: has joined #RubyOnRails
[14:33:23] rodfersou: has joined #RubyOnRails
[14:37:57] Fly80: has joined #RubyOnRails
[14:38:04] orikremer: has joined #RubyOnRails
[14:41:13] sinkensabe: has joined #RubyOnRails
[14:43:27] C0r3: has joined #RubyOnRails
[14:44:10] mbreedlove: has joined #RubyOnRails
[14:44:28] sankaber: has joined #RubyOnRails
[14:45:37] artto: has joined #RubyOnRails
[14:45:43] Fly80: has left #RubyOnRails: ("Leaving")
[14:46:41] C0r3: Guys, I have an app with `users` table and `items` table, and they have been polymorphically associated to `photos` table the database. I want to know, which is the best place (directory in app) to store the User and Item photos??
[14:48:04] eljimmy: has joined #RubyOnRails
[14:48:58] flashpoint9: has joined #RubyOnRails
[14:49:06] stannard: has joined #RubyOnRails
[14:49:08] rvanlieshout: C0r3: should they be accessible through web?
[14:50:03] C0r3: rvanlieshout: Yes! They are like profile photos. Every user and item can have only one photo each.
[14:50:10] lethjakman-l: has joined #RubyOnRails
[14:50:20] jkamenik: has joined #RubyOnRails
[14:50:20] rvanlieshout: then in public
[14:50:54] C0r3: rvanlieshout: I'm wondering whether to create a new folder in the public directory for every new user who registers? Or shall I put them all in one place?
[14:51:35] sankaber: has joined #RubyOnRails
[14:51:45] rvanlieshout: have carrierwave take care of that :)
[14:52:39] C0r3: carrierwave?? Is it a gem? Sorry, I didn't hear that before, I'm new to rails. Can you please explain a bit about it?
[14:52:49] rvanlieshout: it's an awesome gem
[14:53:10] mrbubbles: has joined #RubyOnRails
[14:53:16] rvanlieshout: it can even handle redisplay of your form
[14:54:17] stannard: has joined #RubyOnRails
[14:54:21] hannelita: has joined #RubyOnRails
[14:54:28] mikecmpbll: has joined #RubyOnRails
[14:54:30] C0r3: I see... I'll check it out. I have some more questions.
[14:54:32] C0r3: rvanlieshout: Is there any nice gem that can handle the messaging system for my application??
[14:54:55] rvanlieshout: ruby-toolbox.com
[14:55:45] C0r3: rvanlieshout: Thank you so much.
[14:56:53] a1fa: should validate: ... .. :if occur during validate?
[14:57:02] a1fa: as long as if statement returns true?
[14:57:24] a1fa: (valid?)
[14:57:48] a1fa: validate: :test, present: true, if: status_id == 1
[14:57:56] rvanlieshout: something like that, but in a proc
[14:58:20] a1fa: but if i do model.valid? it skips this validate
[14:58:30] pyemkey: has joined #RubyOnRails
[14:58:32] rvanlieshout: that's because it's in a wrong format
[14:59:11] rvanlieshout: a1fa: http://guides.rubyonrails.org/active_record_validations.html#conditional-validation
[14:59:51] a1fa: ah i see
[14:59:53] a1fa: thanks rvanlieshout
[15:01:02] workmad3: has joined #RubyOnRails
[15:01:37] a1fa: same thing tho
[15:01:49] a1fa: returns model.valid? true
[15:01:55] rvanlieshout: what did you try?
[15:02:07] bmalum: has joined #RubyOnRails
[15:03:04] a1fa: validates :test, presence: true, if: status10?
[15:03:14] rvanlieshout: yeah. that's wrong
[15:03:17] rvanlieshout: anyway.. got to go
[15:03:26] rvanlieshout: back monday CET
[15:04:49] nettoweb: has joined #RubyOnRails
[15:04:57] dionysus69: has joined #RubyOnRails
[15:08:13] _Tariq: has joined #RubyOnRails
[15:09:13] mordof_work: has joined #RubyOnRails
[15:10:01] chipotle: has joined #RubyOnRails
[15:10:12] reckoner: has joined #RubyOnRails
[15:11:42] momomomomo: has joined #RubyOnRails
[15:11:56] jheath: has joined #RubyOnRails
[15:12:20] mordof_work: has joined #RubyOnRails
[15:13:10] cullen: has joined #RubyOnRails
[15:13:21] a1fa: still not sure how to do this, and why its returning true for valid?
[15:14:00] rubyonrailed: has joined #RubyOnRails
[15:17:40] a1fa: am i doing this wrong? http://guides.rubyonrails.org/active_record_validations.html#conditional-validation i like #5.4 section of doing if, but this still returns .valid? = true
[15:18:08] pawnbox: has joined #RubyOnRails
[15:18:15] arup_r: a1fa: your gist again ?
[15:18:29] xardion: has joined #RubyOnRails
[15:19:07] Moeh_: has joined #RubyOnRails
[15:19:22] arup_r: show the code and input which you think shouldn't be valid, but eventually the code is saying it is valid. You might be some where wrong in understanding.
[15:19:25] eljimmy: has joined #RubyOnRails
[15:19:28] a1fa: arup_r: i'm literally using the example
[15:19:37] flov: has joined #RubyOnRails
[15:20:11] Moeh_: arup_r: I tried the approach of using jsonb and store_accessor, however I always get the value as string back. Is there a way to define the type of a accessor so that if I store an integer, I also get an integer back?
[15:20:34] arup_r: a1fa: this validate: :test, present: true, if: status_id == 1 is not valid
[15:20:48] arup_r: try validate: :test, present: true, if: -> { status_id == 1 }
[15:21:03] paulodiniz: has joined #RubyOnRails
[15:21:05] arup_r: try validate: :test, present: true, if: ->(ob) { ob.status_id == 1 }
[15:21:43] arup_r: your code is wrong, your correct code is validate: :test, present: true, if: "status_id == 1"
[15:21:50] arup_r: or what I said above
[15:22:00] arup_r: first fix that and say what you are seeing
[15:22:11] bronson: has joined #RubyOnRails
[15:22:42] build22: has joined #RubyOnRails
[15:22:56] a1fa: arup_r: same thing
[15:23:03] pyemkey: has joined #RubyOnRails
[15:23:38] arup_r: and still if you see the valie.. then the status seems not 1 .. add `puts` like validate: :test, present: true, if: -> { puts atatus; status_id == 1 }
[15:23:48] arup_r: and see what it is printing
[15:24:05] nerfando: has joined #RubyOnRails
[15:24:07] a1fa: model.valid?
[15:24:22] pawnbox_: has joined #RubyOnRails
[15:24:49] arup_r: what value `puts` printing ? I hope it is anything but not `1`
[15:25:16] arup_r: and that's wny your that validation is not running.. because if: evaluates to `false`
[15:25:57] a1fa: arup_r: i found the problem
[15:26:12] arup_r: Moeh_: as Papierkorb said, I didn't try yet, that if you use JSON or JSONB, you will get back the real value..
[15:26:27] arup_r: a1fa: You should :)
[15:26:38] pawnbox: has joined #RubyOnRails
[15:26:42] a1fa: arup_r: status_id was being reset prior to valid?
[15:26:55] a1fa: +1 for console
[15:27:26] arup_r: `puts` is your friend in devlopment env, use it when you need to go inside
[15:28:12] a1fa: does puts get outputed to the dev log?
[15:28:13] arup_r: Moeh_: but yes, still there is a light, you know ? :)
[15:28:17] dtordable: has joined #RubyOnRails
[15:28:22] arup_r: a1fa: yes it does
[15:28:35] Cork: what is the best way to have assets include a js file only in production?
[15:28:45] jeanre: has joined #RubyOnRails
[15:29:29] arup_r: Cork: do you have application.js.erb or only application.js ?
[15:29:40] Cork: application.js
[15:30:08] emachnic: has joined #RubyOnRails
[15:30:17] arup_r: Moeh_: You can override the getters, defined by store_accessor .. go the below of the doc link i gave you.. there they have shown how
[15:30:35] arup_r: in that way, you can transform the value to your like always..
[15:31:17] a1fa: cool thanks arup_r
[15:31:23] arup_r: Cork: with erb you can set like <% #require some_js if Rails.env.production %>
[15:31:42] kerunaru: has joined #RubyOnRails
[15:31:50] arup_r: but wouldn't work with application.js extension. dunno know any better idea
[15:32:09] mrtomme: has joined #RubyOnRails
[15:32:14] loister: has joined #RubyOnRails
[15:32:16] dionysus70: has joined #RubyOnRails
[15:32:38] arup_r: Moeh_: You here, or your left me alone here in this dark room ? :p
[15:33:03] Moeh_: arup-r: I am here, just thinking :)
[15:33:09] Moeh_: ups, arup_r
[15:33:26] arup_r: did u go to the below of the link... there is the solution for you..
[15:33:29] Rodya_: has joined #RubyOnRails
[15:34:06] yardenbar: has joined #RubyOnRails
[15:34:18] gbgdev: has joined #RubyOnRails
[15:34:42] Dfoolz: has joined #RubyOnRails
[15:34:43] loister: has left #RubyOnRails: ()
[15:34:50] sonofdirt: has joined #RubyOnRails
[15:35:03] mbreedlove: has joined #RubyOnRails
[15:35:15] leex: has joined #RubyOnRails
[15:35:17] smathy: has joined #RubyOnRails
[15:36:02] volume166: has joined #RubyOnRails
[15:36:23] ericfreese: has joined #RubyOnRails
[15:36:30] mordof_work: has joined #RubyOnRails
[15:37:00] Cork: arup_r: doesn't seam to work...
[15:37:50] Scient: has joined #RubyOnRails
[15:38:02] arup_r: Cork: http://stackoverflow.com/a/5574662
[15:38:22] arup_r: or what I said but more better than me http://stackoverflow.com/a/3711724
[15:38:37] aegis3121: has joined #RubyOnRails
[15:38:38] veloutin: has joined #RubyOnRails
[15:39:04] eljimmy: has joined #RubyOnRails
[15:39:17] Cork: oh, the defaults one looks interesting
[15:39:22] adavia: has joined #RubyOnRails
[15:40:14] arup_r: Cork: I love you and #jquery both :)
[15:40:47] grassass: has joined #RubyOnRails
[15:41:30] arup_r: brb, fellows .. time to go for dinner
[15:42:36] Janno: has joined #RubyOnRails
[15:42:58] pyemkey: has joined #RubyOnRails
[15:44:27] cornerman: has joined #RubyOnRails
[15:45:39] eljimmy: has joined #RubyOnRails
[15:45:50] silverdust: Which of the answers here on using m:n relationship should I follow https://stackoverflow.com/questions/4394803/rails-model-belongs-to-many
[15:45:56] blackchalk: has joined #RubyOnRails
[15:46:29] silverdust: I already started with the first (Jaime) and created the migration but what I ponder is how I may query without a table
[15:46:30] blackchalk: hey guys. anyone who could help me fix Application Error
[15:46:34] silverdust: *without a model
[15:46:44] Yomero2: has joined #RubyOnRails
[15:46:53] Moeh_: arup_r: Yes, that would have been possible, but I did not want to write all the custom methods. However I found https://github.com/byroot/activerecord-typedstore which does exactly what I need
[15:47:05] ddv: silverdust: easy you create a join model
[15:47:10] silverdust: He seemed to have been saying has_may through does too much
[15:47:27] silverdust: ddv: So you think I should go with the first?
[15:48:13] silverdust: I think it's what I need but I wouldn't want to do something that's against generally accepted practice
[15:48:13] ddv: silverdust: no I would use has_many through, because it's easy and the rails style guide prefers it
[15:48:24] blackchalk: ..following railstutorial and im at deploying it to heroku but viewing the app gives me an application error in the web. checking logs. seems like h10;app crashed, anyone who experienced this?
[15:48:32] silverdust: okay. That's what I wanted to be sure of
[15:48:49] ddv: silverdust: https://github.com/bbatsov/rails-style-guide#has-many-through
[15:50:04] tubbo: blackchalk: why did the app crash?
[15:51:53] pawnbox: has joined #RubyOnRails
[15:52:45] A124: has joined #RubyOnRails
[15:53:29] blackchalk: tubbo: i have no idea. this is just a simple hello world. localhost is fine. but opening App from heroku after deployment gives me an App Error
[15:54:00] pawnbox: has joined #RubyOnRails
[15:54:05] girly_dev: has joined #RubyOnRails
[15:54:12] TheDracle: has joined #RubyOnRails
[15:56:16] tubbo: blackchalk: so in your logs it just goes "State changed from starting to up" and then right below that it says "State change from up to crashed"? nothing in between? no log messages, no errors, nothing?
[15:57:41] paulodiniz: has joined #RubyOnRails
[15:58:23] shinnya: has joined #RubyOnRails
[15:58:27] TheDracle: has joined #RubyOnRails
[16:00:35] blackchalk: tubbo: yeah seems like that. everythings is color blue, and then it changes to yellow [router] from [web.1]
[16:01:13] blackchalk: telling that there is an error code=h10 etc.
[16:02:12] tibra: has joined #RubyOnRails
[16:02:44] jeanre: has joined #RubyOnRails
[16:03:21] blackchalk: is it possible that part of my Gemfile was not read or executed?eg: my production group w/ includes pg gem and rails_12factor?
[16:04:15] codepete: has joined #RubyOnRails
[16:04:56] ornerymoose: has joined #RubyOnRails
[16:05:58] _Tariq: has joined #RubyOnRails
[16:07:00] pawnbox: has joined #RubyOnRails
[16:07:13] tibra: has joined #RubyOnRails
[16:07:44] pyemkey: has joined #RubyOnRails
[16:07:47] Mediogre: has joined #RubyOnRails
[16:09:24] _Tariq: has joined #RubyOnRails
[16:11:08] lacrymology: has joined #RubyOnRails
[16:14:06] arup_r: has joined #RubyOnRails
[16:15:35] ornerymoose: has joined #RubyOnRails
[16:16:33] mordof_work: has joined #RubyOnRails
[16:16:57] podman: has joined #RubyOnRails
[16:17:35] lacuna: has joined #RubyOnRails
[16:17:36] lacuna: has joined #RubyOnRails
[16:18:04] emachnic: blackchalk: Have you tried running a console on Heroku? `heroku run rails console`
[16:20:12] disgrntld: has joined #RubyOnRails
[16:21:29] rubyonrailed: has joined #RubyOnRails
[16:22:14] ericfreese: has joined #RubyOnRails
[16:22:42] mostlybadfly: has joined #RubyOnRails
[16:23:09] blackchalk: emachnic: yeah earlier. but i don't know what i'm catching here. Well something logs about "Specified 'postgresql' for database adapter, but the gem is not loaded. Add 'gem pg' so and so.."
[16:25:01] DaniG2k: has joined #RubyOnRails
[16:25:15] tubbo: blackchalk: that might be the issue
[16:25:32] kitsuneyo: has joined #RubyOnRails
[16:25:53] tubbo: blackchalk: did you do what was instructed? remember that you need that gem installed even if e.g. localhost is using a different db
[16:26:16] TheDracle: has joined #RubyOnRails
[16:26:22] tubbo: blackchalk: for example, if you used sqlite in development but want to use a "real db" like postgres in production, but you didn't add `gem 'pg'` to your Gemfile, you would only get this error when RAILS_ENV=production.
[16:27:22] chouhoulis: has joined #RubyOnRails
[16:27:24] tubbo: blackchalk: to avoid issues like this and make deployment a little easier, most devs opt to use the same DB everywhere these days. sqlite isn't as popular as just installing mysql/postgres in development. you can also test out what happens when the schema changes and use more advanced DB features by choosing a DB to run in all environments.
[16:27:40] blackchalk: tubbo: emachnic: yeah followed each step. got a group: production do those gem pg installed apart from group dev
[16:28:24] tubbo: blackchalk: ok so what happens when you `bundle` (to create the Gemfile.lock) and then push to heroku?
[16:29:16] kitsuneyo: is there like a standard regex to filter unsafe charatcers out of rails form text fields?
[16:29:37] tubbo: kitsuneyo: there's a helper method called `sanitize`
[16:29:47] tubbo: that will escape html and stuff from the render
[16:29:52] tubbo: oh from a form text field? sorry, no
[16:30:01] tubbo: kitsuneyo: what do you mean by "unsafe characters"?
[16:30:15] kitsuneyo: but what if i don't want people to be able to use chars like <, >, / etc
[16:30:58] stannard: has joined #RubyOnRails
[16:31:10] kitsuneyo: i guess i could just write my own with help from rubular, but if there's a safe standard i'd rather use that
[16:31:25] tubbo: kitsuneyo: rails doesn't provide a "standard regex" for dealing with that, not sure if a standard exists (like the way it exists with that massive email address validation RFC)
[16:31:43] kitsuneyo: well not a standard exactly, but one that's maybe widely used
[16:33:10] tubbo: yeah, not sure of one of those either
[16:33:15] tubbo: besides just like /\<
[16:33:20] tubbo: or wait hold on
[16:33:42] tubbo: kitsuneyo: doesn't ruby have a \W regex for detecting word-terminating characters? basically anything non alphanumeric?
[16:33:53] tubbo: i'd start with that
[16:34:11] kitsuneyo: yeah but i need to allow some special chars like ' and -
[16:34:27] Rodya_: has joined #RubyOnRails
[16:35:30] kitsuneyo: [^chars] seems to exclude chars
[16:37:08] Frem: has joined #RubyOnRails
[16:39:04] lethjakman-l: has joined #RubyOnRails
[16:39:40] mary5030: has joined #RubyOnRails
[16:40:42] Sadin: has joined #RubyOnRails
[16:40:43] kitsuneyo: actually i guess this is a bad idea because of all the special characters in non-UK/US names
[16:42:57] kerunaru: How is the correct way to query an external database?
[16:43:17] mordof_work: has joined #RubyOnRails
[16:44:03] kerunaru: It's a sqlite database which I don't own
[16:47:15] steharro: has joined #RubyOnRails
[16:47:26] Limix: has joined #RubyOnRails
[16:47:40] pyemkey: has joined #RubyOnRails
[16:49:20] jowiar: has joined #RubyOnRails
[16:49:55] diegoviola: has joined #RubyOnRails
[16:50:13] arup_r: kerunaru: so they don't have API ?
[16:50:36] arup_r: You will run your SQL query there to fetch data ? -_-
[16:50:49] arup_r: s/run/send
[16:52:02] kerunaru: Maybe I didn't explain myself correctly??? I have the .sqlite file, but I don't maintain the data
[16:54:53] FLeiXiuS: has joined #RubyOnRails
[16:54:54] FLeiXiuS: has joined #RubyOnRails
[16:56:03] tubbo: kerunaru: you can just use the sqlite client to run sql queries on it directly
[16:56:32] chipotle: has joined #RubyOnRails
[16:56:41] stannard: has joined #RubyOnRails
[16:57:04] kerunaru: Just like that? There is no "Rails way"? ????
[16:57:34] claytonzaugg: has joined #RubyOnRails
[16:57:55] kitsuneyo: is there a special way to destroy a straight belongs_to association? can't i just set the field to nil?
[16:57:57] Malgorath: Is there a good free rails hosting service? I'm hoping to not have to run/manage a vps on my own
[16:57:58] stannard: has joined #RubyOnRails
[16:57:58] tubbo: kerunaru: don't know what you're talking about
[16:58:09] arup_r: neither me also
[16:58:09] Papierkorb: kerunaru: Just use the SQLite DB file as database in Rails?
[16:58:10] tubbo: Malgorath: good? i dunno. free? heroku.
[16:58:13] paulodiniz: has joined #RubyOnRails
[16:58:19] myntcake: has joined #RubyOnRails
[16:58:40] tubbo: kerunaru: like are you trying to read from this as a secondary DB? there are ways to get it to work with ActiveRecord but it really depends on how important this DB is to you
[16:58:45] Papierkorb: Malgorath: Heroku offers a free Dyno which runs for some hours of the day
[16:58:53] lacuna: has joined #RubyOnRails
[16:58:53] lacuna: has joined #RubyOnRails
[16:58:58] tubbo: Papierkorb: it runs for all hours :)
[16:59:02] arup_r: kitsuneyo: you mean Fkey field ?
[16:59:11] kitsuneyo: yeah arup_r
[17:00:17] arup_r: ok, u can use a call back then.. like before_destry :set_child_nil in the parent model
[17:00:30] arup_r: and there you set it..
[17:00:32] kerunaru: Yes, tubbo. I only need that sqlite db to retrieve an url. It's quite annoying, I know it??? But that what I need lol
[17:01:04] kerunaru: So, just using the sqlite client will do the thing for what I see
[17:01:05] Malgorath: tubbo, Papierkorb I guess I'll have to get a droplet on DO I guess
[17:01:29] arup_r: kitsuneyo: basiclly what you are looking for is called soft delete. and use https://github.com/rubysherpas/paranoia gem for this
[17:01:50] Papierkorb: tubbo: looked it up, Heroku 'Free' tier: "Must sleep 6 hours in a 24 hour period"
[17:01:56] kitsuneyo: i really don't think i should need a gem to destroy a record association
[17:02:06] polishdub: has joined #RubyOnRails
[17:02:13] kitsuneyo: i'm not even destroying any records here
[17:02:13] arup_r: That is not just a destroy! I am not mad kitsuneyo
[17:02:23] kitsuneyo: lol i know arup_r :)
[17:02:33] arup_r: You are unlinking the child and parent ...
[17:02:53] arup_r: And once you would do it, you will never get it back
[17:03:08] arup_r: You will never know, which child was for which parent
[17:03:12] kitsuneyo: maybe it should be a has_one in that case
[17:03:12] jeanre: has joined #RubyOnRails
[17:03:16] arup_r: that will be a orphan record
[17:03:37] kitsuneyo: because it has 2 belongs_to associations
[17:03:40] arup_r: The gem,, I told will take care of it and many more
[17:03:47] kitsuneyo: and the other one is its real parent
[17:03:51] arup_r: you can destroy or restore back
[17:03:51] kitsuneyo: thanks arup_r
[17:04:02] Malgorath: making orphans... tsk tsk, we have enough problems in this world already
[17:04:25] arup_r: If you just do *unlink* as I said with `nil`, you will never be able to restore
[17:04:27] Papierkorb: Wow PaaS is expensive
[17:04:29] StaticVoid: has joined #RubyOnRails
[17:05:24] srinidhi: has joined #RubyOnRails
[17:05:26] p8m: has joined #RubyOnRails
[17:05:34] kitsuneyo: i don't want to restore, so it's cool
[17:05:48] arup_r: ok, then do what I said at first
[17:05:57] arup_r: just insert nil to the child Fkey
[17:06:16] arup_r: but, remember you lost the relationship FOREVER :)
[17:06:26] brycesenz: has joined #RubyOnRails
[17:06:37] ericfreese: has joined #RubyOnRails
[17:08:16] arup_r: Malgorath: hehe
[17:09:06] kitsuneyo: that's ok arup_r :)
[17:09:20] centrx: has joined #RubyOnRails
[17:09:28] arup_r: cool!.. :) Go ahead!
[17:10:26] arup_r: kitsuneyo: Well, then at least have one more column to back up the value.. so if you really ever need atleast you can connect
[17:10:44] arup_r: make the Fkey as NULL, and copy the actual value to that column
[17:11:00] arup_r: *that backup column
[17:11:01] kitsuneyo: it's just a place_id for user profiles. the profile really belongs to a user - that relationship stays intact
[17:11:10] mordof_work: has joined #RubyOnRails
[17:11:25] arup_r: kitsuneyo: data are important.. :) don't let them go away!
[17:12:10] kitsuneyo: that's true man, but i don't wanna track my users too closely, they should be able to delete their data fully if they want
[17:13:50] Deft: has joined #RubyOnRails
[17:14:14] DrHouse|M6500: has joined #RubyOnRails
[17:14:28] treehug88: has joined #RubyOnRails
[17:16:14] mercerist: has joined #RubyOnRails
[17:17:21] hahuang65: has joined #RubyOnRails
[17:17:34] Mia: has joined #RubyOnRails
[17:17:34] Mia: has joined #RubyOnRails
[17:18:50] blackchalk: has left #RubyOnRails: ()
[17:21:25] pyemkey: has joined #RubyOnRails
[17:21:37] atomical: has joined #RubyOnRails
[17:24:20] jxs_: has joined #RubyOnRails
[17:29:26] mordof_work: has joined #RubyOnRails
[17:29:35] B1n4r10: has joined #RubyOnRails
[17:31:20] alphaatom: has joined #RubyOnRails
[17:32:34] ur5us: has joined #RubyOnRails
[17:34:56] paulodiniz: has joined #RubyOnRails
[17:35:29] Rodya_: has joined #RubyOnRails
[17:37:32] neshmi: has joined #RubyOnRails
[17:37:37] steharro: has joined #RubyOnRails
[17:40:09] neshmi: has joined #RubyOnRails
[17:40:23] PedramT: has joined #RubyOnRails
[17:43:55] sonOfRa: has joined #RubyOnRails
[17:46:09] dopie: Can anyone help me figure out the right way to layout the database for what im trying to do?
[17:46:12] dopie: https://gist.github.com/staycreativedesign/0708ed62317d1486e95b
[17:46:38] mices: does anyone know what empty_trash_conversations_path should be in mailboxer i'm getting undefined local variable or method `empty_trash_conversations_path
[17:47:02] apneic: has joined #RubyOnRails
[17:47:54] rakm: has joined #RubyOnRails
[17:49:00] tfittsy: has joined #RubyOnRails
[17:49:57] mikecmpbll: has joined #RubyOnRails
[17:51:44] tubbo: dopie: seems a little too specific
[17:51:53] tubbo: StepOne, StepTwo, StepThree being different models and all that
[17:52:32] tubbo: dopie: but we do that for e.g. checkout steps, like a Payment record is used to store the payment information
[17:52:48] tubbo: mices: rake routes | grep mailboxer to see all the mailboxer-defined routes
[17:53:04] jxs_: has joined #RubyOnRails
[17:53:13] arup_r: has joined #RubyOnRails
[17:53:17] mices: tubbo: ty
[17:53:26] ornerymoose: has joined #RubyOnRails
[17:56:22] neshmi: has joined #RubyOnRails
[17:56:25] arup_r: dopie: are those fields are always different for each step ?
[17:56:47] neshmi: has joined #RubyOnRails
[17:57:04] sleungcy: has joined #RubyOnRails
[18:00:36] aegis3121: has joined #RubyOnRails
[18:00:37] tfitts: has joined #RubyOnRails
[18:00:59] bronson: has joined #RubyOnRails
[18:01:39] safety_cut: has joined #RubyOnRails
[18:03:54] voidDotClass: has joined #RubyOnRails
[18:04:11] atomical_: has joined #RubyOnRails
[18:05:10] lxsameer: has joined #RubyOnRails
[18:05:10] lxsameer: has joined #RubyOnRails
[18:05:56] srinidhi: has joined #RubyOnRails
[18:06:49] paulodiniz: has joined #RubyOnRails
[18:07:17] pyemkey: has joined #RubyOnRails
[18:08:03] umdstu: has joined #RubyOnRails
[18:10:58] pyemkey: has joined #RubyOnRails
[18:11:47] paulodin_: has joined #RubyOnRails
[18:12:48] umdstu: i'm trying to run two separate ruby instances on a server, one for each app. the passenger config correctly identifies the ruby versions, but I can't seem to install gems for the second ruby version
[18:14:01] tfitts: has joined #RubyOnRails
[18:14:39] jxs_: has joined #RubyOnRails
[18:15:43] konsolebox: has joined #RubyOnRails
[18:15:51] dopie: arup_r: yes they always will be differnt for each step
[18:16:19] dopie: tubbo: so what would you suggest???
[18:16:30] konsolebox: has joined #RubyOnRails
[18:16:46] tubbo: dopie: without knowing more about the problem domain it's hard to say
[18:16:52] arup_r: ok, what is the final goal ?
[18:17:05] iateadonut: has left #RubyOnRails: ()
[18:17:22] renanoronfle: has joined #RubyOnRails
[18:17:23] sinkensabe: has joined #RubyOnRails
[18:17:28] tubbo: dopie: from what i can see, there's no reason to have different models if the structure of the data is basically the same. it seems hard to understand.
[18:17:31] konsolebox: has joined #RubyOnRails
[18:17:33] cornerman: has joined #RubyOnRails
[18:17:44] ornerymoose: has joined #RubyOnRails
[18:17:48] _djbkd: has joined #RubyOnRails
[18:17:52] dopie: so remove steps?
[18:18:22] nettoweb: has joined #RubyOnRails
[18:18:24] arup_r: User has_many steps ?
[18:18:38] konsolebox: has joined #RubyOnRails
[18:18:50] arup_r: and each step taken field and answer to store in a column as a JSON
[18:19:34] jeanre: has joined #RubyOnRails
[18:19:42] konsolebox: has joined #RubyOnRails
[18:20:48] konsolebox: has joined #RubyOnRails
[18:22:41] sandstrom: has joined #RubyOnRails
[18:24:34] chipotle: has joined #RubyOnRails
[18:25:45] brycesenz: has joined #RubyOnRails
[18:26:31] ur5us: has joined #RubyOnRails
[18:27:08] rodferso1|lunch: has joined #RubyOnRails
[18:27:32] rodfersou: has joined #RubyOnRails
[18:27:34] sonOfRa: has joined #RubyOnRails
[18:27:50] lethjakman-l: has joined #RubyOnRails
[18:31:30] cfinley: has joined #RubyOnRails
[18:31:36] arthurix_: has joined #RubyOnRails
[18:32:35] arthurix: has joined #RubyOnRails
[18:33:20] Deft: has joined #RubyOnRails
[18:36:20] jowiar: has joined #RubyOnRails
[18:36:27] Rodya_: has joined #RubyOnRails
[18:38:33] joshkovach: has joined #RubyOnRails
[18:38:40] braincrash: has joined #RubyOnRails
[18:40:18] arthurix: has joined #RubyOnRails
[18:41:41] voidDotClass: has joined #RubyOnRails
[18:42:07] voidDotClass: Rails is suddenly unable to pick up the js files defined in vendor/bower_components in application.js , any ideas?
[18:42:22] voidDotClass: it was working before, i've literally not touched it, and now it wont work
[18:42:33] cornerman: has joined #RubyOnRails
[18:42:58] voidDotClass: '//= require angular-ui-router' is failing
[18:43:00] reckoner: you're using bower with rails?
[18:43:21] emachnic: has joined #RubyOnRails
[18:43:23] voidDotClass: reckoner, yes
[18:43:34] voidDotClass: its located in vendor/assets/bower_components/angular-ui-router
[18:43:44] claytonzaugg: Anyone know a good channel I can ask questions about parallelization of our CDN for web optimization?
[18:44:38] arthurix: has joined #RubyOnRails
[18:44:49] mordof_work: has joined #RubyOnRails
[18:46:34] tubbo: claytonzaugg: parallelization?
[18:47:03] cnk: has joined #RubyOnRails
[18:47:26] claytonzaugg: cdn1.domain.com cdn2.domain.com cdn3.domain.com and so forth. I had some questions about the processes involved.
[18:47:54] claytonzaugg: how you trick the browser into thinking there are multiple servers they can pull images from, etc. https://www.maxcdn.com/one/tutorial/domain-sharding/
[18:47:55] baweaver: has joined #RubyOnRails
[18:48:41] arthurix: has joined #RubyOnRails
[18:49:12] tubbo: claytonzaugg: check this out http://stackoverflow.com/questions/22260281/using-multiple-subdomains-on-rails-config-action-controller-asset-host
[18:49:20] LambdaSource: has joined #RubyOnRails
[18:49:27] pyemkey: has joined #RubyOnRails
[18:50:17] tubbo: you have to modify asset_host but it looks like rails evaluates '%d' to be a random number between 0 and 3
[18:51:05] treehug88: has joined #RubyOnRails
[18:51:39] kerunaru: has joined #RubyOnRails
[18:51:46] voidDotClass: thank you lord #{scientology alien}
[18:51:57] manfrin: has joined #RubyOnRails
[18:52:11] dopie: tubbo: did you add a new reply to my question I had to step out ... :\
[18:54:41] El3ktra: has joined #RubyOnRails
[18:54:41] El3ktra: has joined #RubyOnRails
[18:55:36] emachnic: has joined #RubyOnRails
[18:55:41] mordof_work: has joined #RubyOnRails
[18:55:41] arup_r: dopie: http://goo.gl/uma9x
[18:56:21] eljimmy: has joined #RubyOnRails
[18:56:23] claytonzaugg: thank you tubbo
[18:57:26] LucianoCWB: has joined #RubyOnRails
[18:57:26] dopie: arup_r: where can I learn about what you suggested?
[18:58:54] arup_r: dopie: https://goo.gl/Qn1ipq
[18:59:53] neshmi: has joined #RubyOnRails
[19:00:14] neshmi: has joined #RubyOnRails
[19:00:42] neshmi: has joined #RubyOnRails
[19:00:44] dopie: has joined #RubyOnRails
[19:05:56] kadoppe: has joined #RubyOnRails
[19:06:05] baweaver: has joined #RubyOnRails
[19:06:29] brycesenz: has joined #RubyOnRails
[19:07:07] jowiar: has joined #RubyOnRails
[19:07:30] LambdaSource: has joined #RubyOnRails
[19:07:45] reckoner: hey guys, i'm thinking of moving to PHP
[19:07:56] reckoner: ACTION is kidding
[19:08:09] replay: has joined #RubyOnRails
[19:11:22] alex88: has joined #RubyOnRails
[19:12:28] brycesenz: has joined #RubyOnRails
[19:12:46] theblang: has joined #RubyOnRails
[19:15:45] baweaver: has joined #RubyOnRails
[19:18:04] arthurix_: has joined #RubyOnRails
[19:18:04] zotherstupidguy: has joined #RubyOnRails
[19:18:53] arthurix_: has joined #RubyOnRails
[19:20:29] arthurix: has joined #RubyOnRails
[19:21:02] allcentury: has joined #RubyOnRails
[19:21:03] arup_r: diegoviola: o/
[19:21:07] ivanskie: has joined #RubyOnRails
[19:21:10] JohnT: has joined #RubyOnRails
[19:22:06] atomical: has joined #RubyOnRails
[19:22:10] braincrash: has joined #RubyOnRails
[19:22:42] guacamole: has joined #RubyOnRails
[19:23:12] d0nn1e: has joined #RubyOnRails
[19:24:03] njero: has joined #RubyOnRails
[19:25:03] arthurix: has joined #RubyOnRails
[19:27:01] arthurix_: has joined #RubyOnRails
[19:29:49] LambdaSource: has joined #RubyOnRails
[19:31:49] LambdaSource: has joined #RubyOnRails
[19:33:04] Axy: has joined #RubyOnRails
[19:33:05] Axy: has joined #RubyOnRails
[19:33:07] jgpawletko: has joined #RubyOnRails
[19:33:54] kitsuneyo: has joined #RubyOnRails
[19:34:00] choke: has joined #RubyOnRails
[19:34:54] arthurix: has joined #RubyOnRails
[19:36:20] fryguy: has joined #RubyOnRails
[19:36:21] LambdaSource: has joined #RubyOnRails
[19:36:30] chipotle_: has joined #RubyOnRails
[19:37:13] Rodya_: has joined #RubyOnRails
[19:37:46] LambdaSource: has joined #RubyOnRails
[19:37:55] snowy: has joined #RubyOnRails
[19:38:17] Sirithcam: has joined #RubyOnRails
[19:38:30] emachnic: has joined #RubyOnRails
[19:38:33] baweaver: has joined #RubyOnRails
[19:38:34] mary5030: has joined #RubyOnRails
[19:38:47] SteenJobs: has joined #RubyOnRails
[19:39:14] arthurix: has joined #RubyOnRails
[19:39:22] mary5030: has joined #RubyOnRails
[19:41:00] arthurix_: has joined #RubyOnRails
[19:42:35] LambdaSource: has joined #RubyOnRails
[19:42:44] arthurix: has joined #RubyOnRails
[19:43:19] djbkd: has joined #RubyOnRails
[19:44:02] guacamole: has joined #RubyOnRails
[19:45:11] atomical: has joined #RubyOnRails
[19:45:28] eljimmy: has joined #RubyOnRails
[19:45:30] brycesenz: has joined #RubyOnRails
[19:45:33] arthurix: has joined #RubyOnRails
[19:46:32] arthurix_: has joined #RubyOnRails
[19:47:44] arthurix_: has joined #RubyOnRails
[19:48:18] LambdaSource: has joined #RubyOnRails
[19:48:49] atomical_: has joined #RubyOnRails
[19:50:55] PedramT: has joined #RubyOnRails
[19:51:10] braincrash: has joined #RubyOnRails
[19:51:20] stannard_: has joined #RubyOnRails
[19:51:54] arthurix: has joined #RubyOnRails
[19:52:09] Deft: has joined #RubyOnRails
[19:52:43] rlkvch: has joined #RubyOnRails
[19:52:45] arup_r: diegoviola: now relaxed, and feeling better than those days ? :)
[19:53:13] FailBit: hey guys, I'm thinking of rewriting my app is asm
[19:53:17] rlkvch: has left #RubyOnRails: ()
[19:53:27] diegoviola: my client's lawyer is basically threatening me as of now
[19:53:36] diegoviola: he is basically saying that if I don't accept their money for my app they will proceed to take criminal actions against me
[19:53:39] diegoviola: which is pretty absurd
[19:53:59] Papierkorb: diegoviola: Your app?
[19:54:12] diegoviola: yes, the code I wrote myself
[19:54:14] aegis3121: has joined #RubyOnRails
[19:54:30] Papierkorb: As contract work or is it your own project?
[19:54:34] reckoner: diegoviola, what happened?
[19:54:50] diegoviola: I spent a month and 9 days working on my client's project
[19:54:55] FailBit: how is that criminal
[19:54:56] reckoner: i went through defending myself last year while i client tried to sue me
[19:55:08] FailBit: they could file civil charges
[19:55:17] FailBit: not criminal, if no transaction has happened..
[19:55:23] diegoviola: I delivered their app, deployed it on their server, all while working on Christmas, new year and holidays, including 15 hours a day for some days
[19:55:32] diegoviola: I have not seen a single penny from them yet
[19:55:52] diegoviola: their app is working in production
[19:55:52] reckoner: diegoviola, what is the client accusing you of?
[19:55:56] jowiar: has joined #RubyOnRails
[19:56:10] maxx88: diegoviola: are you US law or other?
[19:56:15] diegoviola: maxx88: Brazil
[19:56:18] netzfisch: has joined #RubyOnRails
[19:56:24] reckoner: documentation is your friend
[19:56:27] reckoner: emails too.
[19:56:40] Papierkorb: diegoviola: many have a 'backdoor' in such apps to pull them off if the clients decides to not pay for that reason
[19:56:42] fox_mulder_cp: diegoviola: i have some spiritual ideas on my mind for your job (( oh. may be i must say to you stop this job some weeks ago (
[19:56:52] maxx88: i???ve been in 8 civil lawsuits but, all US
[19:56:55] diegoviola: reckoner: they said I have negotiated a fixed price at first, but in reality, we don't have a contract, I have spent more time than anything... including working 15 hours for some days, so I want more money for my app
[19:57:04] diegoviola: reckoner: they said "No, we are going to pay you $X"
[19:57:26] soahccc: I don't want to be offending but we never deploy apps to production on foreign servers until we see at least most of the money. On our own we can just shut it down
[19:57:31] reckoner: if you don't have a contract. that's not ideal.
[19:57:33] Papierkorb: diegoviola: No contract!? No e-mails either?
[19:57:34] diegoviola: they're basically saying that I should accept the money they are proposing or they're going to send me to jail
[19:57:34] Sawbones: has joined #RubyOnRails
[19:57:42] atomical: has joined #RubyOnRails
[19:57:43] Andr3as: sad to hear, but better negotiate a contract first, next time
[19:57:55] arthurix: has joined #RubyOnRails
[19:58:06] reckoner: yeah, live and learn. i'd take the lessons from this experience and make sure you build them into this contract
[19:58:07] Andr3as: the jail thing sounds more like a joke to me
[19:58:13] maxx88: if brazil law is like US law then it takes money to win and it???s not about righting the wrong
[19:58:13] reckoner: *this new contract
[19:58:26] diegoviola: I have proposed to work with a contract to the client but he completely ignored the request
[19:58:31] diegoviola: the app was already built when I mentioned that
[19:58:55] snowy: has joined #RubyOnRails
[19:59:00] Andr3as: contract first - i wont work any minute without a contract
[19:59:07] kitsuneyo: has joined #RubyOnRails
[19:59:08] diegoviola: I still think they don't have the right to threat me with criminal actions for not wanting to accept the money
[19:59:15] reckoner: they can't throw you in jail, but could sue you maybe
[19:59:33] soahccc: Papierkorb: isn't a backdoor in the range of criminal activity? :)
[19:59:35] maxx88: diegoviola: my opinion, is push them as much as you can and maybe they will pay you a little more but, stop short of litigation
[20:00:18] reckoner: this is good learning lesson for you IMO.
[20:00:19] maxx88: diegoviola: here in US I haven???t been in a lawsuit that was less than $100k
[20:00:29] Papierkorb: soahccc: Depends. As long you close it and write in the contract, that you have technical measures to ensure full payment even after deployment (allowing for faster deployment for the client), then I don't see the issue tbh
[20:00:54] LambdaSource: has joined #RubyOnRails
[20:01:09] El3ktra: has joined #RubyOnRails
[20:01:09] diegoviola: I quoted the price for my app
[20:01:25] Papierkorb: soahccc: Sure the option of only deploying after having been paid is better, but depends on the client I guess
[20:01:30] diegoviola: "Criminal actions for what? The source code was not released in any way, Daniel part was already removed. Therefore, the source code will remain my sole property as the author, they have no right to use it or modify it, since the payment was not agreed upon."
[20:01:33] diegoviola: that was my response to the lawyer
[20:02:04] maxx88: diegoviola: my guess is you picked the wrong bed partners. even if you have a contract, if you get some shady people they can win with a good lawyer
[20:02:06] reckoner: diegoviola, copy right cases are expensive if you choose to litigate this.
[20:02:15] reckoner: maybe talk to a lawyer and see about scaring them.
[20:02:25] DEA7TH: has joined #RubyOnRails
[20:02:35] diegoviola: I already have a lawyer, he is on par with the case
[20:02:45] reckoner: that's good
[20:02:47] Andr3as: sure, he wants your money
[20:02:54] maxx88: is he contingent
[20:02:58] Andr3as: and the longer the lawsuit goes, the better for him
[20:03:00] soahccc: Papierkorb: hmm true, I just remembered that teamspeak shuts down your server (or it shuts itself down) and refuse to start again if the license expires :D
[20:03:02] _djbkd: has joined #RubyOnRails
[20:03:03] zcreative: has joined #RubyOnRails
[20:03:04] reckoner: understand the risks of moving yoru case forward
[20:03:33] arthurix: has joined #RubyOnRails
[20:03:43] diegoviola: I agree, I will not work without a contract anymore
[20:04:03] maxx88: diegoviola: contracts are only as good as the people you work with
[20:04:03] zcreative: Is it possible to create an AR model instance which is unable to be persisted? Example...: User.unsaveable.new(user_type: 4)
[20:04:11] diegoviola: this is the first time I actually have people fighting about my code, it looks like I've done a good job at least
[20:04:55] diegoviola: maxx88: aye, I will never work with them again, they already know that :)
[20:05:05] claytonzaugg: has joined #RubyOnRails
[20:05:16] maxx88: diegoviola: i spent $40k on a contract to buy a business and i lost the suite because we didn???t properly define 1 word
[20:05:29] Andr3as: yeah, accept it as a lesson and move on.. no time to waste on those suckers
[20:05:43] soahccc: zcreative: you could use a conditional validation which just raises on `before_save'
[20:05:48] diegoviola: Andr3as: aye
[20:06:16] fox_mulder_cp: diegoviola: so, be carefull. you achieve some experience
[20:06:19] maxx88: digeoviola: sorry, i wish you the best!! lawsuits suck!
[20:06:34] diegoviola: thanks guys ;)
[20:06:57] diegoviola: I have nothing to fear, I've done nothing wrong IMHO (other than working with no contract)
[20:07:03] fox_mulder_cp: diegoviola: i have some bad experience too ((
[20:07:26] brycesenz: has joined #RubyOnRails
[20:07:36] diegoviola: they're the ones in the wrong, forcing me to accept something I don't want to and threatening
[20:08:04] diegoviola: I will just ignore their emails and let my lawyer handle it
[20:08:07] fox_mulder_cp: with gangsta's, but this gangsta's works in army and country's FBI analog
[20:08:22] maxx88: deigoviola: I???m almost 60 so, i have seen my fair share of bad deals. just be careful who you go to bed with, contract or no contract
[20:08:47] diegoviola: thanks for the tips
[20:10:15] LambdaSource: has joined #RubyOnRails
[20:11:29] diegoviola: it's funny how things end up... you start with the best of intention, 2 weeks later you can be in a hell of a lawsuit
[20:11:42] Psyq: has joined #RubyOnRails
[20:11:45] FailBit: science and business have the worst clashes
[20:12:01] FailBit: knowledge vs greed
[20:12:25] LambdaSource: has joined #RubyOnRails
[20:12:33] reckoner: digoviola, unfortunately. it doesn't pay to be nice.
[20:12:42] northfurr: has joined #RubyOnRails
[20:13:08] arBmind: has joined #RubyOnRails
[20:13:31] baweaver: diegoviola: we've been over this before.
[20:14:36] diegoviola: baweaver: someone asked me how things were going
[20:14:53] baweaver: ACTION sighs
[20:14:54] maxx88: diegoviola: to me contracts are just to calibrate expectations. if someone decides to breach the contract, with a good attorney any contract can be breached
[20:15:08] diegoviola: baweaver: I'll move it to #ruby-offtopic, sorry for that
[20:15:52] reckoner: that's not true.
[20:16:02] Nuru: has joined #RubyOnRails
[20:16:15] reckoner: breach of contract lawsuits wouldn't exist.
[20:16:40] lethjakman-l: has joined #RubyOnRails
[20:17:17] smathy: Gotta be a pretty big project to justify pursuing in court though.
[20:17:18] baweaver: Let's keep it to #ruby-offtopic folks.
[20:17:27] smathy: Ah, sorry.
[20:18:11] Nuru: Is there a list of threadsafe gems that is being kept updated somewhere? We have 300+ gems in our project, too many for us to check.
[20:18:56] polishdub: has joined #RubyOnRails
[20:19:14] Limix: has joined #RubyOnRails
[20:19:44] fox_mulder_cp: Nuru: How u control it?
[20:19:48] fox_mulder_cp: what is the app?
[20:20:12] baweaver: I think it's a case of trial and critical failure on that one unfortunately.
[20:20:19] arup_r: I didn't know the worst side effect of freelancing.. :( I will remember though
[20:20:53] pyemkey: has joined #RubyOnRails
[20:21:06] baweaver: Most of the time the only way is to read the source, though such a tool may be worthwhile in some ways
[20:21:08] Nuru: fox_mulder_cp: It's a dynamic website with content and e-commerce. We manage gems with bundler, natch.
[20:21:14] baweaver: either that or make a Git badge that something is threadsafe
[20:22:26] mordof_work: has joined #RubyOnRails
[20:22:38] devn: has joined #RubyOnRails
[20:22:44] Nuru: baweaver: We're just sticking with single-threading for now. I was hoping RubyGems or CodeClimate or someone would have a threadsafe certification or intention.
[20:22:56] baweaver: not that I'm aware of at least.
[20:23:03] devn: Is there an easy way to selectively load the rails logger in a rake task?
[20:23:06] baweaver: probably safer in Ruby as it's not often a primary consideration
[20:23:46] Nuru: OK, thanks. Gotta go.
[20:24:37] Scriptonaut: has joined #RubyOnRails
[20:25:06] Scriptonaut: hey guys, I have an two apps running on heroku. One is using TLS1.2 just fine, however the other one is still using something older (I think TSL1.1). How can I force it to use TLS1.2?
[20:26:17] smathy: Scriptonaut, nothing to do with Rails, you should talk to heroku probably.
[20:26:32] Scriptonaut: u sure it couldn't be from an old version of openssl
[20:26:51] fl: has joined #RubyOnRails
[20:26:54] yfeldblum: has joined #RubyOnRails
[20:27:15] sdwrage: has joined #RubyOnRails
[20:27:25] fox_mulder_cp: ssl usually configured ay frontend
[20:28:13] emachnic: has joined #RubyOnRails
[20:28:18] jeanre: has joined #RubyOnRails
[20:29:30] dtordable: has joined #RubyOnRails
[20:29:42] pyemkey: has joined #RubyOnRails
[20:30:00] Scriptonaut: Why would one of my heroku apps work fine
[20:30:03] Scriptonaut: but the other doesn't
[20:30:09] Scriptonaut: that makes me think it's something on my end, not herokus
[20:30:24] Sdwrage_: has joined #RubyOnRails
[20:31:55] tubbo: Scriptonaut: yeah that is really weird
[20:32:33] Cohedrin: has joined #RubyOnRails
[20:33:54] Scriptonaut: I'm manually adding rack-ssl gem to the app
[20:34:07] Scriptonaut: for some reason it doesn't have it (even though the other app doesn't specifically call it in the gemfile, but it still has it)
[20:34:28] tubbo: Scriptonaut: why do you need rack-ssl?
[20:34:46] tubbo: (guess i should've asked if it was a rails app)
[20:36:20] jowiar: has joined #RubyOnRails
[20:36:31] Scriptonaut: yes it's a rails app
[20:36:37] Scriptonaut: I just noticed the app that works, has that
[20:36:39] Scriptonaut: and it forces TLS
[20:36:44] Scriptonaut: whereas my app that doesn't work, doesn't have it
[20:36:45] tubbo: ah interesting :)
[20:37:00] tubbo: i've never had to worry about using rack-ssl, just used config.force_ssl = true, but then again i never tried that on heroku
[20:37:08] tubbo: if i need SSL i would not go with heroku, too expensive :(
[20:37:10] Scriptonaut: It's a shot in the dark, people can't currently sign up so it's costing us a fortune
[20:37:20] Scriptonaut: config.force_ssl would force ssl on all pages right?
[20:37:38] Scriptonaut: our app isn't ready for tha tyet
[20:38:20] Rodya_: has joined #RubyOnRails
[20:41:27] tubbo: Scriptonaut: well it sounds like you figured it out anyway, force_ssl certainly doesn't enforce a version of TLS..
[20:41:48] Scriptonaut: bleh, I'm having heroku issues now
[20:41:51] Scriptonaut: I can't even deploly
[20:44:05] atomical_: has joined #RubyOnRails
[20:46:59] arthurix: has joined #RubyOnRails
[20:47:19] brycesenz: Scriptonaut - i'll pour one out for you. deployment issues suck
[20:48:16] craysiii: has joined #RubyOnRails
[20:48:28] steharro: has joined #RubyOnRails
[20:48:47] smathy: Scriptonaut, it forces SSL by redirecting to an `https` URL. The SSL part of your connection is handled by your httpd, not Rails.
[20:49:30] craysiii: has joined #RubyOnRails
[20:51:00] reckoner: has left #RubyOnRails: ()
[20:51:10] smathy: Scriptonaut, Rails just handles Rack requests, which themselves are just ruby method calls following a certain calling convention, there's no SSL anywhere in there, there's no HTTP.
[20:51:54] speakingcode: has joined #RubyOnRails
[20:52:05] smathy: Ie. your httpd terminates the SSL connection.
[20:52:20] mordof_work: has joined #RubyOnRails
[20:52:37] smathy: As hard as it may be to believe, heroku virtual machines *can* differ.
[20:53:29] Hans267: has joined #RubyOnRails
[20:54:11] Deft: has joined #RubyOnRails
[20:54:30] atomical: has joined #RubyOnRails
[20:54:46] PedramT: has joined #RubyOnRails
[20:57:09] Sawbones: has joined #RubyOnRails
[20:57:26] Sawbones_: has joined #RubyOnRails
[20:57:33] dopie: tubbo, arup_r : https://gist.github.com/staycreativedesign/4d906d8f3780f1a17441
[20:59:56] tubbo: dopie: ok?
[21:00:15] tubbo: dopie: you know how to make a has_many :through
[21:00:43] tubbo: dopie: what's the issue then?
[21:01:04] dopie: i just did that show that i figured out a way with the problem i was having with the data structure that is all :)
[21:01:31] SteenJobs: has joined #RubyOnRails
[21:01:50] tubbo: dopie: oh ok
[21:02:35] tubbo: well that'sgood
[21:04:01] hello9: has joined #RubyOnRails
[21:06:30] hello9: When doing a native sql query in rails, is there a good way to convert the results back to Ruby objects or at least the same hash, or is it going to end up being easier to just use find_by_sql?
[21:07:18] quazimodo: has joined #RubyOnRails
[21:07:19] quazimod1: has joined #RubyOnRails
[21:09:30] jayne_: has joined #RubyOnRails
[21:09:33] zpe: has joined #RubyOnRails
[21:11:06] Pazician: has joined #RubyOnRails
[21:11:12] nfk|laptop: has joined #RubyOnRails
[21:11:13] smathy: hello9, the latter.
[21:11:25] chipotle: has joined #RubyOnRails
[21:11:49] Pazician: has joined #RubyOnRails
[21:12:22] hello9: @smathy thanks
[21:12:53] matthewd: hello9: Though letting AR build it will be easier still (not always possible, but I mention it because my impression is that sometimes people assume they need to go to raw SQL before they actually do)
[21:13:15] hello9: @matthewd the AR here is still too slow even with includes etc
[21:13:51] phon: has joined #RubyOnRails
[21:15:26] ornerymoose: has joined #RubyOnRails
[21:15:37] matthewd: hello9: Oh, but you have a different spelling of the query that performs better?
[21:16:24] snowy: has joined #RubyOnRails
[21:16:47] dtordable: a question: can I create models of my app generating migrations?
[21:17:41] fl: has joined #RubyOnRails
[21:17:49] jvanbaarsen: has joined #RubyOnRails
[21:18:13] lethjakman-l: has joined #RubyOnRails
[21:20:03] bensarz: has joined #RubyOnRails
[21:20:14] chrisarcand: dtordable: the model generator creates a migration by default.
[21:20:40] arup_r: dtordable: use rails g model ....
[21:21:21] arup_r: well dtordable going to read JS again.. hehe.. :)
[21:21:47] arup_r: * i am going
[21:22:24] dtordable: haha arup_r tomorrow ill read something of that
[21:23:34] dtordable: arup_r: use /me for that!
[21:24:09] arup_r: ACTION learns something new
[21:24:13] arup_r: ok.. good
[21:24:14] dideler: has joined #RubyOnRails
[21:24:36] dtordable: yeah arup_r ;)
[21:26:11] theery: has joined #RubyOnRails
[21:27:20] snowy: has joined #RubyOnRails
[21:27:27] mostlybadfly: has joined #RubyOnRails
[21:29:04] jeanre: has joined #RubyOnRails
[21:29:40] djbkd: has joined #RubyOnRails
[21:30:56] joshkovach: has joined #RubyOnRails
[21:31:02] paulodiniz: has joined #RubyOnRails
[21:31:34] voidDotClass: in a hash, how can i refer to other items in the same hash? e.g i have routes = { :admin = "/admin", :admin_accounts = routes[:admin] + "/accounts"}, so i want routes[:admin_accounts] to point to "/admin/accounts"
[21:31:38] Sawbones: has joined #RubyOnRails
[21:31:39] voidDotClass: how can i achieve that?
[21:31:52] Sawbones: has joined #RubyOnRails
[21:32:34] tubbo: hmm, not sure if you can do that
[21:34:24] TheDracle: has joined #RubyOnRails
[21:34:25] Cohedrin: has joined #RubyOnRails
[21:34:46] claytonzaugg: has joined #RubyOnRails
[21:34:50] snowy: has joined #RubyOnRails
[21:35:23] Cohedrin: has joined #RubyOnRails
[21:35:29] bronson: has joined #RubyOnRails
[21:35:30] rhizome: voidDotClass: use a temp variable
[21:36:06] rhizome: but i'd really question what you're trying to do in the first place
[21:36:13] voidDotClass: i cant access another item in the same hash?
[21:36:15] Sdwrage_: has joined #RubyOnRails
[21:36:48] rhizome: routes[:admin] does not yet exist at assignment
[21:37:04] rhizome: is a local variable too much?
[21:38:05] smathy: Just add them one at a time.
[21:39:07] Rodya_: has joined #RubyOnRails
[21:39:32] jack12345: has joined #RubyOnRails
[21:39:34] Papierkorb: Or use a constant instead of a variable.
[21:39:41] jack12345: has left #RubyOnRails: ()
[21:39:44] Papierkorb: Might be better suited for your use case
[21:40:37] jeanre: has joined #RubyOnRails
[21:42:52] victortyau: has joined #RubyOnRails
[21:43:21] skyjumper: question about rspec best practices...
[21:43:23] cac: has joined #RubyOnRails
[21:43:45] skyjumper: i was told that `expect_any_instance_of` is to be avoided, but aren't there times when you have no choice?
[21:44:12] flappynerd: has joined #RubyOnRails
[21:44:12] skyjumper: sorry, meant `allow_any_instance_of`
[21:44:30] flappynerd: what should I use to determine if a given date is more than 1 day ago?
[21:44:37] Papierkorb: skyjumper: Yes, and yes
[21:44:46] flappynerd: I can never remeber if I want Time or Date or DateTime
[21:44:59] rhizome: assert_equal ,"Foo", @foo.class
[21:45:00] theery: has joined #RubyOnRails
[21:45:12] rhizome: extraneous comma from never being able to remember order
[21:45:55] Papierkorb: skyjumper: More often than not it is avoidable, but I do have I think 2-3 places where I need that in >500 examples or whatever that is.
[21:46:08] Papierkorb: skyjumper: if that is considered 'good' I can't tell you!
[21:46:17] choke: has joined #RubyOnRails
[21:46:39] teaearlgraycold: So I'm trying to do this query: Appeal.where(state: appeal_pending).includes(:hearings).where('hearings.state' => hearing_cancelled). I want it to find appeals where /all/ hearings are cancelled, but it's finding appeals where /a/ hearing is cancelled.
[21:46:45] skyjumper: hmm, yeah i used it a bunch in request/controller specs
[21:46:54] teaearlgraycold: Is there a modification I can make to fix that?
[21:47:00] skyjumper: because there's no way to control the instances that would be created
[21:47:26] astron: has joined #RubyOnRails
[21:47:27] Papierkorb: skyjumper: Oh, I just don't put my app logic in controllers. Avoids it pretty well I guess.
[21:47:40] rhizome: teaearlgraycold: wehre(hearings: { state: 'cancelled' }
[21:48:01] teaearlgraycold: rhizome: okay I'll try that thanks
[21:48:07] KensoDev: has joined #RubyOnRails
[21:48:26] skyjumper: Papierkorb: in my case, i was testing how the app handled a 3rd party push notification
[21:48:39] baweaver: has joined #RubyOnRails
[21:48:47] flappynerd: in a Model I should be able to access db columns just by name right? similar to other instance attributes?
[21:48:59] flappynerd: I don't need to uset self.set() or anything special right?
[21:49:14] Papierkorb: skyjumper: Isn't it enough to observe the changes the API call does to your application state, e.g., updated or created database models?
[21:49:21] safety_cut: has joined #RubyOnRails
[21:49:25] rhizome: flappynerd: on the face of it, yes
[21:51:21] skyjumper: Papierkorb: i also had to stub out a method that checks the 3rd party's signature
[21:51:30] edwinvdgraaf: has joined #RubyOnRails
[21:51:43] teaearlgraycold: rhizome: that's still giving me an appeal with hearings that respectively have the states: ["hearing_completed", "hearing_cancelled"]
[21:51:48] Papierkorb: skyjumper: can't you capture a request as 'example' and use that including 'correct' signature?
[21:52:06] rhizome: teaearlgraycold: what's the actual query you're using, and what are the possible values?
[21:52:19] teaearlgraycold: This is the actual query:
[21:52:27] skyjumper: Papierkorb: probably... can't remember why i didn't just do that
[21:52:28] teaearlgraycold: Appeal.where(state: appeal_pending).includes(:hearings).where(hearings: {state: hearing_cancelled})
[21:52:42] rhizome: UMQ: "hearing_cancelled"
[21:52:53] teaearlgraycold: appeal_pending and hearing_cancelled are local vars to State models
[21:53:00] Papierkorb: skyjumper: another possibility could be to abstract out the signature checker stuff and test it on its own, and then have a test-signature checker active for that
[21:53:12] rhizome: teaearlgraycold: uh what. gist all of this stuff
[21:53:15] Papierkorb: skyjumper: But hard to judge without knowing like the whole app :)
[21:53:20] FernandoBasso: has joined #RubyOnRails
[21:53:32] skyjumper: Papierkorb: well how would you implement the test signature cheker?
[21:53:35] netzfisch: has joined #RubyOnRails
[21:54:37] solars: has joined #RubyOnRails
[21:54:42] Papierkorb: skyjumper: I'd have a SignatureChecker::AcmeCorp and SignatureChecker::Test, and then SignatureChecker.checker which returns the checker. Then you can expect() that to be called and_return your mocked checker.
[21:55:31] fl: has joined #RubyOnRails
[21:55:50] teaearlgraycold: rhizome: http://pastebin.com/AMneLi5T
[21:56:01] teaearlgraycold: Pastie is down, helpa!
[21:56:07] skyjumper: yeah, that's a better approach. mine was a method on an instance created in the controller
[21:56:24] sarink: has joined #RubyOnRails
[21:58:02] rhizome: teaearlgraycold: right, so you're basically using hearing_cancelled as a boolean.
[21:58:14] renanoronfle: i have a question, is a good contribution to rails make some improvements about code syntax? for example a number fixed in code like 123456765 123_456_765 or change hashes to ("new syntax" :this => 'value' for this: 'value'), i study the rails code in master and i thinks can i change this when i learning
[21:58:29] teaearlgraycold: rhizome: hearings can be cancelled, scheduled, or completed
[21:58:40] pydave6367: has joined #RubyOnRails
[21:58:56] teaearlgraycold: No, they need a state
[21:59:12] rhizome: includes(:hearings).where('hearings.appeal_id' => nil).
[21:59:23] jowiar: has joined #RubyOnRails
[21:59:30] rhizome: oh, not 'state'
[21:59:41] teaearlgraycold: rhizome: that means appeals without a hearing
[22:00:16] matthewd: renanoronfle: No; cosmetic changes are not accepted
[22:00:17] rhizome: right. so, it's not the greatest solution, but just to get it working use hearing_cancelled.state in the query
[22:00:29] rhizome: sorry, hearing_cancelled.name
[22:00:41] renanoronfle: matthewd, make sense
[22:00:54] mordof_work: has joined #RubyOnRails
[22:00:59] teaearlgraycold: rhizome: I'm not sure I understand what you mean
[22:01:16] rhizome: i've seen a lot of "new hash syntax" PRs merged
[22:01:54] teaearlgraycold: 'hearings.state' doesn't refer to a string, so why would I query by one?
[22:02:10] rhizome: teaearlgraycold: ugh, hold on. i'm trying to work with your existing syntax, which i don't really like.
[22:02:32] Sdwrage_: has joined #RubyOnRails
[22:02:33] rhizome: i corrected it to hearing_cancelled.name, but it occurs to me that you need an id or something for the relation
[22:02:54] rhizome: what are your associations between Appeal and State?
[22:03:13] teaearlgraycold: Appeal has_one state, Appeal has_many hearings, Hearing has_one state
[22:04:25] kerunaru: has joined #RubyOnRails
[22:05:29] teaearlgraycold: To explain, there's a state graph that most entities in the system use
[22:05:52] teaearlgraycold: So once an appeal is in a certain state, it leads into a state belonging to a hearing, and you're prompted to make a hearing
[22:06:06] rhizome: teaearlgraycold: where are your belongs_to?
[22:07:26] teaearlgraycold: rhizome: hearing belongs_to appeal. It seems that states aren't set to belong to anything, even though they store IDs. That's never been an issue before, but I can add in some belongs tos there
[22:07:37] teaearlgraycold: Like State belongs_to appeal, State belongs_to Hearing
[22:07:55] baweaver: has joined #RubyOnRails
[22:08:08] rhizome: the foreign key follows the belongs_to, so belongs_to should not be in State
[22:09:46] flappynerd: hmm, if I call e.g. @current_user.save in a controller, is it going to automatically try to use params?
[22:10:51] stannard: has joined #RubyOnRails
[22:11:47] speakingcode: has joined #RubyOnRails
[22:12:53] smathy: flappynerd, no.
[22:12:57] teaearlgraycold: rhizome: what do you mean? If a model posesses foreign keys it doesn't use belongs_to? That's what I've been doing for months - with success.
[22:13:24] rhizome: teaearlgraycold: the fk goes with the belongs_to model
[22:13:39] rhizome: and you have to have "belongs_to :foo" in that model
[22:13:51] rubyonrailed: has joined #RubyOnRails
[22:13:54] ur5us: has joined #RubyOnRails
[22:13:56] teaearlgraycold: Yeah I'll try adding that cause I realize it should be there in the state model
[22:14:47] teaearlgraycold: Oh wait shit no
[22:14:52] teaearlgraycold: I forgot what I'm doing
[22:15:14] rhizome: you might consider using a state machine gem
[22:16:10] teaearlgraycold: rhizome: yeah I tried looking for one but didn't find any good ones actually
[22:16:47] rhizome: aasm is fine
[22:17:06] Sawbones: has joined #RubyOnRails
[22:18:46] superlou: has joined #RubyOnRails
[22:19:06] voidDotClass: how do i remove the csrf stuff to allow all ajax reqs to go thru
[22:19:28] Martiini: has joined #RubyOnRails
[22:19:49] DEA7TH: I have a one-many relationship. Is it possible to create a factory for the *one* model which has two different instances of the *many* model? Preferably with nice syntax like nested attributes.
[22:19:57] teaearlgraycold: rhizome: yeah this looks neat.
[22:19:59] sarink: has joined #RubyOnRails
[22:20:04] DEA7TH: With FactoryGirl*
[22:20:22] teaearlgraycold: Would this work fine for me with 40 states each with specified outgoing edges and temporal transistions?
[22:20:45] rhizome: DEA7TH: you mean foo.bars.size == 2?
[22:20:53] DEA7TH: rhizome: Exactly.
[22:21:13] DEA7TH: Actually after(:create) might work
[22:21:46] rhizome: DEA7TH: sure. after(:create) { |foo| 2.times do { foo.bars << create(:bar) } }
[22:22:03] rhizome: from memory, might need some tweaking
[22:22:26] rhizome: teaearlgraycold: sure, with typing :)
[22:23:08] teaearlgraycold: It might be too late to add that in though :/ IDK seems like there should be an easy solutino to my original problem
[22:23:52] rhizome: teaearlgraycold: begin by putting all the stuff in a scoping method. @pending = Appeal.pending
[22:24:20] rhizome: maybe with args
[22:24:55] teaearlgraycold: That might get out of control quickly. One entity has 15+ states.
[22:25:14] teaearlgraycold: I might just add (to the Stateful concern) a in_state(state) method
[22:25:15] rhizome: but you're only querying on a small subset
[22:25:43] rhizome: that would be fine
[22:27:21] oded: has joined #RubyOnRails
[22:28:02] llakey: has joined #RubyOnRails
[22:28:21] queequeg1: has joined #RubyOnRails
[22:28:38] kerunaru: has joined #RubyOnRails
[22:28:49] DEA7TH: Yeah, after(:create) worked.
[22:32:10] voidDotClass: I want to do it so some of my controllers respond to json, and for html, they just output a 'bad request' or do a redirect. how can i do that?
[22:32:29] voidDotClass: can i do a trait for that, or should i write a base controller class?
[22:33:25] Cohedrin: you could write a base controller that user before_action I suppose
[22:33:40] Cohedrin: and before every action just check if its html
[22:33:47] Cohedrin: uses* not user
[22:33:58] lethjakman-l: has joined #RubyOnRails
[22:34:09] cnk: has joined #RubyOnRails
[22:37:31] teaearlgraycold: rhizome: It seems that Appeal.in_state(:appeal_pending).includes(:hearings).in_state(:hearing_cancelled) is trying to apply both in_state scopes to Appeals
[22:37:47] capin: hello, i created a form that I would like to submit using JS once the file is selected. However the form isn't currently being submitted, I'm using `onchange: "uploadImage()"`
[22:37:50] teaearlgraycold: Is there a good way to specify the scope is for the hearings?
[22:37:56] yfeldblum: has joined #RubyOnRails
[22:38:09] rhizome: teaearlgraycold: i don't think :appeal_pending is an actual thing you can use
[22:38:50] fox_mulder_cp: voidDotClass: it s basic. scaffold some model and see code in controlled
[22:39:12] fox_mulder_cp: ow wait while i connect to app
[22:39:17] teaearlgraycold: rhizome: it seems to work for me
[22:39:24] teaearlgraycold: Here's my scope: scope :in_state, ->(state_name = nil) { includes(:state).where('states.name' => state_name) }
[22:39:44] teaearlgraycold: When doing Model.in_state(:state_name) it gets the right results
[22:39:59] Rodya_: has joined #RubyOnRails
[22:40:12] voidDotClass: fox_mulder_cp, i know how to do it, my q is, how do i automatically do it for all my controllers
[22:41:24] jeanre: has joined #RubyOnRails
[22:41:26] fox_mulder_cp: voidDotClass: hm
[22:42:58] erick__: has joined #RubyOnRails
[22:44:15] safety_cut: has joined #RubyOnRails
[22:44:49] pyemkey: has joined #RubyOnRails
[22:45:25] choke: has joined #RubyOnRails
[22:46:45] gbgdev: has joined #RubyOnRails
[22:47:10] psyq_: has joined #RubyOnRails
[22:50:21] pyemkey: has joined #RubyOnRails
[22:56:45] erickeeg: has joined #RubyOnRails
[22:59:23] diegoviola: actioncable sounds cool, does it use eventmachine under the hood?
[22:59:54] pawnbox: has joined #RubyOnRails
[23:00:49] snowy: has joined #RubyOnRails
[23:01:29] stannard_: has joined #RubyOnRails
[23:02:16] choke: i'm sad that i cant use Rails5 yet ( for my current app ) :(
[23:02:26] havenwood: diegoviola: EventMachine, Celluloid, KitchenSink, etc. ;P
[23:03:00] davidbitton: has joined #RubyOnRails
[23:03:08] smathy: All choked up about it?
[23:03:40] pyemkey: has joined #RubyOnRails
[23:04:39] aloneintheworld: has joined #RubyOnRails
[23:04:54] choke: yeah... all because of 1 gem
[23:05:02] fox_mulder_cp: choke: my new app used r5beta
[23:05:36] dopie: has joined #RubyOnRails
[23:05:49] choke: yeah, i can't yet... we use a mongo backend for our mobile app api using the mongoid gem. that's not set to support R5 till 2017
[23:06:27] choke: or mongo data store rather
[23:08:48] lethjakman-l: has joined #RubyOnRails
[23:11:57] Pupeno: has joined #RubyOnRails
[23:12:16] pawnbox: has joined #RubyOnRails
[23:15:36] pyemkey: has joined #RubyOnRails
[23:17:10] chouhoulis: has joined #RubyOnRails
[23:20:34] ivanskie: has joined #RubyOnRails
[23:20:57] northfurr: has joined #RubyOnRails
[23:24:31] pawnbox: has joined #RubyOnRails
[23:25:28] atomical: has joined #RubyOnRails
[23:26:54] voidDotClass: I'm defining a route: get '/login', to: 'sessions#login' , when I try to test it in rspec, via: get "/login", i get the error : 'ActionController::UrlGenerationError: No route matches {:action=>"/login", :controller=>"sessions"}' . Any ideas?
[23:31:10] rubyonrails526: has joined #RubyOnRails
[23:33:33] lacrymology: has joined #RubyOnRails
[23:36:50] pawnbox: has joined #RubyOnRails
[23:36:52] qejk: has joined #RubyOnRails
[23:37:04] bronson: has joined #RubyOnRails
[23:39:30] aloneintheworld: has joined #RubyOnRails
[23:41:31] Scriptonaut: has left #RubyOnRails: ()
[23:42:12] jeanre: has joined #RubyOnRails
[23:42:56] Sawbones: has joined #RubyOnRails
[23:43:11] creature: voidDotClass: It looks a bit like it's trying to access an action "/login", rather than just "login". Updating your test to use `get :login` instead might get you going.
[23:45:27] baweaver: has joined #RubyOnRails
[23:45:50] voidDotClass: creature, thanks a lot. i wish there was some logic to these gotchas of when to use :foo and when to use "foo""
[23:47:23] creature: I expect that `get "login"` might have worked too, for what it's worth. :)
[23:47:36] creature: I think this one was more about the leading slash rather than a string vs. symbol issue.
[23:47:42] theery: has joined #RubyOnRails
[23:48:41] ornerymoose: has joined #RubyOnRails
[23:49:18] pawnbox: has joined #RubyOnRails
[23:54:15] northfurr: has joined #RubyOnRails
[23:54:25] Cohedrin: voidDotClass: When you're having that issue, you can do rake routes | grep login
[23:54:31] Cohedrin: and it will display the routes that do exist
[23:54:36] Cohedrin: so you can see what the issue is
[23:54:55] Pazician: has joined #RubyOnRails
[23:55:23] Cohedrin: and yes, creature is right about the leading slash, symbol vs string doesn't typically matter in routes
[23:57:03] Deft: has joined #RubyOnRails
[23:57:16] one_zero: has joined #RubyOnRails
[23:59:03] paulodiniz: has joined #RubyOnRails