« Back to channel list

#RubyOnRails - 21 July 2015

« Back 1 day Forward 1 day »
[00:55:20] helpa: has joined #RubyOnRails
[00:55:35] helpa: has joined #RubyOnRails
[00:55:48] MarkTR: http://www.amazon.com/Rails-4-Action-Ryan-Bigg/dp/1617291099
[00:56:14] Radar: !botsnack
[00:56:14] helpa: Nom nom. Thanks, Radar!
[00:56:18] helpa: Rails 4 in Action - http://manning.com/bigg2 - An excellent book combining Rails and TDD/BDD development. Written by Rebecca Skinner, Steve Klabnik, Ryan Bigg, Yehuda Katz
[00:56:45] Radar: TIL it's the #1 new release in Ruby Programming.
[00:57:05] Radar: And the publication date is supposedly July 31st.
[00:57:32] hololeap: has joined #RubyOnRails
[00:58:20] chipotle: has joined #RubyOnRails
[01:01:27] romdi: has joined #RubyOnRails
[01:02:38] mikenovikov: has joined #RubyOnRails
[01:05:24] SteenJobs: has joined #RubyOnRails
[01:07:24] hatzopoulos: has joined #RubyOnRails
[01:07:28] givanse: has joined #RubyOnRails
[01:08:34] MarkTR: has joined #RubyOnRails
[01:09:49] user1138: has joined #RubyOnRails
[01:12:01] Creeves: has joined #RubyOnRails
[01:14:39] Scripore: has joined #RubyOnRails
[01:17:43] rakm: has joined #RubyOnRails
[01:21:45] pixelhan_: has joined #RubyOnRails
[01:22:54] bonhoeffer: has joined #RubyOnRails
[01:23:59] zorak8: has joined #RubyOnRails
[01:28:32] michael_mbp: has joined #RubyOnRails
[01:29:23] DEA7TH: has joined #RubyOnRails
[01:42:53] choke: has joined #RubyOnRails
[01:43:28] user1138_: has joined #RubyOnRails
[01:43:44] erich: has joined #RubyOnRails
[01:43:46] davidconnolly: has joined #RubyOnRails
[01:44:51] pico-pete: has joined #RubyOnRails
[01:46:55] ur5us: has joined #RubyOnRails
[01:47:07] pontiki: i just receive an email update on the MEAP
[01:47:32] chintanparikh: has joined #RubyOnRails
[01:48:26] Radar: From a couple of days ago?
[01:49:05] CheckYourSix: has joined #RubyOnRails
[01:51:17] code1o6: has joined #RubyOnRails
[01:51:44] pontiki: i didn't download this version since they didn't have epub versions for this one yet
[01:52:51] [H]unt3r: has joined #RubyOnRails
[01:54:09] fgo: has joined #RubyOnRails
[01:54:38] pico-pete: has joined #RubyOnRails
[01:54:53] erich: has joined #RubyOnRails
[01:59:25] seank_: has joined #RubyOnRails
[02:06:02] imkj: has joined #RubyOnRails
[02:06:31] eggoez: has joined #RubyOnRails
[02:15:59] Ericx2x: has joined #RubyOnRails
[02:17:03] Spami: has joined #RubyOnRails
[02:17:54] thatkid: has joined #RubyOnRails
[02:19:05] thatkid: hello, I'm struggling with the error "no implicit conversion of Sprockets::Asset into String", How can I solve the issue? here is the entire log of this issue http://stackoverflow.com/questions/31444000/typeerror-in-spreeadminordersshow-no-implicit-conversion-of-sprocketsass
[02:19:26] hololeap: has joined #RubyOnRails
[02:20:23] dynomist: has joined #RubyOnRails
[02:20:33] chipotle: has joined #RubyOnRails
[02:21:17] dopie: has joined #RubyOnRails
[02:22:10] dynomist: Should all rails Associations be defined on both ends? i.e. If Customers has_many Orders - then Orders should also belong_to Customers ?
[02:22:52] dynomist: Same thing for if Customers has_one Orders - then Order should belong_to Cusomter ?
[02:23:16] pullphinger: has joined #RubyOnRails
[02:23:17] pontiki: it's a good practice to do so, dynomist
[02:23:53] dynomist: thanks pontiki
[02:24:09] avitzurel: has joined #RubyOnRails
[02:24:31] dynomist: the documentation doesn't really emphasize this enough IMO
[02:25:10] pontiki: what bit of documentation omits them in discussing model relationships?
[02:27:06] dynomist: I've been reading over several things, including http://guides.rubyonrails.org/association_basics.html - it's not that the relationships are omitted - it's just I didn't find it said strongly enough that all relationships need to be defined on both sides...
[02:28:04] mdel: any suggestions for allowing one user to grant access to a record they own to another user?
[02:28:12] Mendenhall: has joined #RubyOnRails
[02:28:18] mdel: I can think of several approaches, but curious what others may have in mind
[02:29:24] pontiki: why would it need to be emphasized more than being in every example and discussion?
[02:29:51] workmad3: has joined #RubyOnRails
[02:32:29] charliesome: has joined #RubyOnRails
[02:32:34] xcesariox: has joined #RubyOnRails
[02:32:47] hahuang65: has joined #RubyOnRails
[02:33:00] avitzurel: has joined #RubyOnRails
[02:34:46] dented42: has joined #RubyOnRails
[02:35:01] Xiti: has joined #RubyOnRails
[02:36:01] dopie: has joined #RubyOnRails
[02:36:15] bronson: has joined #RubyOnRails
[02:41:43] Guest683: has joined #RubyOnRails
[02:44:07] michaeldeol: has joined #RubyOnRails
[02:47:14] Amadiro: has joined #RubyOnRails
[02:47:28] Amadiro: has left #RubyOnRails: ("Leaving")
[02:48:33] BenMorganIO: has joined #RubyOnRails
[02:50:45] erich: has joined #RubyOnRails
[02:51:40] erich: has joined #RubyOnRails
[02:53:43] erich: has joined #RubyOnRails
[02:56:04] baweaver: has joined #RubyOnRails
[03:00:58] rails052: has joined #RubyOnRails
[03:01:22] Lightsword: has joined #RubyOnRails
[03:01:27] uris: has joined #RubyOnRails
[03:04:07] davidconnolly: has joined #RubyOnRails
[03:05:24] bronson: has joined #RubyOnRails
[03:05:34] darrencauthon: has joined #RubyOnRails
[03:07:51] bricker: mdel: what are you wondering about? the data model?
[03:09:01] mdel: bricker: in a sense, yes. has_many :through is working just fine (after I learned some of the new stuff in Rails 3 &4)
[03:09:26] mdel: I was just curious if there were any other solutions or gems people would suggest for this seemingly common scenario
[03:09:31] oscarb92: has joined #RubyOnRails
[03:09:44] mdel: and yes, I've been out of the rails game since before 3 :)
[03:09:49] braincrash: has joined #RubyOnRails
[03:10:07] one_zero: has joined #RubyOnRails
[03:10:36] bricker: mdel: no need for a has_many through, just have a join model with user_id, thing_id and thing_type, then add to/remove from that
[03:10:50] bricker: then you check that table when you're verifying authorization
[03:11:43] mdel: if I understand correctly, the :through just gives me nice methods for accessing the data from the join table, yah?
[03:12:37] mdel: or rather, the has_many :through
[03:12:55] oscarbr92: has joined #RubyOnRails
[03:13:49] pwnd_nfsw: mdel, sure does
[03:14:04] bricker: mdel: sure but I don't see why you need it or how you would use it in this case
[03:14:39] mdel: I have Groups, Users, Memberships. I'd like the nice user.memberships method to get all groups
[03:14:48] oscarbr92: I'm new to rails
[03:14:55] mdel: if that doesn't make sense feel free to set me straight ;)
[03:15:16] oscarbr92: I'm wondering why rake db:migrate won't alter the schema.db file or the database itself :/
[03:15:16] uris: has joined #RubyOnRails
[03:15:17] bricker: mdel: Oh, it makes sense
[03:15:26] bricker: mdel: I guess it just depends on what you're doing with the data
[03:15:46] mdel: got it - I didn't exactly give you all the details up front :)
[03:15:46] bricker: oscarbr92: if it's not then it's possible that rails thinks the migration has already run
[03:16:09] bricker: mdel: yeah those business-specific questions are hard to answer
[03:16:27] bricker: requires a full understanding of your application, business needs, etc.
[03:16:55] one_zero: has joined #RubyOnRails
[03:17:02] oscarbr92: @bricker yea, it does look like it runs it, but there's no alteration on the schema.db
[03:18:47] erich: has joined #RubyOnRails
[03:19:42] oscarbr92: bricker: it happens with an specific migration (changing the data type of a column in a table) but if I add a column to another table, the command works
[03:20:04] bricker: oscarbr92: well maybe your migration is written incorrectly
[03:21:44] oscarbr92: bricker: I just altered the migration file where I created the table. I've done this before to add fields and It has worked.
[03:22:25] bricker: oscarbr92: you need to write a new migration to alter the schema, migration files only run once
[03:23:45] htmldrum: has joined #RubyOnRails
[03:25:09] imkj: oscarbr92: You could also rollback and remigrate... but I'd only consider that viable if it's only a local migration (e.g. not pushed yet).
[03:27:36] oscarbr92: imkj: I'm kinda avoiding that, I'm using SQL Server 2008 with the sql server adapter for that version with rails 4.1.8. And there's no way to add foreign keys with rails before version 4.2. So I had to do them manually on the database management. And they're quite a lot :/
[03:28:23] bricker: yeah that sucks
[03:29:18] oscarbr92: imkj: plus that adapter doesn't support other commands that db:migrate (not reset, or purge,..)
[03:29:56] crdpink: has joined #RubyOnRails
[03:29:56] Creeves: has joined #RubyOnRails
[03:30:07] imkj: Yeah, that sucks. I'm not familiar with SQL Server 2008 (PostgreSQL man myself), but in that case I'd definitely go with Bricker's idea and make another migration to edit the schema.
[03:30:36] Eminence_: has joined #RubyOnRails
[03:30:55] Domon: has joined #RubyOnRails
[03:31:15] oscarbr92: imkj: not my choice, friend. Requirements from the company (mostly work with MySQL or PostgreSQL as well)
[03:32:58] charliesome: has joined #RubyOnRails
[03:33:06] imkj: oscarbr92: We've all been there, one way or another. "FOSS" is still a scary term to some companies.
[03:34:51] oscarbr92: imkj: well, I think they are embracing it by letting me code this app on RoR. So, It's a start :D
[03:35:09] drakedouay: has joined #RubyOnRails
[03:35:12] drakedouay: i am missing mod_passenger.so after updating my system. Is this a generic file, or is it something customized to my system?
[03:37:37] duncannz: has joined #RubyOnRails
[03:37:58] imkj: oscarbr92: I suppose so! Let's hope they keep it up! :D
[03:41:32] idd2d: has joined #RubyOnRails
[03:42:39] eggoez: has joined #RubyOnRails
[03:42:43] idd2d: has joined #RubyOnRails
[03:44:59] ecksit: has joined #RubyOnRails
[03:45:05] rakm: has joined #RubyOnRails
[03:47:12] imkj: has joined #RubyOnRails
[03:47:51] Domon: has joined #RubyOnRails
[03:48:30] blindMoe|2: has joined #RubyOnRails
[03:50:17] rakm: hey, i'm a little rusty on using form helpers. geting an undefined_method 'email_reminder_path' with this code: http://pastie.org/10303534
[03:50:22] rakm: what am i doing wrong/
[03:50:55] XCMer: has joined #RubyOnRails
[03:52:14] imkj: The error is in your routes.rb. When you say "as: email_reminders_path" you're causing the resultant path to be: email_reminder_path_path.
[03:52:41] imkj: rakm: Change the "as" clause to: "as: :email_reminders" and try again.
[03:53:32] givanse: has joined #RubyOnRails
[03:59:34] ur5us: has joined #RubyOnRails
[03:59:58] imuglyandimproud: has joined #RubyOnRails
[04:01:26] kp666: has joined #RubyOnRails
[04:01:56] kp666: has joined #RubyOnRails
[04:02:52] tjbiddle: has joined #RubyOnRails
[04:02:53] imuglyandimproud: Hi there. Why when I set up a has_many/belongs_to relation between a product and purchase, within a mountable engine named Store, an error is thrown saying purchase_id is an unknown attribute of a product. The relation is set up in the schema, however that reflects a column named store_product_id. How do I get the function to recognize the prefix?
[04:03:04] dented42: has joined #RubyOnRails
[04:03:08] fgo: has joined #RubyOnRails
[04:06:18] Creeves: has joined #RubyOnRails
[04:07:23] fighella: has left #RubyOnRails: ()
[04:07:51] uri__: has joined #RubyOnRails
[04:08:53] pwnz0r: has joined #RubyOnRails
[04:09:54] imkj: imuglyandimproud: When creating the belongs_to association, you can pass a custom foreign key like so: belongs_to :model, foreign_key: 'store_product_id'.
[04:11:19] imkj: imuglyandimproud: You'll have to specify it for both the has_many and the belongs_to association, if I'm correct. Here's the relevant doc: http://api.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.html
[04:12:06] christiandsg: has joined #RubyOnRails
[04:13:45] yfeldblum: has joined #RubyOnRails
[04:14:47] imkj: ison imuglyandimproud
[04:18:45] workmad3: has joined #RubyOnRails
[04:19:25] siemprefresco: has joined #RubyOnRails
[04:22:18] sevenseacat: has joined #RubyOnRails
[04:27:14] mcr-credil: has joined #RubyOnRails
[04:27:26] siemprefresco: has joined #RubyOnRails
[04:29:06] broman: has joined #RubyOnRails
[04:32:13] thatkid: Hello, I want to run migrations from particular version number, Is there any way to do that?
[04:32:48] baweaver: has joined #RubyOnRails
[04:35:43] user1138: has joined #RubyOnRails
[04:37:02] Scripore: has joined #RubyOnRails
[04:39:03] Radar: thatkid: rake db:migrate VERSION=version I think
[04:40:36] rakm: has joined #RubyOnRails
[04:42:20] kies^: has joined #RubyOnRails
[04:43:48] srinidhi: has joined #RubyOnRails
[04:44:05] rakm: how do I add a checkbox param in a form_for that is a custom param and not an attribute of the resource?
[04:44:06] rakm: http://pastie.org/10303589
[04:46:23] hahuang65: has joined #RubyOnRails
[04:50:56] smathy: rakm, check_box_tag
[04:52:05] duderonomy: has joined #RubyOnRails
[04:52:54] imuglyandimproud: smathy whats up?
[04:53:30] smathy: Y'know, people bitch about the stalwarts here not treating newbs kindly, but if I had a penny for every person who was helped and who showed no signs of gratitude afterwards - I'd be a very rich man.
[04:53:57] smathy: ...for those who are curious
[04:54:04] Creeves: people don't say thanks?
[04:54:10] thatkid: smathy : :)
[04:54:19] smathy: Creeves, neither thatkid nor imuglyandimproud did.
[04:54:37] imuglyandimproud: smathy, imkj logged off so I had no chance
[04:54:40] Creeves: oh true :( though are we sure they saw the replies?
[04:55:07] smathy: imuglyandimproud, fair enough, sorry.
[04:55:17] bwlang: has joined #RubyOnRails
[04:55:30] Creeves: should have a bot that parses "user: thanks" and if user isn't in the chan it tells them once they're back :D
[04:55:31] imuglyandimproud: smathy, but if I was to say anything back, I would say thanks because it did solve my issue
[04:56:14] smathy: My rant wasn't really directed at either of you guys imuglyandimproud or thatkid - I actually think that it's perfectly understandable for people to seem (or even be) rude on occasion, especially online.
[04:56:33] smathy: Mistakes are common, forgetfulness is common, distraction is common.
[04:56:55] imuglyandimproud: smathy emotional intent is one of those things text falters at
[04:56:55] smathy: My main gripe is when people criticize (we) stalwarts for being rude to newbs.
[04:57:10] Creeves: i never see anyone in here really rude to newbs
[04:57:20] Creeves: unless the newbs repeatedly refuse to follow instructions
[04:57:27] thatkid: smathy: I think I forgot to say thanks while dabbling with DB, But the gratitude to the people like Radar can't end up in a "thanks" :)
[04:57:33] smathy: My point is really that everyone can seem rude, and even that everyone can BE rude, take it or leave it - that's the reality.
[04:57:47] jenrzzz: has joined #RubyOnRails
[04:57:50] smathy: thatkid, yep, perfectly understandable.
[04:58:16] imuglyandimproud: I've been using this chann for about a year and a half now, but always lurked in discussions
[04:58:35] smathy: Creeves, thanks - that's a refreshing perspective that I think is mostly the norm here.
[04:59:07] Creeves: for sure yeah :) but i can't say it extends to most chans
[04:59:12] Creeves: especially not on freenode i've found
[04:59:40] Creeves: for instance everyone here is much less stricter about keeping discussion on the topic of rails
[05:01:25] smathy: Creeves, yeah, I've never heard a criticism about that.
[05:01:57] srinidhi: has joined #RubyOnRails
[05:03:05] smathy: Anyway, </rant> - sorry to imuglyandimproud and thatkid for seeming like I was singling you guys out (great nicks btw).
[05:03:46] imuglyandimproud: smathy thanks, I take pride in my lack of self esteem
[05:04:31] oscarbr92: bricker: thank you, doing a new migration file worked
[05:04:36] smathy: Oh, maybe I misunderstood, maybe I don't like your nick at all :) I read that you were ugly but still your self esteem was strong.
[05:04:51] oscarbr92: imkj: thank you for your help as well
[05:05:21] thatkid: smathy: Just wondering, What's the good way to show some gratitude towards sevenseacat? Incase of Radar, I can buy his books :)
[05:06:16] Creeves: thatkid: you can buy Radar and sevenseacat's book at the same time
[05:06:57] Creeves: i believe they're both authors of this one http://www.manning.com/bigg2/
[05:08:03] michael_mbp: has joined #RubyOnRails
[05:09:13] lxsameer: has joined #RubyOnRails
[05:09:13] lxsameer: has joined #RubyOnRails
[05:09:36] Radar: yes you can buy Rails 4 in Action to show gratitude :)
[05:09:43] Radar: Recommending it to others also goes a way to helping
[05:09:51] thatkid: Creeves: I was not aware about the real name of the sevenseacat, thanks for that :)
[05:10:42] blindMoe|2: has left #RubyOnRails: ()
[05:10:52] blindMoe: has joined #RubyOnRails
[05:11:47] thatkid: Radar: already have a copy of that, I'll buy something from here https://leanpub.com/u/ryanbigg :)
[05:12:05] Radar: Yes that helps too :D
[05:12:10] Radar: Want a coupon code?
[05:12:24] thatkid: Radar: sure :)
[05:12:29] Radar: It's been ages since I've discounted MTWR.
[05:13:00] Radar: thatkid: https://leanpub.com/multi-tenancy-rails/c/10off
[05:13:10] Radar: And anyone else who wants Multitenancy with Rails for $10.
[05:13:33] sp1rs: has joined #RubyOnRails
[05:23:07] sevenseacat: has joined #RubyOnRails
[05:23:29] sevenseacat: someone sneaky knows my real name?
[05:24:46] jenrzzz: has joined #RubyOnRails
[05:24:54] cornerma1: has joined #RubyOnRails
[05:25:00] rvanlieshout: has joined #RubyOnRails
[05:25:29] markalanevans: has joined #RubyOnRails
[05:29:23] aganov: has joined #RubyOnRails
[05:30:29] riotjones: has joined #RubyOnRails
[05:32:20] roolo: has joined #RubyOnRails
[05:34:35] imkj: has joined #RubyOnRails
[05:35:02] XCMer: has joined #RubyOnRails
[05:35:42] Creeves: sevenseacat: it's hard to recommend your book without giving it away haha
[05:36:12] tagrudev: has joined #RubyOnRails
[05:36:29] thatkid: sevenseacat: :)
[05:38:10] Mendenhall: has joined #RubyOnRails
[05:41:31] arooni-mobile: has joined #RubyOnRails
[05:41:48] dhjondoh: has joined #RubyOnRails
[05:42:29] Rubie: has joined #RubyOnRails
[05:42:41] echosystm: has joined #RubyOnRails
[05:42:52] echosystm: i need help with an association.
[05:43:10] echosystm: a "Friendship" has a "from_user" and a "to_user".
[05:43:34] echosystm: a "Story" has a "user"
[05:43:35] Creeves: has joined #RubyOnRails
[05:44:01] echosystm: how can i add an association that allows me to get Stories for either user involved in a Friendship?
[05:45:09] darutoko: has joined #RubyOnRails
[05:48:21] harisamin: has joined #RubyOnRails
[05:50:45] rickmasta: has joined #RubyOnRails
[05:52:37] Supertanker2: has joined #RubyOnRails
[05:53:13] hd1: has joined #RubyOnRails
[05:53:49] hd1: ACTION wonders how to test that his views are loaded properly
[05:54:11] metus_violarium: has joined #RubyOnRails
[05:54:13] hd1: i don't think rspec starts webrick, does it?
[05:54:27] Radar: hd1: What exactly are you trying to do?
[05:54:32] Radar: Why wouldn't your views be loaded properly?
[05:55:10] OS-14813: has joined #RubyOnRails
[05:55:35] fgo: has joined #RubyOnRails
[05:56:12] imkj: hd1: To answer your question: RSpec does not start Webrick, AFAIK. But indeed, what are you trying to do?
[05:56:51] krokuz: has joined #RubyOnRails
[05:56:58] hd1: I'm trying to verify that the view has the code it should
[05:57:24] hd1: i could get away with checking the status code of the request
[05:58:12] imkj: You don't need Webrick for that. You can write view specs if your views contain logic (they shouldn't, but hey). Otherwise, I'd test my models and my controllers properly and just display the data in the view.
[05:59:27] hd1: imkj: I would also like to verify that one user can see all the models, while the others can only see models they own
[06:00:30] hd1: i guess i could do that by creating 2 models for two users and then testing whether one user can see 2 instances while the other can see only 1
[06:01:18] XCMer: has joined #RubyOnRails
[06:02:41] imkj: hd1: Personally, I'd have two contexts: with the 'super' user (who can see all models) and one with the 'regular' user. Then I'd check that the controller layer assigns the models to the variable using the "assigns" matcher. That way, the tests do not break if you decide to change your format (e.g. HTML to JSON) or you change your representation.
[06:05:01] Radar: Can someone with Carrierwave experience explain this? https://gist.github.com/radar/f27a6d4d16091e524a45
[06:05:12] Radar: fn_large is a carrierwave-backed field
[06:05:21] Radar: I would think by setting it to nil it would, you know, not be present
[06:05:46] imkj: Radar: I remember having a similar issue like this sometime ago... Hm.
[06:05:53] rvanlieshout: is it also present after a advert.reload?
[06:05:56] Radar: rvanlieshout: ye
[06:06:38] rvanlieshout: so the db column still holds data?
[06:07:27] workmad3: has joined #RubyOnRails
[06:07:56] Radar: advert.fn_large.file.delete fixes it
[06:08:03] rvanlieshout: https://github.com/carrierwaveuploader/carrierwave/blob/a1b96d05d021f0ab53c8a2ef460bc96664e52b79/lib/carrierwave/orm/activerecord.rb#L66
[06:08:04] Radar: but I want to know why nil'ing doesn't do the same sorta thing
[06:08:19] rvanlieshout: what if you call advert.fn_large_will_change! before the save?
[06:08:21] Radar: lol carrierwave
[06:08:33] imkj: Radar: IIRC, the "fn_large = nil" set the contents of the file to nil.
[06:08:58] imkj: But the database column still contained a link.
[06:09:06] imkj: It's been a while though.
[06:09:09] Radar: advert.remove_fn_large = true
[06:09:11] Radar: advert.save
[06:09:12] Radar: that fixes it
[06:09:21] rvanlieshout: cause that'll call the will_change
[06:09:36] sinkensabe: has joined #RubyOnRails
[06:09:45] rvanlieshout: that #{column}=(new_file_ only calls that if !(new_file.blank? ...)
[06:09:50] Radar: Thanks for playing everyone :)
[06:10:34] dideler: has joined #RubyOnRails
[06:11:47] chrissonar: has joined #RubyOnRails
[06:11:51] XCMer: has joined #RubyOnRails
[06:13:06] yardenbar: has joined #RubyOnRails
[06:14:37] arBmind: has joined #RubyOnRails
[06:17:03] Rukeal: has joined #RubyOnRails
[06:17:24] rickmasta: has joined #RubyOnRails
[06:17:42] lxsameer: has joined #RubyOnRails
[06:19:14] vigasdeep: has joined #RubyOnRails
[06:21:30] arup_r: has joined #RubyOnRails
[06:23:16] arup_r1: has joined #RubyOnRails
[06:25:11] arup_r1: has joined #RubyOnRails
[06:25:46] arup_r1: has joined #RubyOnRails
[06:26:10] schaerli: has joined #RubyOnRails
[06:29:04] alphaatom: has joined #RubyOnRails
[06:31:09] neanderslob: hi everyone, I'm trying to figure out how to clear all nested models if the parent has a value of false for a particular field
[06:31:17] riotjones: has joined #RubyOnRails
[06:31:45] neanderslob: I've asked the question in more detail on stack overflow: http://stackoverflow.com/questions/31531438/clear-all-nested-models-if-parent-has-field-of-particular-value
[06:31:57] neanderslob: if anyone's up for having a look it would be appreciated
[06:35:40] rvanlieshout: neanderslob: you could process that in a before_save callback
[06:36:19] markholmes: has joined #RubyOnRails
[06:36:35] calleerlandsson: has joined #RubyOnRails
[06:36:44] neanderslob: rvanlieshout: cool, thanks for the reply; which model should I put it in? does it matter?
[06:37:17] rvanlieshout: the one that holds the change
[06:39:03] imkj: neanderslob: Yeah, rvanlieshout is right. In the before_save callback check for the value and then clear the nested models if necessary.
[06:40:29] hd1: to verify server's http responses, i need to run it, how do i do this using rspec?
[06:40:37] hd1: for example, i
[06:40:53] riotjones: has joined #RubyOnRails
[06:41:06] hd1: d like a route to return 401 if the user doesn't have access to the model instance and 200 if they do
[06:41:18] imkj: hd1: You can use controller specs for that too.
[06:41:27] hd1: imkj: how?
[06:41:38] rvanlieshout: hd1: use an integration test?
[06:41:55] imkj: hd1: Or that.
[06:41:55] neanderslob: imkj: so to clear the nested model, should I just change the value for each nested _destroy param, or is there a more elegant way to do it?
[06:42:06] blindMoe|2: has joined #RubyOnRails
[06:42:12] rvanlieshout: neanderslob: it all depends on what exactly you're trying to clear
[06:42:33] rvanlieshout: in the before_save you can use self.foobar = nil or []
[06:42:36] rvanlieshout: for several things
[06:42:57] imkj: hd1: In the controller spec you can test certain actions with certain parameters, using things like, e.g.: get :show, id: fixture.id
[06:43:32] imkj: hd1: Then you can do: "expect(response).to have_http_status(:unauthorized)"
[06:43:49] BenMorganIO: has joined #RubyOnRails
[06:43:52] Rubie: has joined #RubyOnRails
[06:45:15] imkj: hd1: Kind of depends what you want to do. Otherwise, rvanlieshout's suggestion of using integration tests could be useful too. If it's just about the actions of one controller, using a controller spec is handier.
[06:45:17] neanderslob: rvanlieshout: ah, ok; so in your example I would be setting the roles array for the given person to be empty so in other words: self.roles=[]?
[06:45:56] rvanlieshout: neanderslob: yep
[06:47:26] neanderslob: rvanlieshout: cool; one last question before I give it a shot, do I need to loop through each person or does the before_save callback do that automatically?
[06:48:18] rvanlieshout: isn't it a boolean on a person you edit?
[06:49:17] neanderslob: correct and if the given person's boolean is false I want to clear the nested
[06:49:28] charliesome: has joined #RubyOnRails
[06:49:36] neanderslob: ...for that person
[06:49:40] rvanlieshout: then what loop do you need?
[06:50:29] ur5us: has joined #RubyOnRails
[06:50:30] neanderslob: rvanlieshout: ah, because this is a form_for company and company has_many people
[06:50:41] neanderslob: people are generated dynamically by cocoon as well
[06:50:54] rvanlieshout: ah right. the callback is invoked for each person
[06:51:10] neanderslob: rvanlieshout: sweet
[06:51:19] charliesome: has joined #RubyOnRails
[06:51:29] netzfisch: has joined #RubyOnRails
[06:52:00] neanderslob: rvanlieshout: well many thanks then; off to give it a shot
[06:52:07] xkickflip: has joined #RubyOnRails
[06:52:21] neanderslob: rvanlieshout: thanks :-)
[06:55:12] baweaver: has joined #RubyOnRails
[06:58:44] DoctorMonocular: has joined #RubyOnRails
[07:00:37] noodman: has joined #RubyOnRails
[07:00:52] Palsson: has joined #RubyOnRails
[07:01:09] Lightsword: has joined #RubyOnRails
[07:05:21] JohnBat26: has joined #RubyOnRails
[07:12:25] schaerli: has joined #RubyOnRails
[07:13:19] sp1rs: has joined #RubyOnRails
[07:18:57] dlt_: has joined #RubyOnRails
[07:21:14] neanderslob: rvanlieshout: hey, just wanted to say thanks again, worked like a charm
[07:23:20] yfeldblum: has joined #RubyOnRails
[07:24:52] cac: has joined #RubyOnRails
[07:25:05] Sylario: has joined #RubyOnRails
[07:25:21] rakm: has joined #RubyOnRails
[07:27:16] arup_r: has joined #RubyOnRails
[07:29:39] professor_soap: has joined #RubyOnRails
[07:29:41] DukeDave: has joined #RubyOnRails
[07:30:17] professor_soap: has left #RubyOnRails: ()
[07:31:41] comrad: has joined #RubyOnRails
[07:34:38] Guest_: has joined #RubyOnRails
[07:35:43] artto: has joined #RubyOnRails
[07:36:44] artto: has joined #RubyOnRails
[07:40:38] zpe: has joined #RubyOnRails
[07:41:44] fgo: has joined #RubyOnRails
[07:42:05] duncannz: has joined #RubyOnRails
[07:43:14] duncannz: has joined #RubyOnRails
[07:43:58] rails733: has joined #RubyOnRails
[07:45:42] MaDErroR123: has joined #RubyOnRails
[07:46:49] rails733: Hi! On my production server if i open <root url>/assets/ I get an error like "Sprockets::ArgumentError Asset logical path has no extension: .css". Does anyone know how to hide this error or catch it with a default error page so that a user cannot see it?
[07:46:52] krz: has joined #RubyOnRails
[07:47:19] Anakat: has joined #RubyOnRails
[07:49:17] DoctorMonocular: has joined #RubyOnRails
[07:50:08] christiandsg: has joined #RubyOnRails
[07:51:16] Supertanker2: has joined #RubyOnRails
[07:51:20] Supertanker2: Have I mentioned how much I love Ruby on Rails yet :o https://twitter.com/MxMalloc/status/623386987752374272
[07:51:27] matcouto: has joined #RubyOnRails
[07:51:32] Supertanker2: Guess I should implement email verification next.
[07:51:42] Supertanker2: And pagination using will_pagination (unless Rails has something easier that I missed?)
[07:52:18] hd1: yes you need to use stylesheet_tag instead of linking directly to the asset
[07:52:28] hd1: Supertanker
[07:52:31] matcouto: has joined #RubyOnRails
[07:52:52] rails733: I alway use stylesheet tag its just if i open the url in browser
[07:52:56] CheckYourSix: has joined #RubyOnRails
[07:53:10] Supertanker2: hd1, eh? I think it is using stylesheet_tag in my layout.
[07:53:28] Supertanker2: I'm using rails' asset pipeline (which is a bit of a mystery but it works) with the bootstrap-sass gem.
[07:53:33] hd1: Supertanker2: then it should come up fine in your browser
[07:53:40] exadeci: has joined #RubyOnRails
[07:53:40] rails733: I dont want the user to see errors with such detailed info about my application and the server
[07:54:00] Supertanker2: hd1, oh, you mean rails733 I think.
[07:54:05] matcouto: has joined #RubyOnRails
[07:54:06] hd1: ACTION bypassed boostrap-sass to get the assetes pipeline to work
[07:54:15] MiracleBlue: has joined #RubyOnRails
[07:54:16] Supertanker2: I'm just here to bask in how much fun I'm having programming Rails :o
[07:54:19] rvanlieshout: rails733: that's based on the environment
[07:54:28] hd1: Supertanker2: sorry, mate
[07:54:28] Supertanker2: And absorb good advice via osmosis.
[07:54:35] rvanlieshout: see your config/environments/*.rb
[07:54:46] schaerli: has joined #RubyOnRails
[07:54:52] matcouto: has joined #RubyOnRails
[07:55:21] rails733: Is there a special configuration?
[07:55:27] rvanlieshout: rails733: not special
[07:55:35] rvanlieshout: in what environment is your app running?
[07:55:42] rvanlieshout: cause you would expect detailed error information when running in development
[07:55:52] rails733: For all the other errors like 404, 422 and 500 I show up some custom error pages
[07:56:00] rails733: its on production
[07:56:09] workmad3: has joined #RubyOnRails
[07:56:10] rvanlieshout: and what does it show when?
[07:56:27] matcouto: has joined #RubyOnRails
[07:56:29] rvanlieshout: and what's in your production.rb about local requests?
[07:57:20] rails733: config.consider_all_requests_local = true
[07:57:23] rails733: Did you mean this one?
[07:57:36] x44x45x41x4E: has joined #RubyOnRails
[07:57:42] Lightsword: has joined #RubyOnRails
[07:57:56] matcouto: has joined #RubyOnRails
[07:58:44] rvanlieshout: rails733: yes
[07:58:46] matcouto: has joined #RubyOnRails
[07:58:52] rvanlieshout: that will result in detailed error information
[07:59:03] blackmes1: has joined #RubyOnRails
[07:59:05] rvanlieshout: maybe check the defaults for that file, cause it also affects caching
[07:59:23] rails733: so should it be false?
[07:59:35] rvanlieshout: have you read about what it does?
[08:00:17] matcouto: has joined #RubyOnRails
[08:00:45] rails733: Oh now I understood
[08:00:47] ruurd: has joined #RubyOnRails
[08:00:53] rails733: It should be false in production
[08:01:07] rvanlieshout: maybe also check the other configuration params in that file
[08:01:33] rails733: Ok i will do so
[08:01:38] rails733: thanks a lot :)
[08:01:41] rvanlieshout: not related to your problem
[08:01:48] rvanlieshout: but it's strange that it was set to true
[08:01:50] matcouto: has joined #RubyOnRails
[08:02:02] rvanlieshout: so you might also have others non-optimal for production
[08:02:36] matcouto: has joined #RubyOnRails
[08:02:47] mikecmpbll: has joined #RubyOnRails
[08:03:23] matcouto: has joined #RubyOnRails
[08:04:03] Anakat: has joined #RubyOnRails
[08:04:09] matcouto: has joined #RubyOnRails
[08:04:19] inoter: has joined #RubyOnRails
[08:04:59] matcouto: has joined #RubyOnRails
[08:05:43] Anakat_: has joined #RubyOnRails
[08:06:28] matcouto: has joined #RubyOnRails
[08:07:15] matcouto: has joined #RubyOnRails
[08:07:18] tsujp: has joined #RubyOnRails
[08:07:32] Anakat__: has joined #RubyOnRails
[08:07:56] mcr-credil: has joined #RubyOnRails
[08:08:01] matcouto: has joined #RubyOnRails
[08:08:02] jsrn_: has joined #RubyOnRails
[08:08:26] ledestin: has joined #RubyOnRails
[08:08:50] matcouto: has joined #RubyOnRails
[08:09:12] Anakat: has joined #RubyOnRails
[08:09:31] ur5us: has joined #RubyOnRails
[08:09:37] matcouto: has joined #RubyOnRails
[08:09:47] stardiviner: has joined #RubyOnRails
[08:11:09] matcouto: has joined #RubyOnRails
[08:11:11] ruurd: has joined #RubyOnRails
[08:12:39] matcouto: has joined #RubyOnRails
[08:12:50] Anakat_: has joined #RubyOnRails
[08:13:13] charliesome: has joined #RubyOnRails
[08:14:12] matcouto: has joined #RubyOnRails
[08:14:33] Anakat: has joined #RubyOnRails
[08:14:44] fgo: has joined #RubyOnRails
[08:14:48] noodman: has joined #RubyOnRails
[08:15:45] matcouto: has joined #RubyOnRails
[08:16:02] michael_mbp: has joined #RubyOnRails
[08:16:22] Anakat__: has joined #RubyOnRails
[08:16:36] ur5us_: has joined #RubyOnRails
[08:17:08] axl_: has joined #RubyOnRails
[08:17:14] matcouto: has joined #RubyOnRails
[08:18:04] Anakat_: has joined #RubyOnRails
[08:18:05] matcouto: has joined #RubyOnRails
[08:18:48] terpo: has joined #RubyOnRails
[08:18:53] matcouto: has joined #RubyOnRails
[08:19:40] ur5us: has joined #RubyOnRails
[08:20:04] Anakat: has joined #RubyOnRails
[08:20:22] matcouto: has joined #RubyOnRails
[08:21:09] matcouto: has joined #RubyOnRails
[08:21:51] Anakat__: has joined #RubyOnRails
[08:22:38] dlitz: has joined #RubyOnRails
[08:22:41] matcouto: has joined #RubyOnRails
[08:23:19] gremax: has joined #RubyOnRails
[08:23:26] matcouto: has joined #RubyOnRails
[08:23:27] Anakat_: has joined #RubyOnRails
[08:24:15] matcouto: has joined #RubyOnRails
[08:25:29] Anakat: has joined #RubyOnRails
[08:25:50] matcouto: has joined #RubyOnRails
[08:27:22] Anakat__: has joined #RubyOnRails
[08:27:23] matcouto: has joined #RubyOnRails
[08:28:04] marr: has joined #RubyOnRails
[08:28:26] dsf: has joined #RubyOnRails
[08:28:52] matcouto: has joined #RubyOnRails
[08:29:50] sdff: has joined #RubyOnRails
[08:30:22] matcouto: has joined #RubyOnRails
[08:30:47] Anakat: has joined #RubyOnRails
[08:30:59] dgs: has joined #RubyOnRails
[08:31:13] matcouto: has joined #RubyOnRails
[08:31:56] matcouto: has joined #RubyOnRails
[08:32:21] DoubleMalt: has joined #RubyOnRails
[08:32:48] matcouto: has joined #RubyOnRails
[08:32:49] Anakat_: has joined #RubyOnRails
[08:34:16] matcouto: has joined #RubyOnRails
[08:34:22] Anakat__: has joined #RubyOnRails
[08:34:47] imkj: has joined #RubyOnRails
[08:35:02] matcouto: has joined #RubyOnRails
[08:35:50] matcouto: has joined #RubyOnRails
[08:36:08] mcr-credil: has joined #RubyOnRails
[08:36:26] Anakat: has joined #RubyOnRails
[08:36:39] matcouto: has joined #RubyOnRails
[08:37:13] schaerli: has joined #RubyOnRails
[08:37:26] matcouto: has joined #RubyOnRails
[08:37:54] Anakat_: has joined #RubyOnRails
[08:38:11] matcouto: has joined #RubyOnRails
[08:38:57] matcouto: has joined #RubyOnRails
[08:39:05] Eminence_: has joined #RubyOnRails
[08:39:14] skroon: has joined #RubyOnRails
[08:39:44] Anakat__: has joined #RubyOnRails
[08:39:48] matcouto: has joined #RubyOnRails
[08:40:31] matcouto: has joined #RubyOnRails
[08:41:21] matcouto: has joined #RubyOnRails
[08:41:22] RTG`: has joined #RubyOnRails
[08:41:38] Pupeno: has joined #RubyOnRails
[08:41:40] Anakat: has joined #RubyOnRails
[08:42:05] matcouto: has joined #RubyOnRails
[08:42:22] sp1rs: has joined #RubyOnRails
[08:42:38] rrawlins: has joined #RubyOnRails
[08:42:56] matcouto: has joined #RubyOnRails
[08:43:27] Anakat: has joined #RubyOnRails
[08:43:39] matcouto: has joined #RubyOnRails
[08:44:28] matcouto: has joined #RubyOnRails
[08:45:00] Anakat_: has joined #RubyOnRails
[08:45:16] matcouto: has joined #RubyOnRails
[08:46:05] matcouto: has joined #RubyOnRails
[08:46:50] matcouto: has joined #RubyOnRails
[08:47:02] Anakat__: has joined #RubyOnRails
[08:47:16] arup_r: has joined #RubyOnRails
[08:47:36] matcouto: has joined #RubyOnRails
[08:48:51] Anakat: has joined #RubyOnRails
[08:50:21] Anakat_: has joined #RubyOnRails
[08:52:11] Anakat__: has joined #RubyOnRails
[08:53:58] Anakat: has joined #RubyOnRails
[08:54:32] mikecmpbll: how can I check that an object is an AR scope/relation?
[08:54:56] rvanlieshout: object.is_a?(...)
[08:55:22] mikecmpbll: ah balls, the output from scope.class was confusing me
[08:55:40] mikecmpbll: Foo.where(id: 4).class => Foo::ActiveRecord_Relation
[08:55:56] Anakat_: has joined #RubyOnRails
[08:55:57] mikecmpbll: but Foo.where(id: 4).is_a?(ActiveRecord::Relation) works fine.
[08:57:17] naftilos76: has joined #RubyOnRails
[08:57:32] Anakat__: has joined #RubyOnRails
[08:58:01] gloscombe: has joined #RubyOnRails
[08:59:32] Anakat: has joined #RubyOnRails
[08:59:36] mikecmpbll: ergh, rails is always fighting me.
[08:59:54] nikhgupta: has joined #RubyOnRails
[09:01:03] Anakat_: has joined #RubyOnRails
[09:01:05] tbuehlmann: mikecmpbll, you could also check for .klass, which should return the model class
[09:01:58] grer: has joined #RubyOnRails
[09:02:44] mrbubbles: has joined #RubyOnRails
[09:02:59] Anakat__: has joined #RubyOnRails
[09:03:18] gfds: has joined #RubyOnRails
[09:03:52] mhib: has joined #RubyOnRails
[09:04:01] mikecmpbll: tbuehlmann: ah yes :). i hope rails sort out their connection handling in rails 5
[09:04:28] mikecmpbll: my life would be so much easier right now.
[09:04:34] stamina: has joined #RubyOnRails
[09:04:45] Anakat: has joined #RubyOnRails
[09:04:57] bmalum: has joined #RubyOnRails
[09:05:23] dici: has joined #RubyOnRails
[09:05:42] tbuehlmann: what do you mean?
[09:06:23] Anakat_: has joined #RubyOnRails
[09:06:29] mikecmpbll: the way that the connection is tied completely to the class, makes threading nigh-on impossible, basically this: http://tenderlovemaking.com/2011/10/20/connection-management-in-activerecord.html
[09:07:11] mikecmpbll: which means i'm having to this do kind of crap: https://github.com/meritec/querrel/blob/master/lib/querrel/querreller.rb#L31-L38
[09:07:33] mikecmpbll: making using different connections in different threads nigh-on impossible**
[09:08:13] Anakat__: has joined #RubyOnRails
[09:09:01] tbuehlmann: the usual question: why do you use threads in rails at all?
[09:09:14] mikecmpbll: heh. because sequentially isn't performant enough
[09:09:42] mikecmpbll: and i wanna use AR query lang ;(
[09:09:55] Anakat: has joined #RubyOnRails
[09:10:00] imkj: Frankly, if performance is of the utmost importance, I don't think Rails is the right fit anyhow.
[09:10:18] mikecmpbll: imkj: well, that's a silly thing to say :)
[09:10:49] arup_r: I am trying to make an list of users to whom current_user can send invitation .. The list I am doing right now .. user_lists = current_account.following + current_account.followers ... Any better way of doing it ? https://gist.github.com/aruprakshit/69896ae0060682b9479d
[09:10:58] imkj: mikecmpbll: Hey, don't get me wrong. I love Rails. I'm just saying you ought to use the right tools for the job I mean. :P
[09:11:14] mikecmpbll: rails is plenty fine, just needs to sort out it's connection handling.
[09:11:48] arup_r: I am looking for a associations has_many kind of to get the list out using a single query
[09:11:52] Anakat_: has joined #RubyOnRails
[09:12:03] imkj: mikecmpbll: Fair enough. All the best with that!
[09:13:40] Anakat__: has joined #RubyOnRails
[09:14:28] schaerli: has joined #RubyOnRails
[09:14:44] tbuehlmann: mikecmpbll, to add another layer of abstraction: use jobs for that?
[09:15:11] Anakat: has joined #RubyOnRails
[09:15:45] mikecmpbll: tbuehlmann: hm, interesting idea, but it needs to run in real time really
[09:15:57] krz: has joined #RubyOnRails
[09:16:47] mikecmpbll: but i'll have a look at how threaded job queues handle connections actually.
[09:17:05] Anakat_: has joined #RubyOnRails
[09:17:47] seansith: has joined #RubyOnRails
[09:19:01] Anakat__: has joined #RubyOnRails
[09:19:10] tbuehlmann: mikecmpbll, sucker_punch uses celluloid actors, which should be threads. as we have one connection per thread, each sucker_punch worker should hold one connection
[09:19:24] tbuehlmann: (releasing it after work, iirc)
[09:19:32] krz: has joined #RubyOnRails
[09:20:36] Anakat: has joined #RubyOnRails
[09:21:02] mikecmpbll: wonder what happens if you change connection inside a job
[09:21:15] mikecmpbll: and another job runs using the same AR class
[09:21:25] krz: has joined #RubyOnRails
[09:21:26] mikecmpbll: presumably you've changed connection for the other job too?
[09:21:32] rvanlieshout: the apartment gem also handles different connections
[09:22:15] safeforge: has joined #RubyOnRails
[09:22:16] tbuehlmann: mikecmpbll, why should the job change a connection?
[09:22:22] Anakat_: has joined #RubyOnRails
[09:22:32] mikecmpbll: tbuehlmann: to do work on another database? :)
[09:23:29] mikecmpbll: that's the crux of the whole thing, i need to be able to use a class to interface different databases in different threads. i've had an idea to create a dynamic temporary class in the thread which i'm just playing with atm
[09:23:31] arup_r: hints please... how to do it in a single query ?
[09:24:07] Anakat__: has joined #RubyOnRails
[09:24:08] rvanlieshout: arup_r: why would a single query be better?
[09:24:41] tbuehlmann: mikecmpbll, ah, I see. I'd probably just perform different jobs for that
[09:24:44] rvanlieshout: and hang on. let me write something
[09:25:25] dtcristo: has joined #RubyOnRails
[09:25:31] mikecmpbll: tbuehlmann: yeah, but you'd still have the same problem (theoretically), unless you had two seperate classes, or the jobs were running in different processes
[09:25:52] mikecmpbll: so i'm wondering if these job queues account for that, but i suspect not, it's kinda edge-case.
[09:25:53] Anakat: has joined #RubyOnRails
[09:26:35] rvanlieshout: arup_r: something like Follower.joins('INNER JOIN relationships ON relationships.follower_id = followers.id OR relationships.followed_id = followers.id').joins('INNER JOIN accounts ON accounts.id = relationships.account_id').where(accounts: { id: current_account.id })
[09:26:45] arup_r: rvanlieshout: Yes.. the reason is I will be using this user_list in a select_tag with options_from_collection_for_select(@user_lists, "id", "name")
[09:27:18] tbuehlmann: mikecmpbll, guess so, yeah
[09:27:41] Anakat_: has joined #RubyOnRails
[09:27:50] arup_r: if I do what I said above it is giving an array rather a collection object https://gist.github.com/aruprakshit/69896ae0060682b9479d#gistcomment-1497160
[09:28:21] rvanlieshout: but you did something totally different
[09:28:45] arup_r: So.. I am thinking to make a associations so that I can reuse it and make always a single query
[09:29:08] rvanlieshout: create an association for that: Follower.joins('INNER JOIN relationships ON relationships.follower_id = followers.id OR relationships.followed_id = followers.id').joins('INNER JOIN accounts ON accounts.id = relationships.account_id').where(accounts: { id: current_account.id })
[09:29:12] ruurd: has joined #RubyOnRails
[09:29:14] imkj: has left #RubyOnRails: ()
[09:29:34] workmad3: has joined #RubyOnRails
[09:29:42] Anakat__: has joined #RubyOnRails
[09:29:47] arup_r: Can we call `joins` method on the relationship name too ?
[09:30:30] rvanlieshout: why would you want that?
[09:30:48] arup_r: Asking because you used Follower .. I have no table such that
[09:31:05] rvanlieshout: arup_r: ah right. then gist the code
[09:31:09] Anakat: has joined #RubyOnRails
[09:31:13] emilkarl: has joined #RubyOnRails
[09:31:24] arup_r: https://gist.github.com/aruprakshit/69896ae0060682b9479d
[09:31:41] bin_005: has joined #RubyOnRails
[09:33:11] Anakat_: has joined #RubyOnRails
[09:34:05] rrawlins: howdy! I'm trying to configure a resource as my root route, however the generated routes don't seem to allow for :format on the index action.
[09:34:06] rrawlins: https://gist.github.com/SirRawlins/de6dd0c28b7c532d07c8
[09:34:25] rrawlins: Is this the correct behaviour? or am I doing something wrong? .... This is rails 4.1
[09:34:49] Anakat__: has joined #RubyOnRails
[09:34:54] relix: has joined #RubyOnRails
[09:35:01] rrawlins: Basicly I want to be able to access /index.html, /index.json and /index.xml
[09:35:12] rrawlins: At the moment all three throw a 404.
[09:35:15] axl_: has joined #RubyOnRails
[09:36:14] emilkarl: Hey, anyone got any tips for making a gulp project into a rails gem? I???ve got the gulp project buut would like a bulp task to create vendor folders and include only include some scss and js, not everything.
[09:36:48] Anakat: has joined #RubyOnRails
[09:37:10] simrat: has joined #RubyOnRails
[09:40:02] Anakat_: has joined #RubyOnRails
[09:41:17] rvanlieshout: arup_r: and what exactly do you want as a response?
[09:41:57] simrat: I am trying to send emails to multiple recipients using active job.But emails are not recieved. This is my gist : https://gist.github.com/anonymous/8f631781fbaee6ce5c66
[09:42:00] arup_r: id and email_id I will be displaying the in the select list..
[09:42:17] xkickflip_: has joined #RubyOnRails
[09:42:19] arup_r: id is option value and email id optioon text
[09:42:36] zorak8: has joined #RubyOnRails
[09:43:02] arup_r: rvanlieshout: but it will be good have a collection of all objects so that I can reuse the association in other places too
[09:43:30] rvanlieshout: a collection of what exactly? i assumed followers
[09:43:43] Anakat: has joined #RubyOnRails
[09:44:44] mikecmpbll: haha i hacked around it with a temporary class
[09:45:28] Anakat_: has joined #RubyOnRails
[09:45:30] bobbobbins: has joined #RubyOnRails
[09:45:56] mikecmpbll: https://gist.github.com/mikecmpbll/b34311f61e6e695f1ec5
[09:46:01] simrat: Please help on my email post
[09:46:25] simrat: I am trying to send emails to multiple recipients using active job.But emails are not recieved. This is my gist : https://gist.github.com/anonymous/8f631781fbaee6ce5c66
[09:46:35] arup_r: rvanlieshout: collection of followers and followings
[09:46:49] mikecmpbll: i should probably unset all those classes afterwards though, if that's possible.
[09:46:55] schaerli: has joined #RubyOnRails
[09:47:08] Anakat__: has joined #RubyOnRails
[09:48:06] axl_: has joined #RubyOnRails
[09:48:08] krz: has joined #RubyOnRails
[09:48:56] Anakat: has joined #RubyOnRails
[09:49:03] krz: has joined #RubyOnRails
[09:49:55] workmad3: mikecmpbll: looks horrible
[09:50:01] mikecmpbll: workmad3: idgaf :D
[09:50:14] mikecmpbll: workmad3: only way i can do it.
[09:50:28] workmad3: mikecmpbll: I can't even tell what you're doing
[09:50:44] Anakat_: has joined #RubyOnRails
[09:50:46] mikecmpbll: running the same query on multiple databases concurrently
[09:51:50] krz: has joined #RubyOnRails
[09:52:06] gaussblurinc1: has joined #RubyOnRails
[09:52:29] Anakat__: has joined #RubyOnRails
[09:52:30] workmad3: mikecmpbll: ah right
[09:52:36] workmad3: mikecmpbll: why are you setting a constant though?
[09:52:47] DEA7TH: has joined #RubyOnRails
[09:52:48] mikecmpbll: because AR won't let me use an anonymous class :(
[09:53:17] gaussblurinc1: hi! I have Campaign table in database and I want to add :country_codes property to it. Should I store this property as serialized array or it is better to create association?
[09:53:22] mikecmpbll: creating a new class because otherwise i'm modifying the connection of the class which is shared between threads
[09:53:44] matcouto: has joined #RubyOnRails
[09:53:45] codelahoma: has joined #RubyOnRails
[09:54:15] workmad3: mikecmpbll: bleh, that sucks
[09:54:15] Anakat: has joined #RubyOnRails
[09:54:32] mikecmpbll: workmad3: yeah it's the sucky way that the AR connection handler works :( completely bound to the model
[09:56:02] Anakat_: has joined #RubyOnRails
[09:56:22] workmad3: mikecmpbll: you can get around it by defining `name` on your anonymous class, btw
[09:56:30] workmad3: mikecmpbll: rather than setting a constant
[09:56:54] xkickflip: has joined #RubyOnRails
[09:56:56] mikecmpbll: workmad3: that sir, is a great idea. let me test
[09:57:26] krz: has joined #RubyOnRails
[09:57:48] Anakat__: has joined #RubyOnRails
[09:58:48] tachyons: has joined #RubyOnRails
[09:59:19] workmad3: mikecmpbll: you could potentially even make use of that and base the class 'name' off the resolved connection pool spec for the object, so that if two threads are trying to run against the same database, they use the same connection pool
[09:59:35] Anakat: has joined #RubyOnRails
[09:59:45] sp1rs: has joined #RubyOnRails
[10:00:22] tbuehlmann: gaussblurinc1, up to you! when using an association, different campaigns can reference the same country codes (or countries), makes querying easier
[10:00:44] ur5us: has joined #RubyOnRails
[10:01:20] Anakat_: has joined #RubyOnRails
[10:01:40] ruurd: has joined #RubyOnRails
[10:02:19] mikecmpbll: workmad3: that sounds great. i'll work on that.
[10:02:28] tachyons: hi , how do i use utc+14:00 time zone in rails
[10:02:44] tachyons: http://stackoverflow.com/questions/31535505/how-do-i-use-utc-1400-in-ruby-on-rails
[10:02:45] rvanlieshout: tachyons: !g rails guide timezone
[10:03:20] Anakat__: has joined #RubyOnRails
[10:04:47] Anakat: has joined #RubyOnRails
[10:05:02] tachyons: rvanlieshout, hi , problem is that I can't find that time zone offset in rails timezone list
[10:06:20] universa1: tachyons: which land / city is that?
[10:06:30] Hates_: has joined #RubyOnRails
[10:06:37] Anakat_: has joined #RubyOnRails
[10:06:40] rvanlieshout: that uses TZInfo::Timezone
[10:06:48] gaussblurinc1: tbuehlmann: great, easy fetching is a good idea, but what about list of available country codes? should i18n do it job?
[10:07:08] tachyons: Line Islands Time
[10:07:34] tachyons: universa1, https://en.wikipedia.org/wiki/UTC%2B14:00
[10:07:35] gaussblurinc1: tbuehlmann: also, how to store 'in all countries' association?
[10:08:28] Anakat__: has joined #RubyOnRails
[10:08:50] rvanlieshout: these are all: https://github.com/tzinfo/tzinfo/blob/fc62d751d0e34d8de932ce5c6e2926d0a20ba685/test/tzinfo-data/tzinfo/data/indexes/timezones.rb
[10:09:08] universa1: tachyons: config.time_zone = "Samoa"
[10:10:05] JulienTa_: has joined #RubyOnRails
[10:10:10] Anakat: has joined #RubyOnRails
[10:10:43] fighella: has joined #RubyOnRails
[10:10:55] gaussblurinc1: tbuehlmann: uh, I could store 'AllCountries' item in database
[10:11:10] tbuehlmann: gaussblurinc1, is the list of available countries fix? you could save them in a constant and translate via I18n then. if not, sounds like a database table to me. an "in all countries" information could be a custom attribute on the campaign model
[10:11:35] tbuehlmann: gaussblurinc1, you could do that, but then you might have to filter that one out in some cases
[10:11:57] Anakat_: has joined #RubyOnRails
[10:12:10] universa1: tachyons: https://github.com/tzinfo/tzinfo/blob/fc62d751d0e34d8de932ce5c6e2926d0a20ba685/test/tzinfo-data/tzinfo/data/indexes/timezones.rb#L542
[10:12:26] universa1: tachyons: i don't see a mapping for that one in the rails stuff
[10:12:49] tbuehlmann: you'd have to handle that one special. but that check might be clever anyway, so you either want to have associated countries OR the all-countries country (/custom attribute) set
[10:13:00] arup_r1: has joined #RubyOnRails
[10:13:03] tbuehlmann: if you ask me, "All Countries" is not a country and should not reside in the countries table
[10:13:10] chrise86: has joined #RubyOnRails
[10:13:49] tachyons: universa1, * UTC -11:00 *
[10:13:50] tachyons: International Date Line West
[10:13:50] tachyons: Midway Island
[10:13:58] tachyons: it is utc -11:00
[10:14:57] tachyons: universa1, sorry :-)
[10:14:58] gaussblurinc1: tbuehlmann: sure, ti is an option, not a 'country'. ok, yes, list of available countries is fixed. And, I think, it rather small ( ~ 10 countries ). Should I store them in database in this case?
[10:15:33] Anakat: has joined #RubyOnRails
[10:15:37] tbuehlmann: gaussblurinc1, I personally would store them in the db
[10:17:22] Anakat_: has joined #RubyOnRails
[10:17:32] tachyons: universa1, is it a bug or feature ? any idea ?
[10:19:10] Anakat__: has joined #RubyOnRails
[10:19:18] ur5us_: has joined #RubyOnRails
[10:19:44] Rubie: has joined #RubyOnRails
[10:19:51] ruurd: What's this country business? AFAIK there is a gem for that.
[10:20:03] gaussblurinc1: tbuehlmann: thanks for advice! I think that database will be ok
[10:20:35] tbuehlmann: gaussblurinc1, welcome!
[10:21:46] gaussblurinc1: ruurd: suppose that you have Campaign table in database. You want to add country_codes property to it. How would you do that: add property as string ( serialized array of country codes ) or add association to countries/country codes?
[10:22:29] Anakat: has joined #RubyOnRails
[10:22:38] arup_r: has joined #RubyOnRails
[10:23:33] hd1: has left #RubyOnRails: ()
[10:23:49] tbuehlmann: alternative to your first option: use a real array column if your database supports it, not needing to serialize/deserialize
[10:24:02] tbuehlmann: but well, enough said, I'm out of this :)
[10:24:02] ruurd: Since 1) country codes are an ISO standard and 2) that standard stands a fair chance not changing existing country codes I even would not consider a country table.
[10:24:20] emilkarl: has joined #RubyOnRails
[10:24:27] Anakat_: has joined #RubyOnRails
[10:25:07] ruurd: it's fairly easy to put them into a string that you can tokenize when you want to interpret the contents, so: nl, be, f, e, usa
[10:25:17] _utah_: has joined #RubyOnRails
[10:25:47] Detch: has joined #RubyOnRails
[10:26:11] Anakat__: has joined #RubyOnRails
[10:26:40] dangerousdave: has joined #RubyOnRails
[10:27:36] ruurd: And if you want to map the country code to the localized name, use the i18n-country-translations gem
[10:27:55] Anakat: has joined #RubyOnRails
[10:28:16] livathinos: has joined #RubyOnRails
[10:28:29] noodman: has joined #RubyOnRails
[10:28:41] ruurd: It contains translated country names for ISO-639_1 standard country codes
[10:29:20] fgo: has joined #RubyOnRails
[10:29:38] Anakat_: has joined #RubyOnRails
[10:30:25] gaussblurinc1: ruurd: hm, and what about country codes? Where could I take them?
[10:30:44] ruurd: They are in the same gem.
[10:31:25] Anakat__: has joined #RubyOnRails
[10:31:38] schaerli: has joined #RubyOnRails
[10:32:05] ruurd: Or get them from this one: iso_country_codes
[10:32:15] bruno-: has joined #RubyOnRails
[10:32:18] ArchRogem: has joined #RubyOnRails
[10:32:28] gaussblurinc1: ruurd: good, thanks!
[10:33:06] Anakat: has joined #RubyOnRails
[10:33:48] ruurd: Point is: if the data tends to be static, there is no need to put it in a database. Actually, loading it from a Yaml file once is much faster.
[10:34:03] andreixix: has joined #RubyOnRails
[10:34:04] mikecmpbll: unless you want relational capabilities
[10:35:12] ruurd: You do not need them. It is possible to validate the country code against the static data.
[10:35:30] ruurd: Besides, what relational capabilities would you want?
[10:36:44] Anakat_: has joined #RubyOnRails
[10:37:35] Scripore: has joined #RubyOnRails
[10:37:58] dtcristo: has joined #RubyOnRails
[10:38:23] gaussblurinc1: ruurd: only fetching from database and, maybe, validation of data. since data is static, yes, this is not an advantage of database
[10:38:25] Anakat: has joined #RubyOnRails
[10:38:50] Guest70108: has left #RubyOnRails: ()
[10:41:58] Anakat_: has joined #RubyOnRails
[10:43:46] Anakat: has joined #RubyOnRails
[10:44:40] ruurd: for the standpoint of rails it's easy to validate against membership of an array. Much quicker BTW.
[10:45:34] darrencauthon: has joined #RubyOnRails
[10:45:35] Anakat__: has joined #RubyOnRails
[10:47:07] simrat: has joined #RubyOnRails
[10:47:17] Anakat_: has joined #RubyOnRails
[10:47:32] MaDErroR123: has joined #RubyOnRails
[10:49:01] Anakat: has joined #RubyOnRails
[10:49:57] arBmind: has joined #RubyOnRails
[10:50:57] Anakat__: has joined #RubyOnRails
[10:51:00] cac: has joined #RubyOnRails
[10:52:46] Anakat_: has joined #RubyOnRails
[10:53:55] arup_r: rvanlieshout: I came up with this.. https://gist.github.com/aruprakshit/69896ae0060682b9479d#gistcomment-1497202 but the result shoould have 9 records I am getting 18 and If I use uniq then 8 .. so where is wrong I am doing ? any idea
[10:54:22] Anakat: has joined #RubyOnRails
[10:54:29] rvanlieshout: what 9 would you spect?
[10:54:31] rvanlieshout: what 8 did you get?
[10:54:34] nettoweb: has joined #RubyOnRails
[10:54:45] rvanlieshout: and what if you use (a.following + a.followers).uniq.size
[10:55:02] Olipro: has joined #RubyOnRails
[10:55:28] DylanJ: your active and passive relationships are the same
[10:55:54] arup_r: DylanJ: no it is not ..
[10:56:17] arup_r: they are diff.. But they looks like same :) Very confusing
[10:56:43] gaussblurinc1: ruurd: thanks for help!
[10:56:59] arup_r: rvanlieshout: (a.following + a.followers).uniq.size #=> 7
[10:58:07] Anakat_: has joined #RubyOnRails
[10:59:33] arup_r: with joins query giving lots of duplicate id https://gist.github.com/aruprakshit/69896ae0060682b9479d#gistcomment-1497212
[10:59:53] Anakat: has joined #RubyOnRails
[11:00:20] erich: has joined #RubyOnRails
[11:01:30] workmad3: arup_r: you know you have a duplicate in your (a.followers + a.following).map(&:id) result... right?
[11:01:31] Anakat__: has joined #RubyOnRails
[11:01:43] workmad3: (2 in fact)
[11:02:03] arup_r: workmad3: yes
[11:02:45] arup_r: thinking why I have dup records
[11:03:19] Anakat_: has joined #RubyOnRails
[11:03:53] workmad3: arup_r: people that are following each other
[11:04:40] emilkarl: has joined #RubyOnRails
[11:04:41] workmad3: arup_r: so the Account appears in both the followers relationship (because they're following this Account) and in the followings relationship (because this Account is following them)
[11:05:09] Anakat: has joined #RubyOnRails
[11:05:46] dlitz: has joined #RubyOnRails
[11:05:55] silverdust: has joined #RubyOnRails
[11:06:05] allcentury: has joined #RubyOnRails
[11:06:24] arup_r: Yes.. But I think the joins() query I did is not correct.. so checking that
[11:06:37] workmad3: arup_r: your joins query picks up Account 55 too
[11:06:41] workmad3: arup_r: which makes it 1 larger
[11:06:45] arup_r: (a.followers + a.following).map(&:id) this is giving correct result
[11:06:53] arup_r: workmad3: you are right
[11:06:54] Anakat__: has joined #RubyOnRails
[11:07:16] arup_r: workmad3: 55 is nothing but `a` .. and `a` is shouldn't be there
[11:07:22] workmad3: arup_r: you need an `accounts.id != 55` in your query
[11:07:26] mostlybadfly: has joined #RubyOnRails
[11:07:34] arup_r: so chaning the query to elimiate the `a` from the reuslt
[11:07:53] arup_r: workmad3: thatis what I added in the joins right not
[11:08:04] DEA7TH_: has joined #RubyOnRails
[11:08:21] workmad3: arup_r: the join you're doing is grabbing all accounts which are linked by a relationship with either id set to 55... that also includes account 55 (fairly trivially)
[11:08:23] strcmp1: has joined #RubyOnRails
[11:08:33] Anakat_: has joined #RubyOnRails
[11:09:32] ecksit: has joined #RubyOnRails
[11:09:45] Tinyyy: has joined #RubyOnRails
[11:09:56] arup_r: workmad3: fixed
[11:10:17] Anakat: has joined #RubyOnRails
[11:11:24] arup_r: https://gist.github.com/aruprakshit/69896ae0060682b9479d#gistcomment-1497217
[11:11:39] lxsameer: any solution to get the model name from RecordNotFound
[11:12:02] Anakat__: has joined #RubyOnRails
[11:15:46] Anakat: has joined #RubyOnRails
[11:15:54] DylanJ: lxsameer: probably.
[11:17:17] Aswebb_: has joined #RubyOnRails
[11:17:22] Anakat_: has joined #RubyOnRails
[11:18:38] andreixix: has joined #RubyOnRails
[11:18:51] ruurd: That would be odd.
[11:19:04] ruurd: Maybe the table name - that would be logical.
[11:19:21] Anakat__: has joined #RubyOnRails
[11:20:25] ruurd: # Raised when Active Record cannot find record by given id or set of ids.
[11:20:26] ruurd: class RecordNotFound < ActiveRecordError
[11:20:35] arup_r: What should be the more sensible method name which will give the follower and followings records,, once is connection but can't give it.. as I have already one..
[11:21:04] Anakat: has joined #RubyOnRails
[11:21:06] dangerousdave: has joined #RubyOnRails
[11:22:16] diegoviola: has joined #RubyOnRails
[11:22:38] Hates_: just be aware that you're overriding the activerecord method connection
[11:22:40] Anakat_: has joined #RubyOnRails
[11:22:45] ecksit: has joined #RubyOnRails
[11:23:38] nerdsville: has joined #RubyOnRails
[11:23:49] JeramyRR: has joined #RubyOnRails
[11:23:53] Hates_: oh wait, that's a class method isn't it
[11:24:19] Quintasan: has joined #RubyOnRails
[11:24:30] Anakat__: has joined #RubyOnRails
[11:25:18] Quintasan: Hi, is it somehow possible to group objects by day, month and year when I have a full timestamp?
[11:25:26] arup_r: done... thanks again
[11:26:08] bin_005_g: has joined #RubyOnRails
[11:26:21] Anakat: has joined #RubyOnRails
[11:26:31] rvanlieshout: Quintasan: using sql or using ruby?
[11:26:46] schaerli: has joined #RubyOnRails
[11:26:48] Quintasan: rvanlieshout: I don't really care. Using Ruby would be easier I guess.
[11:26:55] rvanlieshout: .group('sql method to get day, month, year') or .group_by({ |record| record.to_date } ish
[11:27:01] rvanlieshout: using sql would be way better if possible
[11:27:17] Quintasan: Performance reasons?
[11:27:38] schaerli: has joined #RubyOnRails
[11:28:15] Anakat_: has joined #RubyOnRails
[11:29:55] Anakat__: has joined #RubyOnRails
[11:30:31] fgo: has joined #RubyOnRails
[11:31:36] Anakat: has joined #RubyOnRails
[11:33:24] Anakat_: has joined #RubyOnRails
[11:33:36] andreixix: has joined #RubyOnRails
[11:34:32] tvw: has joined #RubyOnRails
[11:35:09] Anakat__: has joined #RubyOnRails
[11:36:16] relix: has joined #RubyOnRails
[11:36:57] Anakat: has joined #RubyOnRails
[11:38:42] darrencauthon: has joined #RubyOnRails
[11:38:55] Anakat_: has joined #RubyOnRails
[11:39:45] cac: has joined #RubyOnRails
[11:39:47] arup_r: has joined #RubyOnRails
[11:40:07] nickenchuggets: has joined #RubyOnRails
[11:40:07] nickenchuggets: has joined #RubyOnRails
[11:40:37] Anakat__: has joined #RubyOnRails
[11:40:55] skroon: What would be an easy way to develop locally when your connecting to external services? Fake them or something, or would it just require to always be connected online and have access to the external service?
[11:42:01] universa1: skroon: there are gems to record the http requests and then "play them back", or you can go the stub route
[11:42:14] Anakat: has joined #RubyOnRails
[11:43:58] Anakat_: has joined #RubyOnRails
[11:45:49] Anakat__: has joined #RubyOnRails
[11:46:09] ldnunes: has joined #RubyOnRails
[11:46:33] schaerli: has joined #RubyOnRails
[11:47:43] Anakat: has joined #RubyOnRails
[11:47:44] skroon: universa1: oke, i'm struggling to see how you should develop, when you have a microservices architecture
[11:47:59] skroon: universa1: wondering if now I need to always have several service running locally in order to develop
[11:48:13] Lightsword: has joined #RubyOnRails
[11:49:01] universa1: if you constantly need the others, this sounds like your services are not really properly encapsulated...
[11:49:17] Anakat_: has joined #RubyOnRails
[11:49:48] universa1: skroon: https://github.com/vcr/vcr
[11:50:16] universa1: skroon: https://robots.thoughtbot.com/how-to-stub-external-services-in-tests
[11:50:56] skroon: universa1: right that sounds indeed right, better I would just be able to develop on a microservice locally and everything locally in a single microservice
[11:51:18] Anakat__: has joined #RubyOnRails
[11:51:37] skroon: universa1: i'm wondering though how this works with UI, most architecture diagrams I see, either have one big monolotic UI layer at the front, or a monolotic API Gateway to which the UI layer talks to
[11:52:54] Anakat: has joined #RubyOnRails
[11:53:20] universa1: skroon: i can't give any advice on that... ...not active enough in that direction.
[11:54:41] DoubleMalt: has joined #RubyOnRails
[11:54:44] Anakat_: has joined #RubyOnRails
[11:54:46] nettoweb_: has joined #RubyOnRails
[11:55:02] Lightsword: has joined #RubyOnRails
[11:55:48] konsolebox: has joined #RubyOnRails
[11:56:25] Anakat__: has joined #RubyOnRails
[11:57:23] tagrudev: has joined #RubyOnRails
[11:58:08] Anakat: has joined #RubyOnRails
[11:58:48] syath: has joined #RubyOnRails
[11:59:27] dede: has joined #RubyOnRails
[12:00:00] Anakat_: has joined #RubyOnRails
[12:01:06] arup_r1: has joined #RubyOnRails
[12:01:37] aganov: has joined #RubyOnRails
[12:01:50] Anakat__: has joined #RubyOnRails
[12:02:24] stamina: has joined #RubyOnRails
[12:03:25] Creeves: has joined #RubyOnRails
[12:04:53] quazimodo: has joined #RubyOnRails
[12:05:14] Anakat: has joined #RubyOnRails
[12:06:59] Anakat_: has joined #RubyOnRails
[12:07:31] sadaf2605: has joined #RubyOnRails
[12:08:27] Rubie: has joined #RubyOnRails
[12:08:41] Voxxit: has joined #RubyOnRails
[12:08:51] Anakat__: has joined #RubyOnRails
[12:10:44] Anakat: has joined #RubyOnRails
[12:10:53] Ericx2x: has joined #RubyOnRails
[12:11:51] sadaf: has joined #RubyOnRails
[12:12:18] Anakat_: has joined #RubyOnRails
[12:12:35] hahuang65: has joined #RubyOnRails
[12:13:16] jkamenik: has joined #RubyOnRails
[12:13:55] blackmes1: has joined #RubyOnRails
[12:14:08] Anakat__: has joined #RubyOnRails
[12:15:49] Anakat: has joined #RubyOnRails
[12:15:51] Betray1st: has joined #RubyOnRails
[12:16:06] shyshy: has joined #RubyOnRails
[12:17:35] Anakat_: has joined #RubyOnRails
[12:19:27] Anakat__: has joined #RubyOnRails
[12:19:32] lapide_viridi: has joined #RubyOnRails
[12:20:44] konsolebox: has joined #RubyOnRails
[12:20:45] yardenbar: has joined #RubyOnRails
[12:21:06] Anakat: has joined #RubyOnRails
[12:22:44] arup_r: has joined #RubyOnRails
[12:23:32] sadaf2605: has joined #RubyOnRails
[12:24:18] arup_r: I am having confusion always between the use of `source` and `class_name` while working with has_one and has_many.. Do we use `source` when dealing with `through:` and `class_name` for other cases ?
[12:24:39] Anakat_: has joined #RubyOnRails
[12:24:52] rustymyers: has joined #RubyOnRails
[12:25:38] dlitz: has joined #RubyOnRails
[12:25:52] rvanlieshout: source is what source association to use
[12:25:58] rvanlieshout: class_name is what class name the actual association is
[12:26:23] jamiely: has joined #RubyOnRails
[12:26:24] Anakat: has joined #RubyOnRails
[12:28:16] Anakat__: has joined #RubyOnRails
[12:29:58] Anakat_: has joined #RubyOnRails
[12:31:09] sankaber: has joined #RubyOnRails
[12:31:45] Anakat: has joined #RubyOnRails
[12:33:36] victortyau: has joined #RubyOnRails
[12:35:22] Anakat_: has joined #RubyOnRails
[12:35:22] victortyau: has joined #RubyOnRails
[12:36:15] arup_r1: has joined #RubyOnRails
[12:36:39] emilkarl: has joined #RubyOnRails
[12:37:07] Anakat: has joined #RubyOnRails
[12:38:49] Anakat__: has joined #RubyOnRails
[12:39:40] sinkensabe: has joined #RubyOnRails
[12:40:47] Anakat_: has joined #RubyOnRails
[12:40:50] juanpaucar: has joined #RubyOnRails
[12:41:15] juanpaucar: has joined #RubyOnRails
[12:41:27] schaerli: has joined #RubyOnRails
[12:41:33] LoBoGoL: has joined #RubyOnRails
[12:42:21] Anakat: has joined #RubyOnRails
[12:43:23] nickenchuggets: has joined #RubyOnRails
[12:43:23] nickenchuggets: has joined #RubyOnRails
[12:44:09] Anakat__: has joined #RubyOnRails
[12:45:53] cac: has joined #RubyOnRails
[12:45:54] Anakat_: has joined #RubyOnRails
[12:46:56] dlitz: has joined #RubyOnRails
[12:47:40] Anakat: has joined #RubyOnRails
[12:49:11] xkickflip: has joined #RubyOnRails
[12:49:35] Anakat__: has joined #RubyOnRails
[12:49:53] n1lo_: has joined #RubyOnRails
[12:50:58] SteenJobs: has joined #RubyOnRails
[12:51:13] Anakat_: has joined #RubyOnRails
[12:52:10] ruurd: has joined #RubyOnRails
[12:54:00] pullphinger: has joined #RubyOnRails
[12:54:48] Anakat__: has joined #RubyOnRails
[12:55:07] dlt_: has joined #RubyOnRails
[12:55:56] charliesome: has joined #RubyOnRails
[12:56:04] k4nd4lf: has joined #RubyOnRails
[12:56:32] Anakat_: has joined #RubyOnRails
[12:56:56] luisjose: has joined #RubyOnRails
[12:57:48] luisjose: good morning
[12:58:15] Anakat: has joined #RubyOnRails
[12:58:21] luisjose: I would like to try rails 5 but I can't get it to work from master in github
[12:58:29] luisjose: it keep failing with the gem arel
[13:00:14] Anakat__: has joined #RubyOnRails
[13:00:16] stantonnet: has joined #RubyOnRails
[13:01:52] Anakat_: has joined #RubyOnRails
[13:02:57] mhib: has joined #RubyOnRails
[13:03:54] bmurt: has joined #RubyOnRails
[13:04:15] Tinyyy: has joined #RubyOnRails
[13:05:22] Anakat: has joined #RubyOnRails
[13:05:45] Spami: has joined #RubyOnRails
[13:06:56] eggoez: has joined #RubyOnRails
[13:07:18] Anakat_: has joined #RubyOnRails
[13:07:29] alienaut: has joined #RubyOnRails
[13:08:54] Anakat__: has joined #RubyOnRails
[13:09:05] Rubie: has joined #RubyOnRails
[13:09:25] jgpawletko: has joined #RubyOnRails
[13:09:28] bungoman: has joined #RubyOnRails
[13:10:07] bungoman: has joined #RubyOnRails
[13:10:38] Anakat: has joined #RubyOnRails
[13:10:46] chinmay_dd: has joined #RubyOnRails
[13:10:46] leslie: how do I pass multiple and size attributes to FormHelper.select ?
[13:11:50] rvanlieshout: leslie: with a ,?
[13:12:18] annlewis: has joined #RubyOnRails
[13:12:27] Anakat_: has joined #RubyOnRails
[13:12:30] leslie: rvanlieshout, it doesn't show up in the output html
[13:12:34] slash_nick: leslie: multiple is an html option... the method signature for that is: select(object, method, choices = nil, options = {}, html_options = {}, &block)
[13:12:42] schaerli: has joined #RubyOnRails
[13:12:43] rvanlieshout: leslie: what did you try?
[13:13:05] leslie: aha, html_options might work, lemme try
[13:13:32] BGuimberteau: has joined #RubyOnRails
[13:14:13] Anakat__: has joined #RubyOnRails
[13:14:34] DylanJ: leslie: paste your code
[13:14:38] DylanJ: you're probably close
[13:14:42] DylanJ: select is confusing
[13:15:19] tagrudev: has joined #RubyOnRails
[13:15:31] leslie: http://pastie.org/10304269
[13:15:33] nso95: has joined #RubyOnRails
[13:15:43] leslie: could be that I'm using bootstrap_form
[13:15:55] slash_nick: that's close, leslie
[13:15:56] Anakat: has joined #RubyOnRails
[13:16:06] rvanlieshout: the htmnl_options are the next param
[13:16:12] rvanlieshout: select(method, choices = nil, options = {}, html_options = {}, &block)
[13:16:25] leslie: oh, so they're positional?
[13:16:29] slash_nick: f.select :region, @regions, {}, {multiple: true, size: 6}
[13:16:48] leslie: not used to that in Rails
[13:17:00] leslie: thanks :) that did it
[13:17:44] sp1rs: has joined #RubyOnRails
[13:17:47] Anakat_: has joined #RubyOnRails
[13:17:50] jkamenik: has joined #RubyOnRails
[13:18:34] slash_nick: leslie: the first hash (options, 3rd arg) is optional, but if you don't put something in, you can't supply the next arg (4th arg, html_options)
[13:18:50] blackmes1: has joined #RubyOnRails
[13:19:30] Anakat__: has joined #RubyOnRails
[13:19:44] slash_nick: leslie: not the best explanation... but... usually if the last argument is a hash, you can just supply the required arguments foo(req1, req2, {last_arg: :is_a_hash}).... but in this case, the last two arguments were hash
[13:21:09] Juanchito: has joined #RubyOnRails
[13:21:26] aganov: has joined #RubyOnRails
[13:21:29] Anakat: has joined #RubyOnRails
[13:21:48] anoob: has joined #RubyOnRails
[13:22:11] JoshL: has joined #RubyOnRails
[13:22:14] kies^: has joined #RubyOnRails
[13:22:33] nettoweb: has joined #RubyOnRails
[13:22:52] gaussblurinc1: has joined #RubyOnRails
[13:23:04] Anakat_: has joined #RubyOnRails
[13:23:46] doodlehaus: has joined #RubyOnRails
[13:23:51] jonee: has joined #RubyOnRails
[13:24:10] zorak8: has joined #RubyOnRails
[13:24:26] anoob: i am not able to run rails: http://pastebin.com/0cGz6m0Q
[13:24:51] Anakat__: has joined #RubyOnRails
[13:24:53] chinmay_dd: has joined #RubyOnRails
[13:24:56] anoob: sorry, http://pastie.org/10304280
[13:24:56] drale2k: has joined #RubyOnRails
[13:25:34] vedu: anoob: what is your build environment?
[13:25:50] dhjondoh: has joined #RubyOnRails
[13:26:20] vedu: anoob: for Linux follow: http://ryanbigg.com/2014/10/ubuntu-ruby-ruby-install-chruby-and-you/
[13:26:24] anoob: vedu, i am not sure what you mean, but i'm running debian testing armhf with ruby and rails packages ...
[13:26:26] allcentury: has joined #RubyOnRails
[13:26:30] sevenseacat: has joined #RubyOnRails
[13:26:42] dhjondoh: has joined #RubyOnRails
[13:26:43] Anakat: has joined #RubyOnRails
[13:26:56] Madman_man: has joined #RubyOnRails
[13:27:07] anoob: vedu, yes, i am using rails from apt-get ...
[13:27:34] anoob: vedu, i will read it, thanks!
[13:27:34] vedu: anoob: so you have found your mistake
[13:27:48] anoob: vedu, it does work in another debian box
[13:28:00] vedu: anoob: first do `apt-get purge ruby`
[13:28:09] vedu: It shuold
[13:28:19] Anakat_: has joined #RubyOnRails
[13:28:53] blackmes1: has joined #RubyOnRails
[13:29:16] anoob: vedu, i see ...
[13:30:12] Anakat__: has joined #RubyOnRails
[13:30:27] leslie: slash_nick, makes sense. I guess it'd be better designed if the html_options hash were a hash inside the options hash, like I've seen elsewhere in Rails
[13:31:23] darrencauthon: has joined #RubyOnRails
[13:31:51] Anakat: has joined #RubyOnRails
[13:33:52] Anakat_: has joined #RubyOnRails
[13:34:00] Madman_man: I have a niggly question
[13:34:16] Madman_man: I keep getting an Invalid Parameter Error
[13:34:43] Madman_man: A uninitialized constant
[13:34:49] Madman_man: can anyone hellp
[13:35:13] vedu: Madman_man: !code
[13:35:29] Anakat__: has joined #RubyOnRails
[13:35:35] hahuang65: has joined #RubyOnRails
[13:35:52] user1138: has joined #RubyOnRails
[13:36:16] vedu: Madman_man: see this: https://gist.github.com/radar/996779
[13:37:12] Anakat: has joined #RubyOnRails
[13:37:49] lxsameer: has joined #RubyOnRails
[13:39:07] Anakat_: has joined #RubyOnRails
[13:40:12] vedu: Madman_man: okay. paste your gist here. lots of people to help
[13:40:50] Anakat__: has joined #RubyOnRails
[13:40:51] Madman_man: https://gist.github.com/ff25d5b11fb45eb7557a.git
[13:41:10] Madman_man: The error is a uninitialized constant
[13:41:26] luisjose: has joined #RubyOnRails
[13:41:33] Madman_man: but i can't see any problem with it. I've check almost every file realted to the controller, model and view
[13:42:17] vedu: Madman_man: I am getting a 404 on the link you have given
[13:42:19] mary5030: has joined #RubyOnRails
[13:42:32] Anakat: has joined #RubyOnRails
[13:42:32] michael_mbp: has joined #RubyOnRails
[13:43:00] mary5030: has joined #RubyOnRails
[13:43:41] Madman_man: https://gist.github.com/LouisFryer/ff25d5b11fb45eb7557a
[13:44:05] rvanlieshout: Madman_man: and you've got a Sign model defined somewhere?
[13:44:20] Anakat_: has joined #RubyOnRails
[13:44:39] vedu: Madman_man: what rvanlieshout said plus add the error trace in the gist
[13:46:18] Anakat__: has joined #RubyOnRails
[13:47:05] fgo: has joined #RubyOnRails
[13:47:38] schaerli: has joined #RubyOnRails
[13:47:58] Anakat: has joined #RubyOnRails
[13:48:10] Madman_man: Full Trace added as comment
[13:48:32] Madman_man: Yes a model called Signs was generated in the last migration
[13:48:50] Madman_man: Shall I add the migration to the gist?
[13:49:00] cpruitt: has joined #RubyOnRails
[13:49:29] rvanlieshout: add the model
[13:49:34] rvanlieshout: and run 'Sign.all' in a console
[13:49:36] vedu: Madman_man: you can add more files to your gist
[13:49:37] diego_k: has joined #RubyOnRails
[13:49:39] Anakat_: has joined #RubyOnRails
[13:49:43] slash_nick: Madman_man: the trace doesn't include "uninitialized constant"
[13:51:10] Madman_man: NameError: undefined local variable or method `sign' for ActiveSupport::Dependencies:Module
[13:51:19] Madman_man: that's running sign.all in console
[13:51:28] slash_nick: Madman_man: capital S
[13:51:56] Casty: has joined #RubyOnRails
[13:52:35] diego_k: has joined #RubyOnRails
[13:53:04] Madman_man: The plot thickens
[13:53:06] Madman_man: NameError: undefined local variable or method `sign' for ActiveSupport::Dependencies:Module
[13:53:16] Anakat: has joined #RubyOnRails
[13:53:18] Madman_man: then I corrected it
[13:53:33] Madman_man: ActiveRecord::StatementInvalid: SQLite3::SQLException: no such table: signs: SELECT "signs".* FROM "signs"
[13:53:44] rvanlieshout: did you run the migrations/
[13:54:01] Madman_man: Im almost 100%
[13:54:05] cogsbox_: has joined #RubyOnRails
[13:54:06] momomomomo: has joined #RubyOnRails
[13:54:16] Madman_man: also when I did a precautionary migration
[13:54:40] Madman_man: I run rake db:migrate and it had nothing to do
[13:54:52] Madman_man: shall I run one again to check
[13:54:56] rvanlieshout: did you edit a migration you've already executed?
[13:55:07] Anakat__: has joined #RubyOnRails
[13:55:19] rvanlieshout: it won't execute them again if you do that
[13:55:40] Madman_man: what i remember doing is
[13:55:45] Madman_man: doing a rollback
[13:55:50] Madman_man: editing the migration
[13:56:00] Madman_man: and the doing a migration
[13:56:14] momomomomo: if this is in development, just drop/reset and migrate
[13:56:15] Madman_man: should I just redo it
[13:56:18] rvanlieshout: well.. the sings table doesn't exist
[13:56:28] Anakat_: has joined #RubyOnRails
[13:56:38] Madman_man: Is it ok if I try this and get back to you in a min
[13:57:29] Madman_man: quick question
[13:58:02] Madman_man: does Rake Db:reset remove everything and then redo the migrations?
[13:58:07] Madman_man: for future notice
[13:58:46] momomomomo: Madman_man: read the docs
[13:59:14] momomomomo: Madman_man: edgeguides.rubyonrails.org/active_record_migrations.html#resetting-the-database
[13:59:19] momomomomo: http://edgeguides.rubyonrails.org/active_record_migrations.html#resetting-the-database *
[13:59:44] Rubie: has joined #RubyOnRails
[13:59:55] willywos: has joined #RubyOnRails
[14:00:16] Madman_man: Is writing a Schema a good way of building all the right tables?
[14:00:21] Madman_man: I have more to add
[14:00:24] slash_nick: Madman_man: also `rake -T | grep db` shows you most (i didn't see reset) of the db rake tasks
[14:00:27] rvanlieshout: the schema.rb is generated
[14:00:31] rvanlieshout: you should not edit it
[14:00:32] [H]unt3r: has joined #RubyOnRails
[14:00:56] imkj: has joined #RubyOnRails
[14:01:13] slash_nick: Madman_man: to answer your question about whether db:reset runs migrations -- no it does not
[14:02:00] Madman_man: so I did that
[14:02:07] paulcsmith: has joined #RubyOnRails
[14:02:14] garrypolley: has joined #RubyOnRails
[14:02:22] Madman_man: now it works when I type Sign.all into console
[14:02:32] Madman_man: but i still have original error from gist
[14:02:40] Madman_man: undefined variable
[14:02:41] rvanlieshout: what rails server?
[14:02:46] cogsbox_: Hello everyone, I am having some difficulty. I want a green button to show up when my user becomes a premium user. I think I have my syntax wrong. https://gist.github.com/anonymous/fdf55685a54aacc1bf69
[14:02:51] ruurd: has joined #RubyOnRails
[14:02:55] rvanlieshout: undefined variable is not the same as you've told us efore
[14:03:03] rvanlieshout: and restart your rails server instance just to be sure
[14:03:10] Madman_man: sorry my mistake
[14:03:19] Madman_man: uninitialized constant SignsController::Sign
[14:03:20] relix: has joined #RubyOnRails
[14:03:25] Madman_man: I have reset server
[14:03:55] chouhoulis: has joined #RubyOnRails
[14:04:13] imkj: cogsbox_: If I am not mistaken, it's with your 'rescue' clause.
[14:05:07] imkj: cogsvox_: You have no 'begin' before it and no end after. The basic structure is "begin ... rescue ... end".
[14:05:39] Madman_man: I'm so confued
[14:05:48] slash_nick: Madman_man: what happened?
[14:06:08] Madman_man: still seems to not like me using Sign.all in the controller
[14:06:32] slash_nick: Madman_man: what do you mean by not like? returns empty? or breaks?
[14:07:25] slash_nick: gotta run to work
[14:08:51] elaptics: cogsbox_: you're only setting them to premium if there's an error with the stripe payment
[14:09:05] werelivinginthef: has joined #RubyOnRails
[14:09:17] DEA7TH: has joined #RubyOnRails
[14:09:37] elaptics: imkj: no, the syntax is valid, you don't need explicit begin or ends - in cogsbox_ code the rescue is effectively scoped to the create method
[14:09:56] zpr: has joined #RubyOnRails
[14:09:59] vedu: Madman_man: you haven't put the model in your gist
[14:10:16] elaptics: imkj: imho this reads nicely and if you have nice small single purpose methods then it means that if you're expecting to deal with an exception you can deal with it neatly within the method where it'd be raised
[14:11:14] cogsbox_: I changed the code this is my new controller https://gist.github.com/anonymous/22fccbdfc1315e991990
[14:11:41] Madman_man: vedu will do now
[14:12:27] cogsbox_: The problem is that I can't see what is wrong because stripe is not working with c9.io. So I push my code to heroku and just get a page that says that their is an error, but I don't know what the error is.
[14:12:35] Madman_man: the Signs.rb?
[14:13:17] sarink: has joined #RubyOnRails
[14:13:31] Hates_: Madman_man: It should match your model name which is normally singular. So Sign.all
[14:13:50] vedu: yes Madman_man. so this is your mistake probably
[14:13:54] Madman_man: hates_ in the cotroller?
[14:13:54] imkj: elaptics: You're right about it not being a syntax error. Sorry. Also, you are correct about it being nice in purpose methods, but in this case I would rather use the full construct. That's my two cents.
[14:13:57] The_Phoenix: has joined #RubyOnRails
[14:14:03] Hates_: Madman_man: Just show us your contorller and model code
[14:14:29] Madman_man: by model code do you mean the migration or the .rb
[14:14:36] sarink: has joined #RubyOnRails
[14:14:43] jkamenik1: has joined #RubyOnRails
[14:14:47] The_Phoenix: has joined #RubyOnRails
[14:14:55] Hates_: Madman_man: Gist the controller code, the model code and the error you are getting
[14:14:55] elaptics: imkj: I sort of agree with you, but actually I'd move all that stripe processing out of the controller into a separate object
[14:15:12] codepete: has joined #RubyOnRails
[14:15:30] jgpawletko: has joined #RubyOnRails
[14:15:34] Madman_man: https://gist.github.com/LouisFryer/86107ece08251219a36b
[14:15:38] Madman_man: thats the controller
[14:15:42] The_Phoenix: has joined #RubyOnRails
[14:15:45] Madman_man: model in the contents
[14:15:50] elaptics: cogsbox_: have a look at the logs
[14:16:11] treehug88: has joined #RubyOnRails
[14:16:26] vedu: Madman_man: by model we mean the model. in the app/models directory
[14:16:43] sp1rs: has joined #RubyOnRails
[14:16:47] The_Phoenix: has joined #RubyOnRails
[14:16:50] cogsbox_: elaptics: Thanks, for the input. Sorry, for my lack of experience. How do I look at the logs when deployed on heroku?
[14:16:52] elaptics: cogsbox_: not familiar with c9 but I don't see why it wouldn't work if it's providing the same as what you'd have running it on your local machine
[14:17:20] elaptics: cogsbox_: on heroku you'd need to either use the heroku logs command or install one of the log add-ons
[14:17:22] vedu: Madman_man: here is an example of a proper gist: https://gist.github.com/vedant1811/ecb16f8624b57c18ebe5
[14:17:29] Hates_: Madman_man: just so you know, you can add multiple files to a gist
[14:17:41] The_Phoenix: has joined #RubyOnRails
[14:17:43] Madman_man: couldn't see how
[14:17:54] vedu: Madman_man: google it
[14:18:08] Hates_: when creating the gist there is an "Add File" button in the bottom left
[14:18:15] Madman_man: ahhh! got it
[14:18:21] Madman_man: want me to have another go
[14:18:42] The_Phoenix: has joined #RubyOnRails
[14:18:42] cogsbox_: elaptics: Wow, thanks for the help let me look at it for a min.
[14:18:45] The_Phoenix: has joined #RubyOnRails
[14:19:23] pullphinger15: has joined #RubyOnRails
[14:20:05] Madman_man: https://gist.github.com/LouisFryer/86107ece08251219a36b (Updated)
[14:20:25] annlewis: has joined #RubyOnRails
[14:20:26] Hates_: Madman_man: your model name should be called just Sign and the filename sign.rb
[14:20:51] cogsbox_: elaptics: ActiveRecord::RecordNotFound (Couldn't find User with 'id'=). Is my error in the logs. Is their a better/different way I should find User?
[14:21:00] k4nd4lf_: has joined #RubyOnRails
[14:21:09] Madman_man: If I edit these will that be enough or will I need to remove all files and restart the process of creating the table
[14:21:41] Hates_: Madman_man: you should just be able to rename them
[14:21:57] elaptics: cogsbox_: are you actually passing a user's id in your params to that charges controller?
[14:22:32] srinidhi: has joined #RubyOnRails
[14:23:05] cogsbox_: elaptics: no, but the user must be logged in to may a payment. I thought that by finding by user id it would get the current user.
[14:23:06] IceyEC: has joined #RubyOnRails
[14:23:06] Madman_man: mmm, sorry to be a pain, but when you say rename the model. do i do that in migrations?
[14:23:17] dyulax: has joined #RubyOnRails
[14:23:58] Hates_: Madman_man: models != migration
[14:24:13] Hates_: Madman_man: Models are models, migrations are migrations.
[14:24:39] Hates_: Madman_man: you are just renaming the file signs.rb to be sign.rb and side of that class Signs -> class Sign
[14:25:01] pullphinger: has joined #RubyOnRails
[14:25:10] puddy: has joined #RubyOnRails
[14:25:14] dopie: has joined #RubyOnRails
[14:25:23] Madman_man: so restart server and retry?
[14:25:43] elaptics: cogsbox_: if you already have code that ensures current_user (or whatever) is set, then just use that
[14:25:53] Madman_man: Looks like it's worked
[14:25:59] jgpawletko: has joined #RubyOnRails
[14:26:12] elaptics: cogsbox_: if that gist of your charges controller is accurate where is the check that requires a user to be logged in?
[14:26:57] Madman_man: Umm. so this is weird
[14:27:02] Anakat: has joined #RubyOnRails
[14:27:28] Madman_man: It said that it cannot find a controller when generating the back button
[14:27:38] curses: has joined #RubyOnRails
[14:27:48] Madman_man: So do I change Signs controller to sign controller
[14:27:55] Hates_: Madman_man: no.
[14:28:09] Hates_: Madman_man: controllers are generally plurals, and models always singular
[14:28:21] Madman_man: can I show you the error in my gist
[14:28:42] pacman: has joined #RubyOnRails
[14:28:45] mase-chatter: has joined #RubyOnRails
[14:28:48] Anakat_: has joined #RubyOnRails
[14:29:00] pacman: has left #RubyOnRails: ()
[14:29:03] cogsbox_: elaptics: You are right I will add a before filter to make sure user is logged in. I do have a current_user method I am going to give it a try.
[14:29:06] imanzarrabian: has joined #RubyOnRails
[14:29:43] jgpawletko_: has joined #RubyOnRails
[14:30:05] Hates_: Madman_man: you should be using signs_path. sign_path is for when you want to show a specific sign, and you would generally use sign_path(@sign)
[14:30:36] Anakat__: has joined #RubyOnRails
[14:30:57] darutoko-: has joined #RubyOnRails
[14:31:01] vedu: Madman_man: someone already pointed out your mistake
[14:31:57] Madman_man: sorry vedu. I appreciate your help
[14:31:59] vedu: You are calling Sing (without the trailing 's') and have defined Signs.rb
[14:32:13] Madman_man: Thanks hates_ that posting
[14:32:15] broman: has joined #RubyOnRails
[14:32:16] The_Phoenix: has joined #RubyOnRails
[14:32:24] Anakat: has joined #RubyOnRails
[14:32:30] Madman_man: but I think the error bumped along to /signs/new
[14:32:47] Madman_man: looks like it works too
[14:32:52] Madman_man: Thanks to you all
[14:33:07] broman: i have a SimuladosAproveitamentosController class ... when i call a method from it from a service i get an uninitialized constant SimuladoService::SimuladosAproveitamentos error... what's wrong?
[14:33:14] charliesome: has joined #RubyOnRails
[14:33:15] Madman_man: I'm new to rails and sometimes the conventions really trip you up
[14:33:34] Hates_: Madman_man: yeah, there are a lot of them. but once you get the hang of it, it starts to make sense
[14:33:46] Hates_: Madman_man: quite a steep learning curve
[14:33:52] SteenJobs: has joined #RubyOnRails
[14:34:10] Anakat_: has joined #RubyOnRails
[14:34:27] Madman_man: Yea, only recently the MVC thing clicked. It takes a time for all the literature to sink it
[14:34:58] cogsbox_: elaptics: okay, I am glad that I ran into this problem. This is a question I always have. I have current_user defined outside of my charges controller. https://gist.github.com/anonymous/b487be79ab8b788b38b4 how do I user that method in my chargers controller.
[14:34:59] Hates_: Madman_man: yeah for sure.
[14:35:20] Madman_man: I have a small follow up question
[14:35:22] Hates_: broman: you're calling a class that doesn't exist?
[14:35:49] vedu: Madman_man: don't ask to ask. just ask :)
[14:35:53] elaptics: cogsbox_: do you include that module into your controller? probably ApplicationController
[14:36:01] Anakat__: has joined #RubyOnRails
[14:36:16] broman: Hates_, i think it does exist
[14:36:34] Hates_: broman: that's not what rails thinks :P
[14:36:36] broman: Hates_, class SimuladosAproveitamentosController < ReitoriaController
[14:36:49] Hates_: broman: yeah and it's looking for SimuladoService::SimuladosAproveitamentos
[14:36:51] Madman_man: so with links. in conventional HTML you have anchors with href=""
[14:36:56] schaerli: has joined #RubyOnRails
[14:37:05] Madman_man: and Rails promotes using relative links
[14:37:09] broman: inside simuladoservice i issue a SimuladosAproveitamentos.novo(params)
[14:37:14] disgrntld: has joined #RubyOnRails
[14:37:22] broman: Hates_, what should i do?
[14:37:33] Madman_man: everywhere I look it says use link_to
[14:37:43] Hates_: broman: have you namespaced the controllers? you could try :: SimuladosAproveitamentos.novo
[14:37:44] Anakat: has joined #RubyOnRails
[14:37:48] Hates_: broman: ::SimuladosAproveitamentos.novo
[14:37:49] Madman_man: and you have a code like new_sign_path
[14:38:01] cogsbox_: elaptics: https://gist.github.com/anonymous/daf92538b9c3c0c5c62a this is my application controller. It has include SessionsHelper. Will that include current_user?
[14:38:05] Madman_man: what defines these locations
[14:38:09] dangerousdave: has joined #RubyOnRails
[14:38:11] Madman_man: I can find them in the controller
[14:38:17] Hates_: Madman_man: they are defined by your config/routes.rb
[14:38:31] Madman_man: so if signs is a resource
[14:38:37] Madman_man: it can route signs_new
[14:38:55] broman: Hates_, i did not understand
[14:38:57] Madman_man: sorry I mean new_signs_path as -> Signs.controller - Get New
[14:38:58] Hates_: Madman_man: this explains all the different routes you get http://guides.rubyonrails.org/routing.html#crud-verbs-and-actions
[14:38:59] annlewis: has joined #RubyOnRails
[14:39:09] broman: *understood
[14:39:09] creature: has joined #RubyOnRails
[14:39:20] Papierkorb: has joined #RubyOnRails
[14:39:30] Hates_: broman: try adding :: before your SimuladosAproveitamentos.novo
[14:39:32] Anakat_: has joined #RubyOnRails
[14:39:36] creature: Hello. I'd like to simulate a DB failure in my app, so I can see how well it tolerates it. Is there a 'best practices' way of doing that?
[14:39:44] Hates_: broman: hard to know for sure as it sounds like you have classes that are namespaced
[14:39:51] broman: Hates_, uninitialized constant SimuladosAproveitamentos
[14:39:51] imkj: has joined #RubyOnRails
[14:40:03] broman: what defines a namespace?
[14:40:20] Hates_: broman: well something is refering to SimuladoService
[14:40:25] Hates_: broman: you need to track that down
[14:41:14] broman: Hates_, i have that function in the simuladoservice http://pastie.org/10304386
[14:41:15] Anakat__: has joined #RubyOnRails
[14:41:19] Madman_man: Can I map a single route. rather than all crud operations
[14:41:33] Madman_man: something like home_overview?
[14:41:37] Hates_: has joined #RubyOnRails
[14:41:45] Hates_: creature: sorry, got disconnected
[14:41:54] Hates_: creature: was saying you could call remove_connection
[14:42:05] Casty: has joined #RubyOnRails
[14:43:03] Anakat: has joined #RubyOnRails
[14:43:56] creature: Hates_: Mmm. I guess the thing is, I'm not sure _where_ to. :) This model uses establish_connection in the class definition to connect to a different DB; it's that DB that I want to simulate the failure of.
[14:44:01] broman: Hates_, i have that function in the simuladoservice http://pastie.org/10304386
[14:44:27] broman: Hates_, what do you think i should do to get this fixed? :D maybe reading something..
[14:44:34] amortimer: has joined #RubyOnRails
[14:44:46] drale2k: has joined #RubyOnRails
[14:44:50] Anakat_: has joined #RubyOnRails
[14:45:18] Hates_: creature: are you trying to do this as part of a test?
[14:46:06] Hates_: broman: well did you try adding the :: there?
[14:46:34] Anakat__: has joined #RubyOnRails
[14:47:15] broman: Hates_, yes... i got an uninitialized constant SimuladosAproveitamentos error
[14:47:15] puddy: has left #RubyOnRails: ()
[14:47:32] creature: Hates_: Just a manual test for now. The second DB is non-critical; I'd like downtime on it to be non-fatal for the wider webapp.
[14:48:13] Hates_: creature: I guess you can't just shut the database down?
[14:48:22] Anakat: has joined #RubyOnRails
[14:48:24] Rodya_: has joined #RubyOnRails
[14:49:00] Hates_: broman: this is really confusing without seeing the full class names etc
[14:49:19] elaptics: cogsbox_: yes
[14:49:26] creature: Hates_: Well, the complicating factor here is: on development, they're writing to exactly the same database (just via different DB names/settings files).
[14:49:37] broman: Hates_, this is my class: http://pastie.org/10304392
[14:49:46] creature: And yes, I _could_ pull the plug on the production system and see what happens... but I quite like my job & would like to keep it. :)
[14:49:48] Rubie: has joined #RubyOnRails
[14:49:53] Hates_: creature: lol :P
[14:50:05] Anakat_: has joined #RubyOnRails
[14:50:18] Hates_: creature: maybe just breaking the establish_connection config would be enough then
[14:50:37] elaptics: cogsbox_: though I would change that method to return @current_user straight away if it's already been set so that it's not trying to find it every time that method is called
[14:50:55] cogsbox_: elaptics: ActionView::Template::Error (undefined method `premium?' for #<User:0x007f48c6a479f8>): I am making progress. I did not realize that I did not define "premium?" do I define this in my chargers model or controller?
[14:51:04] creature: Hates_: I'll give it a shot, but I have a suspicion that AR might just say "Oh, that's invalid, I'll try falling back to the default config" and it'll work. But I'll try it and get back to you.
[14:51:23] alexx1523: has joined #RubyOnRails
[14:51:31] curses: has joined #RubyOnRails
[14:51:35] Hates_: broman: what was your error again?
[14:52:08] broman: Hates_, uninitialized constant SimuladoService::SimuladosAproveitamentos or uninitialized constant SimuladosAproveitamentos (when i put ::)
[14:52:26] alexx1523: how to integrate xmpp-client with rails application any leads/link guys
[14:52:30] MaDErroR123: has joined #RubyOnRails
[14:52:34] broman: Hates_, the filename is simulados_aproveitamentos_controller.rb
[14:52:41] Hates_: broman: I just dont understand where SimuladoService plays into this
[14:52:44] Anakat__: has joined #RubyOnRails
[14:52:59] broman: Hates_, i just got the application like that.. they use services...
[14:53:23] broman: Hates_, the post call the service that calls the controller and so on..
[14:53:28] Hates_: broman: do you actually have a SimuladosAproveitamentos class?
[14:54:06] alexx1523: how to integrate xmpp-client with rails application any leads/link guys
[14:54:25] broman: Hates_, class SimuladosAproveitamento < ActiveRecord::Base
[14:54:27] Anakat: has joined #RubyOnRails
[14:54:39] Hates_: broman: SimuladosAproveitamentos != SimuladosAproveitamento
[14:54:52] naftilos76: has joined #RubyOnRails
[14:55:26] broman: ** feeling stupid **]
[14:55:39] Hates_: I'm not angry... just disappointed... :P
[14:55:42] alldaywill: has joined #RubyOnRails
[14:56:26] Anakat_: has joined #RubyOnRails
[14:56:49] alexx1523: how to integrate xmpp-client with rails application any leads/link guys
[14:57:01] Hates_: alex_____: no need to ask three time
[14:57:12] Hates_: alex_____: if someone knows they will chime in :)
[14:57:19] alexhartley: has joined #RubyOnRails
[14:58:02] Anakat__: has joined #RubyOnRails
[14:58:20] elaptics: cogsbox_: in your user model. That's the object you're calling that method on
[14:58:49] elaptics: cogsbox_: if you have a premium column in your users table then you should automatically have that predicate method - ActiveRecord creates it for you
[14:58:55] dangerousdave: has joined #RubyOnRails
[14:59:49] Anakat: has joined #RubyOnRails
[15:00:33] cogsbox_: elaptics: okay, https://gist.github.com/anonymous/d1451f4a431e75930381, but the success button never shows up. Which tells me that premium is never evaluating to true.
[15:00:47] nickenchuggets_: has joined #RubyOnRails
[15:00:57] arBmind1: has joined #RubyOnRails
[15:00:58] jkamenik: has joined #RubyOnRails
[15:01:30] drale2k_: has joined #RubyOnRails
[15:01:37] Anakat___: has joined #RubyOnRails
[15:01:55] elaptics: cogsbox_: 1. https://gist.github.com/anonymous/d1451f4a431e75930381#file-charges_controller-rb-L22 you're not setting the user to be premium around here which you had before
[15:02:03] relix_: has joined #RubyOnRails
[15:02:12] dented42: has joined #RubyOnRails
[15:02:16] strcmp2: has joined #RubyOnRails
[15:02:27] elaptics: cogsbox_: 2. https://gist.github.com/anonymous/d1451f4a431e75930381#file-show-html-erb-L12 you can just do: if @user.premium?
[15:02:27] corioliss_: has joined #RubyOnRails
[15:02:29] MiracleBlue_: has joined #RubyOnRails
[15:02:31] Juanchito_: has joined #RubyOnRails
[15:02:35] annlewis_: has joined #RubyOnRails
[15:02:48] cogsbox_: elaptics: blast! I can't believe I missed that.
[15:02:49] tenderlo_: has joined #RubyOnRails
[15:03:20] garrypolley: has joined #RubyOnRails
[15:03:20] jxf_: has joined #RubyOnRails
[15:03:41] crdpink2: has joined #RubyOnRails
[15:03:42] DEA7TH__: has joined #RubyOnRails
[15:04:35] jkamenik2: has joined #RubyOnRails
[15:04:53] charliesome_: has joined #RubyOnRails
[15:04:59] Derasi: has joined #RubyOnRails
[15:05:06] Anakat: has joined #RubyOnRails
[15:06:31] drewdavis_: has joined #RubyOnRails
[15:06:59] Anakat___: has joined #RubyOnRails
[15:08:01] harisamin: has joined #RubyOnRails
[15:08:13] exchgr`: has left #RubyOnRails: ()
[15:08:18] leslie1: has joined #RubyOnRails
[15:08:21] EXCHGR: has joined #RubyOnRails
[15:08:48] Anakat___: has joined #RubyOnRails
[15:09:03] chinmay_dd: has joined #RubyOnRails
[15:09:49] hahuang65: has joined #RubyOnRails
[15:10:29] Anakat: has joined #RubyOnRails
[15:12:22] Anakat_: has joined #RubyOnRails
[15:14:08] Anakat__: has joined #RubyOnRails
[15:15:18] cogsbox_: elaptics: NoMethodError (undefined method `premium=' for #<User:0x007faa68b14148>):
[15:15:28] cogsbox_: elaptics: I am working on the gist
[15:15:41] zorak8: has joined #RubyOnRails
[15:15:53] Anakat: has joined #RubyOnRails
[15:16:43] jkamenik: has joined #RubyOnRails
[15:16:53] krz: has joined #RubyOnRails
[15:17:24] cogsbox_: elaptics: https://gist.github.com/anonymous/07c5a3cfad0de7d2251d
[15:17:36] rubyonrailed: has joined #RubyOnRails
[15:17:37] Anakat_: has joined #RubyOnRails
[15:18:02] volsus: has joined #RubyOnRails
[15:18:08] mase-chatter: has joined #RubyOnRails
[15:18:09] kitsuneyo: has joined #RubyOnRails
[15:18:14] mcr-credil: has joined #RubyOnRails
[15:18:25] startupality: has joined #RubyOnRails
[15:18:53] Maletor: has joined #RubyOnRails
[15:18:57] Hates__: has joined #RubyOnRails
[15:19:25] startupality: When implementing file upload functionality locally and using heroku server for production do you think its better that the code uses local machine storage for files when in development or it should use aws s3 for development, staging and production? What would be the standard/best way?
[15:19:29] Anakat__: has joined #RubyOnRails
[15:20:25] LiquidInsect: has joined #RubyOnRails
[15:21:00] RegulationD: has joined #RubyOnRails
[15:21:14] Anakat: has joined #RubyOnRails
[15:22:03] hobodave_: has joined #RubyOnRails
[15:22:53] cogsbox_: elaptics: this is my full error https://gist.github.com/anonymous/60c83bfd6d1fa5006f8e
[15:23:01] Anakat_: has joined #RubyOnRails
[15:23:08] hobodave_: has joined #RubyOnRails
[15:24:46] Anakat__: has joined #RubyOnRails
[15:26:32] Anakat: has joined #RubyOnRails
[15:27:05] cogsbox_: sorry about that last commant
[15:27:08] dangerousdave: has joined #RubyOnRails
[15:28:31] Anakat_: has joined #RubyOnRails
[15:30:17] Anakat__: has joined #RubyOnRails
[15:31:56] Anakat: has joined #RubyOnRails
[15:32:17] naftilos76: has joined #RubyOnRails
[15:33:52] Anakat_: has joined #RubyOnRails
[15:34:16] n1lo: has joined #RubyOnRails
[15:35:37] Anakat__: has joined #RubyOnRails
[15:35:43] kitsuneyo: has joined #RubyOnRails
[15:36:01] hackeron: has joined #RubyOnRails
[15:36:48] jyunderwood: has joined #RubyOnRails
[15:37:09] AzaToth: has joined #RubyOnRails
[15:37:15] Anakat: has joined #RubyOnRails
[15:37:23] garrypolley: has joined #RubyOnRails
[15:37:57] chuythong: has joined #RubyOnRails
[15:39:02] Anakat_: has joined #RubyOnRails
[15:39:35] cogsbox_: elaptics: do you have any ideas why it says premium is undifined?
[15:40:26] r_baron: has joined #RubyOnRails
[15:40:47] Anakat__: has joined #RubyOnRails
[15:40:58] hahuang65: has joined #RubyOnRails
[15:41:02] elaptics: cogsbox_: have you actually run your migration?
[15:41:44] bix: has joined #RubyOnRails
[15:42:33] Anakat: has joined #RubyOnRails
[15:44:23] Anakat_: has joined #RubyOnRails
[15:44:39] ArchRogem: has joined #RubyOnRails
[15:44:41] riotjones: has joined #RubyOnRails
[15:45:04] hd1: has joined #RubyOnRails
[15:46:12] Anakat__: has joined #RubyOnRails
[15:46:34] artto: has joined #RubyOnRails
[15:46:50] gelinas2_: has joined #RubyOnRails
[15:47:57] Anakat: has joined #RubyOnRails
[15:48:01] ruurd: has joined #RubyOnRails
[15:48:18] dpritchett: has joined #RubyOnRails
[15:48:23] dpritchett: morning folks
[15:48:38] centrx: has joined #RubyOnRails
[15:48:50] towski_: has joined #RubyOnRails
[15:48:53] cac: has joined #RubyOnRails
[15:48:59] bix: has joined #RubyOnRails
[15:49:01] dpritchett: hey Radar are there any cool docs on the implications of using redis as the rails cache store when it comes to asset precompiles?
[15:49:06] chuythong: has left #RubyOnRails: ()
[15:49:24] dpritchett: I have some apps built on a rails ecommerce framework (cough cough) that are incredibly slow to precompile
[15:49:32] dpritchett: i noticed we are running Rails.cache.clear as part of our deploy process
[15:49:36] dpritchett: which is fine
[15:49:44] Anakat_: has joined #RubyOnRails
[15:49:49] dpritchett: i just dont' want to lose incremental (re)compilation of the asests if possible
[15:50:02] dpritchett: i'm reading through code in various redis-store repos now
[15:50:07] dpritchett: saw your name
[15:51:26] lindii_: has joined #RubyOnRails
[15:51:37] hobodave_: has joined #RubyOnRails
[15:51:45] Anakat__: has joined #RubyOnRails
[15:52:03] safeforge: has joined #RubyOnRails
[15:53:30] sonofdirt: has joined #RubyOnRails
[15:53:51] Anakat: has joined #RubyOnRails
[15:54:16] gambl0re: has joined #RubyOnRails
[15:55:37] Anakat_: has joined #RubyOnRails
[15:56:32] Cache_Money: has joined #RubyOnRails
[15:57:11] Anakat__: has joined #RubyOnRails
[15:57:38] Maletor: has joined #RubyOnRails
[15:57:45] wydont: has joined #RubyOnRails
[15:59:04] Anakat: has joined #RubyOnRails
[15:59:48] xcesariox: has joined #RubyOnRails
[16:00:04] tubbo: dpritchett: the rails cache doesn't have much to do with assets IIRC, because you precompile them into static files and serve them from the static web server, or on S3/some other CDN
[16:00:44] Anakat_: has joined #RubyOnRails
[16:01:01] dpritchett: sure tubbo but the files seem to show up in tmp/cache/assets
[16:01:14] dpritchett: I'm experimenting with various strategies to preserve those artifacts for future builds
[16:01:24] dpritchett: without upsetting my sysadmin's desire to do a cache clear on each deploy
[16:01:37] dpritchett: i think the main issue is that we aren't linking tmp/cache/assets between cap deploys
[16:02:32] tubbo: dpritchett: oh, i think that's when assets get recompiled in development
[16:02:33] Anakat__: has joined #RubyOnRails
[16:02:45] dpritchett: i'm doing experiments using RAILS_ENV=production locally tubbo
[16:02:51] tubbo: or in prod, it's just another temp directory
[16:02:51] dpritchett: so far i have this
[16:02:56] tubbo: dpritchett: don't paste, gist
[16:02:59] dpritchett: https://usercontent.irccloud-cdn.com/file/f9KIJCYD/
[16:03:06] dpritchett: hard to gist an image
[16:03:16] dpritchett: in prod we use redis-rails for our cache store
[16:03:18] tubbo: dpritchett: you're using IRCCloud so it uploaded itself :)
[16:03:24] dpritchett: i <3 pasting images
[16:03:30] tubbo: dpritchett: you can copy out that text and paste it to gist.github.com fwiw
[16:03:51] rustymyers: has joined #RubyOnRails
[16:04:14] tubbo: dpritchett: what version of rails are you running? rails 4 made some changes that you can backport
[16:04:27] Anakat: has joined #RubyOnRails
[16:04:53] hahuang65: has joined #RubyOnRails
[16:06:08] Anakat_: has joined #RubyOnRails
[16:07:01] arup_r: has joined #RubyOnRails
[16:07:05] kitsuneyo: has joined #RubyOnRails
[16:07:42] gambl0re: has joined #RubyOnRails
[16:07:54] Anakat__: has joined #RubyOnRails
[16:08:23] dpritchett: i think i've finished my investigation tubbo
[16:08:29] dpritchett: when i use `cache_store = :redis_store`
[16:08:39] dpritchett: then Rails.cache.clear doesn't touch tmp/cache
[16:08:45] dpritchett: but when i don't, then it deletes tmp/cache
[16:08:48] tubbo: ah, that makes sense dpritchett
[16:08:57] tubbo: because by default i think rails just writes cache stuff to the filesystem..
[16:08:59] dpritchett: rake assets:precompile seems to always use tmp/cache/assets
[16:09:19] dpritchett: so if i want faster deploys but i also want to clear cache on deploy
[16:09:21] tubbo: right, because sprockets doesn't know/care about your caching medium, it's just using a folder it knows is probably there
[16:09:23] dpritchett: then i need to 1) use redis cache
[16:09:36] dpritchett: 2) link tmp/cache in the capistrano config so it's always the same folder between deploys
[16:09:37] Anakat: has joined #RubyOnRails
[16:09:40] dpritchett: and that's about it
[16:09:45] dpritchett: thanks for rubber ducking with me :D
[16:10:00] cac: has joined #RubyOnRails
[16:10:17] tubbo: no problem dpritchett
[16:10:29] tubbo: that's what people typically do (#2) so that sprockets will only compile the files it needs instead of *all* of them
[16:10:50] tubbo: for some reason i thought capistrano did that by default, but maybe that's just the public/assets dir
[16:11:28] melter: has joined #RubyOnRails
[16:11:40] Anakat_: has joined #RubyOnRails
[16:11:55] dangerousdave: has joined #RubyOnRails
[16:13:15] Anakat__: has joined #RubyOnRails
[16:14:44] givanse: has joined #RubyOnRails
[16:15:11] Anakat: has joined #RubyOnRails
[16:16:13] zpe: has joined #RubyOnRails
[16:16:31] markalanevans: has joined #RubyOnRails
[16:16:56] Anakat_: has joined #RubyOnRails
[16:17:26] dpritchett: i think capistrano *recommends* you link tmp/cache
[16:17:36] dpritchett: but my team's capfiles don't seem to have been doing so
[16:17:49] jkamenik: has joined #RubyOnRails
[16:17:54] dpritchett: plus not all of our staging servers have redis_store enabled
[16:18:00] dpritchett: we have a project that is approaching all-hands criticality
[16:18:04] dpritchett: and people were complaining about slow deploys
[16:18:08] dpritchett: so i just finished this investigation
[16:18:20] dpritchett: and now i'm implementing my findings on a less critical project to verify
[16:19:04] Lightsword: has joined #RubyOnRails
[16:19:14] paulcsmith: has joined #RubyOnRails
[16:19:56] rubyonrailed: What's standard practice for handling out of range numbers? I have a few inputs that take numbers, users can put too many characters in there and when saved, it goes out of range. Should I put a JS limit on the inputs?
[16:20:19] Anakat: has joined #RubyOnRails
[16:20:31] cogsbox_: has joined #RubyOnRails
[16:21:26] ciree: rubyonrailed: that works, or you can simply do server side validation and then display errors
[16:21:37] jkamenik: has joined #RubyOnRails
[16:21:47] ruurd: has joined #RubyOnRails
[16:22:09] Anakat_: has joined #RubyOnRails
[16:22:21] mastyd: has joined #RubyOnRails
[16:22:48] mastyd: Hi is anyone familiar with deploying Ruby on Rails to AWS Elastic Beanstalk and using AWS RDS for the DB?
[16:23:37] cogsbox_: has joined #RubyOnRails
[16:23:58] Anakat__: has joined #RubyOnRails
[16:24:19] fgo: has joined #RubyOnRails
[16:25:03] broman: has joined #RubyOnRails
[16:25:33] Aswebb_: has joined #RubyOnRails
[16:25:40] Anakat: has joined #RubyOnRails
[16:25:47] zhifu: has joined #RubyOnRails
[16:25:55] zorak8: has joined #RubyOnRails
[16:27:29] Anakat_: has joined #RubyOnRails
[16:29:11] imkj: has joined #RubyOnRails
[16:29:18] Anakat__: has joined #RubyOnRails
[16:29:59] Scripore: has joined #RubyOnRails
[16:31:02] Anakat: has joined #RubyOnRails
[16:32:48] Anakat_: has joined #RubyOnRails
[16:33:17] ruurd: has joined #RubyOnRails
[16:34:27] michaeldeol: has joined #RubyOnRails
[16:34:41] Anakat__: has joined #RubyOnRails
[16:34:57] dopie: has joined #RubyOnRails
[16:35:44] shinnya: has joined #RubyOnRails
[16:35:53] siemprefresco: has joined #RubyOnRails
[16:36:27] Anakat: has joined #RubyOnRails
[16:37:12] gambl0re: has joined #RubyOnRails
[16:37:33] DEA7TH: has joined #RubyOnRails
[16:37:42] dangerousdave: has joined #RubyOnRails
[16:38:00] n1lo: has joined #RubyOnRails
[16:38:14] Anakat_: has joined #RubyOnRails
[16:39:19] bricker: has joined #RubyOnRails
[16:40:14] Anakat__: has joined #RubyOnRails
[16:41:58] Anakat: has joined #RubyOnRails
[16:42:19] polpak: has joined #RubyOnRails
[16:42:39] p8m: has joined #RubyOnRails
[16:43:32] Anakat_: has joined #RubyOnRails
[16:45:01] charliesome: has joined #RubyOnRails
[16:45:18] Anakat__: has joined #RubyOnRails
[16:45:27] siddart_: has joined #RubyOnRails
[16:46:32] siemprefresco: has joined #RubyOnRails
[16:47:05] Rubie: has joined #RubyOnRails
[16:47:07] Anakat: has joined #RubyOnRails
[16:49:07] Anakat_: has joined #RubyOnRails
[16:50:43] Anakat__: has joined #RubyOnRails
[16:50:48] Rubie: has joined #RubyOnRails
[16:52:27] Anakat: has joined #RubyOnRails
[16:54:05] DoctorMonocular: has joined #RubyOnRails
[16:54:17] Anakat_: has joined #RubyOnRails
[16:55:24] _djbkd: has joined #RubyOnRails
[16:55:25] zorak8: has joined #RubyOnRails
[16:56:01] Anakat__: has joined #RubyOnRails
[16:56:15] mtchllbrrn: has joined #RubyOnRails
[16:57:50] Anakat: has joined #RubyOnRails
[16:57:56] kies^: has joined #RubyOnRails
[16:58:31] mtchllbrrn: I'm attempting to deploy my rails app to production via Digital Ocean. I'm running nginx + passenger. When I attempt to access it via the browser, I get the following errors in /var/log/nginx/error.log: *** Exception RuntimeError in Rack application object (Missing `secret_token` and `secret_key_base` for 'production' environment, set these value
[16:58:31] mtchllbrrn: s in `config/secrets.yml`) (process 16586, thread 0x007fb379c31a98(Worker 1)):
[16:58:35] rubyonrailed: has joined #RubyOnRails
[16:59:00] erich: has joined #RubyOnRails
[16:59:04] kohgpat: has joined #RubyOnRails
[16:59:39] Anakat_: has joined #RubyOnRails
[16:59:39] zeknox: mtchllbrrn: http://guides.rubyonrails.org/4_1_release_notes.html#config-secrets-yml
[17:00:18] imkj: mtchllbrrn: "rake secret" might help, too.
[17:00:43] zeknox: mtchllbrrn: also this: http://guides.rubyonrails.org/upgrading_ruby_on_rails.html#config-secrets-yml
[17:01:04] mtchllbrrn: zeknox: Here's my config/secrets.yml http://hastebin.com/akowebikup.vala
[17:01:27] dpritchett: is anyone using coreos or kubernetes or something to manage modest rails deployments?
[17:01:37] Anakat__: has joined #RubyOnRails
[17:01:44] dpritchett: 90% of our rails apps are just a couple of puma processes, postgres or mysql, and redis
[17:01:48] dpritchett: no huge farms
[17:01:56] imkj: mtchllbrrn: Did you set the environment variables "SECRET_KEY_BASE" and "SECRET_TOKEN"?
[17:01:57] mtchllbrrn: I'm not exactly sure which user is running my rails app (how do I find out?), but I've set universal environment vars via /etc/environment
[17:02:00] zeknox: mtchllbrrn: this too: http://daniel.fone.net.nz/blog/2013/05/20/a-better-way-to-manage-the-rails-secret-token/
[17:02:32] manfrin: has joined #RubyOnRails
[17:03:08] Anakat: has joined #RubyOnRails
[17:03:51] mtchllbrrn: When I run `rails c production`, `ENV.fetch("SECRET_KEY_BASE")`, I get the secret key as set by my env variable, as expected.
[17:04:50] atal421: has joined #RubyOnRails
[17:05:04] Anakat_: has joined #RubyOnRails
[17:06:10] emilkarl: has joined #RubyOnRails
[17:06:11] atal421: re factorygirl. is there a way to create a fake factory that becomes another factory? So, somehting like toy_car = FactoryGirl.create(:product, :toy_car) where product doesn't really do anything?
[17:06:39] atal421: i was looking at alias and trait but i'm not sure that's the right direction
[17:06:42] Anakat__: has joined #RubyOnRails
[17:07:37] gambl0re: has joined #RubyOnRails
[17:08:30] Anakat: has joined #RubyOnRails
[17:10:00] smathy: atal421, what's the underlying problem you're trying to solve?
[17:10:23] Anakat_: has joined #RubyOnRails
[17:10:30] RegulationD: has joined #RubyOnRails
[17:11:14] atal421: i'm trying to make it clear to other testers that although they could do stuff like FactoryGirl.create(:toy_car) toy_car is considered a product, and so they should know that it IS a product (even though there's no product model, or STI, stuff like that)
[17:12:09] Anakat__: has joined #RubyOnRails
[17:13:24] ruurd: has joined #RubyOnRails
[17:13:44] rakm: has joined #RubyOnRails
[17:13:53] Anakat: has joined #RubyOnRails
[17:14:02] mtchllbrrn: If I bake my secret_key_base and secret_token directly into config/secrets.yml on my production machine, it works fine.
[17:14:42] mtchllbrrn: So something is going wrong with fetching the environment variables. Running `env | grep SECRET` retrieves both keys, as expected.
[17:15:39] Anakat_: has joined #RubyOnRails
[17:17:29] Anakat__: has joined #RubyOnRails
[17:19:15] Anakat: has joined #RubyOnRails
[17:20:41] Eminence_: has joined #RubyOnRails
[17:21:10] Anakat_: has joined #RubyOnRails
[17:21:53] unix63: has joined #RubyOnRails
[17:21:56] unix63: In general, what are some common ways to progressive upload data to a web URL? I know of multipart. Are there other known ways?
[17:22:44] imkj: mtchllbrrn: According to the Passenger docs, the application is run by the owner of config.ru. Does that user have access to the environment?
[17:22:58] Anakat__: has joined #RubyOnRails
[17:23:00] mtchllbrrn: Yes, I read that as well. And yes, it does.
[17:23:07] zly: has joined #RubyOnRails
[17:23:17] Gnut: has joined #RubyOnRails
[17:23:18] mtchllbrrn: That's the user from which I deployed the rails app, ran `bundle install`, etc.
[17:23:40] justthisguy: has joined #RubyOnRails
[17:23:58] mikecmpbll: has joined #RubyOnRails
[17:24:05] imkj: mtchllbrrn: I'm curious, if you make those environment variables specific to that user, instead of putting them in the global conf, if this would still happen.
[17:24:10] nickenchuggets: has joined #RubyOnRails
[17:24:47] Anakat: has joined #RubyOnRails
[17:25:38] benlieb: has joined #RubyOnRails
[17:26:13] mtchllbrrn: imkj: I wondered the same, and went ahead and added them specifically to the rails app user. No dice, same problem.
[17:26:24] Anakat_: has joined #RubyOnRails
[17:27:12] mtchllbrrn: I've also been restarting the server via `nginx -s reload`, so that shouldn't be an issue.
[17:27:25] RegulationD: has joined #RubyOnRails
[17:28:19] Anakat__: has joined #RubyOnRails
[17:28:28] imkj: mtchllbrrn: Just to cover the bases, you also sourced from the .bashrc after adding the environment variables to it? I'm just making sure.
[17:28:29] smathy: atal421, so no, you can't do what you want without making your own wrapper around FG.
[17:29:14] mtchllbrrn: I didn't add the environment variables via .bashrc, I did `export SECRET_KEY_BASE=`rake secret``
[17:29:29] smathy: unix63, what's "progressive upload"?
[17:29:30] mtchllbrrn: for the sake of getting it working. once I get it working, I'd likely add it to the user's bashrc
[17:29:42] unix63: smathy: where i can upload a 1gb file while showing a progress bar
[17:29:52] mtchllbrrn: imkj: let me try adding to .bashrc, just for giggles.
[17:29:56] schaerli: has joined #RubyOnRails
[17:29:57] Anakat: has joined #RubyOnRails
[17:30:06] Jon30: has joined #RubyOnRails
[17:31:22] Jon30: hey guys... i got after_save callback in a model, but when I have paperclip upload, it seems like the file is only created after after_save callback. Is there a callback for after the file is created in the public directory?
[17:31:42] Anakat_: has joined #RubyOnRails
[17:32:02] startupality: has joined #RubyOnRails
[17:32:21] qejk: has joined #RubyOnRails
[17:33:01] nnull: has joined #RubyOnRails
[17:33:17] smathy: unix63, you can do them async with a hidden iframe, there's a nice gem that makes this seem like an ajax request: https://github.com/JangoSteve/remotipart
[17:33:20] mtchllbrrn: imkj: Same problem, no change when I add to .bashrc and `source`
[17:33:38] imkj: mtchllbrrn: Hmm... splendid. Let me think.
[17:34:29] erich: has joined #RubyOnRails
[17:34:33] imkj: mtchllbrrn: Is it possible that the Passenger processes are somehow run as www-data (or equivalent) and that it has no permission to read the environment?
[17:34:50] jhack32: has joined #RubyOnRails
[17:35:08] ararog: has joined #RubyOnRails
[17:35:17] mtchllbrrn: imkj: That occurred to me as well. Tried setting the env vars there, same problem.
[17:35:19] Anakat: has joined #RubyOnRails
[17:36:32] imkj: mtchllbrrn: Where exactly did you set them, if I might ask?
[17:37:10] mtchllbrrn: `sudo su www-data`, `export SECRET_KEY_BASE=`rake secret``, then the same for SECRET_TOKEN
[17:37:16] Anakat_: has joined #RubyOnRails
[17:37:24] garrypolley: has joined #RubyOnRails
[17:37:33] siddart_: has joined #RubyOnRails
[17:37:53] mtchllbrrn: imkj: Could it maybe be that Nginx doesn't like using the user's env? Maybe it requires its own env vars via nginx.conf or something?
[17:38:37] towski_: has joined #RubyOnRails
[17:38:45] imkj: mtchllbrrn: I was thinking the same thing. I was reading the Nginx docs about it.
[17:38:47] yfeldblum: has joined #RubyOnRails
[17:40:10] solars: has joined #RubyOnRails
[17:40:22] smathy: Jon30, the way paperclip works is by adding an after_save hook, this should be done when `has_attached_file` is run, so if your `after_save` comes after the `has_attached_file` then it should be executed after the Paperclip file is saved.
[17:40:41] kb3ien: has joined #RubyOnRails
[17:40:42] Anakat: has joined #RubyOnRails
[17:40:44] simplyianm: has joined #RubyOnRails
[17:40:53] darrencauthon: has joined #RubyOnRails
[17:41:16] dstarh: has joined #RubyOnRails
[17:41:58] bungoman: has joined #RubyOnRails
[17:42:04] kb3ien: I'm trying to debug this error: http://troika.www6.databit7.com/articles?utf8=%E2%9C%93&locals[src]=articles&op=AND&all_fields=byzantium&title=apogee&author=Stephens&journal=&sort=score+desc%2C+pub_date_sort+desc%2C+title_sort+asc&search_field=advanced&commit=Search What could have caused working code on a working route to throw undefined method `[]' for nil:NilClass ?
[17:42:31] Anakat_: has joined #RubyOnRails
[17:43:55] alphaatom: has joined #RubyOnRails
[17:44:14] Anakat__: has joined #RubyOnRails
[17:44:21] smathy: kb3ien, gist the definition of your generate_next_url method.
[17:44:37] smathy: (and indicate which line is 433)
[17:44:52] nickenchuggets: has joined #RubyOnRails
[17:44:52] nickenchuggets: has joined #RubyOnRails
[17:44:59] imkj: mtchllbrrn: Do you use RVM or Rbenv?
[17:45:12] simplyianm: has joined #RubyOnRails
[17:46:02] Anakat: has joined #RubyOnRails
[17:46:17] Ergo: has joined #RubyOnRails
[17:46:27] gerep: has joined #RubyOnRails
[17:47:01] imkj: mtchllbrrn: I'm thinking maybe somehow Rbenv doesn't pass the full environment to the Rails project...
[17:47:34] startupality: has joined #RubyOnRails
[17:47:49] Anakat_: has joined #RubyOnRails
[17:47:55] axl_: has joined #RubyOnRails
[17:48:19] Lightsword: has joined #RubyOnRails
[17:49:31] kb3ien: nit is defined https://github.com/ebsco/blacklight_with_eds/blob/master/app/helpers/blacklight/articles_helper_behavior.rb
[17:49:37] Anakat__: has joined #RubyOnRails
[17:49:43] ruurd: has joined #RubyOnRails
[17:49:51] smathy: mtchllbrrn, how are you setting your ENV vars?
[17:50:08] gambl0re: has joined #RubyOnRails
[17:50:59] mtchllbrrn: imkj: That's a good idea, I'll have to look into it.
[17:51:22] Anakat: has joined #RubyOnRails
[17:51:39] mtchllbrrn: smathy: `export SECRET_KEY_BASE=`rake secret``, same for SECRET_TOKEN
[17:51:49] mtchllbrrn: For the user under which the rails app runs
[17:52:03] baweaver: has joined #RubyOnRails
[17:52:46] skroon: has joined #RubyOnRails
[17:53:11] Anakat_: has joined #RubyOnRails
[17:53:14] bruno-: has joined #RubyOnRails
[17:53:30] smathy: mtchllbrrn, ok so no, nginx doesn't work like that, it removes all environment variables except TZ.
[17:54:07] smathy: mtchllbrrn, you have to set it either in your nginx configuration, or in Rails (eg. by using .env )
[17:54:09] l0oky: has joined #RubyOnRails
[17:54:12] baweaver: has joined #RubyOnRails
[17:54:13] gerep: I'm following a Rails Cast video about nested forms and this is the code I have: https://gist.github.com/anonymous/aa1490a1fa153e655600 Right now when I update a Survey, the questions are duplicated, what am I missing?
[17:54:23] cornerma1: has joined #RubyOnRails
[17:54:32] lindii_: why i would be getting uninitialized constant YAML (NameError) when i restart the server after installing private pub
[17:54:39] smathy: mtchllbrrn, how to set it (or preserve it) in nginx conf: http://nginx.org/en/docs/ngx_core_module.html#env
[17:54:52] jamesrward: has joined #RubyOnRails
[17:54:53] baweaver_: has joined #RubyOnRails
[17:54:57] kb3ien: smathy that is where generate_next_url is defined. I changed (added, removed) some URL parameters, and the lod code throws this error now.
[17:55:08] kb3ien: s/lod/old/
[17:55:32] smathy: kb3ien, only thing in there which would make that error is line 434 if params was nil.
[17:55:48] kb3ien: params may now be nil. I'll check.
[17:56:46] SteenJobs: has joined #RubyOnRails
[17:56:50] Anakat: has joined #RubyOnRails
[17:58:10] mhib: has joined #RubyOnRails
[17:58:20] smathy: kb3ien, the line numbers don't match up, which is odd too. Maybe the code that's running isn't what you think it is. Make sure you restart your server and/or check what code is actually on that server,.
[17:58:33] Anakat__: has joined #RubyOnRails
[17:59:10] kb3ien: smathy, it looks defined , i enclosed the problem code in " if ( defined?( params ) ) " one would think that should trap the error.
[17:59:56] simplyianm: has joined #RubyOnRails
[18:00:08] codelahoma: has joined #RubyOnRails
[18:00:22] Anakat_: has joined #RubyOnRails
[18:00:57] smathy: gerep, you've included the wrong view in your gist.
[18:01:36] smathy: kb3ien, not necessarily, params is defined even if it's nil.
[18:01:45] hobodave: has joined #RubyOnRails
[18:02:03] Anakat: has joined #RubyOnRails
[18:02:39] gerep: smathy, which should I add?
[18:02:53] kb3ien: it seems to be keeping up with the changes. I've seen rubyonrails do that a bunch. Off by one or two....
[18:02:58] smathy: gerep, what do you think?
[18:02:58] gerep: smathy, the edit view just render the form
[18:03:14] skroon: has joined #RubyOnRails
[18:03:23] kb3ien: Rails.logger.warn ( "params = " + params.inspect ) logged the following : params = {"locals"=>"{&quot;src&quot;=&gt;&quot;articles&quot;}", "op"=>"AND", "all_fields"=>"byzantium", "title"=>"apogee", "author"=>"Stephens", "journal"=>"", "sort"=>"score desc, pub_date_sort desc, title_sort asc", "search_field"=>"advanced", "commit"=>"Search"}
[18:03:43] gerep: smathy, I'll add the form
[18:03:45] smathy: gerep, that's still more relevant than the show view, but think about what view files are in play here, and show them all.
[18:03:55] Anakat__: has joined #RubyOnRails
[18:03:58] rakm: has joined #RubyOnRails
[18:04:28] zhifu: has joined #RubyOnRails
[18:04:29] smathy: kb3ien, and what if you log something after the `end` of that `if` ? Does that show up?
[18:05:09] Lytol: has joined #RubyOnRails
[18:05:38] kb3ien: Which causes the crash, whereas when params = {"search_field"=>"author", "q"=>"Stephens"}
[18:05:51] Anakat_: has joined #RubyOnRails
[18:06:22] kb3ien: everything works fine. I'm assuming that params really is defined at this point.
[18:06:39] simplyianm: has joined #RubyOnRails
[18:07:19] hahuang65: has joined #RubyOnRails
[18:07:28] gerep: smathy, the problem was that I didn't have the id in the params.permit
[18:07:29] Anakat: has joined #RubyOnRails
[18:07:40] gerep: smathy, the question id, that's why it was duplicating :)
[18:08:03] smathy: kb3ien, ok, so the stacktrace isn't matching the code you showed me.
[18:08:18] safeforge: has joined #RubyOnRails
[18:08:19] smathy: kb3ien, so, ignoring the line number the problem is obviously your session[:results]['SearchRequestGet']['QueryString']
[18:08:26] Olipro_: has joined #RubyOnRails
[18:08:41] curses: has joined #RubyOnRails
[18:08:47] circ-user-rNANL: has joined #RubyOnRails
[18:08:58] smathy: kb3ien, looking at the session dump on your error page, session[:results] does not contain a SearchRequestGet key: results: {"DetailedErrorDescription"=>"Parameter Name: query Parameter value: AND,AND,AU:Stephens. Too many arguments received.", "ErrorDescription"=>"Incorrect Number of Arguments", "ErrorNumber"=>"105"}
[18:09:14] Anakat__: has joined #RubyOnRails
[18:09:17] smathy: gerep, cool, well done.
[18:09:44] jamesrward: trying to get a counter_cache going and I'm not sure what I missed. I ran the migration and added the change to my model but I'm getting NoMethod errors when I call type.allies.count. Any suggestions where to look for my mistake?
[18:10:26] jamesrward: Things seem to work fine in rails console. If I create a type object and call type.allies.count it runs the sql I expect and uses the counter_cache
[18:10:56] urkle: has joined #RubyOnRails
[18:11:03] Anakat_: has joined #RubyOnRails
[18:11:14] circ-user-rNANL: has left #RubyOnRails: ()
[18:11:16] hfp: has joined #RubyOnRails
[18:11:20] Silox|: has joined #RubyOnRails
[18:11:21] hfp_work: has joined #RubyOnRails
[18:11:39] epochwolf: has joined #RubyOnRails
[18:11:46] gambl0re: has joined #RubyOnRails
[18:11:51] jsrn_: has joined #RubyOnRails
[18:11:54] smathy: jamesrward, so where does it not work?
[18:12:12] jalcine: has joined #RubyOnRails
[18:12:17] universa1: has joined #RubyOnRails
[18:12:35] sfr^: has joined #RubyOnRails
[18:12:45] jamesrward: on my activeadmin dashboard. Here's a gist of how I am calling it https://gist.github.com/anonymous/deade707a2511b6f9d4f
[18:13:00] Anakat: has joined #RubyOnRails
[18:14:02] FooBarWidget: has joined #RubyOnRails
[18:14:05] Seich: has joined #RubyOnRails
[18:14:06] circ-user-rNANL: has joined #RubyOnRails
[18:14:14] bricker: !notworking
[18:14:28] bricker: jamesrward: gist the error, stack trace, etc.
[18:14:38] helpa: (ノಠ益ಠ)ノ彡┻━┻
[18:14:40] Anakat__: has joined #RubyOnRails
[18:14:44] jamesrward: bricker: will do
[18:14:57] Klumben: has joined #RubyOnRails
[18:15:33] bungoman: has joined #RubyOnRails
[18:15:44] markelite: has joined #RubyOnRails
[18:15:45] larissa: has joined #RubyOnRails
[18:15:47] skarn: has joined #RubyOnRails
[18:15:51] girakrok: has joined #RubyOnRails
[18:15:56] LBRapid: has joined #RubyOnRails
[18:15:57] Elion: has joined #RubyOnRails
[18:16:13] george2: has joined #RubyOnRails
[18:16:33] Anakat_: has joined #RubyOnRails
[18:17:21] smathy: ACTION has no idea about AA
[18:17:41] pixelhandler: has joined #RubyOnRails
[18:17:49] jamesrward: bricker: here's the console dump https://gist.github.com/anonymous/976a0ae96be6bed87af4
[18:18:19] Anakat: has joined #RubyOnRails
[18:19:03] broman: has joined #RubyOnRails
[18:19:07] jdcauley: has joined #RubyOnRails
[18:19:11] jamesrward: bricker: and the full trace https://gist.github.com/jamesrward/d38b9874876989d68fef
[18:19:46] hfp: has joined #RubyOnRails
[18:19:57] Anakat__: has joined #RubyOnRails
[18:19:59] smathy: jamesrward, the error you have (`undefined method `allies' for #<Class...`) suggests that `type` in the AA code you showed is the class, not the instance.
[18:20:15] ciree: is there a way to figure out which layout rails is using? I can't figure out what the default is
[18:20:16] hfp_work: has joined #RubyOnRails
[18:20:50] jamesrward: here is the complete code for my dashboard.rb where I call type.allies.count https://gist.github.com/anonymous/01b25afad6089c794120
[18:21:13] broman: can anyone help me?? im passing a json ( http://pastie.org/10304671 ) to my model save method ( http://pastie.org/10304672 ) .. it goes through the first model and then saves other rows in this other table... im getting null as values.. what can i do?
[18:21:15] erichu: has joined #RubyOnRails
[18:21:27] rakm: has joined #RubyOnRails
[18:21:42] Anakat_: has joined #RubyOnRails
[18:21:44] jamesrward: smathy: I see what you're saying. Not sure how to correct it thought.
[18:22:01] smathy: jamesrward, nor me, I know nothing about AA.
[18:22:20] SteenJobs: has joined #RubyOnRails
[18:22:22] aguynamedben: has joined #RubyOnRails
[18:23:29] Anakat: has joined #RubyOnRails
[18:24:10] smathy: broman, there's not enough code there to see what you're doing.
[18:24:17] hfp_: has joined #RubyOnRails
[18:24:31] smathy: broman, make a gist please, showing both models, and the controller, as well as that JSON.
[18:24:40] fgo_: has joined #RubyOnRails
[18:24:51] charliesome: has joined #RubyOnRails
[18:24:58] broman: smathy, i am receiving that json on a post... after that i save the event i want to save some other things associated to it...
[18:25:01] smathy: broman, !gist-usage - for how to do it properly.
[18:25:01] helpa: broman: How to use Gist properly: https://github.com/radar/guides/blob/master/using-gist.markdown
[18:25:29] Anakat__: has joined #RubyOnRails
[18:26:06] A-ron: has joined #RubyOnRails
[18:26:47] n1lo: has joined #RubyOnRails
[18:26:50] terrellt_: has joined #RubyOnRails
[18:27:00] broman: smathy, https://gist.github.com/anonymous/c1ffb1a015aef5fbce76
[18:27:05] Anakat_: has joined #RubyOnRails
[18:27:50] A-ron: has joined #RubyOnRails
[18:27:55] broman: smathy, refer to the line 152 on simulado_service.rb
[18:28:42] mtchllbrrn: smathy: Sorry for the delay, I was away from my computer. I tried setting the secrets in nginx.conf, and... It worked! I was unaware that nginx flushes all env vars. Is it considered best practice to do it in this way? You mentioned doing it from within rails with .env? How does that work?
[18:28:47] hfp_work: has joined #RubyOnRails
[18:28:51] Anakat: has joined #RubyOnRails
[18:29:29] smathy: ciree, from within your controller: logger.debug _layout.inspect
[18:29:30] OS-14813: has joined #RubyOnRails
[18:30:30] safeforge: has joined #RubyOnRails
[18:30:41] Anakat__: has joined #RubyOnRails
[18:30:49] gambl0re: has joined #RubyOnRails
[18:30:53] FCser: has joined #RubyOnRails
[18:31:30] ciree: smathy: thanks!
[18:31:35] relix: has joined #RubyOnRails
[18:31:42] smathy: ciree, you're welcome.
[18:32:30] Anakat_: has joined #RubyOnRails
[18:32:38] smathy: broman, why did you show me the SimuladosAproveitamentosController ?
[18:33:10] broman: smathy, that's the place where i try to save the params[:aproveitamentos_produto]
[18:33:13] doodlehaus: has joined #RubyOnRails
[18:33:36] broman: smathy, "aproveitamentos_produto"=>{"aproveitamento_id"=>["1"]},
[18:34:06] smathy: mtchllbrrn, there's a gem called dotenv that allows you to set the vars in .env (which is how heroku works) - but in my opinion, setting them in nginx is best practice.
[18:34:07] simplyianm: has joined #RubyOnRails
[18:34:12] Anakat: has joined #RubyOnRails
[18:34:28] Mendenhall: has joined #RubyOnRails
[18:34:45] eggoez: has joined #RubyOnRails
[18:34:51] smathy: broman, well (a) how is that called? and (b) where is SimuladosAproveitamentos defined?
[18:35:02] mtchllbrrn: smathy: Gotcha, thanks for all of your help.
[18:35:15] ruurd: has joined #RubyOnRails
[18:35:18] toretore: has joined #RubyOnRails
[18:35:22] jhack32: has joined #RubyOnRails
[18:35:22] smathy: broman, or are you using that SimuladoService somewhere? (you're not showing where you're using that)
[18:35:28] smathy: mtchllbrrn, you're welcome.
[18:35:54] avat: has joined #RubyOnRails
[18:36:02] Anakat__: has joined #RubyOnRails
[18:36:47] avat: Hey guys, I want to write a MQTT broker in Rails, is it possible? All gems are clients as far as I understand
[18:37:06] ciree: smathy: that worked great but is there a general default? Like should I have assumed that if there wasn't an explicit layout that it would have been application.html.erb?
[18:37:14] broman: smathy, well.. on the page there is a form to insert an event(simulado) on the page... at this event i have some other variables (aproveitamentos)... when i hit post, i get that big json, including that aproveitamento json i just showed you! but when i do the .new(params[:aproveitamentos_produto] it's inserting null values to my database
[18:37:35] SteenJobs: hey gents, anyone work with the stripe API before?
[18:37:48] hfp_work: has joined #RubyOnRails
[18:37:58] smathy: Avat, https://github.com/njh/ruby-mqtt says it's a publisher too.
[18:37:59] Anakat_: has joined #RubyOnRails
[18:38:18] hfp: has joined #RubyOnRails
[18:39:07] SteenJobs: i???m having trouble with the callback after the stripe payment is made
[18:39:15] paulf__: has joined #RubyOnRails
[18:39:22] werelivinginthef: has joined #RubyOnRails
[18:39:26] elaptics: SteenJobs: !code
[18:39:26] helpa: SteenJobs: We cannot help you with your problem if you don't show us your code. Please put it on http://gist.github.com and give us the URL so we can see it.
[18:39:33] Anakat: has joined #RubyOnRails
[18:39:40] smathy: ciree, maybe read this: http://guides.rubyonrails.org/layouts_and_rendering.html#finding-layouts It explains how rails finds the right layout to use.
[18:39:48] smathy: (assuming you don't explicitly specify it)
[18:40:07] SteenJobs: elaptics: i know i know. there???s not much code to show, it???s straight off their website. i just want to know if i have to render anything or do any type of action after the charge is made
[18:40:07] ciree: smathy: thanks!
[18:40:12] smathy: ciree, you're welcome :)
[18:40:43] elaptics: SteenJobs: that's up to your app, what do you want to happen once the transaction is done
[18:41:24] avat: @smathy so one of the clients can just work as a broker?
[18:41:24] Anakat__: has joined #RubyOnRails
[18:41:40] avat: smathy: so one of the clients can just work as a broker?
[18:41:44] smathy: broman, you haven't even explained *which* new(params[:aproveitamentos_produto]) is being called, you have two different ones in your gist, one called on SimuladosAproveitamento in the service object, and one called on SimuladosAproveitamentos in the controller.
[18:41:46] asahi: has joined #RubyOnRails
[18:41:46] SteenJobs: elaptics: the frontend is angular. i want it to navigate to a new page upon success, or show an error message and not navigate if it fails. as of now i don???t have callbacks written and the server shows a 500 error, missing template for api/charges/create
[18:42:12] werelivinginthef: has joined #RubyOnRails
[18:42:17] broman: smathy, consider the one on the service
[18:42:39] smathy: broman, my inclination is to assume that the controller is what's being called because (a) it's a controller so that's the conventional handler for incoming requests and (b) you included it in your gist. What I'm unclear on is where SimuladosAproveitamentos is defined because you didn't show that.
[18:42:42] hobodave: has joined #RubyOnRails
[18:42:45] DLSteve: has joined #RubyOnRails
[18:42:49] clamstar: has joined #RubyOnRails
[18:43:06] broman: smathy, you mean the model?
[18:43:10] Anakat_: has joined #RubyOnRails
[18:43:26] broman: smathy, its the simulados_aproveitamento.rb file
[18:43:47] elaptics: SteenJobs: not really familiar with angular but based on the outcome of the Stripe::Charge.create method you just do the relevant thing, e.g. in a typical rails app you've be redirecting to a successful page or maybe adding an error to an object and re-rendering it in some way
[18:44:09] Rubie: has joined #RubyOnRails
[18:44:12] DLSteve: has joined #RubyOnRails
[18:44:22] SteenJobs: elaptics: so what would be causing that error?
[18:44:23] AlvaroFernandoMS: has joined #RubyOnRails
[18:44:25] gaussblurinc1: has joined #RubyOnRails
[18:44:44] smathy: broman, well, if you're telling me that your service object is the code that's being called then I want to know how we get there, so I can see exactly what the arguments to vinculaPerfisAoSimulado are.
[18:44:56] elaptics: SteenJobs: I'm guessing because it's done the charge and in the absence of anything else rails is going to try and render a template named according to the action and you don't have one
[18:45:06] Anakat: has joined #RubyOnRails
[18:45:11] SteenJobs: elaptics: ah yea that???s what i thought.
[18:45:13] sonofdirt: has joined #RubyOnRails
[18:45:24] smathy: broman, basically I want to see the HTTP request you're making, the controller that's handling it, and then all the methods between that controller and that service object method.
[18:45:36] SteenJobs: elaptics: but i???m not sure what to render, because all i really need is to send a response back to angular saying everything is either a okay, or no good.
[18:45:38] elaptics: SteenJobs: the error message is quite specific :D
[18:45:55] SteenJobs: elaptics: haha i know. thought maybe there was an underlying thing i didn???t see.
[18:46:12] elaptics: SteenJobs: so like a head :ok message if all good or render some json with errors if it failed?
[18:46:13] smathy: broman, otherwise how can I possibly be of use to you? The `params` argument to the SimuladoService.vinculaPerfisAoSimulado method could be *ANYTHING* right now.
[18:46:34] elaptics: SteenJobs: I dunno what you normally expect in an angular app
[18:46:55] Anakat__: has joined #RubyOnRails
[18:47:02] SteenJobs: elaptics: aright lemme try something, i???ll bbak in a sec.
[18:47:05] elaptics: SteenJobs: but basically return what you want based on the success or failure of the stripe charge
[18:47:05] workmad3: has joined #RubyOnRails
[18:47:10] smathy: broman, let's begin with the code that's sending the JSON you showed, how are you making the request, and what URL are you making it to, and what HTTP method are you using?
[18:47:14] smathy: broman, and what other headers?
[18:47:24] SteenJobs: elaptics: that???s the thing, nothing needs to be returned /:
[18:47:41] elaptics: SteenJobs: so how would angular know what it should do?
[18:47:52] broman: smathy, i understood you and will assemble all the info :) just give me a minute
[18:49:09] SteenJobs: elaptics: so angular returns a ???promise??? from what i understand???but i guess with rails, how do you simply return a thumbs up when the call was successful?
[18:49:15] gambl0re: has joined #RubyOnRails
[18:49:35] SteenJobs: elaptics: i guess just render :status => 200?
[18:51:05] benlieb: has joined #RubyOnRails
[18:51:37] broman: how do i make rails write on console?
[18:51:45] elaptics: SteenJobs: yes, or head :ok
[18:51:49] kidoz: has joined #RubyOnRails
[18:52:00] baweaver: has joined #RubyOnRails
[18:52:01] SteenJobs: elaptics: ah never seen head :ok, gonna look it up now.
[18:52:11] Anakat: has joined #RubyOnRails
[18:52:18] podman: has joined #RubyOnRails
[18:53:25] elaptics: SteenJobs: http://guides.rubyonrails.org/layouts_and_rendering.html#using-head-to-build-header-only-responses
[18:53:40] SteenJobs: elaptics: thanks. still not working, getting the 500 error. gonna gist the code in a moment
[18:53:47] elaptics: SteenJobs: there's also a link to all the nice symbols you can use
[18:53:54] Anakat_: has joined #RubyOnRails
[18:54:22] lindii_: has left #RubyOnRails: ("Leaving")
[18:54:35] adavia: has joined #RubyOnRails
[18:57:28] skroon: has joined #RubyOnRails
[18:57:28] smathy: broman, Rails.logger.debug "the message"
[19:00:44] sarink: has joined #RubyOnRails
[19:01:46] SteenJobs: elaptics: still getting the 500 - https://gist.github.com/SteenJobs/e211230cd56f65ced29c
[19:02:21] centrx: has joined #RubyOnRails
[19:02:33] f3ttX]: has joined #RubyOnRails
[19:03:37] relix: has joined #RubyOnRails
[19:03:53] DoubleMalt: has joined #RubyOnRails
[19:04:27] doodlehaus: has joined #RubyOnRails
[19:05:29] elaptics: SteenJobs: what error - can you add to gist with backtrace,etc
[19:05:31] erich__: has joined #RubyOnRails
[19:05:49] SteenJobs: elaptics: yea - same error as before though, it???s from my server - 500 missing template.
[19:06:05] asahi: anyone know how I can pass a select value as the ID when a form is submitted? I'm looking for a URL that looks like action/ID
[19:06:27] mary5030_: has joined #RubyOnRails
[19:06:50] jdayvie: has joined #RubyOnRails
[19:07:01] n1lo: has joined #RubyOnRails
[19:07:06] SteenJobs: elaptics: don???t think i can get a backtrace if it???s from the server logs?
[19:07:16] emilkarl: has joined #RubyOnRails
[19:07:24] elaptics: asahi: you'd have to interfere with the form submission using javascript since what you're actually asking is that you want to change the forms action dynamically based on the form submitted data
[19:07:51] elaptics: SteenJobs: yes, your dev log should have the request and the error backtrace - gist all that
[19:08:05] kadoppe: has joined #RubyOnRails
[19:08:35] jdayvie: Hey there =) Within my project, I am looking to have the admin be able to edit a users information. I currently have it setup where an account can be deleted but cannot figure out how to edit a users' information.
[19:08:36] elaptics: asahi: personally I'd suggest a different approach
[19:09:03] giowong: has joined #RubyOnRails
[19:09:05] SteenJobs: elaptics: https://gist.github.com/SteenJobs/de8ac1e89d5b92e9d74a
[19:09:34] asahi: elaptics: I see. So I guess I can pass the ID as a key=value parameter, then handle it in the controller and then redirect to the action/ID format?
[19:09:50] elaptics: jdayvie: a users controller with an edit action that has a check to make sure the logged in user is an admin?
[19:10:06] jdayvie: There are two ways I think that can happen, neither of which I can get to work, but also not sure which is best. One is to signin as the user and view their information to edit or the other is to use a before_action and ensure that an admin is able to view.
[19:11:04] elaptics: jdayvie: how did you implement the delete then? Cos edit is basically the same thing - as logged in admin, find relevant user then display details for editing
[19:11:33] giowong: is clockwork the only available option i have if heroku scheduler doesn't suit my needs?
[19:11:51] elaptics: giowong: what are your needs?
[19:12:22] giowong: i need to run a rake task once a month at the end of each month, and send a email once a month at the beginning of the month
[19:12:29] jdayvie: elaptics: Hmm, well in that regard I simply adjusted a route (match 'users/:id' => 'admins#destroy', :via => :delete) and created the link (<%= link_to "delete", x, method: :delete, data: { confirm: "You sure?" } %>).
[19:12:36] giowong: heroku scheduler doesnt have the option to customize the time scheudle
[19:12:57] jdayvie: Problem I imagine is I need to actually view the edit information page where the delete is simply clicking the link for the action to occur.
[19:13:16] hashrocket: has joined #RubyOnRails
[19:14:26] girakrok: has joined #RubyOnRails
[19:14:33] jdayvie: Would this work then...?
[19:15:11] jdayvie: match 'users/:id' => 'admins#edit_user_info', :via => :edit and then simply link it?
[19:15:11] giowong: elaptics: any suggestions?
[19:15:19] Ergo: has joined #RubyOnRails
[19:16:01] jdayvie: Wait no...that would not work. Hmm..
[19:16:05] elaptics: giowong: aside from not using heroku :)
[19:16:40] elaptics: giowong: you could just use the simple scheduler to run daily and write your job such that it looks to see if it's the day that you're interested in and then runs the thing otherwise does nothing
[19:18:23] broman: how do i save an integer on a variable[:param] ?
[19:18:26] elaptics: jdayvie: do you have a users controller?
[19:18:38] giowong: simple scheduler are you referring to the heroku one?
[19:18:42] elaptics: giowong: yes
[19:18:53] SteenJobs: has joined #RubyOnRails
[19:19:00] broman: i want to mount a variable to pass it to a model...
[19:19:05] jenrzzz: has joined #RubyOnRails
[19:19:11] SteenJobs: elaptics: sorry, got disconnected. did you say anything while i was gone (pertaining to me)?
[19:19:14] jdayvie: elaptics: Yes, I do.
[19:19:34] adavia: did anyone tried this private pub gem?
[19:19:40] elaptics: broman: still not sure what you actually mean... you have a param passed in a request that needs to be an integer to pass to a model?
[19:19:46] jdayvie: I created one myself but then I do have Devise too.
[19:20:02] elaptics: jdayvie: !gist what you have currently
[19:20:02] helpa: jdayvie: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[19:20:21] jdayvie: You want my entire Users Controller in a gist?
[19:20:58] broman: elaptics, no.. im passing an id value to a function .. in that function i want to make a variable to pass to a model
[19:21:05] jdayvie: elaptics: https://gist.github.com/Jdayvie/d4d31c10d553f0ad935a
[19:21:22] giowong: elaptics: so run a rake task to check if its the day
[19:21:31] giowong: and if it is, call the other rake task?
[19:21:37] asahi: has left #RubyOnRails: ()
[19:21:50] giowong: thats a very clever solution
[19:21:54] elaptics: SteenJobs: nope - just try using head :ok instead of render :status => 200 on line 22 of your controller
[19:22:06] elaptics: giowong: yes
[19:22:06] jdayvie: elaptics: I know you have many people, so if too many right now, I understand =) No pressure and I appreciate it regardless =)
[19:22:35] elaptics: broman: can you gist what you have or are trying to do
[19:23:12] jdayvie: elaptics: I updated my gist because I have an admin controller and the delete is in there so in case you wanted to see that.
[19:23:47] broman: elaptics, how can i make it possible on a console? -> variable[:id] = 32
[19:24:48] erich__: has joined #RubyOnRails
[19:24:58] elaptics: jdayvie: ok, well personally I wouldn't organize like you've done but you just add edit_user and update_user actions to your admin controller that accepts the id of the user you want to edit/update in the edit action render a form to edit the user which PUTs the data to the update_user action
[19:25:19] smathy: ACTION is still waiting on a broman gist
[19:25:49] broman: smathy, i've changed my approach.. i will gist it now!
[19:26:09] smathy: I won't hold my breath.
[19:26:30] jdayvie: Elaptics: Thank you, that makes perfect sense and will work on that now. Curious, how would you have done it in short? =) I really appreciate it.
[19:26:52] startupality: has joined #RubyOnRails
[19:26:57] sonofdirt: has joined #RubyOnRails
[19:27:33] broman: smathy, elaptics, https://gist.github.com/anonymous/5e959a04a8a23749a640
[19:27:37] elaptics: jdayvie: I would have a restful users controller - maybe if it's for admins only then it would be in an admin namespace then it's just straightforward CRUD stuff
[19:28:33] jdayvie: elaptics: Okay, thank you very much =) I greatly appreciate your help.
[19:29:17] smathy: Holy hell broman, you want a new SimuladosAproveitamento for each param you're passed?
[19:29:36] Lytol: has joined #RubyOnRails
[19:29:46] bruno-: has joined #RubyOnRails
[19:30:01] Fire-Dragon-DoL: has joined #RubyOnRails
[19:30:02] smathy: broman, I'm sorry, I think I've been unfair on you because I'm assuming that the issues you're having are just because of the language barrier. I've now concluded that you just have no idea what you're doing here.
[19:30:11] broman: for each param inside aproveitamentos_produto
[19:30:24] adavia: any idea what this error means /home/adavia/.rvm/gems/ruby-2.2.1/gems/private_pub-1.0.3/lib/private_pub.rb:21:in `load_config': uninitialized constant YAML (NameError)
[19:30:33] smathy: broman, that's not what `params.each` does.
[19:30:36] Scripore: has joined #RubyOnRails
[19:31:05] smathy: broman, learn more ruby here: https://www.ruby-lang.org/en/documentation/ and then learn more rails here: http://guides.rubyonrails.org/ and do a tutorial book like Agile Web Development with Rails.
[19:31:11] broman: smathy, maybe i am not expressing myself very well
[19:31:18] broman: smathy, follow me please
[19:31:23] broman: i have an event form
[19:31:23] elaptics: adavia: it means that ruby can't find the YAML class
[19:31:33] broman: inside that event i can assign to it various aproveitamentos
[19:31:33] benlieb: how can I get rspec to fail when an error occurs in a method it calls? Right now it only fails when an expectation fails specifically
[19:31:49] broman: i'm already saving the event.. that aproveitamentos thing is new
[19:31:58] adavia: elaptics: should it be a problem with my ruby version
[19:31:59] smathy: broman, you're also not following simple requests, I spelled out what I needed from you in a gist - showing everything from the request itself through the controller to your service object. You said you understood, and yet here we are again with you giving a gist of a tiny part of your code.
[19:32:03] broman: i need to save lots os aproveitamentos for each event
[19:32:25] elaptics: benlieb: fail how?
[19:32:28] smathy: broman, AND the code you're showing is iterating over params creating a SimuladosAproveitamento for every param in the hash.
[19:32:30] broman: smathy, everything else is ok!!! try to understand that
[19:32:35] broman: that's the only NEW part
[19:32:46] broman: smathy, that's exactly what i want!
[19:32:59] broman: now i am having problems to link that do the event id
[19:33:04] broman: just that!
[19:33:07] leofrozenyogurt: has joined #RubyOnRails
[19:33:15] benlieb: elaptics: For example if all I have in a test is get :create, and the create method has raise ???error???, the test doesn???t fail
[19:33:24] broman: i need to loop because it can be various aproveitamentos
[19:33:29] broman: 10 aproveitamentos for each event
[19:33:34] broman: so i need to save it 10 times!
[19:33:35] benlieb: I will of course make assertions as well, but this behavior seems strange
[19:33:40] broman: 10 rows on the table
[19:33:43] manfrin: has joined #RubyOnRails
[19:33:47] benlieb: I???m pretty sure minitest would fail
[19:33:50] smathy: broman, you're iterating over params! This is your params right? http://pastie.org/10304671
[19:34:17] broman: "aproveitamentos_produto"=>{"aproveitamento_id"=>["1"]} .. yes!
[19:34:20] elaptics: benlieb: you're trying to make rspec bomb out?
[19:34:22] broman: in that case i only have on
[19:34:27] broman: but it could be 1000
[19:34:57] elaptics: benlieb: raising an error could be perfectly valid so rspec's not going to fail on that unless you've set up expectations that it is or isn't going to do it
[19:35:05] smathy: broman, no, you're iterating over params.
[19:35:10] elaptics: benlieb: pretty sure minitest would be similar
[19:35:10] smathy: broman, look what that means: https://gist.github.com/smathy/50b303bf72ba910ff584
[19:35:17] broman: i am iterating over the :aproveitamentos_produto param
[19:35:18] leofrozenyogurt: I am having a weird issue with a where query that is then ordered. So i pass an array to where(id: array_of_ids) and then i want to order it by a has_many count , now the issue is that it works on other queries where lets say i say Product.where(category: 1) but if i do Product.where(id: array_of_ids) i cant order them
[19:35:25] broman: not all params
[19:35:54] broman: smathy, i am iterating because it could be 1000 aproveitamentos and i need to save 1000 on the table in this case...
[19:35:59] smathy: broman, what do you think `params.each` does?
[19:35:59] broman: my problem now is being saving the evento id
[19:36:00] kies^: has joined #RubyOnRails
[19:36:12] broman: smathy, i know that it iterates over params
[19:36:14] smathy: broman, "not all params" vs `params.each`
[19:36:20] smathy: broman, right, all params.
[19:36:30] broman: params in that case is the name of the variable
[19:36:39] broman: i could have called it aproveitamento_params
[19:36:49] smathy: broman, EXACTLY!!!!
[19:36:49] jhack32: has joined #RubyOnRails
[19:36:58] broman: if you look on the function that calls this one it's passing only the params[:aproveitamento_params]
[19:37:00] smathy: broman, SEEE, I **DO** NEED TO SEE THE OTHER CODE I ASKED FOR!!
[19:37:01] broman: how hard can it be?
[19:37:14] broman: smathy, this is on the code i gave you mate!
[19:37:29] broman: vinculaPerfisAoSimulado(simulado, params[:aproveitamentos_produto])
[19:37:36] smathy: broman, good luck.
[19:37:49] broman: smathy, ok. thank you for your time
[19:38:39] elaptics: leofrozenyogurt: !code
[19:38:39] helpa: leofrozenyogurt: We cannot help you with your problem if you don't show us your code. Please put it on http://gist.github.com and give us the URL so we can see it.
[19:39:10] DarkBushido: has joined #RubyOnRails
[19:39:48] Surt_Q: has joined #RubyOnRails
[19:40:28] benlieb: elaptics: it should be an uncaught error
[19:40:40] elaptics: benlieb: why?
[19:40:54] elaptics: benlieb: what are you testing exactly?
[19:43:00] benlieb: i figured it out, it???s because we???re doing rescue_from StandardError, with: :render_standard_error
[19:43:52] rakm: has joined #RubyOnRails
[19:43:53] harisamin: has joined #RubyOnRails
[19:44:00] elaptics: benlieb: ah, that would explain it then
[19:44:07] meoblast001: has joined #RubyOnRails
[19:45:01] A-ron: has joined #RubyOnRails
[19:46:50] ruurd: has joined #RubyOnRails
[19:47:40] tercenya: has joined #RubyOnRails
[19:47:44] Rubie: has joined #RubyOnRails
[19:50:14] n008f4g_: has joined #RubyOnRails
[19:51:12] bin_005: has joined #RubyOnRails
[19:51:32] chipotle: has joined #RubyOnRails
[19:52:53] baweaver: has joined #RubyOnRails
[19:53:29] arBmind: has joined #RubyOnRails
[19:54:27] cnk: has joined #RubyOnRails
[19:56:09] lala: has joined #RubyOnRails
[19:56:12] ruurd: has joined #RubyOnRails
[19:56:41] jhack32: has joined #RubyOnRails
[19:57:06] ruurd: has joined #RubyOnRails
[19:58:47] benlieb: has joined #RubyOnRails
[19:59:17] user1138: has joined #RubyOnRails
[19:59:19] manfrin: I just love being one of the first people to use a partner's APIs
[19:59:37] manfrin: at my old company, we had an email provider push us hard to move new calls over to their v2
[19:59:45] manfrin: so after like 6 months of wrangling with it
[19:59:54] manfrin: we discovered this enormous bug that prevented like 100k emails from going out
[19:59:55] manfrin: on their end
[19:59:58] manfrin: their response
[20:00:09] manfrin: 'well, its a beta project, you shouldnt have used it if you didnt want to help test'
[20:00:12] manfrin: YOU PUSHED US
[20:00:21] manfrin: they lost our contract after that, lol
[20:02:40] hd1: https://gist.github.com/hdiwan/1537ced822f64440f16d what stupidity lurks here, anyone have any idea?
[20:04:22] cnk: other than the fact the desc is misleading.... it only tests the second half
[20:04:31] manfrin: puts @notes.inspect at the end to see what you're getting
[20:04:42] nya: has joined #RubyOnRails
[20:04:43] manfrin: also you should set up your data in lets(:dfhjs)s
[20:04:45] cnk: and I don't see 5 notes
[20:05:11] qejk: has joined #RubyOnRails
[20:05:14] manfrin: also where is 5 coming from
[20:05:24] manfrin: also hashrockets
[20:05:34] imkj: has joined #RubyOnRails
[20:05:35] manfrin: also brackets for a multiline block
[20:06:15] manfrin: also 'describe' is typically used to reference the method being tested, context for the setup of the situation, and it "<description of hte test> do
[20:06:19] fgo_: has joined #RubyOnRails
[20:06:30] cnk: hd1: so now that you know the chanel is active, what is your actual question?
[20:06:43] hd1: manfrin: 5 is the number of instances an admin should see
[20:06:51] manfrin: why is it 5
[20:07:11] hd1: manfrin: the factory creates 5 valid instances
[20:07:15] hd1: 3 invalid ones
[20:07:23] cnk: and how do we know 'user' is an admin
[20:07:31] cnk: I took that to be a normal user
[20:07:43] manfrin: if someone changes your factory, your test will break
[20:07:52] manfrin: why not Notes.valid.length for your expectation number?
[20:08:00] manfrin: (assuming you have a :valid scope)
[20:08:09] hd1: manfrin: i don't have a valid scope
[20:08:17] manfrin: also why are you loading the json response in to notes
[20:08:37] imkj: has left #RubyOnRails: ()
[20:08:54] hd1: manfrin: that's how i'm getting it into an array to test
[20:09:03] hd1: and that is what's not working, manfrin
[20:09:50] ruurd: has joined #RubyOnRails
[20:10:03] cnk: so what is line 7 printing out?
[20:10:17] nfk: has joined #RubyOnRails
[20:10:47] cnk: are you having trouble with your authentication mocking or ??
[20:10:56] dman777_alter: has joined #RubyOnRails
[20:11:05] hd1: nothing
[20:11:13] Lytol: has joined #RubyOnRails
[20:11:16] hd1: cnk: not sure where i'm having trouble
[20:11:24] alphaatom: has joined #RubyOnRails
[20:11:39] dman777_alter: resources :datacenters ....since there is no name space how can I add :defaults => {:format => :json} to it?
[20:12:32] hd1: dman777_alter: do so in your actions?
[20:12:48] robbyoconnor: has joined #RubyOnRails
[20:13:03] tubbo: dman777_alter: did you try adding defaults: { format: :json }
[20:13:32] cnk: hd1: Then simplify. Comment out the warden stuff and comment out the authentication check in the index controller and see if you can get the json you expect.
[20:13:41] cnk: Then add back the authentication
[20:14:31] hd1: too few arguments
[20:16:06] bricker: has joined #RubyOnRails
[20:16:16] DoctorMonocular: has joined #RubyOnRails
[20:16:37] dangerousdave: has joined #RubyOnRails
[20:16:45] cnk: so it isn't inferring the controller?
[20:17:29] cnk: and should that be format or :format?
[20:17:39] hd1: cnk: I don't know
[20:19:11] bruno-: has joined #RubyOnRails
[20:19:43] giowong_: has joined #RubyOnRails
[20:20:11] cnk: does the start of the file that exerpt is from look like: RSpec.describe WidgetsController, :type => :controller do
[20:20:47] cnk: if so, then it probably knows the controller - though you can watch your test logs to see if you are getting a request for the notes index action
[20:21:01] Rubie: has joined #RubyOnRails
[20:22:00] cnk: and yes, I think you want :format => :json
[20:22:14] cnk: or format: :json in the newer hash notation
[20:22:39] cnk: has left #RubyOnRails: ()
[20:22:46] ruurd: has joined #RubyOnRails
[20:22:59] baweaver: has joined #RubyOnRails
[20:23:15] hd1: ok... progress
[20:25:05] Eminence_: has joined #RubyOnRails
[20:27:07] sypheren: has joined #RubyOnRails
[20:27:22] sonofdirt: has joined #RubyOnRails
[20:28:50] MarkTR: has joined #RubyOnRails
[20:29:32] Scripore: has joined #RubyOnRails
[20:30:12] baweaver: has joined #RubyOnRails
[20:32:05] jenrzzz: has joined #RubyOnRails
[20:32:12] baweaver_: has joined #RubyOnRails
[20:32:21] hd1: grumble, fixing this has taken longer than it took the original guy to write the code that did the functionality in the first place *sigh*
[20:35:39] werelivinginthef: has joined #RubyOnRails
[20:35:53] workmad3: has joined #RubyOnRails
[20:35:59] nettoweb: has joined #RubyOnRails
[20:38:25] dman777_alter: is jbuilder meant to be used in a controller?
[20:39:33] yfeldblum: has joined #RubyOnRails
[20:40:04] codepete: has joined #RubyOnRails
[20:41:19] meoblast001: has joined #RubyOnRails
[20:41:20] roolo: has joined #RubyOnRails
[20:43:27] AlvaroFernandoMS: has left #RubyOnRails: ()
[20:46:43] disgrntld: has joined #RubyOnRails
[20:46:44] bricker: dman777_alter: It can be but its intended use is as a jbuilder template
[20:47:07] CheckYourSix: has joined #RubyOnRails
[20:47:40] broman: http://pastie.org/10304881 ----> when the array.length > 1 it works.. why doesn't it with only one object in array???
[20:48:23] hololeap: has joined #RubyOnRails
[20:49:39] Rubie: has joined #RubyOnRails
[20:49:42] erich__: has joined #RubyOnRails
[20:50:08] FernandoBasso: has joined #RubyOnRails
[20:52:15] dman777_alter: bricker: does the controller pass the json to the index.json.jbuilder for jbuilder to mutate and output?
[20:52:28] sonofdirt: has joined #RubyOnRails
[20:52:36] bricker: dman777_alter: no, the jbuilder template builds the json
[20:52:49] bricker: dman777_alter: just like an ERB or HAML template build the HTML
[20:53:27] CheckYourSix: has joined #RubyOnRails
[20:53:36] dman777_alter: bricker: oh...ok. So, for a api only route the controller doesn't need to have any logic in it?
[20:54:36] bricker: dman777_alter: the controller will need to fetch the data from the database, validate parameters, authorize, etc.
[20:55:53] ur5us: has joined #RubyOnRails
[20:56:30] cac_: has joined #RubyOnRails
[20:57:40] bix: has joined #RubyOnRails
[20:59:28] manfrin: has joined #RubyOnRails
[20:59:54] charliesome: has joined #RubyOnRails
[21:00:03] dman777_alter: bricker: thanks!
[21:00:03] justthisguy: has joined #RubyOnRails
[21:04:40] netzfisch: has joined #RubyOnRails
[21:06:41] fighella: has joined #RubyOnRails
[21:07:12] Gnut: has joined #RubyOnRails
[21:07:37] zautke: has joined #RubyOnRails
[21:08:00] Jarboe: has joined #RubyOnRails
[21:08:32] skroon: has joined #RubyOnRails
[21:10:04] broman: has joined #RubyOnRails
[21:11:46] rubyonrailsMLB: has joined #RubyOnRails
[21:12:55] ascarter: has joined #RubyOnRails
[21:13:15] LoBoGoL: has joined #RubyOnRails
[21:15:34] solars: has joined #RubyOnRails
[21:16:01] imkj: has joined #RubyOnRails
[21:16:23] dman777_alter: hmm....how could I use jbuilder to remove the duplicates in a json array? [["1A","1A"],["1B","1B"],["ATL1","ATL1"].... I have json.array! @datacenter
[21:17:22] bricker: dman777_alter: that's not jbuilder's job, you should do that before it's passed to the template
[21:18:30] dman777_alter: bricker: cool, thanks!
[21:18:35] mfp: has joined #RubyOnRails
[21:21:20] Lightsword: has joined #RubyOnRails
[21:21:31] madebymarkca: has joined #RubyOnRails
[21:23:06] shmilan: has joined #RubyOnRails
[21:24:16] VeryBewitching: has joined #RubyOnRails
[21:24:30] workmad3: has joined #RubyOnRails
[21:24:56] dangerousdave: has joined #RubyOnRails
[21:28:24] neanderslob: has joined #RubyOnRails
[21:28:40] Palsson: has joined #RubyOnRails
[21:31:14] alphaatom: has joined #RubyOnRails
[21:31:17] mfp: has joined #RubyOnRails
[21:31:17] guest343: has joined #RubyOnRails
[21:31:38] guest343: has left #RubyOnRails: ()
[21:31:53] ellisTAA: has joined #RubyOnRails
[21:32:10] shinnya: has joined #RubyOnRails
[21:32:24] ellisTAA: i can???t find out how to grab the first 5 matches in my activrecord query, does anyone know how to do this?
[21:32:27] Radar: GOOD MORNING
[21:32:29] ellisTAA: google didn???t turn up anything that worked
[21:32:31] Radar: elaptics: what have you tried?
[21:32:36] Radar: EllisTAA: ^
[21:33:04] Papierkorb: Radar: OHAYOOO
[21:33:22] ellisTAA: Photo.where(completed: false, :limit => 5) doesn???t work
[21:33:32] mhf: has joined #RubyOnRails
[21:33:38] neanderslob: hi there, is there a simple way to add a class to one of the div wrappers of a simple_form input? I've seen a few solutions on stack overflow that involve editing a config file but it appears that would change all wrappers in the form
[21:33:48] Papierkorb: EllisTAA: try putting the limit to another position in the line where it'd make sense
[21:34:07] bricker: EllisTAA: come on
[21:34:09] bricker: EllisTAA: http://guides.rubyonrails.org/active_record_querying.html
[21:34:12] bricker: Cmd+F "limit"
[21:35:06] bricker: critical thinking
[21:35:49] bricker: neanderslob: use the wrapper_html option on the input
[21:36:36] doodlehaus: has joined #RubyOnRails
[21:37:16] sloggerkhan: has joined #RubyOnRails
[21:37:58] neanderslob: bricker: awesome, thanks
[21:38:12] cac_: has joined #RubyOnRails
[21:40:14] Lightsword: has joined #RubyOnRails
[21:40:42] zorak8: has joined #RubyOnRails
[21:42:53] broman: has joined #RubyOnRails
[21:45:01] htmldrum: has joined #RubyOnRails
[21:47:34] michael_mbp: has joined #RubyOnRails
[21:53:11] LoBoGoL: has joined #RubyOnRails
[21:55:15] baweaver: has joined #RubyOnRails
[21:56:23] workmad3: has joined #RubyOnRails
[21:58:40] Eminence_: has joined #RubyOnRails
[21:58:49] user1138: has joined #RubyOnRails
[21:59:13] Lightsword: has joined #RubyOnRails
[21:59:17] Palsson: has joined #RubyOnRails
[21:59:24] wethu: has joined #RubyOnRails
[22:00:08] ellisTAA: has joined #RubyOnRails
[22:00:38] justthisguy: has joined #RubyOnRails
[22:05:25] bruno-: has joined #RubyOnRails
[22:06:29] crankharder: has joined #RubyOnRails
[22:06:34] eggoez: has joined #RubyOnRails
[22:06:41] ellisTAA: has joined #RubyOnRails
[22:06:51] dangerousdave: has joined #RubyOnRails
[22:06:58] Nuck: has joined #RubyOnRails
[22:07:55] sash_: has joined #RubyOnRails
[22:08:01] bungoman: has joined #RubyOnRails
[22:08:33] bronson: has joined #RubyOnRails
[22:08:43] fighella: has joined #RubyOnRails
[22:10:50] jenrzzz: has joined #RubyOnRails
[22:11:22] crankharder: has joined #RubyOnRails
[22:11:57] Marquel: has joined #RubyOnRails
[22:13:15] dman777_alter: DeviceListsController has datacenters = Datacenter.options_for_select. Should class DatacentersController < DeviceListsController have accesss to @datacenters?
[22:13:18] marr: has joined #RubyOnRails
[22:14:45] shinnya: has joined #RubyOnRails
[22:14:55] fighella: has joined #RubyOnRails
[22:15:14] johntrails: has joined #RubyOnRails
[22:17:50] bruno-: has joined #RubyOnRails
[22:18:38] centrx: datacenters != @datacenters
[22:18:43] centrx: Controller "has"?
[22:18:45] johntrails: has joined #RubyOnRails
[22:20:04] cnk: has joined #RubyOnRails
[22:20:23] centrx: has joined #RubyOnRails
[22:20:46] Palsson: has joined #RubyOnRails
[22:22:20] manfrin: has joined #RubyOnRails
[22:23:20] [H]unt3r: has joined #RubyOnRails
[22:23:49] blindMoe|2: has left #RubyOnRails: ()
[22:24:00] blindMoe: has joined #RubyOnRails
[22:25:10] x-light: has joined #RubyOnRails
[22:25:44] xhoy: has joined #RubyOnRails
[22:25:58] robbyoconnor: has joined #RubyOnRails
[22:26:16] givanse: has joined #RubyOnRails
[22:29:01] johntrails: has joined #RubyOnRails
[22:29:07] hd1: ACTION is raging against rspec
[22:29:42] rakm: has joined #RubyOnRails
[22:30:07] bricker: dman777_alter: that's too vague, show your code and what you're trying to do
[22:30:31] noodman: has joined #RubyOnRails
[22:30:43] hd1: https://gist.github.com/hdiwan/1537ced822f64440f16d ggrrrrr
[22:31:24] manfrin: if your block is more than 1 line, do not use braces
[22:31:28] manfrin: do and end are your friend
[22:31:50] manfrin: also jeebus that before block
[22:31:57] contradictioned: has joined #RubyOnRails
[22:32:16] hd1: manfrin: that's not the problem
[22:32:21] manfrin: it is to me
[22:33:00] manfrin: also, when you assign variables for a test, use them in let blocks
[22:33:14] manfrin: you're setting user = double("user") twice
[22:33:19] bricker: hd1: well.... what's the problem?
[22:33:22] hd1: https://gist.github.com/hdiwan/1537ced822f64440f16d better now
[22:33:32] zeknox: how does one typically handle authentication and authorization when exposing an API?
[22:33:39] arBmind1: has joined #RubyOnRails
[22:33:42] bricker: you showed us a test with no failures or error
[22:33:44] tdy: has joined #RubyOnRails
[22:33:47] hd1: the problem is that @notes isn't being saved to the database
[22:34:01] bungoman_: has joined #RubyOnRails
[22:34:17] bricker: hd1: which @notes
[22:34:28] bricker: hd1: there is an array @notes and a Note @notes
[22:34:51] hd1: https://gist.github.com/hdiwan/1537ced822f64440f16d
[22:35:07] DEac-: has joined #RubyOnRails
[22:35:28] hd1: bricker: the one that's restored from the database
[22:35:41] bricker: so your response body from the controller is empty, find out why
[22:36:03] ellisTAA: has joined #RubyOnRails
[22:36:20] hd1: not sure where to start on that
[22:36:58] Rubie: has joined #RubyOnRails
[22:37:15] bricker: hd1: start with a debugger (I like Pry) placed right after the `get` call, then start poking around. First thing to check is response.status
[22:37:39] bricker: then when you have a better idea or what you're looking for, place debuggers in your controller
[22:37:51] bricker: also tail log/test.log to see if there are any errors being thrown
[22:38:24] bricker: My guess is it's authentication, it usually is
[22:38:29] hd1: ok, it's not saving
[22:38:36] workmad3: has joined #RubyOnRails
[22:38:56] manfrin: https://gist.github.com/manfrin/26468a714c55d69e03f5
[22:39:00] manfrin: this is better laid out
[22:39:04] manfrin: and more conventional
[22:39:11] manfrin: it's not great, but I didnt want to spend too much time on it
[22:39:16] bricker: hd1: do the stuff I suggested, I can't debug for you
[22:40:07] manfrin: couple things to point out: if you ever have an instance variable in your tests, you are doing something wrong (use lets)
[22:40:24] manfrin: use contexts to separate what sorts of things your testing, and to give you more specialized before blocks
[22:40:29] manfrin: do/end over {} if multilined
[22:40:36] Regulati_: has joined #RubyOnRails
[22:40:54] manfrin: never, ever assign something like @notes.user_id = 2, when 2 comes from nowhere (use user.id or whatever if you have to)
[22:41:10] manfrin: if you are calling save in your test, and you are not specifically testing something that happens on save, you're doing something wrong
[22:41:37] hd1: I'm verifying the data is saved correctly
[22:41:53] manfrin: that's not what your tests look like
[22:42:49] Ropeney: has joined #RubyOnRails
[22:43:08] hd1: manfrin: you have been whinging about the beauty of my code the last 30-40 minutes, maybe you should take a look at what it means and read what i'm saying instead of putting your own idea of "beauty" on it
[22:43:21] jhack32: has joined #RubyOnRails
[22:43:39] manfrin: I'm trying to help, it's not about making the code look nice, it's about knowing what you are trying to do
[22:43:41] manfrin: your code is a mess
[22:43:58] manfrin: the fact that I misread what you are trying to do is a sign of that
[22:44:10] hd1: no, you CHOSE not to read what I'm trying to do
[22:44:25] manfrin: good luck debugging
[22:44:27] hd1: you're bloviating about how your style is better than mine
[22:44:28] bricker: hd1: manfrin's example is the correct way to write tests
[22:44:43] hd1: ok, you won, happy?
[22:44:43] bricker: hd1: it's not about style, it's about using the tool correctly
[22:44:47] doodlehaus: has joined #RubyOnRails
[22:45:02] manfrin: I'm not trying to win, man, I was trying to help
[22:45:06] hd1: bricker: if the code worked, as written, style wouldn
[22:45:09] hd1: 't be an issue
[22:45:13] acti0nman: has joined #RubyOnRails
[22:45:19] hd1: manfrin: then focus on functionality, not style
[22:45:25] manfrin: rails is a language/framework of convention; there are established ways of writing code
[22:45:32] hd1: scoring style points is cheap
[22:45:32] manfrin: 'if it works it works' is not an idiom of the language
[22:45:40] manfrin: this is my dayjob
[22:45:41] bricker: hd1: for example, manfrin's usage of response[:notes] instead of your myster @notes.from_json() method that we have no idea what it does
[22:45:50] bricker: is conventional will probably work
[22:46:54] hd1: as we say in my world, one gets paid for working code, not beautiful code
[22:47:02] manfrin: is your code working?
[22:47:06] bricker: hd1: yep, and you have neither, don't you? :)
[22:47:21] hd1: bricker: if I eliminate the tests, it is working
[22:47:31] ElSif: you really shouldn't think that way
[22:47:43] ElSif: its a recipe for having code that you have no idea how it works
[22:48:01] bricker: right, so your tests are broken and manfrin is suggesting a better way to write them.
[22:48:26] manfrin: and that way of writing them also lets you debug a bit easier -- when you break things up like that, you can isolate whatever issue you have
[22:48:38] hd1: but we plan on spinning out the project, and the guys picking it up will not be the original authors -- neither am I, btw -- so, it's for the guys who pick it up afterwards
[22:48:46] manfrin: that's the point of unit tests: you break things down to their smallest constiutent parts so that you know exactly where something is going wrong
[22:48:55] ElSif: then you should care even more, or they will hate you :)
[22:48:56] bricker: hd1: even more reason to write the code conventionally
[22:49:03] manfrin: the guys who pick if up after you will hate you so much if you give this to them
[22:49:20] manfrin: from professional experience, when I have encountered code like yours, I usually end up rewriting it
[22:49:24] manfrin: you are creating more work
[22:49:27] manfrin: for everyone
[22:49:47] hd1: manfrin: buddy, I have more professional experience in my left foot than you
[22:49:53] hd1: so don't bloviate
[22:50:06] manfrin: so debug it yourself mister professional
[22:50:29] hd1: manfrin: that's what I'm trying to do
[22:50:37] hd1: and you're criticising style
[22:50:53] hd1: it's not like you're in charge of this code, mr professional
[22:51:06] manfrin: ??\_(???)_/??
[22:51:27] hd1: keyboard jockey
[22:51:33] bricker: careful there buddy
[22:51:47] ElSif: someone seperate these two :P
[22:52:01] manfrin: no need, I'm done trying to help someone who clearly knows so much more than us
[22:52:48] hd1: bricker: of what? of silly manfrin thinking he knows more than 15 years of experience in some of the biggest financial outfits on Earth?
[22:52:55] hd1: sorry, I'm not scared of that
[22:53:03] hd1: he can think what he wants
[22:53:19] bricker: hd1: k, no name-calling
[22:53:47] hd1: manfrin: laugh it up, electron ball
[22:54:17] bricker: bricker kicked hd1:
[22:54:24] hd1: has joined #RubyOnRails
[22:54:38] ElSif: hd1: i am not trying to just shit on you here, but using instance vars in spec tests is not a good sign
[22:54:48] bricker: good luck at your big financial outfit
[22:55:00] hd1: I've done fine at my financial outfits
[22:55:04] manfrin: ElSif he's got 15 years experience, who are you to tell him his code is wrong?!
[22:55:11] hd1: I earned an O-1 at one of them
[22:55:55] hd1: you probably don't know what that is, let alone earned one, manfrin
[22:56:08] manfrin: you are correct, I have no idea what that is
[22:56:12] manfrin: I'm a rails developer
[22:56:25] hd1: manfrin: and that's precisely why you won't get one
[22:56:42] hd1: and I'm an angel investor
[22:56:58] hd1: which is why I eat and spit out people like you 10 times before breakfast
[22:57:07] manfrin: lol an O-1 is a visa
[22:57:08] bricker: +q hd1!*@*
[22:57:13] manfrin: you're right, I'll never earn one
[22:57:19] manfrin: because I'm a natural born citizen
[22:58:15] Cache_Money: has joined #RubyOnRails
[22:58:16] ElSif: hd1 you really should listen, manfrin's code is a large improvement over yours, thats not just hate, any ruby dev would say the same i guarantee you
[22:58:45] bricker: conversation is over, everybody's a winner.
[22:59:20] manfrin: back to my puny non-O-1 life of being eaten by a venture capitalist 10 times a day D:
[22:59:37] ElSif: thats some kind of ego that guy has :P
[22:59:56] manfrin: the convo went from 0 to 100 real fast, lol
[23:00:09] ElSif: faster than the new Tesla Model S!
[23:00:11] manfrin: back to banging my head around with imagemagick
[23:00:19] ElSif: oh god D:
[23:00:42] manfrin: imagemagicks, the dark arts of the underworld
[23:01:12] hd1: has left #RubyOnRails: ()
[23:01:35] christiandsg: has joined #RubyOnRails
[23:01:39] Papierkorb: In a RSpec test, why do people choose to use a block over and_return() in a line like this: expect(something).to receive(:stuff).and_return(123)
[23:02:08] arBmind: has joined #RubyOnRails
[23:02:12] bricker: Papierkorb: it's the "legacy" style
[23:02:22] Papierkorb: bricker: the block style? or the and_return?
[23:02:30] ElSif: and return
[23:02:33] bricker: -o bricker
[23:02:46] Papierkorb: Ok. brb fixing that.
[23:02:47] bricker: Papierkorb: no I think the block style is legacy mode
[23:03:06] Papierkorb: Their own docs use both
[23:03:13] bricker: eg Thing.stub(:method) { "canned response" }
[23:03:23] ElSif: i though this was something else
[23:03:34] ElSif: listen to bricker, im gonna get coffee
[23:04:24] ElSif: >.> i think hd1 has a friend in here
[23:04:47] pwnd_nfsw|2: has joined #RubyOnRails
[23:05:00] Papierkorb: bricker: What's the difference between expect(some_double).to receive(...) and Something.stub(...) ?
[23:05:21] ElSif: one has an expectation
[23:05:29] ElSif: i know you didnt ask me :)
[23:05:38] Papierkorb: ElSif: ... I could've seen that too..
[23:05:45] Papierkorb: Well, replace expect with allow
[23:05:59] ElSif: then i dont think there is any practical difference? though again, need coffee
[23:06:36] theBestNunu: has joined #RubyOnRails
[23:08:12] bronson: has joined #RubyOnRails
[23:08:20] ascarter: has joined #RubyOnRails
[23:08:35] theBestNunu: hello. can some1 pls help me? im new to bootstrap and im trying to make these buttons align horizontally: http://awesomescreenshot.com/0ae5339ga9 can some1 pls tell me how to do that?
[23:08:36] bricker: Papierkorb: Well, two things: first of all, Something.stub() is deprecated and Something.should_...()
[23:09:04] theBestNunu: i mean align them together vertically ;)
[23:09:13] bricker: Papierkorb: second of all, and more importantly, expect() will raise an error (eg fail the test) if the condition isn't met
[23:09:38] bricker: Papierkorb: stub()'s equivalent in the new rspec syntax is allow()
[23:09:39] x-light: has joined #RubyOnRails
[23:09:45] bricker: which makes it much more clear imo
[23:09:53] ElSif: i agree :D
[23:09:58] bricker: expect(some_double).to receive vs allow(some_double).to receive
[23:10:12] mcr-credil: has joined #RubyOnRails
[23:10:17] Papierkorb: bricker: Ah. thanks. I think so too, but it's sometimes hard to see what's legacy and what's not, as still a lot legacy code snippets are around ..
[23:10:34] bricker: Papierkorb: yes, rspec changes its API every 6 months so it can be hard to keep up
[23:10:49] ElSif: usually it gets better at least :)
[23:11:47] bricker: I'm glad they got rid of the "monkey patch hack"
[23:12:07] bricker: stub() describe() etc.
[23:14:01] ElSif: theBestNunu: you may want to ask in ##bootstrap
[23:15:42] mary5030: has joined #RubyOnRails
[23:17:28] Papierkorb: Does anyone know if spam bots which try to register accounts on websites evaluate JS?
[23:17:30] chrishough: has joined #RubyOnRails
[23:17:47] Papierkorb: Wondering if I can get rid of ReCAPTCHA there.
[23:17:49] ElSif: some dont
[23:17:56] Radar: Papierkorb: What if I told you not everything which spams websites is automated?
[23:18:06] Cache_Money: I've been asked to migrate an existing Rails app running on a server we rent (CentOS 5.9) to a server we own (AWS EC2 instance). It looks like it's running Ruby 1.9.2 and Rails 3.2.15 with a `mysql2` gem. And it appears it's an Apache web server. As this is my first time doing something like this, do you have any advice on things I need to consider?
[23:18:10] Papierkorb: Radar: that's what I fear too
[23:18:22] ElSif: probably not, unless the website's recaptcha is poorly implemented
[23:18:24] mike___1234: has joined #RubyOnRails
[23:18:44] ElSif: oh u want to get rid of it on your site?
[23:18:47] ciree: they definitely do evaluate js
[23:18:59] ciree: i mean there are different kinds of spam runners, but they can js
[23:19:20] Papierkorb: ElSif: If it dminishes the possibility of me getting completely hammered by something like that, yes, no reason for it to look ugly there
[23:21:21] ElSif: well, people like breaking through captchas anyway, and it is pretty reliable (in the probablistic, retry several captchas, case). so meh, i don't think they are much protection against a concerted spammer
[23:21:35] jesterfraud: has joined #RubyOnRails
[23:23:20] Papierkorb: I think I'll leave it out for now then. Then I also don't have to do weird hacks in the feature test to get around the captcha
[23:23:45] ElSif: yea, i would say thats not a bad call, if you see a spam problem you can always add one to try and mitigate
[23:24:17] Lightsword: has joined #RubyOnRails
[23:25:35] Papierkorb: I must say that while Opal is quite rough around the edges, it's pretty great to work with now
[23:25:50] Radar: Have you heard of our lord + saviour, Elixir?
[23:27:40] Papierkorb: %Wow dat {:syntax}
[23:27:51] Papierkorb: %Wow -> dat {:syntax}
[23:28:20] adavia: anyone evey tried this private pub gem
[23:28:25] Radar: We would've also accepted "Wow |> dat |> syntax"
[23:28:35] Radar: http://exercism.io/submissions/c250479fb2d34812bc3f9c26c86bee5e
[23:29:03] hd1: has joined #RubyOnRails
[23:29:31] Papierkorb: Is a "foo bar".split(/ .\[\]\(\)\?!/).reject(&:empty?).count really that hard?
[23:30:28] shmilan: has joined #RubyOnRails
[23:31:02] Denarii: has joined #RubyOnRails
[23:31:34] mcr-credil: has joined #RubyOnRails
[23:31:41] Radar: Well that gives an entirely different result, so yeah obviously :D
[23:33:04] idd2d: has joined #RubyOnRails
[23:33:16] tfitts: has joined #RubyOnRails
[23:34:24] Caldmann: has joined #RubyOnRails
[23:34:55] tfitts: I have a new app that I've been working on in development mode and I'm trying to put it in production and I get uninitialized constant RailsSettings (NameError) which I'm guessing is from the 'rails-settings-cached' gem but I don't know why it's not working in a production environment. The migrations have been run and the settings table exists in the production db
[23:35:21] Radar: tfitts: Did you require 'rails_settings' anywhere?
[23:35:38] Caldmann: has left #RubyOnRails: ()
[23:36:45] [H]unt3r: has joined #RubyOnRails
[23:36:56] Olipro: has joined #RubyOnRails
[23:37:11] cogsbox_: has joined #RubyOnRails
[23:37:12] ellisTAA: has joined #RubyOnRails
[23:37:15] wcalderipe: has joined #RubyOnRails
[23:37:18] tfitts: I don't think I did that in development either. I'll take a look.
[23:37:24] wcalderipe: hi, i'm new on rails and i have a doubt in how to standardize my api responses keeping DRY.. something like https://github.com/WhiteHouse/api-standards
[23:40:25] allcentury: has joined #RubyOnRails
[23:41:51] tfitts: radar: I don't have that anywhere in my app, or in a different app running in production with the same gem. Where should I put it?
[23:42:25] Radar: tfitts: config/application.rb
[23:42:29] Radar: Seems weird that it's not being required in your ap
[23:42:32] Radar: steps to reproduce
[23:42:43] cogsbox_: Sorry, I had to step away from the computer earlier. I have my code on gist. The error I am getting is at the bottom of the gist. https://gist.github.com/anonymous/4aac7d231eb8723bfc1a
[23:42:46] Radar: wcalderipe: Explain in more details please.
[23:43:08] christiandsg: has joined #RubyOnRails
[23:43:10] Radar: cogsbox_: You have not ran the migration to add the premium field to the users table.
[23:43:27] wcalderipe: Radar: I would like to keep a standard of responses like you can see here: https://github.com/WhiteHouse/api-standards#record-limits
[23:44:07] cogsbox_: That is what I thought. but I ran 'bundle exec rake db:migrate'
[23:44:08] wcalderipe: Radar: Always respond with a JSON object which will contain a key called metadata and another one called data
[23:44:38] xkickflip: has joined #RubyOnRails
[23:44:46] Radar: wcalderipe: And what have you tried so far?
[23:44:59] Radar: cogsbox_: !rule12
[23:44:59] helpa: cogsbox_: Do not PM members of the channel without first asking if that is OK.
[23:45:01] ElSif: cogsbox_: can you post your schema.rb?
[23:45:04] Radar: cogsbox_: I charge $200/hr for private consultation.
[23:45:18] Radar: cogsbox_: Direct messages at me by prefixing them with my name if you want my attention.
[23:45:37] wcalderipe: Radar: At this point I have 2 controllers with a total of 9 actions I just have a protected method that I call before respond
[23:45:50] wcalderipe: This method is defined in my base controller
[23:46:00] Radar: wcalderipe: Seems like you want me to play 20 questions here...
[23:46:04] Radar: wcalderipe: Code is better shown than explained.
[23:46:09] Radar: A gist explains a thousand lines of code ;)
[23:46:48] tfitts: Radar: ah, I think it's a rails 4.1/4.2 compatibility thing. My other app is 4.1
[23:47:10] Radar: tfitts: can you or can you not reproduce this issue in a brand new Rails 4.2 application?
[23:47:21] ElSif: awwwwwwww
[23:47:54] quazimodo: has joined #RubyOnRails
[23:49:06] cogsbox_: ElSif https://gist.github.com/anonymous/9d1ff21c0d6a039ee360
[23:49:20] cogsbox_: Radar Sorry
[23:50:01] Radar: cogsbox_: Looks like it's a Heroku error in the first gist. `heroku run rake db:migrate`?
[23:50:52] shmilan: has joined #RubyOnRails
[23:51:19] tfitts: Radar: nope, but that did help me figure it out. I was trying to use the setting in class in the lib directory
[23:52:47] tfitts: n/m, that didn't work either. My app fired up but still no rails settings, now if I include 'rails-settings-cached' it works
[23:53:09] jkamenik: has joined #RubyOnRails
[23:54:11] cogsbox_: Radar, `heroku run rake db:migrate` worked. you are a life saver
[23:54:33] Radar: cogsbox_: Just doing my job :)
[23:56:38] eggoez: has joined #RubyOnRails