« Back to channel list

#RubyOnRails - 24 May 2016

« Back 1 day Forward 1 day »
[00:00:39] hnanon: Radar: I was worried I had (another) gap in my understanding related for fields_for.
[00:00:43] Futronic: has joined #RubyOnRails
[00:01:43] Futronic: quazimodo: good morning
[00:03:28] roamingdog: has joined #RubyOnRails
[00:04:59] badoo: has joined #RubyOnRails
[00:05:52] idefine: has joined #RubyOnRails
[00:06:23] mrgreenfur: has joined #RubyOnRails
[00:07:22] Futronic: has joined #RubyOnRails
[00:09:00] roamingdog: has joined #RubyOnRails
[00:11:01] nettoweb: has joined #RubyOnRails
[00:11:25] Futronic: has left #RubyOnRails: ()
[00:14:19] badoo: has joined #RubyOnRails
[00:14:46] xxcesarioxx: has joined #RubyOnRails
[00:15:29] neha-: has joined #RubyOnRails
[00:15:51] xcesariox: has joined #RubyOnRails
[00:16:30] neha-: if i have a has_many relationship (user has_many posts), can i ensure in my schema that posts user_id is not null?
[00:16:57] neha-: is that overkill, or good practice?
[00:17:12] xcesariox: Why would you wanna make it null
[00:17:15] Radar: xcesariox: it's not working please try again later.
[00:17:25] neha-: i mean to ensure that some weirdness doesn't happen
[00:17:34] neha-: and an orphan post isn't created with a null user_id
[00:17:35] Radar: neha-: yes, add a foreign key to posts for user_id.
[00:17:47] xcesariox: Radar: nice joke there haha
[00:18:04] neha-: couldn't i do change_column_null ?
[00:18:10] neha-: as a migration
[00:18:11] Radar: [10:17:41] <Radar> neha-: yes, add a foreign key to posts for user_id.
[00:18:21] Radar: change_column_null only fixes half the problem.
[00:18:26] xcesariox: Radar: are you residing in the same country as sevencat?
[00:18:33] Radar: xcesariox: Allegedly.
[00:18:34] Technodrome: has joined #RubyOnRails
[00:18:36] neha-: okay thanks Radar
[00:19:15] pramodv: has joined #RubyOnRails
[00:19:53] ELCALOR: has joined #RubyOnRails
[00:20:10] badroo: has joined #RubyOnRails
[00:20:10] frem_: has joined #RubyOnRails
[00:20:35] digitalfiz: has joined #RubyOnRails
[00:20:40] acalewin: has joined #RubyOnRails
[00:20:46] Guest4184_______: has joined #RubyOnRails
[00:21:51] JoshGlzBrk: has joined #RubyOnRails
[00:22:59] stannard: has joined #RubyOnRails
[00:24:05] xcesariox: has joined #RubyOnRails
[00:28:09] lawell: has joined #RubyOnRails
[00:30:43] bronson: has joined #RubyOnRails
[00:32:27] stannard: has joined #RubyOnRails
[00:32:38] SteenJobs: has joined #RubyOnRails
[00:32:39] lawell: I'm facing a little challenge. I didn't intend to use coffeescript and Saas. However, I didn't comment out the corresponding gems in Gemfile. Now, my plain Javascript and CSS aren't working. I receive error messages such as: cannot load such file -- saas. Can someone help me fix it.
[00:34:48] roamingdog: has joined #RubyOnRails
[00:36:16] gopz: has joined #RubyOnRails
[00:36:40] Radar: Lawell: Can you show us the stacktrace from that error please?
[00:37:08] Radar: Lawell: !gist
[00:37:08] helpa: Lawell: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[00:38:49] MarkTR: has joined #RubyOnRails
[00:40:33] macsteps: has joined #RubyOnRails
[00:44:36] helpa: has joined #RubyOnRails
[00:44:57] helpa: has joined #RubyOnRails
[00:53:21] jowiar: has joined #RubyOnRails
[00:55:48] ensyde: has joined #RubyOnRails
[00:56:52] Rodya_: has joined #RubyOnRails
[00:57:30] jenrzzz: has joined #RubyOnRails
[00:59:34] hnanon: Radar: Thanks for your help.
[00:59:50] Radar: hnanon: np
[01:00:32] Cohedrin: has joined #RubyOnRails
[01:00:38] datanoise: has joined #RubyOnRails
[01:01:38] jstransky: has joined #RubyOnRails
[01:01:51] sypheren: has joined #RubyOnRails
[01:07:43] lukec: has joined #RubyOnRails
[01:10:34] sypheren: has joined #RubyOnRails
[01:11:17] DoctorMonocular: has joined #RubyOnRails
[01:18:11] JoshGlzBrk: has joined #RubyOnRails
[01:18:16] scottschecter: has joined #RubyOnRails
[01:18:40] TheNet: has joined #RubyOnRails
[01:19:34] TheNet: has left #RubyOnRails: ()
[01:19:58] rubyonrailed: has joined #RubyOnRails
[01:20:43] roamingdog: has joined #RubyOnRails
[01:21:26] RegulationD: has joined #RubyOnRails
[01:21:43] diegoaguilar: has joined #RubyOnRails
[01:22:00] mrgreenfur: has joined #RubyOnRails
[01:22:00] Ropeney: has joined #RubyOnRails
[01:23:53] jtdowney: has joined #RubyOnRails
[01:25:11] roamingdog: has joined #RubyOnRails
[01:25:58] jancel: has joined #RubyOnRails
[01:28:45] barhum2013: has joined #RubyOnRails
[01:29:05] rubyonrailed: has joined #RubyOnRails
[01:29:12] one_zero: has joined #RubyOnRails
[01:31:18] arBmind: has joined #RubyOnRails
[01:31:56] roamingdog: has joined #RubyOnRails
[01:36:26] ur5us: has joined #RubyOnRails
[01:39:10] sevenseacat: has joined #RubyOnRails
[01:39:25] macsteps: has joined #RubyOnRails
[01:43:49] macsteps: has joined #RubyOnRails
[01:44:13] Megamos: has joined #RubyOnRails
[01:44:54] rafaelfranca: has joined #RubyOnRails
[01:45:09] chopin: has joined #RubyOnRails
[01:45:50] roamingdog: has joined #RubyOnRails
[01:47:28] jowiar: has joined #RubyOnRails
[01:54:28] Coldblackice_: has joined #RubyOnRails
[01:59:10] xlegoman: has joined #RubyOnRails
[01:59:15] kgrz: has joined #RubyOnRails
[01:59:42] crystal77: has joined #RubyOnRails
[02:00:54] DanKnox: has joined #RubyOnRails
[02:00:58] alexhartley: has joined #RubyOnRails
[02:01:44] arBmind1: has joined #RubyOnRails
[02:02:27] asheinfeld: has joined #RubyOnRails
[02:03:32] JesseH: has joined #RubyOnRails
[02:04:03] Axilla: has joined #RubyOnRails
[02:04:45] Dimik: has joined #RubyOnRails
[02:06:19] chipotle: has joined #RubyOnRails
[02:06:23] owenjones: has joined #RubyOnRails
[02:07:49] rafaelfranca: has joined #RubyOnRails
[02:08:04] owenjones: I've been unable to google an error I'm having, switching an app from sqlite to PostGres on rails 5, running migrations I constantly get: unknown attribute 'version' for ActiveRecord::SchemaMigration. none of my tables have a column called version, so not sure where this is coming from...
[02:08:57] hcnewsom: has joined #RubyOnRails
[02:13:26] gfvcastro: has joined #RubyOnRails
[02:13:47] Seich: has joined #RubyOnRails
[02:13:58] Radar: owenjones: it's coming from the schema_migrations table that Rails automatically creates.
[02:14:05] owenjones: right, upon inspection
[02:14:16] owenjones: it looks like its creating them with a different user than the one specified for the app
[02:15:05] owenjones: https://gist.github.com/owengalenjones/06327ed27a6da444406494d8e889f0fa
[02:16:41] gfvcastro: has joined #RubyOnRails
[02:16:47] roamingdog: has joined #RubyOnRails
[02:19:18] jenrzzz: has joined #RubyOnRails
[02:21:42] macsteps: has joined #RubyOnRails
[02:21:58] Radar: owenjones: how is that possible?
[02:22:10] Radar: owenjones: and does that table have a version column?
[02:22:21] owenjones: I added another comment to that gist showing the \dt
[02:22:30] Radar: Drop the table, run rake db:migrate. it might create that table again.
[02:22:30] owenjones: no columns whatsoever in that schema_migrations table
[02:23:18] owenjones: if I even do rails db:create, the table is there, with the wrong owner
[02:24:15] benlieb: has joined #RubyOnRails
[02:24:42] Radar: Ok, I don't know how that's happening. Sorry.
[02:25:05] yfeldblum: has joined #RubyOnRails
[02:25:18] owenjones: no worries, thanks!
[02:25:18] Ropeney: owenjones, can you delete the whole database from postgres and start again or do you have valuable data in there?
[02:25:29] owenjones: nope, been running multiple db:drops
[02:25:42] Ropeney: actually delete database
[02:25:47] yfeldblum: has joined #RubyOnRails
[02:26:00] Ropeney: and start again then
[02:26:25] idefine: has joined #RubyOnRails
[02:27:11] chipotle: has joined #RubyOnRails
[02:32:48] DanKnox_: has joined #RubyOnRails
[02:33:07] roamingdog: has joined #RubyOnRails
[02:33:33] neruda: has joined #RubyOnRails
[02:34:05] neruda: noob question, if rails can use introspection/reflection to reason about the database, why can't strong params do the same, so i don'
[02:34:06] RegulationD: has joined #RubyOnRails
[02:34:21] neruda: dont have to explicitly whitelist parameters
[02:34:50] sevenseacat: because not every field in your database should be whitelisted
[02:34:53] macsteps: has joined #RubyOnRails
[02:34:56] owenjones: Ropeney Radar ok, looks like actually removing /usr/local/var/postgres and re-running initdb fixed it
[02:35:06] owenjones: thanks everyone
[02:35:09] Ropeney: well that was extreme, but good job :D
[02:35:15] neruda: sevenseacat: yeah buts its easier (in my case) to list the ones i dont want than to list the ones i do
[02:35:26] sevenseacat: no it's not, its a potential security hole
[02:35:47] sevenseacat: if you add another field to your database, its open by default unless you change every place it can be mass assigned
[02:35:54] Ropeney: neruda, untill someone adds a column and doesnt update some hidden controller that allows updating to it
[02:37:42] neruda: sevenseacat/ropeney: i have a giant/complex crud and am essentially defining the schema a second time for strong params
[02:37:50] baweaver: whitelist everything that comes from userland
[02:38:04] neruda: sevenseacat: lol no its not
[02:38:04] Ropeney: neruda, enjoy the security :)
[02:38:05] baweaver: never ever trust a user
[02:38:06] Radar: neruda: imagine a users table which had a field called "admin" that determined if the user was an admin or not
[02:38:18] Radar: neruda: Would you like that field to be settable by users by default, or not?
[02:38:35] neruda: Radar: got it, i read your book =), but seriously its easier to say .except(:bad_admin_field)
[02:38:38] baweaver: always err on the side of security
[02:38:49] neruda: in my case
[02:38:51] unreal: has joined #RubyOnRails
[02:38:58] Radar: neruda: Yes it's easier to write that, but it is better to be secure by default than the other way around.
[02:39:10] baweaver: Windows is blacklist based
[02:39:16] baweaver: How many exploits does it have?
[02:39:28] Ropeney: neruda `Model.column_names.map(&:to_sym)` in rails c to get all attributes as syms so you can copy paste
[02:39:29] baweaver: OpenBSD is whitelist based.
[02:39:30] jancel: has joined #RubyOnRails
[02:39:36] neruda: Radar: im not against security im against non-railsy stuff, redefining schema sucks
[02:39:37] maxz: has joined #RubyOnRails
[02:39:53] baweaver: It has 3 remote exploits in its existence
[02:40:01] Radar: neruda: Rails preventing you from blowing your foot off by default is not a sucky thing
[02:40:19] neruda: baweaver: respectfully, apples to oranges, compare windows to ubuntu and openbsd to any grsec kernel
[02:40:41] Ropeney: neruda, it was comparing security to security....
[02:41:58] baweaver: blacklists are a bad idea on anything that's user facing
[02:42:40] shiru: has joined #RubyOnRails
[02:43:10] neruda: Ropeney: thanks
[02:43:36] baweaver: but I'm not going to rephrase that 10 more ways either. The last I'll say on it is that blacklisting params is a horrible idea.
[02:43:37] Ropeney: neruda, please don't actually use that code in your strong params though
[02:44:01] neruda: Ropeney: no i wont, i'll just copy/paste
[02:51:13] Radar: Good stuff.
[02:56:18] gopz: has joined #RubyOnRails
[03:04:02] Ebok: has joined #RubyOnRails
[03:09:19] Radar: michael_mbp: helllo
[03:09:41] jenrzzz: has joined #RubyOnRails
[03:09:41] michael_mbp: If I leave a comment outside your timezone, don't worry. When you mention my handle my bouncer keeps a track of any messages you send :)
[03:10:09] michael_mbp: Shame that DHH's approach to Rails is 'If it works for basecamp, that's it'
[03:10:19] noodle: has joined #RubyOnRails
[03:10:25] michael_mbp: and that he doesn't give a toss about whatever anyone else might have to say.
[03:11:07] michael_mbp: Absolutely unnecessary arrogance too on his part :/
[03:13:23] diegoviola: has joined #RubyOnRails
[03:15:10] braincrash: has joined #RubyOnRails
[03:15:11] konsolebox: has joined #RubyOnRails
[03:16:32] hous: has joined #RubyOnRails
[03:17:14] Radar: strongly confirm
[03:17:28] Radar: I'd love it if the Rails core team tossed him out on his ass, but it's not going to happen so
[03:17:29] helpa: ¯\_(ツ)_/¯ Sorry, Radar is not able to help you any further as they do not know.
[03:19:06] moeabdol: has joined #RubyOnRails
[03:20:51] k3rn31: has joined #RubyOnRails
[03:24:23] Rodya_: has joined #RubyOnRails
[03:26:59] datanoise: has joined #RubyOnRails
[03:31:07] akshat: has joined #RubyOnRails
[03:31:52] arBmind: has joined #RubyOnRails
[03:33:12] bronson: has joined #RubyOnRails
[03:33:53] jenrzzz: has joined #RubyOnRails
[03:34:44] roamingdog: has joined #RubyOnRails
[03:37:24] njero: has joined #RubyOnRails
[03:38:33] owenjones: has joined #RubyOnRails
[03:39:15] alexhartley: has joined #RubyOnRails
[03:40:54] jancel: has joined #RubyOnRails
[03:41:28] alexhartley: has joined #RubyOnRails
[03:42:47] jgpawletko: has joined #RubyOnRails
[03:43:11] jenrzzz: has joined #RubyOnRails
[03:43:34] shiru: has joined #RubyOnRails
[03:45:16] braincra-: has joined #RubyOnRails
[03:47:03] jancel: has joined #RubyOnRails
[03:50:18] rubyonrailed: has joined #RubyOnRails
[03:52:32] duncannz: has joined #RubyOnRails
[03:53:17] duncannz: has joined #RubyOnRails
[03:54:29] _Sypheren: has joined #RubyOnRails
[03:58:11] Devalo: has joined #RubyOnRails
[03:59:04] dgs: has joined #RubyOnRails
[04:00:25] Inside: has joined #RubyOnRails
[04:00:25] Inside: has joined #RubyOnRails
[04:07:37] dgs: hey, question re running passenger + apache2. the passenger path/version is specificied in my apache2 conf - this changes from time to time when gems get upgraded etc which requires editing apache config, which is frustrating when deploying the app to multiple servers. is there anyway to link apache to the current version of passenger in my app so I don't have edit the apache config each time passenger version changes
[04:07:56] dgs: or is that just a cost of using passenger + apache?
[04:13:00] roamingdog: dgs: sounds like a job for your deploy script (cough ansible)
[04:14:36] Dios: has joined #RubyOnRails
[04:22:01] dgs: roamingdog: yeah, that was what I was figuring
[04:22:12] sneakersec: has joined #RubyOnRails
[04:23:07] dgs: unfortunately we've looked at doing automated deployments before, but have never been able to implement due to other development priorities, so no such thing
[04:23:31] dgs: still, one more reason to put down in the plus column for next time we look at it
[04:23:42] rickmasta: has joined #RubyOnRails
[04:25:57] Rodya_: has joined #RubyOnRails
[04:27:33] tildes_: has joined #RubyOnRails
[04:28:31] p1k: is there something special that needs to be done with engines to get routes->controller mapping to work correctly?
[04:29:05] p1k: I thought it would implicitly scope: <engine_module> but that doesn't seem to be the case
[04:29:09] cheeti: has joined #RubyOnRails
[04:32:18] artemaminov: has joined #RubyOnRails
[04:32:41] cheeti: Hi i am using simple captcha in my application it's giving error in production not loading image but working localhost perfectly. Error is "Routing error Get /simple_captcha" https://gist.github.com/mamatharao/d2827d9b49ecf8104865d5083c7b23ce
[04:33:10] sevenseacat: cheeti: because you're only loading the gem in your development group
[04:33:12] sevenseacat: in your Gemfile
[04:35:02] cheeti: sevenseacat how to load in production group
[04:35:11] dgs: has left #RubyOnRails: ()
[04:35:17] sevenseacat: cheeti: move it outside the development group
[04:35:19] pawnbox: has joined #RubyOnRails
[04:36:31] SteenJobs: has joined #RubyOnRails
[04:37:47] cheeti: sevenseacat can you please tell me more i am added gem in Gemfile and run bundle install in server
[04:39:34] pawnbox: has joined #RubyOnRails
[04:39:54] k3rn31: has joined #RubyOnRails
[04:42:14] Radar: cheeti: show us your Gemfile as it is now
[04:44:37] cheeti: Radar https://gist.github.com/mamatharao/d2827d9b49ecf8104865d5083c7b23ce
[04:44:59] Radar: That's the same Gist as before.
[04:45:07] Radar: Did you move simple_captcha2 to outside of the development group, or not?
[04:46:52] cheeti: Radar How to move? i am not getting?
[04:47:33] Radar: gem 'simple_captcha2', require: 'simple_captcha'
[04:47:35] Radar: Copy this line
[04:47:42] Radar: Put it outside of the group :development do; end block
[04:48:34] cheeti: Radar Ho thank i got it
[04:48:37] SteenJobs: Radar: oh boy this email stuff is terrible
[04:48:42] Radar: SteenJobs: yup.
[04:48:58] Radar: SteenJobs: Thank god we don't use it as a vital part of global communica... oh fuck
[04:49:06] SteenJobs: Radar: went with zurb’s stuff, but still incredibly convoluted. i’m almost done with email template number….2
[04:49:22] SteenJobs: yea, im not sure how everyone forgot about keeping email up to date
[04:50:41] cheeti: Radar Thanks it's working
[04:56:01] hous: has joined #RubyOnRails
[04:57:34] pawnbox: has joined #RubyOnRails
[04:58:10] pawnbox: has joined #RubyOnRails
[05:04:15] pawnbox: has joined #RubyOnRails
[05:09:30] DoctorMonocular: has joined #RubyOnRails
[05:13:16] sn1ff3r: has joined #RubyOnRails
[05:14:25] Y_Ichiro: has joined #RubyOnRails
[05:14:25] Y_Ichiro: has joined #RubyOnRails
[05:16:40] rvanlieshout: has joined #RubyOnRails
[05:16:41] Jet4Fire_: has joined #RubyOnRails
[05:16:56] quazimodo: has joined #RubyOnRails
[05:17:01] dmz: has joined #RubyOnRails
[05:17:10] veloutin_: has joined #RubyOnRails
[05:17:21] quazimodo: https://gist.github.com/siassaj/3d30a23bb4b0c27e69d888e5326ef7ac
[05:17:36] Haydos: has joined #RubyOnRails
[05:18:02] quazimodo: why does capture(&block) in a view helper producet the desired "Hi' but capture(&block) in the class produces a huge html string taht seems to represent the entire 'yield' content?
[05:18:18] zhunting: has joined #RubyOnRails
[05:18:34] iamayam: has joined #RubyOnRails
[05:19:36] bratsche: has joined #RubyOnRails
[05:20:01] spectra: has joined #RubyOnRails
[05:20:22] yfeldblum: has joined #RubyOnRails
[05:20:31] rvanlieshout: quazimodo: there is a difference between returns and outputs
[05:20:45] quazimodo: rvanlieshout: in this case, returns
[05:21:10] quazimodo: in both cases capture builds a new buffer that the block shoves it's data into
[05:22:20] quazimodo: and then it's meant to return whatever the block put into that fresh buffer
[05:22:23] M-shine: has joined #RubyOnRails
[05:22:35] quazimodo: at least that's what the source code looks like it's doing to me
[05:22:36] bb: has joined #RubyOnRails
[05:22:56] rvanlieshout: https://github.com/rails/rails/blob/1c73eb6389e4ef312eec3ad2addad7bbcb3a00be/actionview/lib/action_view/helpers/capture_helper.rb#L36
[05:23:00] rvanlieshout: it uses output_buffer
[05:23:02] rvanlieshout: that conflicts with yours
[05:23:07] quazimodo: but mixing ActionView::Helpers::CaptureHelper doesn't seem to work on the class, I'm certain that i'm missing something
[05:23:37] quazimodo: sure, with_output_buffer creates that new fresh buffer i mentioned
[05:24:17] quazimodo: how's it conflicting?
[05:24:25] lxsameer: has joined #RubyOnRails
[05:24:29] Devalo: has joined #RubyOnRails
[05:25:26] rvanlieshout: cause it's also defined in your class
[05:25:31] rvanlieshout: but what do you want this to do?
[05:28:16] datanoise: has joined #RubyOnRails
[05:29:07] rubyonrailed: has joined #RubyOnRails
[05:30:15] Haydos: has joined #RubyOnRails
[05:31:26] alfie_max15: i've got a rails app which is just an api for an angular app.
[05:31:26] alfie_max15: A token based authentication is used here(auth token is passed in for every request in the header). Now i'm trying to use omniauth to get social profile access from users, but after authentication when the provider redirects back to the callback uri, there wouldn't be any auth header, and without that i can't figure out whose token it was.
[05:31:26] alfie_max15: Am i doing something wrong here? I haven't done anything like this before, and this feels wrong in some way, Please help.
[05:32:21] arBmind: has joined #RubyOnRails
[05:33:36] quazimodo: rvanlieshout: i want to build the html in a class, rather than the helper
[05:33:45] quazimodo: there's a bit of logic so iwant it out of the helper
[05:34:00] quazimodo: and i don't want to constantly do 'h.capture' and 'h.content_tag'
[05:34:06] quazimodo: where h is the view context
[05:34:26] quazimodo: i'm sure i'm missing something
[05:34:29] quazimodo: some include
[05:34:49] jancel: has joined #RubyOnRails
[05:35:27] njero: alfie_max15: doesn't the auth hash return by provider has enough info about user?
[05:35:36] bronson: has joined #RubyOnRails
[05:36:09] alfie_max15: you mean like the username, etc ?
[05:36:26] njero: yeah may be email, if that's the key
[05:36:53] alfie_max15: three social media i'm trying to connect to are, facebook, twitter and instagram
[05:37:01] alfie_max15: only facebook provides email,
[05:37:17] benlieb: has joined #RubyOnRails
[05:37:33] owenjones: has joined #RubyOnRails
[05:37:44] njero: need to refresh auth flow :P
[05:38:11] alfie_max15: and, even that's not enough for my case because, these accounts(within the app) are for company employees, and the social account they connect would be for the company
[05:38:31] alfie_max15: n_e_o, any ideas how i can?
[05:39:36] njero: alfie_max15: nope.. let me check
[05:42:58] datanoise: has joined #RubyOnRails
[05:53:08] netzfisch: has joined #RubyOnRails
[05:53:23] alfie_max15: figured it out..
[05:53:37] moeabdol: has joined #RubyOnRails
[05:54:29] alfie_max15: since there is nothing in the response i get that i can use to identify the user, i can pass in some kind of identifier to omniauth, which will be returned
[05:55:37] njero: alfie_max15: nice
[05:56:06] njero: if it's api only how are you passing token to application?
[05:56:32] alfie_max15: in the request header
[05:57:11] alfie_max15: every request must have one, else the response would be 401
[05:57:28] njero: correct me if i'm wrong, isn't that request being generated from front end
[05:57:51] njero: so you're revealing token and secret to front end?
[05:58:20] moeabdol: has joined #RubyOnRails
[05:58:32] PlasmaStar: has joined #RubyOnRails
[05:58:45] alfie_max15: my same concerns :D
[05:58:53] njero: alfie_max15: :(
[05:59:10] alfie_max15: i'm not completely sure how it's done, hadn't got time to go over this fully
[05:59:30] alfie_max15: just got into this project, and was asked to implement a new feature
[05:59:35] njero: actually i needed that for my native app too.. But i couldn't figure a way without webwiew
[06:00:21] alfie_max15: i'll go through the front end code once i'm done with this and let you know if it's been implemented differently
[06:00:22] njero: alfie_max15: ping me if you crack that :)
[06:00:34] cstls: has joined #RubyOnRails
[06:00:54] bachmann: has joined #RubyOnRails
[06:01:12] yfeldblum: has joined #RubyOnRails
[06:04:39] adgtl: has joined #RubyOnRails
[06:04:39] adgtl: has joined #RubyOnRails
[06:05:42] yfeldblum: has joined #RubyOnRails
[06:09:52] hahuang61: has joined #RubyOnRails
[06:10:43] neanderslob: howdie! I'm currently getting an "undefined method" error from cancancan that's I just can't figure out
[06:11:13] neanderslob: the act actual question and code can be found here http://stackoverflow.com/questions/37402865/cancancan-throws-error-when-creating-new-record
[06:11:44] neanderslob: any/all ideas would be greatly appreciated
[06:11:45] sevenseacat: "NoMethodError (undefined method `users' for nil:NilClass): app/models/ability.rb:82:in `block in initialize'"
[06:11:58] Radar: undefined method `user_companies' for nil:NilClass
[06:12:02] sevenseacat: seems pretty straightforward
[06:12:11] Radar: Seems like there's two errors.
[06:12:30] Radar: It's not clear what line 82 is in ability.rb
[06:12:53] neanderslob: sevenseacat: I suppose that's reassuring
[06:13:11] sevenseacat: read error, go to line of code error points to
[06:13:21] sevenseacat: whats on that line?
[06:14:01] zpe: has joined #RubyOnRails
[06:14:28] neanderslob: the line is asset.company.user_companies.where(user: user).exists?
[06:14:42] lipoqil: has joined #RubyOnRails
[06:14:47] Radar: so maybe asset.company is nil
[06:15:03] sevenseacat: that might be for the error Radar mentioned, but not the one I mentioned
[06:15:15] zpe: has joined #RubyOnRails
[06:16:25] Hosh: has joined #RubyOnRails
[06:16:49] neanderslob: Radar: that's what I was thinking but it correctly identifies the company_id within the parameters
[06:16:56] camilasan: has joined #RubyOnRails
[06:17:26] helpa: has joined #RubyOnRails
[06:17:27] swgillespie: has joined #RubyOnRails
[06:17:41] digitalfiz: has joined #RubyOnRails
[06:17:46] yfeldblum: has joined #RubyOnRails
[06:17:57] spastorino: has joined #RubyOnRails
[06:18:02] sevenseacat: all yours Radar :P
[06:18:10] DukeDave: has joined #RubyOnRails
[06:18:30] dmcc: has joined #RubyOnRails
[06:18:38] nyandoge: has joined #RubyOnRails
[06:18:45] Hates_: has joined #RubyOnRails
[06:18:49] andrew9184: has joined #RubyOnRails
[06:19:16] CornishPasty: has joined #RubyOnRails
[06:19:17] one_zero_m: has joined #RubyOnRails
[06:19:17] neanderslob: sevenseacat: honestly I have no idea what would be causing that error either
[06:19:19] Obi_obi_: has joined #RubyOnRails
[06:19:31] sevenseacat: ...so whats on that line?
[06:19:40] apotry: has joined #RubyOnRails
[06:20:01] neanderslob: asset.company.user_companies.where(user: user).exists?
[06:20:06] sevenseacat: thats not line 82
[06:20:15] sevenseacat: there is no reference to `users` on that line
[06:20:29] boshhead: has joined #RubyOnRails
[06:20:36] codepete: has joined #RubyOnRails
[06:21:01] meinside: has joined #RubyOnRails
[06:21:21] AlexJakeGreen: has joined #RubyOnRails
[06:21:52] helpa: has joined #RubyOnRails
[06:22:05] neanderslob: sevenseacat: I'm sorry, where are you getting line 87?
[06:22:17] sevenseacat: 82, and from the error message you posted on stack overflow
[06:22:20] sevenseacat: which I posted above
[06:22:32] sevenseacat: "NoMethodError (undefined method `users' for nil:NilClass): app/models/ability.rb:82:in `block in initialize'"
[06:22:42] SuppliedRelic: has joined #RubyOnRails
[06:23:22] kumavis: has joined #RubyOnRails
[06:23:26] neanderslob: I'm sorry, must have misunderstood; it's probably getting "users" from the user_companies model that I'm referencing
[06:23:37] neanderslob: which joins users and companies in a many-to-many relationship
[06:24:00] Hosh: has joined #RubyOnRails
[06:24:13] amitchellbullard: has joined #RubyOnRails
[06:24:17] jlyndon: has joined #RubyOnRails
[06:24:46] sniff: has joined #RubyOnRails
[06:25:03] JackMc: has joined #RubyOnRails
[06:25:29] neanderslob: sevenseacat: no?
[06:26:25] Macaveli: has joined #RubyOnRails
[06:26:34] joaomdmoura__: has joined #RubyOnRails
[06:26:42] Macaveli: Good morning
[06:27:03] darutoko: has joined #RubyOnRails
[06:27:16] Macaveli: I'm having trouble with current_user (Devise) is nil after a form submit, anyone have a suggestion? http://stackoverflow.com/questions/37405888/devise-current-user-nil-on-form-submit-rails-4
[06:27:48] crystal77: has joined #RubyOnRails
[06:28:17] kallisti5: has joined #RubyOnRails
[06:28:22] stannard: has joined #RubyOnRails
[06:29:36] Radar: neanderslob: Which error are we debugging here?
[06:29:42] Radar: neanderslob: It looks like there are two.
[06:31:17] strongcode: has joined #RubyOnRails
[06:31:59] Radar: Macaveli: show us the logs from that request ploease.
[06:32:14] Radar: The request that the form does when it is submitted.
[06:32:15] neanderslob: Radar: oooh, I see where the confusion is; my error log isn't even referencing the error in my question, one moment; I need to look through this more carefully
[06:32:29] Radar: neanderslob: indeed.
[06:32:49] Macaveli: Hold on Radar will do
[06:36:07] Macaveli: Radar log -> https://gist.github.com/DelawareConsulting/8a6dbf1bf646c32e75124165accab6c3
[06:36:17] Radar: Can't verify CSRF token authenticity
[06:36:22] Radar: hash-tag-well-there's-your-problem
[06:36:42] Radar: When Rails throws that it clears your session as a security precaution
[06:37:20] Radar: Submit the form with a CSRF token (I forget the method for it)
[06:37:52] Radar: ACTION digs
[06:38:09] Macaveli: mmm that's new since rails 4 right? I just ported from rais 3
[06:38:16] Radar: Should've been the same in Rails 3.
[06:38:53] Macaveli: Didn't have issues in Rails 3
[06:39:23] neanderslob: Radar: ok, I updated the log on the SO question. I'd changed my code while troubleshooting so the log came from that code
[06:39:48] neanderslob: Radar: there is now only one error and the post should reflect that
[06:40:03] neanderslob: apologies for any confusion
[06:40:12] Radar: neanderslob: thank you
[06:40:30] Radar: neanderslob: I still think asset.company is nil in one case.
[06:40:47] Radar: neanderslob: Asset.all.detect { |a| a.company.nil? } in console might tell you which one
[06:43:20] benlieb: has joined #RubyOnRails
[06:43:57] Oog: has joined #RubyOnRails
[06:44:00] crdpink: has joined #RubyOnRails
[06:44:22] neanderslob: Radar: but wouldn't the fact that the parameters indicate that "company_id"=>"1" suggest otherwise?
[06:45:25] Radar: neanderslob: Show us the code from AssetsController#new please.
[06:46:42] neanderslob: Radar: well the console has confirmed your suspicions
[06:46:54] Cervajz: has joined #RubyOnRails
[06:48:09] neanderslob: Radar: I believe it should be posted in the question; 4th code block from the top
[06:48:21] Radar: So it is.
[06:48:30] Radar: Why is @asset being s et twice.
[06:49:09] chipotle: has joined #RubyOnRails
[06:49:31] Coldblackice_: has joined #RubyOnRails
[06:49:43] Oog: i haev a class - how can i define a method that is aclled around it?
[06:49:45] neanderslob: Radar: mostly, because of incompetence on my part
[06:49:58] neanderslob: let's get rid of that
[06:50:19] helpa: has joined #RubyOnRails
[06:51:08] matthias_: has joined #RubyOnRails
[06:51:56] helpa: has joined #RubyOnRails
[06:52:59] neanderslob: Radar: alright, I cleaned that up and we still have the error
[06:53:48] neanderslob: my thoughts exactly
[06:53:53] Radar: neanderslob: got any before_actions in that controller?
[06:54:31] sevenseacat: so did you verify that every single asset has an associated company?
[06:54:42] Radar: sevenseacat: it's happening on the new action
[06:55:31] lxsameer: has joined #RubyOnRails
[06:55:41] sevenseacat: ten bucks says theres a load_and_authorize_resource somewhere
[06:57:29] neanderslob: Radar: no before_actions to report
[06:58:56] Radar: neanderslob: I am out of ideas.
[06:59:11] Radar: Steps to reproduce in a new app plzkthx
[06:59:24] ksmutthu: has joined #RubyOnRails
[06:59:39] sevenseacat: can we see the whole controller? plus any parent controllers?
[07:00:46] Palsson: has joined #RubyOnRails
[07:03:05] mark_661: has joined #RubyOnRails
[07:03:43] neanderslob: sevenseacat: ...I think you just won ten bucks
[07:04:22] dionysus69: has joined #RubyOnRails
[07:04:37] Oog: is there a way using activesupport to create an around method for every method in a class?
[07:05:12] neanderslob: more to the point, I must have gotten rid of my "skip_authorize_resource" line
[07:05:17] universal: Oog: what is your reason to doing it?
[07:05:54] Oog: i want every method in the class in a transaction that is rolledback it is my mail tester
[07:06:27] neanderslob: Radar: thanks for walking me through that though
[07:07:32] Radar: sevenseacat: nice one
[07:07:34] universal: Oog: mail tester? still trying to understand the original problem ;)
[07:07:47] Oog: i preview emails i want to make sure nothing messes with real data
[07:09:28] comrad: has joined #RubyOnRails
[07:09:55] finnnnnnnnnnn: has joined #RubyOnRails
[07:10:51] solars: has joined #RubyOnRails
[07:11:16] lalalaaa: has joined #RubyOnRails
[07:11:22] jstransky: has joined #RubyOnRails
[07:11:57] benlieb: has joined #RubyOnRails
[07:12:28] crystal77: has joined #RubyOnRails
[07:13:10] hahuang61: has joined #RubyOnRails
[07:13:23] universal: Oog: and you really need persisted instances?
[07:14:15] zyzioziom: has joined #RubyOnRails
[07:14:16] Oog: i dont want persisted...
[07:14:19] Oog: it is to guarantee the rollback
[07:14:30] Oog: i got ithttps://gist.github.com/anonymous/99a017c95e55ceb714695c281cf0a864
[07:14:31] universal: so don't save the instances in the first place?
[07:15:08] Oog: i just add ActiveRecordTransaction.around(self, instance_methods - Object.methods) to the end of my class
[07:15:12] armyriad: has joined #RubyOnRails
[07:15:26] universal: Oog: what i mean is: in your "test" method just do User.new some_attributes; and pass that to the mailer
[07:15:30] dionysus69: how do I handle migrations when I deploy rails to remote server? migrations fail because some stuff do not exist anymore since later migrations changed. can I delete earlier migrations to avoid those conflicts? for example one of my migrations was used to drop a table. But in production I never created that table in first place so there is nothing to drop. What is a classic way to avoid such conflicts?
[07:15:33] universal: no need for a transaction, ... ;)
[07:15:43] neshmi: has joined #RubyOnRails
[07:15:47] Oog: interesting but then i need to mock users etc
[07:15:51] Oog: now i can test with live ones :)
[07:16:09] Radar: Oog: Seems like a bad idea tbh.
[07:16:19] universal: dionysus69: you shouldn't have messed with the migrations.
[07:16:20] Radar: I agree with universal's suggestioins
[07:16:35] Oog: why is this bad
[07:16:42] universal: dionysus69: use the schema file to load the current state. and then migrate on from that.
[07:16:48] dionysus69: universal: I didn't, I never deleted or modified migrations manually. I always created new migration to modify stuff
[07:17:07] Radar: Oog: You're monkeypunching some ActiveRecord methods.
[07:17:14] Radar: Oog: It's going to end in tears.
[07:17:21] dionysus69: so you are saying I can totally gitignore migration dir since schema is enough to recreate current state?
[07:17:28] universal: dionysus69: o0
[07:17:36] Oog: this class is not inhertied from active record it is just a plain class
[07:17:39] Oog: i take out the object methods
[07:17:58] universal: dionysus69: if you did not delete any migraitons, then you can not have a migration creating a table, you later dropped in another one.
[07:18:02] Radar: Oog: Ok, enjoy your nice shiny new footgun. I've said my piece.
[07:18:20] ur5us: has joined #RubyOnRails
[07:18:33] Oog: lol ok ill be back when it blows up
[07:18:45] universal: dionysus69: therefore by your error you "messed" with the migrations.
[07:18:56] dionysus69: universal: ok I ll try using schema to load current state because thats all I need
[07:19:07] conta: has joined #RubyOnRails
[07:20:32] conta: guys. so I have model Newsreel with valid_from/to and on View I wanna show it when valid Newsreel is available. But can;t figure out how not do go DB every view
[07:20:53] universal: conta: sorry, what?
[07:20:54] armyriad: has joined #RubyOnRails
[07:21:15] universal: conta: you are looking for caching?
[07:22:29] njero: where is smathy? haven't heard for a while...
[07:23:05] conta: universal: Not sure. So how I want it work: When I am in Time between valid_from and valid_to from some Newsreel, I want to show it in (every) View (eg via partial in template).
[07:23:52] jancel: has joined #RubyOnRails
[07:23:53] conta: And I don't know how to not go to DB to check if there is Newsreel available for ne everytime User go different view
[07:24:13] universal: conta: http://guides.rubyonrails.org/caching_with_rails.html
[07:27:14] EXCHGR: has joined #RubyOnRails
[07:27:33] TvL2386: has joined #RubyOnRails
[07:28:01] conta: thanks, I'm looking into it
[07:28:40] mikecmpbll: has joined #RubyOnRails
[07:31:06] rubyonrailed: has joined #RubyOnRails
[07:37:01] KnownSyntax: has joined #RubyOnRails
[07:37:33] KnownSyntax: has joined #RubyOnRails
[07:37:36] bronson: has joined #RubyOnRails
[07:38:04] KnownSyntax: has joined #RubyOnRails
[07:38:33] gingray: has joined #RubyOnRails
[07:38:38] KnownSyntax: has joined #RubyOnRails
[07:39:14] KnownSyntax: has joined #RubyOnRails
[07:39:32] AzaToth: has joined #RubyOnRails
[07:39:49] KnownSyntax: has joined #RubyOnRails
[07:40:39] edwinvdgraaf: has joined #RubyOnRails
[07:42:08] j3r0: has joined #RubyOnRails
[07:43:08] alexhartley: has joined #RubyOnRails
[07:44:07] Oog: has joined #RubyOnRails
[07:45:30] gambl0re: has joined #RubyOnRails
[07:45:30] gambl0re: has joined #RubyOnRails
[07:49:42] Ch4rAss: has joined #RubyOnRails
[07:50:26] benlieb: has joined #RubyOnRails
[07:51:40] GarethAdams: has joined #RubyOnRails
[07:56:38] lawell: has joined #RubyOnRails
[07:57:11] allenn: has joined #RubyOnRails
[07:57:29] alfie_max15: has joined #RubyOnRails
[07:58:14] finnnnnnnnnnn: morning! how can I read the value of a hash if I do not know the key? example, I don’t know that the key in this is foo but I want to read bar { foo: bar }
[07:58:42] alfie_max15: finnnnnnnnnnn, you already know the value??
[07:58:57] alfie_max15: or is it that there is only one key-value in the hash?
[07:59:13] rvanlieshout: finnnnnnnnnnn: .values?
[07:59:18] tildes: finnnnnnnnnnn: http://ruby-doc.org/core-2.2.0/Hash.html#method-i-values
[07:59:29] mikecmpbll: has joined #RubyOnRails
[08:00:52] tildes: fin*: ever thought about having a more human friendly irc handle? ;-)
[08:01:00] finnnnnnnnnnn: tildes: values is perfect thanks
[08:01:21] finnnnnnnnnnn: tildes: you’re not the first one to say that, I have tab completion on my IRC client. Do most people not?
[08:01:41] lawell: has joined #RubyOnRails
[08:01:42] finnnnnnnnnnn: but, yeah, I should probably change the name. It’s quite painful
[08:02:00] barhum2013: has joined #RubyOnRails
[08:02:21] kgrz: has joined #RubyOnRails
[08:03:47] defsdoor: has joined #RubyOnRails
[08:06:37] lawell: Hey there, I didn't intend to use both coffeescript and saas in my app. However, I omitted to comment out their respectives gem in the Gemfile. Thus, neither my javascript nor my css works. In addition I receive error messages such as LoadError in DemoController#index cannot load such file -- sass
[08:07:25] lawell: app/views/layouts/application.html.erb:5:in `_app_views_layouts_application_html_erb__121618739__1047898478'
[08:07:45] edwinvdgraaf: has joined #RubyOnRails
[08:08:20] lawell: <head> <title>SimpleCms</title> <%= stylesheet_link_tag('application', :media => 'all') %> <%= javascript_include_tag('public') %> </head> <body>
[08:10:02] adre: has joined #RubyOnRails
[08:10:37] drptbl: has joined #RubyOnRails
[08:11:21] alfie_max15: lawell, it has something to do with your application.css manifest
[08:12:02] Dimik: has joined #RubyOnRails
[08:14:26] lawell: alfie_max15, this is the content of my application.css manifest: *= require public *= require admin *= require_tree . *= require_self */
[08:15:10] roamingdog: has joined #RubyOnRails
[08:16:48] jsrn: has joined #RubyOnRails
[08:16:59] sevenseacat: is it actually called application.css ? there's no sass there?
[08:17:08] raunicolae: has joined #RubyOnRails
[08:19:46] walidvb: has joined #RubyOnRails
[08:21:30] phredus: has joined #RubyOnRails
[08:21:45] edwinvdgraaf: has joined #RubyOnRails
[08:23:09] Ergo: has joined #RubyOnRails
[08:23:17] marr: has joined #RubyOnRails
[08:24:08] tetraktys: has joined #RubyOnRails
[08:26:04] srinidhi: has joined #RubyOnRails
[08:29:57] matthias_: has joined #RubyOnRails
[08:34:29] tvw: has joined #RubyOnRails
[08:36:23] lawell: has joined #RubyOnRails
[08:36:44] walidvb_: has joined #RubyOnRails
[08:37:23] walidvb_: hey friends. i'm getting signed out of my app everytime i push a new version on heroku, which is quite painful as you can imagine..
[08:37:34] walidvb_: my devise setup says config.secret_key=ENV['SECRET_KEY_BASE']
[08:37:46] walidvb_: but that might not be the right setting?
[08:38:09] finnnnnnnnnnn_: has joined #RubyOnRails
[08:39:54] datanoise: has joined #RubyOnRails
[08:40:15] TvL2386: has joined #RubyOnRails
[08:43:39] Pumukel: has joined #RubyOnRails
[08:44:02] dionysus69: has joined #RubyOnRails
[08:49:05] srinidhi: has joined #RubyOnRails
[08:50:39] vedu: for all my tests, I am getting this error: `NoMethodError: undefined method `type' for nil:NilClass`. How can I get a stack trace or something to debug this
[08:51:48] vedu: ok got it. log/test.log :)
[08:51:49] atrius: has joined #RubyOnRails
[08:53:17] p1k: is there a way to ignore rails complaints about assets precompile without the global `config.assets.raise_runtime_errors` ?
[08:53:18] arBmind: has joined #RubyOnRails
[08:57:01] p1k: specifically if you have files used only for testing/development they really shouldn't be in precompile ?
[09:01:23] ferr: has joined #RubyOnRails
[09:03:02] zyzioziom1: has joined #RubyOnRails
[09:05:30] Axilla: has joined #RubyOnRails
[09:06:48] weckl: has joined #RubyOnRails
[09:11:03] Pazician: has joined #RubyOnRails
[09:12:00] lawell: Hey guys, I didn't intend to use both Coffeescript and Saas. However, I didn't commented their respective gem before generating my controllers. Now, my plain Javascript and CSS aren't working. Rails is throwing errors messages such as: cannot load file such as -- Saas, or CoffeeScript. Also, Rails highlight <%= stylesheet_link_tag('application', :media => 'all') %>.
[09:12:05] lawell: app/views/layouts/application.html.erb:5:in `_app_views_layouts_application_html_erb__3189042__1049880008'
[09:15:47] oded: has joined #RubyOnRails
[09:16:22] sevenseacat: is it actually called application.css ? there's no sass there?
[09:16:55] ur5us: has joined #RubyOnRails
[09:16:56] GarethAdams: has joined #RubyOnRails
[09:17:37] mdw: has joined #RubyOnRails
[09:17:49] chipotle: has joined #RubyOnRails
[09:18:03] Circuit8: has joined #RubyOnRails
[09:18:46] snowy: has joined #RubyOnRails
[09:18:56] lawell: Hey ur5us, you're right. there isn't any saas in application.css manifest
[09:19:02] lawell: because I am not using saas
[09:23:29] sevenseacat: lawell: !rule12
[09:23:29] helpa: lawell: Do not PM members of the channel without first asking if that is OK.
[09:23:39] Megamos: has joined #RubyOnRails
[09:23:41] snowy: has joined #RubyOnRails
[09:24:12] lawell: well noted
[09:24:24] ql6wlld: has joined #RubyOnRails
[09:26:22] artto: has joined #RubyOnRails
[09:27:02] ur5us: all good, lawell confused me with somebody else I guess
[09:27:14] myntcake: has joined #RubyOnRails
[09:30:22] Jet4Fire: has joined #RubyOnRails
[09:31:03] kgrz_: has joined #RubyOnRails
[09:32:01] tetraktys: has joined #RubyOnRails
[09:33:39] walidvb_: vedu: i use pry-rails and web-console which are really helpful for debugging (when an error is raised, you get a prompt within your browser at that specific point)
[09:34:26] pipework: I prefer a pry session in a terminal myself.
[09:34:40] pipework: So either pry or pry-remote depending on what you're doing.
[09:35:52] vedu: walidvb_: I am getting errors running rake test. rails s works fine
[09:36:42] srinidhi: has joined #RubyOnRails
[09:37:33] Weavel: has joined #RubyOnRails
[09:38:40] artto: has joined #RubyOnRails
[09:39:16] walidvb_: still, with pry you can basically set breakpoints, handy.
[09:39:48] walidvb_: pipework: agree with you. still, when you're not expecting the error, it's nice to have the prompt right in front of you imho
[09:40:20] walidvb_: i'm still not figuring out how to have my heroku+devise keep me logged in between deployments..
[09:42:00] Devalo: has joined #RubyOnRails
[09:42:15] ch3m1c: has joined #RubyOnRails
[09:42:47] zyzioziom: has joined #RubyOnRails
[09:43:41] startupality: has joined #RubyOnRails
[09:46:33] walidvb_: any hint on that would be greatly appreciated!
[09:49:37] chemic: has joined #RubyOnRails
[09:50:18] workmad3: has joined #RubyOnRails
[09:51:17] mdw7: has joined #RubyOnRails
[09:51:22] chemic: I'm facing a weird problem.. I'm using postgis to store coordinates and other location data in postgres database and with last migration I'm trying to do.. to add few columns to a table it doesn't effect geography_columns for some reason
[09:51:26] chemic: add_column :users, :last_loc_lonlat, :point, :geographic => true
[09:51:53] chemic: and now when I want to save something to the database I get a cast error
[09:51:55] chemic: TypeError (can't cast RGeo::Geographic::ProjectedPointImpl to point):
[09:56:56] chemic: when this geography_columns should get updated, right away with migration while adding columns, or with 1st insert into table? as I'm not adding new rows.. I'm updating old ones.. where I'm getting that casting error
[09:58:22] Palsson: has joined #RubyOnRails
[10:00:52] artto: has joined #RubyOnRails
[10:03:28] lalalaaa: has joined #RubyOnRails
[10:06:13] chemic: it just looks like AddGeometryColumn postgis isn't called with column adding migration.. but why?
[10:07:46] alexhartley: has joined #RubyOnRails
[10:07:51] lalalaaa: If I process multiple Paperclip attachments in the background with delayed_job and https://github.com/jrgifford/delayed_paperclip/ like I did in http://code.runnable.com/VYQeWSsznmoeLtHQ/delayed_paperclip (see app/models/photo.rb) -- aren't these processes (ie. ImageMagick's `convert`) supposed to line up and fire one by one?
[10:07:56] lalalaaa: Over here they're firing simultaneously, making the server grind to a halt and 502. I'm starting it like `bin/delayed_job --queue=paperclip --pool=paperclip:1 start RAILS_ENV=production`.
[10:09:16] conta: has joined #RubyOnRails
[10:13:57] lxsameer: what's the point of manifest.js in sprockets 5? what's the benefit of using it ?
[10:14:03] Oog: has joined #RubyOnRails
[10:14:47] Axilla: has joined #RubyOnRails
[10:20:16] srinidhi: has joined #RubyOnRails
[10:21:00] vedu: How can I assert if my model object was touched? i.e. its updated_at was changed
[10:22:18] rvanlieshout: assert_changes ish
[10:22:58] artto: has joined #RubyOnRails
[10:23:00] startupality: has joined #RubyOnRails
[10:23:52] User458764: has joined #RubyOnRails
[10:24:33] antgel: has joined #RubyOnRails
[10:24:34] vedu: rvanlieshout: there's only a assert_difference and it checks for a particular difference
[10:24:43] Gkj8899: has joined #RubyOnRails
[10:25:56] rvanlieshout: vedu: what's wrong with looking for a particular difference?
[10:26:00] rvanlieshout: the updated_at has changed?
[10:26:28] universal: before = foo.updated_at; ...; after = foo.reload.updated_at; assert_not_equal before, after ?
[10:26:40] stardiviner: has joined #RubyOnRails
[10:26:58] westoque: has joined #RubyOnRails
[10:27:01] blackhuey: has joined #RubyOnRails
[10:27:32] bphogan: has joined #RubyOnRails
[10:27:57] vedu: rvanlieshout: yes
[10:28:23] pipework: walidvb_: there's a way to get a pry session on every unhandled exception in the stack.
[10:28:24] Fire-Dragon-DoL: has joined #RubyOnRails
[10:28:35] vedu: universal: yeah I am copying the `assert_difference` source and creating a assert_change
[10:28:54] walidvb_: pipework: that sounds cool, and better than in browser for sure
[10:30:00] Detch: has joined #RubyOnRails
[10:30:14] neanderslob: has joined #RubyOnRails
[10:30:19] rvanlieshout: vedu: why not just use assert_difference?
[10:30:47] eyck: has joined #RubyOnRails
[10:34:49] andrew9184: has joined #RubyOnRails
[10:38:36] artto: has joined #RubyOnRails
[10:38:43] vedu: rvanlieshout: updated_at should be changed, but its difference wont be one
[10:40:37] bronson: has joined #RubyOnRails
[10:41:26] datanoise: has joined #RubyOnRails
[10:42:14] Macaveli: has joined #RubyOnRails
[10:42:49] rvanlieshout: vedu: assert_difference checks if it's changed during the block
[10:43:31] GodFather_: has joined #RubyOnRails
[10:44:37] vedu: rvanlieshout: no. have a look at its method signature: assert_difference(expression, difference = 1, message = nil, &block)
[10:44:45] tetraktys: has joined #RubyOnRails
[10:46:16] myntcake: has joined #RubyOnRails
[10:49:17] Macaveli: has joined #RubyOnRails
[10:49:56] srinidhi: has joined #RubyOnRails
[10:50:04] Ch4rAss: has joined #RubyOnRails
[10:52:46] artto_: has joined #RubyOnRails
[10:54:46] artto: has joined #RubyOnRails
[10:55:37] fox_mulder_cp: hi. somebody uses delayed_job? i have a custom job, but when i try create new job from my model method, it creates 4+ jobs for one instance
[10:56:06] tetraktys: has joined #RubyOnRails
[10:58:26] rvanlieshout: fox_mulder_cp: are you sure you're not just calling it 4 times?
[10:58:31] vedu: Hello. I am getting a totally unrelated (so I feel) SQL error while trying to create a record. code and error: https://gist.github.com/vedant1811/f0bb74f26d4913945f3d55052703bd39
[10:58:53] artto: has joined #RubyOnRails
[10:59:50] jancel: has joined #RubyOnRails
[11:00:28] alfie_max15: has joined #RubyOnRails
[11:02:34] fox_mulder_cp: rvanlieshout: yes. when i try from rails console CreateContainerJob.new(WebApp.first) it add two tasks
[11:03:16] fox_mulder_cp: rvanlieshout: in pre start hooks i add lock/save for job, but it uneffective
[11:03:51] RegulationD: has joined #RubyOnRails
[11:03:54] artto: has joined #RubyOnRails
[11:04:03] zpe: has joined #RubyOnRails
[11:05:01] rvanlieshout: gist that createjob thing
[11:05:04] GodFather: has joined #RubyOnRails
[11:05:06] rvanlieshout: and away for lunch. back in 30 min
[11:06:20] k3rn31: has joined #RubyOnRails
[11:06:26] GodFather_: has joined #RubyOnRails
[11:06:29] dangerousdave: has joined #RubyOnRails
[11:06:47] finnnnnnnnnnn: I’m trying to store references to a nested object in an array and then write to that object - https://gist.github.com/fionnbharra/0caf8aa8a48eb15b3f764933191e2974. I can’t seem to write, probably because I’m doing it wrong. Anyone suggest a way to do this?
[11:08:31] GodFather: has joined #RubyOnRails
[11:09:44] fox_mulder_cp: code here https://gist.github.com/anonymous/227ef047b0ef687c76ba8c8028fb2142
[11:09:53] rodfersou: has joined #RubyOnRails
[11:10:52] rodfersou: has joined #RubyOnRails
[11:12:04] GodFather: has joined #RubyOnRails
[11:12:36] vedu: Can anyone understand why postgreSQL is giving me an error for no reason! code and error: https://gist.github.com/vedant1811/f0bb74f26d4913945f3d55052703bd39
[11:14:05] alfie_max15: lol... for no reason :D
[11:14:12] rvanlieshout: vedu: column clients.roleable_id
[11:14:16] rvanlieshout: does not exist
[11:14:22] rvanlieshout: what more do you need?
[11:14:59] rvanlieshout: your https://gist.github.com/vedant1811/f0bb74f26d4913945f3d55052703bd39#file-client-rb-L2 implies that client has that property
[11:15:03] rvanlieshout: but it doesn't
[11:15:14] rvanlieshout: anyway.. lunch. bbl
[11:15:24] habitullence: has joined #RubyOnRails
[11:15:47] eGGshke: has joined #RubyOnRails
[11:16:07] fox_mulder_cp: rvanlieshout: i post some lines ago my code. can u help me with it?
[11:17:40] GodFather: has joined #RubyOnRails
[11:18:16] vedu: rvanlieshout: Its has_one, not belongs_to. come back from lunch then please help me out
[11:18:48] vedu: fox_mulder_cp: you are running it locally?
[11:19:31] GodFather_: has joined #RubyOnRails
[11:19:32] aleskandro: has joined #RubyOnRails
[11:19:40] fox_mulder_cp: vedu: yes. it creates 2 jobs, one of it locked by my hook
[11:19:52] aleskandro: Hi all, i'm using the i18n gem on a rails project. In one form I have a nested form for room with fields_for (roomFeature) and the label of the fields are translated from the yaml. But when I make a validation error the field name is not translated. I receive "Roomfeatures description non puo` essere bianca". How can I set "Roomfeatures description" in the yaml?
[11:20:12] vedu: fox_mulder_cp: kill all your delayed_job processes, and then run the code, then see how many entries are created in the delayed_job table
[11:21:03] aleskandro: I tried room/room_feature: \n description_text: "Descrizione della caratteristica" but it didn't work
[11:23:43] startupality: has joined #RubyOnRails
[11:27:12] zyzioziom1: has joined #RubyOnRails
[11:28:24] AzaToth: has joined #RubyOnRails
[11:30:08] doodlehaus: has joined #RubyOnRails
[11:30:34] chipotle: has joined #RubyOnRails
[11:35:07] elementaru: has joined #RubyOnRails
[11:41:04] ldnunes: has joined #RubyOnRails
[11:42:08] c355E3B: has joined #RubyOnRails
[11:44:49] artto_: has joined #RubyOnRails
[11:45:56] myntcake: has joined #RubyOnRails
[11:46:00] fox_mulder_cp: vedu: i already do it, but it seems that locked two jobs
[11:50:01] ql6wlld: has joined #RubyOnRails
[11:50:26] qsun: has joined #RubyOnRails
[11:51:25] quazimodo: has joined #RubyOnRails
[11:52:25] raunicolae: has left #RubyOnRails: ("Once you know what it is you want to be true, instinct is a very useful device for enabling you to know that it is")
[11:53:19] GrizzlyZolam: has joined #RubyOnRails
[11:57:56] alexhart_: has joined #RubyOnRails
[11:58:32] doodlehaus: has joined #RubyOnRails
[11:58:48] |2701: has joined #RubyOnRails
[12:00:54] roamingdog: has joined #RubyOnRails
[12:01:44] AzaToth: has joined #RubyOnRails
[12:02:13] maucar: has joined #RubyOnRails
[12:04:45] chouhoulis: has joined #RubyOnRails
[12:06:45] hcnewsom: has joined #RubyOnRails
[12:07:05] atrius: has joined #RubyOnRails
[12:07:18] roamingdog: has joined #RubyOnRails
[12:09:09] srinidhi: has joined #RubyOnRails
[12:09:42] beauby: has joined #RubyOnRails
[12:11:15] jokke: has joined #RubyOnRails
[12:11:31] jokke: is it possible to check whether db:seed has been run?
[12:11:55] gopz: has joined #RubyOnRails
[12:12:43] umdstu: has joined #RubyOnRails
[12:12:45] lalalaaa: has joined #RubyOnRails
[12:14:07] epochwolf: jokke: sure, is the stuff in seed.rb in the database? If so, yes it's been run.
[12:14:20] Devalo: has joined #RubyOnRails
[12:14:47] jokke: epochwolf: yeah... i was hoping for a rake task.. i need to set up a docker container for a rails app so i'd need to check this in the entrypoint
[12:15:04] epochwolf: And I'm being absolutely serious when I say that. There's no flags anywhere to tell if it's been run,.
[12:15:17] gopz: has joined #RubyOnRails
[12:15:23] jokke: i could check if logs exist :P
[12:15:42] epochwolf: jokke: why does the docker container need to check if db:seed has been run?
[12:15:53] adaedra: You could check if one of the tables you seed is empty
[12:15:58] epochwolf: Aren't containers contained and initalized with a script?
[12:16:02] hahuang61: has joined #RubyOnRails
[12:16:29] jokke: adaedra: i need rails for that since the db config is done through rails
[12:16:39] jokke: or i'd need to parse it in the entrypoint script
[12:17:01] adaedra: add a rake task yourself
[12:17:15] jokke: it's not my app
[12:17:42] jokke: i think i really check if production.log exists.. should be created on db:seed right?
[12:17:46] adaedra: if it's for a container, I suppose it's for differentiating the first run and next runs – you could touch a file in the container for that
[12:18:02] jokke: adaedra: yeah i thought about that too
[12:18:39] ksmutthu_: has joined #RubyOnRails
[12:19:28] Lloyd: just run the seeds task everytime? and adjust it so that it’s using find_or_initialize_by instead of just creating?
[12:19:47] Lloyd: had to go lookup how the huginn container did it
[12:19:59] Lloyd: as that deals with migrations and seeding on start
[12:20:20] ferr: When I send json object through ajax true/false and integers become strings, how would I solve this problem? https://gist.github.com/Fercell/699017c74051321a11f2dd1443c3de2b
[12:20:34] kgrz: has joined #RubyOnRails
[12:21:34] mauricar: has joined #RubyOnRails
[12:21:53] moeabdol: has joined #RubyOnRails
[12:22:02] eGGshke: has joined #RubyOnRails
[12:22:08] epochwolf: ferr: not all the integers become strings... add a console.log in the javascript that dumps the data variable. It may not contain what you think it does.
[12:22:30] vedu: Can anyone understand why postgreSQL is giving me an error for no reason! code and error: https://gist.github.com/vedant1811/f0bb74f26d4913945f3d55052703bd39
[12:22:38] ferr: epochwolf: it does contain normal json object, but when it goes to rails, it becomes all string
[12:23:40] epochwolf: ferr: can you include the json from the client and the contents of the web request? I'm thinking something isn't matching up here.
[12:24:30] ferr: Just to clarify, do you want the data obj from ajax call and rails server log?
[12:24:40] visof: has joined #RubyOnRails
[12:25:08] epochwolf: ferr: it would help, it's been a long time since I'd delved into this part of rails. I'm going to have to read some source code. :)
[12:25:26] ql6wlld: has joined #RubyOnRails
[12:25:44] mikecmpb_: has joined #RubyOnRails
[12:25:49] epochwolf: ferr: also, it would help to see what your browser says it's sending. Network tab in the web inspect if you're using chrome.
[12:26:05] epochwolf: I'm interested in the request headers and body.
[12:26:27] visof: i start new rails project, rails new new_project, and i got this when run bundle install http://pastie.org/10850413
[12:26:48] jokke: join #mongodb
[12:27:01] ql6wlld: has joined #RubyOnRails
[12:27:30] aegis3121: has joined #RubyOnRails
[12:27:58] jokke: i was missing an /
[12:28:19] ferr: epochwolf: I've updated the gist
[12:29:22] epochwolf: ferr: Content-Type: application/x-www-form-urlencoded; charset=UTF-8 It's not sending json.
[12:29:54] WhereIsMySpoon_: has joined #RubyOnRails
[12:30:03] epochwolf: x-www-form-urlencoded does not have integers, all keys and values are strings.
[12:30:34] ferr: contentType: 'application/json', is this what I need?
[12:30:54] epochwolf: ferr: unsure, let me check jquery's docs.
[12:30:54] jeffmess: has joined #RubyOnRails
[12:31:44] jeffmess: I've just updated from rails5.beta3 => rc1. My api responses aren't being wrapped by a root object now, is there a setting I now need to add to my serializers?
[12:32:35] epochwolf: ferr: processData: false, contentType: 'application/json', data: JSON.stringify(data),
[12:35:36] Craigimus: has joined #RubyOnRails
[12:36:14] kailido1: has joined #RubyOnRails
[12:36:34] njero: has joined #RubyOnRails
[12:37:06] ferr: epochwolf: thanks
[12:37:12] kailido1: everytime i click like, edit or delete it appears me this error: Uncaught Error: Syntax error, unrecognized expression: /improvement_actions/300/like
[12:37:13] epochwolf: ferr: did that work? :)
[12:37:22] kailido1: and this was working fine previously
[12:37:28] ferr: Yea, I just need to add additional params now
[12:37:38] epochwolf: ferr: excellent, happy coding. :)
[12:37:50] epochwolf: kailido_: what did you change since it was working?
[12:38:32] moeabdol: has joined #RubyOnRails
[12:38:34] veloutin: has joined #RubyOnRails
[12:38:49] kailido1: i installed trix gem, but i tried to run a previous commit and its doing the same thing i dont know why
[12:39:00] kailido1: and I know this didnt happen before
[12:39:28] tildes: kailido_: is that the only change? did you bundle anew after returning to previous commit?
[12:40:13] kailido1: i tried ckeditor and then unistalled and later trix gem
[12:40:21] kailido1: bundle anew?
[12:40:48] tildes: I think you need to run bundle even when you remove a gem again (=> anew)
[12:40:49] kies: has joined #RubyOnRails
[12:41:17] startupality: has joined #RubyOnRails
[12:41:29] kailido1: i ran bundle, because it was need to run the project
[12:42:52] bronson: has joined #RubyOnRails
[12:43:17] kailido1: hmm i tried again, and in the previous commit it appear there trix too :/
[12:44:16] datanoise: has joined #RubyOnRails
[12:45:17] tildes: kailido_: find a commit where it still works, and do a "git diff" or equivalent for your version control system
[12:45:28] kailido1: its giving me errors in browser everytime i run ajax
[12:46:21] kailido1: but thats whats strange, because im running a commit that I know it worked, but its the same
[12:54:36] GrizzlyZolam: has joined #RubyOnRails
[12:54:54] rubyonrailed: has joined #RubyOnRails
[13:01:43] dstarh: has joined #RubyOnRails
[13:02:20] epochwolf: kailido_: then either something is cached in the browser, or you are wrong about A. the commit worked in the past, B. you have properly loaded that commit.
[13:03:07] epochwolf: We won't discuss C) bugs in your tools/hardware until we have ruled out all other options.
[13:03:21] FreddieFresh: has joined #RubyOnRails
[13:03:41] epochwolf: My first recommendation is to verify you have properly loaded that commit and you have no changed or uncommited files in git.
[13:04:05] epochwolf: Then, restart all applications running that code. Or just restart the entire machine if that's faster.
[13:04:29] kailido1: i used this to load a previous commit https://github.com/{username}/{projectname}/archive/{sha}.zip
[13:04:29] tildes: kailido_: technically it could be, that "the commit that worked" was not properly loaded at the time it was working
[13:05:16] epochwolf: Another option is you could have source code outside of version control...
[13:05:23] ramortegui: has joined #RubyOnRails
[13:05:26] tildes: kailido_: in any case you must identify the diff, that contains the actual change, that broke your app
[13:05:56] epochwolf: tildes: I've seen some people store code in the database.
[13:06:10] tildes: epochwolf: ouch
[13:06:22] epochwolf: some people... like one stupid wolf...
[13:06:39] tildes: ACTION used to code pl/sql in the distant past
[13:06:43] epochwolf: Granted it was only html templates but damn was that a pain.
[13:07:18] tildes: I would certainly avoid that, given the option
[13:09:43] hcnewsom: has joined #RubyOnRails
[13:10:11] tildes: kailido_: use git checkout sha in your project folder. git clean -df will remove your untracked files
[13:10:21] tildes: check that your local files are as they should. try again
[13:10:40] tildes: (assuming that the trix theory is correct)
[13:11:11] epochwolf: And I'd make sure you using bundle exec for running things.
[13:11:26] epochwolf: Otherwise... the results are unpredictable.
[13:11:38] tennis: has joined #RubyOnRails
[13:14:09] tetraktys: has joined #RubyOnRails
[13:14:17] yellow5: has joined #RubyOnRails
[13:14:58] artto: has joined #RubyOnRails
[13:15:27] AzaToth: has joined #RubyOnRails
[13:15:56] kailido1: I "git checkout sha" in my latest version folder ?
[13:16:22] tildes: in your local development app folder
[13:16:30] tildes: what do you mean with version folder?
[13:16:53] ldnunes: has joined #RubyOnRails
[13:16:58] hahuang61: has joined #RubyOnRails
[13:17:04] kailido1: because I downloaded the sha and runned on other project
[13:17:13] kailido1: i was afraid of making even more mistakes
[13:17:19] startupality: has joined #RubyOnRails
[13:17:29] jsrn: has joined #RubyOnRails
[13:17:44] macsteps: has joined #RubyOnRails
[13:17:48] tildes: it's ok to make mistakes locally, on your own machine, when you use version control
[13:17:56] tildes: kailido_: I have no clue what you have done and why
[13:18:29] tildes: the "runned on other project" part sounds dubious, at best
[13:18:48] petor: has joined #RubyOnRails
[13:19:01] kailido1: i made a copy of the project
[13:19:11] atrius: has joined #RubyOnRails
[13:19:14] kailido1: and runned the previous sha
[13:20:19] tildes: I would prefer doing git clone, if you want a new folder, that way you are tracking the remote, and can switch between commits
[13:20:29] tildes: idk if you can do that if you just download a zip file
[13:21:04] kailido1: I can try your way, its probably the best tho
[13:21:15] kailido1: I do "git checkout sha" ?
[13:21:21] hcnewsom: has joined #RubyOnRails
[13:22:09] tildes: git clone <myrepo> && cd <myrepo> && git checkout <sha for the commit I want>
[13:22:41] doodlehaus: has joined #RubyOnRails
[13:25:56] artemaminov: has joined #RubyOnRails
[13:26:15] User458764: has joined #RubyOnRails
[13:28:26] kailido1: after git checkout <sha>, do this? git clean -df
[13:28:47] finnnnnnnnnnn: has joined #RubyOnRails
[13:29:35] artto: has joined #RubyOnRails
[13:29:38] tildes: kailido: I would do git status to see if there are untracked files, and if yes, clean them with git clean -df
[13:29:53] gfvcastro: has joined #RubyOnRails
[13:31:48] artto: has joined #RubyOnRails
[13:32:58] kailido1: i dont undestand, its giving me the same errors
[13:34:06] chipotle: has joined #RubyOnRails
[13:35:26] hcnewsom: has joined #RubyOnRails
[13:37:21] gfvcastro: has joined #RubyOnRails
[13:37:21] tildes: kailido_: sending you good energy and stuff, but it's hard to help until you identify the exact diff
[13:37:32] tildes: or give more info about the errors & code executed
[13:38:08] kailido1: but if im running the previously working version why its now working now? :(
[13:39:39] asheinfeld: has joined #RubyOnRails
[13:40:13] lalalaaa: has joined #RubyOnRails
[13:41:19] tildes: either the "previously working version" was not really working or you are not running exactly the same set of code right now
[13:43:17] zyzioziom: has joined #RubyOnRails
[13:44:59] kailido1: im running the code because I notice the changes, but it happens the same errors
[13:45:35] kailido1: im going to try other version than, but this always worked well
[13:46:05] stannard: has joined #RubyOnRails
[13:46:14] chipotle: has joined #RubyOnRails
[13:47:11] startupality: has joined #RubyOnRails
[13:50:19] artto: has joined #RubyOnRails
[13:52:22] centrx: has joined #RubyOnRails
[13:52:32] ferr: epochwolf: https://gist.github.com/Fercell/6d51711d02a236996b4631eabd859d15#file-example-js-L5 do you have any ideas how would I add external params to this?
[13:53:06] Talltree: i got a general question about Convention over configuration. is how you should store something in the model a convention?
[13:53:25] epochwolf: ferr: external params?
[13:53:26] Talltree: i'm having a discussion with someone and i'm against storing something that is absoloutly not human readable
[13:53:35] Talltree: like plain bytes
[13:53:48] tildes: what is the use case?
[13:53:59] epochwolf: Talltree: nothing wrong with binary data in a database if there's a good reason.
[13:54:00] tildes: plain bytes sounds a bit rare for a rails app
[13:54:13] epochwolf: tildes: images or firmware comes to mind.
[13:54:16] idefine_: has joined #RubyOnRails
[13:54:37] epochwolf: There can be reasons to store those in a database as opposed to storing them on disk.
[13:54:42] Talltree: sounds odd to me too, its saving space and bandwidth, i'm dealing with thousands of entries here
[13:54:46] idefine: has joined #RubyOnRails
[13:55:01] epochwolf: Talltree: what's the data?
[13:55:02] Talltree: is there a way to "convert" the model values inside the controller into fields that are human readable
[13:55:14] epochwolf: Why do you need to convert anything?
[13:55:28] Talltree: i'm making a ladder website for a computer game
[13:55:32] idefine_: has joined #RubyOnRails
[13:55:36] crystal77: has joined #RubyOnRails
[13:55:39] Talltree: and you have to memory read the values off the game
[13:55:46] Talltree: which returns a byte
[13:55:55] Talltree: the byte defines class and "league"
[13:56:13] Talltree: class as in character class, sorry
[13:56:20] xibalba: has joined #RubyOnRails
[13:56:43] epochwolf: Okay, then create a mapping class that's used to convert between those and save the human readable bits in the database.
[13:56:45] pawnbox: has joined #RubyOnRails
[13:56:51] crystal77: has joined #RubyOnRails
[13:57:05] epochwolf: Since your primary usecase is going to be displaying that information, correct?
[13:57:26] Talltree: and sorting it, and filtering etc
[13:57:40] tildes: epochwolf: when would you use firmware in a rails app? (just curious)
[13:57:42] epochwolf: Yeah, just store it in a format that makes sense for your use case.
[13:58:01] epochwolf: tildes: IBM Mainframe firmwares for an internal site. :)
[13:58:08] epochwolf: Just an idea.
[13:58:15] crystal77: has joined #RubyOnRails
[13:58:16] Talltree: ha, i got a maybe odd question then too, is it possible to make a route param, instead of character?class=sorceress /character/sorceress/
[13:58:30] epochwolf: Talltree: no, just map /character
[13:58:48] Talltree: doing that right now, just wondering
[13:58:59] sevenseacat: i dont get that last question
[13:58:59] epochwolf: Talltree: it's doable, but I'll hate you for it.
[13:59:00] Talltree: since somebody told be thats not the RESTful way of doing it
[13:59:01] stannard: has joined #RubyOnRails
[13:59:16] epochwolf: And I don't tell you how to make that work. :P
[13:59:30] Talltree: sevenseacat, simply filtering the character model with a route instead of a params
[13:59:39] finnnnnnnnnnn_: has joined #RubyOnRails
[13:59:57] epochwolf: But I have remapped a fully restful site into php file urls of every format I can think of for fun.
[14:00:20] tildes: Talltree: how is using params to find the character model not restful?
[14:00:34] GodFather_: has joined #RubyOnRails
[14:00:58] epochwolf: tildes: someone has a pinecone up their butt about clean urls most likely. A lot of people don't know how to make apis.
[14:01:13] Talltree: tildes: idk, didnt read the full spec of restful design, i wasn't going to listen to him, but wonderd
[14:01:27] Talltree: epochwolf, absoloutly correct sir! :D
[14:01:30] Talltree: thanks for your help ;)
[14:01:34] tildes: Talltree: read the rails guides and stick with that :)
[14:01:52] tildes: that should be enough for your app really
[14:01:54] kailido1: <tildes> its working with a even more old version
[14:02:14] kailido1: how do I call a person here in webchat ?
[14:02:15] tildes: kailido_: great, then you have the diff! or at least a starting point
[14:03:36] Talltree: maybe if you type the beginning letter
[14:03:41] Talltree: and then press tab
[14:03:49] Talltree: works for my client, dunno if web works too :D
[14:04:12] tonymilne: has joined #RubyOnRails
[14:04:12] tildes: Talltree: what is rest and what is not is a sort of a debate on it's own. for a rails app that provides an api for displaying stuff in the front end, rails guides will have everything you need
[14:05:06] xibalba: Hey folks, my wife is interested in learning rails. she's coming from no computer science background (other than listening to me talk IT geek) but from an Econ/Math background. I wanted to know if you had any recommended resources, perhaps a list, of tutorials/teachings she should go through from someone coming with no background. Thanks
[14:05:13] tildes: (and that's what you can refer to with pinecone peeps too)
[14:06:29] crankhar1er: I'm working on a app that runs off the localfile system (full read access to a particular folder) -- I need to upload a file that I have the path to. Not sure how to read the file and convert it to binary before posting it. can that be done?
[14:06:38] Talltree: tildes no they didnt actually. but it works too
[14:06:48] sevenseacat: xibalba: https://pragprog.com/titles/ltp2/learn-to-program-2nd-edition
[14:07:01] Talltree: i mean, i could find it with a lot of patience and aksing here :D
[14:07:01] xibalba: Thanks, compiling a list now
[14:08:39] xibalba: sevenseacat , I was looking at the Agile Web Dev w/Rails4 book for her too from PragProg. Do you think the learn to program book is a good starting point, followed by the agile web dev?
[14:08:54] xibalba: this book; https://pragprog.com/book/rails4/agile-web-development-with-rails-4
[14:09:01] xibalba: maybe now rails5
[14:09:05] sevenseacat: i wouldnt really recommend AWDWR - I'd recommend Rails 4 in Action next instead, but I'm biased :P
[14:09:28] xibalba: whats your reasoning there?
[14:10:12] P0w3r3d: has joined #RubyOnRails
[14:10:44] bb: has joined #RubyOnRails
[14:11:15] xibalba: any recommendations like; http://tryruby.org/ ?
[14:11:31] Talltree: hahahaha sevenseacat
[14:11:45] tildes: xibalba: http://learnrubythehardway.org/book/
[14:11:55] sevenseacat: I always disclose my affiliation, I'd feel guilty otherwise!
[14:11:58] tildes: for a hands-on start
[14:12:06] xibalba: ha why is it the hardway
[14:12:20] tildes: the author believes in deliberate practice
[14:12:30] xibalba: oh interesting
[14:12:43] Talltree: sevenseacat, but that has highly amusing for me, "why do you like it?" "because i wrote it!"
[14:13:00] tildes: R4IA is good as well, but you will need to know at least some ruby first
[14:13:15] tildes: (for Rails it's great actually)
[14:13:18] Talltree: for something without that much money to spend
[14:13:20] tildes: (I didn't write it)
[14:13:23] sevenseacat: right, which is why I recommended Learn to Program first
[14:13:24] Talltree: what do you recommend next?
[14:13:44] xibalba: any thoughts on Practical C being a good start for the introduction into computer systems, functions, and all that or is it too low-level for a newb to start with
[14:13:53] xibalba: besides PRactical C being ancient
[14:13:54] rube-newb: has joined #RubyOnRails
[14:13:57] rube-newb: Hey folks, my wife is interested in learning rails. she's coming from no computer science background (other than listening to me talk IT geek) but from an Econ/Math background. I wanted to know if you had any recommended resources, perhaps a list, of tutorials/teachings she should go through from someone coming with no background. Thanks
[14:13:58] rube-newb: has left #RubyOnRails: ()
[14:14:03] sevenseacat: xibalba: its not really relevant if she's interested in ruby
[14:14:07] Talltree: i like js for starting out, but thats just my opinion i guess...
[14:14:13] srinidhi1: has joined #RubyOnRails
[14:14:28] arup_r: has joined #RubyOnRails
[14:14:47] tildes: I'd recommend python for the first programming language atm to somebody just about to start, but python is not relevant with rails
[14:14:51] tildes: and it's quite similar to ruby
[14:14:56] tildes: why not ruby first
[14:15:08] Talltree: there is a MVC framework in python too, i dont remember the name
[14:15:18] sevenseacat: django you're probably thinking of
[14:15:33] Talltree: maybe i try it someday, but i just fell in love with rails too much
[14:15:44] Malgorath: has joined #RubyOnRails
[14:16:53] Malgorath: I am working with Rails Engine and a host app, in the engine I want to access the defined user variable from the host app, its just <%= :user %> should render it in a view? or am I missing a step?
[14:17:17] Talltree: do you guys just do backend or do you do frontend too? is there even a frontend and backend differenciation in rails
[14:18:01] rubyonrailed: has joined #RubyOnRails
[14:18:45] sevenseacat: I am not a guy, but I work on all parts of a rails app
[14:19:38] Malgorath: Talltree: Rails incorporates all aspects of web development. You can use it to do just frontend, just backend, both, or even just middleware.
[14:20:06] Malgorath: Talltree: and yeah, gender neutral pronouns will save you a lot of headache now days.
[14:20:20] mauricari: has joined #RubyOnRails
[14:20:35] Talltree: guy wasnt meant gender specific.
[14:21:13] Talltree: english is not my native language and i thought "you guys" was gender neutral
[14:21:14] epochwolf: Talltree: sshhhh, it's okay. Just use yall next time.
[14:21:27] epochwolf: Talltree: it is, some people get upset about it.
[14:21:36] Talltree: but i tried so hard, and got so faaaaarrrr
[14:21:39] Talltree: but in the end...
[14:22:12] epochwolf: Talltree: english defaults to male pronouns as the default and currently there's debate whether or not it's sexist.
[14:22:24] ql6wlld: has joined #RubyOnRails
[14:22:29] Talltree: i see, SJW stuff etc
[14:22:48] epochwolf: Talltree: yes, but it's not fair to dismiss it.
[14:23:31] axl_: has joined #RubyOnRails
[14:23:37] tildes: I think most males who identify themselves as males would not like to be called "gals", even if some or most English speakers defaulted to that expression
[14:23:49] tildes: I mean think about it :D
[14:24:22] tildes: Talltree: mostly backend, occasionally some front end fiddling
[14:24:39] Malgorath: I don't care if I'm called guy, girl, he she, it, I'm just happy to be included. But I'm a minority I know
[14:24:51] Ergo: has joined #RubyOnRails
[14:25:35] Talltree: its intresting, i don't know if i would ever specialize in front or backend
[14:25:42] Talltree: interesting
[14:26:13] sevenseacat: I'd never specialize in frontend these days, way too much clusterfuckery in the JS world
[14:26:16] epochwolf: Talltree: y'all is a shortening of you all, it's common in the southern US. You guys is used everywhere else. I'd like to see y'all become standard. :)
[14:26:30] Talltree: it sounds rednecky :D
[14:26:38] epochwolf: That's because it is.
[14:26:51] tildes: don't the Irish say you's ?
[14:27:18] epochwolf: tildes: the only time we care about the Irish is St Patty's day or when they are bombing something.
[14:27:43] epochwolf: And the second one is debatable when it's across the ocean. :P
[14:28:39] n1lo: has joined #RubyOnRails
[14:29:11] Talltree: i'm listing to so much english stuff can i can distinguish different USA/Canada/British dialects pretty well.
[14:29:15] Talltree: my grammar is bad tho :D
[14:29:46] sevenseacat: seems pretty good to me, I wouldnt have picked you weren't a native speaker
[14:29:49] adaedra: has joined #RubyOnRails
[14:30:07] epochwolf: spoken and written grammar are a little different.
[14:30:20] epochwolf: irc is somewhere in between.
[14:30:28] Talltree: sevenseacat i'm taking that as a compliment :D
[14:30:43] sevenseacat: Talltree: it was intended as one :)
[14:31:21] Juanchito: has joined #RubyOnRails
[14:31:26] tildes: epochwolf: all this time I thought you were German. no idea why :D
[14:31:36] Talltree: maybe he is?
[14:31:55] epochwolf: American of Polish descent.
[14:32:08] tubbo: no woman would be called "wolf" on the internet.
[14:32:17] epochwolf: tubbo: actually...
[14:32:24] Talltree: you dont know the women i know tubbo
[14:33:01] tubbo: epochwolf: http://www.quickmeme.com/p/3w5fa4
[14:33:07] Talltree: do yall know Unbreakable Kimmy Schmidt?
[14:33:09] epochwolf: There is a shortage of female wolves... but there's no shortage female coyotes. :D
[14:33:27] startupality_: has joined #RubyOnRails
[14:33:41] jhass: Talltree: "they" if you're unsure ;)
[14:33:59] jhass: https://en.wikipedia.org/wiki/Singular_they
[14:34:08] Talltree: the "landlord" of kimmy, has a thick New York accent.
[14:34:30] Talltree: with some italien in it i think
[14:34:35] B1n4r10: has joined #RubyOnRails
[14:34:37] Talltree: i like that dialect very much^^
[14:34:47] epochwolf: jhass: however, plural you needs it's own word.
[14:35:04] kdough: has joined #RubyOnRails
[14:35:05] epochwolf: I propose yall.
[14:35:07] ddv: nerds ^
[14:35:13] quazimodo: has joined #RubyOnRails
[14:35:26] epochwolf: ddv: You're in a chatroom for a programming framework... this is self-evident.
[14:36:36] crankharder: has joined #RubyOnRails
[14:38:37] stannard: has joined #RubyOnRails
[14:39:16] tubbo: epochwolf: you'se
[14:39:21] tubbo: is the correct form IIRC
[14:40:41] arup_r: has joined #RubyOnRails
[14:41:17] B1n4r10: has joined #RubyOnRails
[14:42:18] hcnewsom: has joined #RubyOnRails
[14:43:28] idefine: has joined #RubyOnRails
[14:43:30] Velizar: has joined #RubyOnRails
[14:44:28] jhack: has joined #RubyOnRails
[14:44:28] dionysus69: has joined #RubyOnRails
[14:44:40] bronson: has joined #RubyOnRails
[14:45:02] mdw: has joined #RubyOnRails
[14:45:38] armyriad: has joined #RubyOnRails
[14:45:40] datanoise: has joined #RubyOnRails
[14:46:12] chouhoulis: has joined #RubyOnRails
[14:46:25] Devalo: has joined #RubyOnRails
[14:46:55] chouhoulis: has joined #RubyOnRails
[14:50:11] chouhoul_: has joined #RubyOnRails
[14:50:35] Velizar: has joined #RubyOnRails
[14:50:57] idefine: has joined #RubyOnRails
[14:54:10] walidvb: has joined #RubyOnRails
[14:56:16] fmcgeough: has joined #RubyOnRails
[14:58:23] aegis3121: has joined #RubyOnRails
[14:59:12] lalalaaa: has joined #RubyOnRails
[15:01:12] Velizar: I'm thinking of abstracting a few features of my app as Rails engines to release as open-source, and then expand both the app and those engines when necessary. Is this a good idea? I've never made any Rails engines before and am worried it might not work as I imagine it.
[15:02:17] tubbo: Velizar: how are you re-using the code today? how many apps have you copy/pasted the same code to and noticed it working?
[15:03:39] FooMunki: has joined #RubyOnRails
[15:03:55] tubbo: usually i stand by a "rule of three" when deciding what to abstract into a gem. if 3 apps use the exact same code, or very similar versions of the same code, you might as well refactor that out into an engine so it's easier to use
[15:04:28] Velizar: tubbo: I'm only using one instance of everything, but I want to make it available for others to use it.
[15:04:42] smathy: has joined #RubyOnRails
[15:05:14] srinidhi: has joined #RubyOnRails
[15:06:49] tubbo: Velizar: the caveat to refactoring features into an engine is that it's way more complex to develop on. just more moving parts and indirection, more places to look, etc.
[15:07:25] tubbo: like for example: is that route to /foo/bars coming from one of the 15 or so engines you have installed, or your app? are you really OK with looking through 15 separate repos just to debug something?
[15:07:27] walidvb: i need to have a taxonomy on a model, that has a hierarchy. i'm not sure how to accomplish that. I was hoping to use acts_as_taggable_on, but i woudn't be sure as to how to add the tree functionality to it.
[15:07:41] Velizar: tubbo: so it's a better idea to first finish my product, and then refactor into engines, rather than start with partway-done engines on a partway-done product?
[15:07:52] walidvb: obviously i could rewrite it, but i'd assume someone's done it already ;)
[15:08:41] tubbo: Velizar: absolutely. this will also teach you how to decouple things properly. your gems will probably be inter-dependent and hard to use at first, and then you'll figure out better ways of organizing your code so that doesn't occur in the future.
[15:09:35] smathy: walidvb, https://www.ruby-toolbox.com/categories/Active_Record_Nesting
[15:10:15] walidvb: smathy: i saw that, but how could i integrate it with acts_as_taggable_on
[15:10:33] gfvcastro: has joined #RubyOnRails
[15:10:52] smathy: None of them would integrate, they serve totally different purposes.
[15:10:56] badoo: has joined #RubyOnRails
[15:12:01] DoubleMalt: has joined #RubyOnRails
[15:14:08] lukec: has joined #RubyOnRails
[15:14:38] triptec: has joined #RubyOnRails
[15:15:44] ss_much: has joined #RubyOnRails
[15:15:57] gingray_: has joined #RubyOnRails
[15:16:55] walidvb: smathy: so your suggestion would be use a hierarchy gem, and implement tagging myself, correct?
[15:17:36] walidvb: totally an option, though slightly frustrating, coming from drupal that has tree_taxonomy out of the box (but it's drupal :D)
[15:17:41] B1n4r10: has joined #RubyOnRails
[15:17:48] tubbo: walidvb: the hierarchy and tags shouldn't really have anything to do it.
[15:18:03] walidvb: tubbo: what do you mean?
[15:18:45] hahuang61: has joined #RubyOnRails
[15:18:46] Riva: has joined #RubyOnRails
[15:18:54] jowiar: has joined #RubyOnRails
[15:19:19] fox_mulder_cp: can some body help me with delayed_job - it create two jobs when i try create one for my object. code here https://gist.github.com/foxmuldercp/1d0fd78d533667ccf4b69fc6a7cdc61a
[15:19:21] tubbo: walidvb: sorry that was a poorly-constructed sentence, let me rephrase :D...if you need tree-based taxonomy, tagging may not be the correct solution. instead, you might want to look for a gem that implements a tree structure.
[15:19:43] disgrntld: has joined #RubyOnRails
[15:19:53] walidvb: and create a Tag model that would include that tree structure func
[15:20:03] tubbo: walidvb: since we're on mongo, we use https://github.com/benedikt/mongoid-tree to implement that tree structure for navigation links.
[15:21:18] mauricar: has joined #RubyOnRails
[15:21:50] Riva: I'm attempting to learn RoR by building some small applications. Right now I'm trying to figure out permissions/roles. I'm used to just pulling roles from a DB in php, however struggling trying to get stuff working for ror. I found this post for cancancan and tried to recreate it (https://www.reddit.com/r/rails/comments/3cbjri/best_way_to_structure_app_with_multiple_user/csvc5mi) however, as soon as I check for it in the view, I
[15:22:08] smathy: walidvb, tagging is tagging, freeform, no hierarchy, etc. Taxonomy/categorization/tree structures are totally different. If you want taxonomy use a tree gem (not a tagging gem).
[15:22:25] yardenbar: has joined #RubyOnRails
[15:23:58] kgrz: has joined #RubyOnRails
[15:24:11] walidvb: apols, i did mean taxonomy, rather than 'tag'. (prob got confused by drupal which kind of mixes them, imo)
[15:24:31] chopin: has joined #RubyOnRails
[15:25:46] davidw: has joined #RubyOnRails
[15:25:57] fox_mulder_cp: by my logger i see that 2 enqueue CreateContainerJob started with different id's
[15:26:22] diegoaguilar: has joined #RubyOnRails
[15:26:54] smathy: fox_mulder_cp, !gist-usage - you should know better by now.
[15:26:54] helpa: fox_mulder_cp: How to use Gist properly: https://github.com/radar/guides/blob/master/using-gist.markdown
[15:27:28] badoo: has joined #RubyOnRails
[15:29:27] fox_mulder_cp: smathy: u about colorizing of code? i do it, thanks
[15:30:25] tubbo: why wouldn't you syntax-highlight?
[15:30:28] smathy: fox_mulder_cp, and separate files, just organize it man.
[15:31:03] fox_mulder_cp: smathy: 'pastebin'-way is bad, i know it ^(
[15:33:20] tubbo: fox_mulder_cp: the first thing i would do to debug this is log in your model's create_container method, like `Rails.logger.info "create_container has been called"`. then, check your logs to see how many times that message appears.
[15:33:24] tubbo: it should only appear once.
[15:33:36] tubbo: if it appears multiple times, your method is getting called multiple times, and that's the bug.
[15:33:43] tubbo: otherwise it may be something deeper
[15:34:03] Cohedrin: has joined #RubyOnRails
[15:34:27] njero: has left #RubyOnRails: ("Oops! connection lost.")
[15:34:50] njero: has joined #RubyOnRails
[15:35:46] zyzioziom: has joined #RubyOnRails
[15:36:49] Malgorath: Is there a way to add params to a url on a redirect_to like you can with link_to? link_to 'New Todolist', new_todolist_path(@todolist, :project_id => @project.id)
[15:37:12] gfvcastro: has joined #RubyOnRails
[15:37:30] tubbo: Malgorath: i think you'd have to pass the params that you get explicitly when you redirect_to
[15:37:44] tubbo: like redirect_to actual_path(something: params[:something])
[15:38:06] maxz: has joined #RubyOnRails
[15:38:44] Malgorath: tubbo: I guess, I was just hoping to make it more DRY or restful method
[15:38:48] neha-: has joined #RubyOnRails
[15:39:04] fox_mulder_cp: tubbo: i update my gist with radar' guides my colorizing code and text log https://gist.github.com/foxmuldercp/1d0fd78d533667ccf4b69fc6a7cdc61a
[15:39:10] Riva: I'm attempting to learn RoR by building some small applications. Right now I'm trying to figure out permissions/roles. I'm used to just pulling roles from a DB in php, however struggling trying to get stuff working for ror. I found this post for cancancan and tried to recreate it (https://www.reddit.com/r/rails/comments/3cbjri/best_way_to_structure_app_with_multiple_user/csvc5mi) however, as soon as I check for it in the view, I
[15:39:11] smathy: def my_redirect; ...
[15:39:23] Riva: user.role , anyone have any experience with permissions that could help me out?
[15:39:34] tubbo: Riva: your message didn't complete. split it into two.
[15:39:42] fox_mulder_cp: Riva: what gem u use for roles? pundit?
[15:39:42] tubbo: thought you were gonna continue after the "I"
[15:39:54] tubbo: i ignore messages that require obvious questions
[15:39:56] neha-: hey, what's the term for when i want to store like the posts_count of a user in the user object (for caching, speed)
[15:40:09] neha-: by user object i mean the user table
[15:40:22] macsteps: has joined #RubyOnRails
[15:40:22] Ch4rAss: has joined #RubyOnRails
[15:40:22] spectra: has joined #RubyOnRails
[15:40:22] nekomune: has joined #RubyOnRails
[15:40:22] rbr: has joined #RubyOnRails
[15:40:22] algernop_k: has joined #RubyOnRails
[15:40:22] martinbjeldbak: has joined #RubyOnRails
[15:40:23] djgraham|calypso: has joined #RubyOnRails
[15:40:23] proboszc1: has joined #RubyOnRails
[15:40:23] ereslibre_laptop: has joined #RubyOnRails
[15:40:23] webdestroya: has joined #RubyOnRails
[15:40:23] jpterry: has joined #RubyOnRails
[15:40:23] csmb: has joined #RubyOnRails
[15:40:23] DigitalDarwin: has joined #RubyOnRails
[15:40:23] hadronzoo: has joined #RubyOnRails
[15:40:23] neha-: not in memory, but to persist that data in the db
[15:40:42] Riva: Fox: cancancan
[15:40:52] smathy: Riva, the first part of your message ends at "check for it in the view," and your second message doesn't (seem to) continue from there. It's not clear what your issue is.
[15:41:04] fox_mulder_cp: neha-: u may cache it in redis, memcached, time? oh, if your app is twiiter- style for many microposts - interval may be loong
[15:41:22] smathy: neha-, counter cache
[15:41:35] neha-: is that persisting it in the regular db smathy?
[15:41:51] Riva: Smathy, I'm trying to follow this guys advice https://www.reddit.com/r/rails/comments/3cbjri/best_way_to_structure_app_with_multiple_user/csvc5mi using cancancan
[15:41:54] User458764: has joined #RubyOnRails
[15:42:09] tubbo: fox_mulder_cp: great. why did you feel the need to add your own logger calls btw? ActiveJob handles that for you, at least it does for me...but YMMV because I use Sidekiq.
[15:42:25] neha-: counter cache looks good smathy thanks
[15:42:49] Riva: Being new to RoR im just trying to create a basic app with permissions, but having a hard time figuring it out. my user model has the role column
[15:42:55] smathy: neha-, you're welcome.
[15:43:10] tubbo: Riva: however, as soon as I check for it in the view, I...
[15:43:13] smathy: Riva, yes, I saw your post, now (re)read mine and explain your issue.
[15:43:24] moeabdol: has joined #RubyOnRails
[15:43:25] tubbo: i'm just gonna start giving advice in here without reading people's messages at all
[15:43:46] tubbo: neha-: when you cache make sure to use rack-cache. also linoleum counter tops are shit go with granite.
[15:43:47] Riva: but when I add <% if can? :manage, posts %> to the view, i get method returns nil
[15:44:04] neha-: haha, i was like...wha??
[15:44:18] Devalo: has joined #RubyOnRails
[15:44:33] Riva: and it points to the line that says case user.role
[15:44:52] smathy: Riva, what's the actual error you're getting, copy and paste the line.
[15:45:00] dgynn: has joined #RubyOnRails
[15:45:01] smathy: Riva, or make a gist.
[15:45:06] fox_mulder_cp: tubbo: hm, Sidekiq.. delayed_jobs seems very easy to use for me, so i try it, but i can't find about 'locking' jobs when it start to execution. AR create one record in database for this model, but why delayed_job start two task syncronously?
[15:45:37] py4_: has joined #RubyOnRails
[15:45:54] centrx: has joined #RubyOnRails
[15:45:54] atrius: has joined #RubyOnRails
[15:45:54] Craigimus: has joined #RubyOnRails
[15:45:54] umdstu: has joined #RubyOnRails
[15:45:54] myntcake: has joined #RubyOnRails
[15:45:55] habitullence: has joined #RubyOnRails
[15:45:55] eyck: has joined #RubyOnRails
[15:45:55] GarethAdams: has joined #RubyOnRails
[15:45:55] DanKnox_: has joined #RubyOnRails
[15:45:55] rafaelfranca: has joined #RubyOnRails
[15:45:55] nertzy: has joined #RubyOnRails
[15:45:55] mozzarella: has joined #RubyOnRails
[15:45:55] Zackio: has joined #RubyOnRails
[15:45:55] patrick_star_3: has joined #RubyOnRails
[15:45:55] triangles2: has joined #RubyOnRails
[15:45:55] fcser_: has joined #RubyOnRails
[15:45:55] malcolmva: has joined #RubyOnRails
[15:46:02] AzaToth: has joined #RubyOnRails
[15:46:03] Riva: https://gist.github.com/rivacom/a9060b95b7f5ddcf53723a0bbf739fa7
[15:46:25] tubbo: fox_mulder_cp: because something in your code, somewhere, is causing the job to run twice. i would argue that overriding methods coming from ActiveJob might be the culprit? that's a really bad practice no matter what you're doing.
[15:46:28] sevenseacat: you likely don't have a user logged in
[15:46:52] smathy: Riva, right, so your error is: "undefined method `role' for nil:NilClass" which is coming from the line `user.role` - so what does that tell you?
[15:47:02] tubbo: fox_mulder_cp: http://guides.rubyonrails.org/active_job_basics.html#callbacks has all the info you need to run code around the perform method. if you override those methods improperly, which it seems you are doing, then you might encounter weird errors like this one.
[15:47:08] frem_: has joined #RubyOnRails
[15:47:09] epochwolf: smathy: OH! OH! role is nil.
[15:47:40] smathy: :eyeroll:
[15:47:56] [Butch]: has joined #RubyOnRails
[15:48:02] AntiSpamMeta: has joined #RubyOnRails
[15:48:23] tubbo: fox_mulder_cp: are you using ActiveJob or just delayed_job directly? sorry i should've asked that.
[15:48:47] crystal77: has joined #RubyOnRails
[15:50:54] Riva: smathy, forgive my newness for rails/mvc but isn't user.role referencing my user model(user table) with role being the column>
[15:50:57] fox_mulder_cp: tubbo: class CreateContainerJob < < ActiveJob::Base, hm. may be use it as class CreateContainerJob < Delayed::Job?
[15:51:34] smathy: Riva, one step at a time. The code `user.role` is causing the error "undefined method `role' for nil:NilClass" - so what does that tell you?
[15:52:14] tubbo: fox_mulder_cp: sorta depends on what the base class of ApplicationJob is.
[15:53:05] fox_mulder_cp: tubbo: it's a default ApplicationJob < ActiveJob::Base class
[15:53:36] UAS91_: has joined #RubyOnRails
[15:53:43] javierbuilder: has joined #RubyOnRails
[15:54:06] tubbo: fox_mulder_cp: ok, so you're using ActiveJob. in that case, i'd follow the docs for ActiveJob and mostly disregard those for Delayed::Job unless you need something that AJ can't provide.
[15:54:41] Riva: Smathy, I would assume it's returning nothing
[15:54:43] fox_mulder_cp: tubbo: but when i try CreateContainerJob << Delayed::Job - app falis to start because enqueue_as indefined
[15:55:07] UAS91_: I have a conditional and I'm struggling with making it, part link & part regular text. How do I add a normal string at the end of my link? link_to("text", path(user))
[15:55:17] Coldblackice_: has joined #RubyOnRails
[15:55:24] UAS91_: If I put the string on the next line, it'll only show the string and not the link_to, if I put it on the same line it won't work
[15:55:26] tubbo: fox_mulder_cp: sure, because you changed the framework you were working in
[15:55:29] alfie_max15: UAS91_, example??
[15:55:46] tubbo: fox_mulder_cp: you just switched CreateContainerJob to be a basic Delayed::Job. that's probably not what you want.
[15:55:55] smathy: Riva, I'm sorry, I can't help you.
[15:56:08] UAS91_: that was the example
[15:56:17] tubbo: fox_mulder_cp: instead of that, why not refactor CreateContainerJob to use ActiveJob's API instead of Delayed::Job's?
[15:56:21] UAS91_: if x.empty?
[15:56:23] UAS91_: link_to("text", path(user))
[15:56:26] UAS91_: "to do X"
[15:56:43] UAS91_: I want text to be a link, and "to do X" to be a normal string
[15:56:43] tubbo: UAS91_: are you using haml or is this in a helper?
[15:56:56] UAS91_: it's in a normal ruby file, I'm using activeadmin
[15:57:07] tubbo: anyway i think concat will work
[15:57:12] tubbo: concat link_to(...), 'to do X'
[15:57:22] fox_mulder_cp: tubbo: this api uses delayed::job as backend when i use it in initializer, yes?
[15:57:35] smathy: ...or just +
[15:58:03] tubbo: fox_mulder_cp: rephrase
[15:59:38] fox_mulder_cp: tubbo: u say, that i'm must switch from D::J api to default AJ api, but i'm interest - AJ api uses DJ api as backend, when i configure my app to use Delayed::Job as backend for long tasks execution, yes?
[16:00:12] tubbo: fox_mulder_cp: correct. please read more about active job on the rails guides, it will tell you far more than i know abou tit.
[16:00:28] idefine: has joined #RubyOnRails
[16:00:38] norc: has joined #RubyOnRails
[16:02:32] yopp: has joined #RubyOnRails
[16:03:21] cabinB: has joined #RubyOnRails
[16:06:17] centrx: has joined #RubyOnRails
[16:06:17] atrius: has joined #RubyOnRails
[16:06:17] Craigimus: has joined #RubyOnRails
[16:06:17] umdstu: has joined #RubyOnRails
[16:06:17] myntcake: has joined #RubyOnRails
[16:06:17] habitullence: has joined #RubyOnRails
[16:06:17] eyck: has joined #RubyOnRails
[16:06:17] GarethAdams: has joined #RubyOnRails
[16:06:17] DanKnox_: has joined #RubyOnRails
[16:06:17] rafaelfranca: has joined #RubyOnRails
[16:06:17] nertzy: has joined #RubyOnRails
[16:06:17] mozzarella: has joined #RubyOnRails
[16:06:17] Zackio: has joined #RubyOnRails
[16:06:17] patrick_star_3: has joined #RubyOnRails
[16:06:17] triangles2: has joined #RubyOnRails
[16:06:17] fcser_: has joined #RubyOnRails
[16:06:17] malcolmva: has joined #RubyOnRails
[16:06:45] moeabdol: has joined #RubyOnRails
[16:07:07] dionysus69: has joined #RubyOnRails
[16:09:06] jmignault: has joined #RubyOnRails
[16:10:18] jmignault: has joined #RubyOnRails
[16:10:31] ksmutthu: has joined #RubyOnRails
[16:12:29] andywww: has joined #RubyOnRails
[16:13:03] allcentury: has joined #RubyOnRails
[16:14:07] andywww: is it possible to select an aggregate function in active record without resorting to .select()?
[16:14:11] andywww: https://gist.github.com/anonymous/4c00b67c0f70b655328b9776e7bb10a8
[16:14:36] andywww: its screwing up a merge later because the model object is coming back different
[16:14:52] rubyonrailed: has joined #RubyOnRails
[16:15:18] fox_mulder_cp: tubbo: hmm. seems work, but when i want extend my default AJ by delayed::job callbacks, which more costomizable?
[16:15:36] artto: has joined #RubyOnRails
[16:17:49] fox_mulder_cp: tubbo: and seems that two tasks created
[16:18:19] rogue_koder: has joined #RubyOnRails
[16:18:30] fox_mulder_cp: after log clear, delayed::job.destroy_all and my model.destroy_all
[16:18:41] brendan-: has joined #RubyOnRails
[16:19:43] srinidhi: has joined #RubyOnRails
[16:20:04] umdstu: is it possible to write a scope that excludes any records who’s associated model list is empty?
[16:21:32] tbuehlmann: umdstu: are you looking for a simple (inner) join?
[16:21:38] fox_mulder_cp: umdstu: hmhm... may be includes help u? as example Mastermodel.includes(:submodel).where(submodel.count = 0) ?
[16:22:05] gingray: has joined #RubyOnRails
[16:22:09] zpe: has joined #RubyOnRails
[16:23:00] umdstu: well, i kind of do the join afterwards, @relation.to_json(include: {children: {only: [:name]}})
[16:23:18] umdstu: i guess I would do the includes before hand and just pass that?
[16:24:20] tbuehlmann: if you only want records with children, you'd go with @relation.joins(:children)
[16:25:18] umdstu: yea seems right
[16:25:27] umdstu: now to limit to name
[16:26:29] smathy: ...and you can put that in a scope.
[16:26:40] umdstu: right, got it
[16:26:42] umdstu: thanks guys
[16:26:48] benlieb: has joined #RubyOnRails
[16:29:33] armyriad: has joined #RubyOnRails
[16:31:18] idefine: has joined #RubyOnRails
[16:31:22] startupality: has joined #RubyOnRails
[16:32:11] agent_white: has joined #RubyOnRails
[16:33:54] B1n4r10: has joined #RubyOnRails
[16:34:11] norc: umdstu, pray you dont have big tables because it will trash performance on any serious table sizes like that.
[16:35:03] norc: umdstu, on second thought ignore what I just said.
[16:35:05] norc: I need to get some sleep.
[16:35:16] umdstu: norc: lol, gnight
[16:35:39] umdstu: (no they aren’t big tables btw!)
[16:35:41] tildes_: has joined #RubyOnRails
[16:39:24] User458764: has joined #RubyOnRails
[16:41:14] lictor36: has joined #RubyOnRails
[16:43:18] startupality: has joined #RubyOnRails
[16:44:47] artto: has joined #RubyOnRails
[16:46:06] clandry94: has joined #RubyOnRails
[16:47:16] matthias_: has joined #RubyOnRails
[16:47:57] shinnya: has joined #RubyOnRails
[16:49:24] barajasfab: has joined #RubyOnRails
[16:51:21] startupality: has joined #RubyOnRails
[16:52:31] Ebok: has joined #RubyOnRails
[16:55:35] srinidhi: has joined #RubyOnRails
[16:56:16] conta: has joined #RubyOnRails
[16:56:47] ql6wlld: has joined #RubyOnRails
[16:58:07] artto: has joined #RubyOnRails
[17:00:50] aegis3121: has joined #RubyOnRails
[17:01:45] hahuang61: has joined #RubyOnRails
[17:03:33] startupality: has joined #RubyOnRails
[17:04:42] Circuit8: has joined #RubyOnRails
[17:06:06] qejk: has joined #RubyOnRails
[17:06:44] srinidhi1: has joined #RubyOnRails
[17:07:10] refinerysource: has joined #RubyOnRails
[17:07:44] qsun_: has joined #RubyOnRails
[17:08:50] MachbooSS: has joined #RubyOnRails
[17:10:27] MachbooSS: i am new to ruby on rails and have been working on an app... but suddenly in development environment now my app is all screwed up..
[17:11:23] MachbooSS: i installed inkscape which installed Xquartz.. and now when i launch the local server all my partials more stuff just not showing up on the page.. its like the app is not finding the files in the folder
[17:11:49] MachbooSS: does anyone know what the problem is.. i have been trying to solve this for few days and cant seem to find a solution by googling it
[17:12:15] epochwolf: I'm trying to deploy my application and rake airbrake:deploy is failing, how do I see why it's failing?
[17:12:40] yellow5: has joined #RubyOnRails
[17:13:12] epochwolf: Using capistrano 2.15.5
[17:14:47] tvw: has joined #RubyOnRails
[17:15:24] startupality_: has joined #RubyOnRails
[17:17:24] asheinfeld: has joined #RubyOnRails
[17:19:06] datanoise: has joined #RubyOnRails
[17:20:27] mikecmpbll: has joined #RubyOnRails
[17:20:37] RegulationD: has joined #RubyOnRails
[17:20:45] srinidhi: has joined #RubyOnRails
[17:20:49] sneakersec: has joined #RubyOnRails
[17:21:17] walidvb: 2nd app i have using s3 and paperclip, where the original file uploaded is 0 bytes... Have now just noticed as i added delayed_paperclip to postpone the image processing
[17:21:55] DoctorMonocular: has joined #RubyOnRails
[17:22:24] DragonPunch: has joined #RubyOnRails
[17:23:29] walidvb: has anyone encountered that before?? i'm super confused about it
[17:26:18] Cohedrin: has joined #RubyOnRails
[17:27:24] B1n4r10: has joined #RubyOnRails
[17:29:42] gingray: has joined #RubyOnRails
[17:29:45] sypheren: has joined #RubyOnRails
[17:29:54] walidvb: this is the output i get, i can't see anything wrong there... https://gist.github.com/walidvb/b03109a6a8a80d4b104ac7eda3bb522f
[17:30:21] walidvb: except that the resize is 0, which is to be expected if the original is 0 bytes..
[17:30:42] Ebok: I saw something like that last week, the process of saving the file hadn't completed before they moved on.
[17:31:23] hahuang65: has joined #RubyOnRails
[17:31:25] Ebok: Although that was Javascript
[17:32:21] walidvb: Ebok: i have this on another app, too, and i could never debug it. except there i don't delay processing, so it's not a problem
[17:32:30] walidvb: it's kind of driving me nuts.
[17:33:12] MachbooSS: has anyone here installed Xquartz and their app suddenly stop working properly?
[17:33:55] MachbooSS: my browser suddenly cant seem to find files and partials. says ActionView::MissingTemplate in something#new for everything
[17:34:21] flopsec: has joined #RubyOnRails
[17:34:28] tubbo: MachbooSS: !gist your routes file
[17:34:28] helpa: MachbooSS: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[17:34:34] lalalaaa: has joined #RubyOnRails
[17:34:49] dblessing: has joined #RubyOnRails
[17:35:52] lictor36: has joined #RubyOnRails
[17:35:58] Ebok: walidvb, I have a couple of questions here. I dont think I know enough to parse just the error report. What code stack are you using? Also how are you saving the file? And did you say if you've successfully used paperclip before?
[17:36:16] edwinvdgraaf: has joined #RubyOnRails
[17:36:25] walidvb: code stack?
[17:36:49] Ebok: Uh, the coding langages you used .
[17:36:51] walidvb: i'm using Rails 4.2, paperclip 4.3.6
[17:36:55] tubbo: Ebok: i bet he's using ruby
[17:36:56] tubbo: OH LOOK IM RIGHT
[17:36:58] walidvb: ruby, rails
[17:37:22] Ebok: I almost always get neck deep into react/redux/javascript
[17:37:26] Ebok: On top of rails
[17:37:40] walidvb: nah, this is simple rails+paperclip+s3 issue.
[17:37:45] Ebok: Alright.
[17:37:49] tubbo: yo dawg i heard u like frameworks
[17:38:20] Ebok: Hey there could be other complications in the other frameworks, I just wanted to make sure.
[17:38:32] walidvb: i'm surprised i find nothing on it online though.. am i the only getting this?
[17:38:34] tubbo: walidvb: did you intentionally upload a 0byte file?
[17:38:40] walidvb: plus, the other, i did not set up myself
[17:38:44] walidvb: tubbo: ... :D no
[17:38:50] walidvb: they're regular images
[17:38:55] tubbo: yeah that's what i figured :)
[17:39:02] tubbo: some people are just really into breaking their apps haha
[17:39:06] Ebok: It is odd. I've used paperclip a few times in the last months and hadnt run into this myself.
[17:39:24] MachbooSS: do you mean i need to adjust my routes?
[17:39:36] walidvb: it's only with s3
[17:40:24] tubbo: MachbooSS: did you not understand what "gist" means? it means that you should post your config/routes.rb to gist.github.com.
[17:40:59] tubbo: walidvb: can you verify that params[:partner][:pictures_attributes][0][:file] is more than 0 bytes in length?
[17:41:03] tubbo: (in your controller)
[17:41:22] walidvb: i'll do so in my model, i'm going via rails_admin
[17:41:58] tubbo: walidvb: my plan of attack here is "process of elimination". when debugging, just keep ruling things out until you get the SPECIFIC problem identified.
[17:42:01] MachbooSS: ah ok.. the startup i am working for isnt too keen on that hehe.. :(
[17:42:12] tubbo: MachbooSS: have fun with your problem :)
[17:42:17] MachbooSS: thanks anyways
[17:42:17] tubbo: no one here is going to help you
[17:42:23] walidvb: agree, but ultimately it's the model that saves it no?
[17:42:40] tubbo: walidvb: by the time you're in the model, the params have been abstracted away to only the hash of attrs that are needed
[17:42:41] walidvb: damn MachbooSS sry to here that
[17:43:13] walidvb: tubbo: let me fire up the app locally in prod then.
[17:43:18] JoshGlzBrk: has joined #RubyOnRails
[17:43:20] MachbooSS: this Inkscape completly screwed up my app.. production works fine by in dev env its all over the place
[17:44:19] rubyonrailed: has joined #RubyOnRails
[17:44:25] MachbooSS: its weird.. i think i installed inkscape with the xquartz server not that server isnt finding the files.. in removed xquartz but still problem is the same.. i think i need to adjust terminal to use the default server before xquatz. anyone know whats it called?
[17:45:06] walidvb: tubbo: agree, however is it not the model that sends the file to s3? I could File.read then no?
[17:45:46] walidvb: damn, need to relocate soon
[17:45:59] JoshGlzBrk: has joined #RubyOnRails
[17:46:10] norc: has joined #RubyOnRails
[17:46:58] Ebok: Mach, just use git to find you
[17:47:12] alaing: has joined #RubyOnRails
[17:47:16] Ebok: You can look at the project pre and post XQuartz
[17:48:02] bronson: has joined #RubyOnRails
[17:48:08] Ebok: Walidvb, the model sends and receives the data to and from the database yeah, through ActiveRecord.
[17:48:16] alaing: Hi, is there a way to only validate a record for a specific controllers action?
[17:48:20] MachbooSS: i tried... nothing is changed
[17:48:36] Ebok: Then uh... nothing changed.
[17:48:38] MachbooSS: i dont even have any commit to make
[17:48:40] alaing: has joined #RubyOnRails
[17:48:50] alaing: Hi, is there a way to only validate a record for a specific controllers action?
[17:48:54] MachbooSS: i think its an insue in my terminal or server its using
[17:49:09] Ebok: I don't know alaing, but that would be useful.
[17:49:44] zel: has joined #RubyOnRails
[17:50:09] asheinfeld: has joined #RubyOnRails
[17:50:18] Ebok: MachbooSS, the only suggestion I can give you, since you cannot show us code, is to look through your git history for a time when it wasnt broken in dev. Launch that, make sure it wasnt broken, then git diff the differences and look into those places specifically.
[17:50:30] seaworthy: has joined #RubyOnRails
[17:50:30] seaworthy: has joined #RubyOnRails
[17:52:51] MachbooSS: ebok, thanks.. I'll follow that and see whats going on.. thanks again!
[17:53:18] edwinvdg_: has joined #RubyOnRails
[17:54:43] walidvb: so... locally it works
[17:54:46] tubbo: MachbooSS: oh if it
[17:54:58] tubbo: it's just dev workstation issues, i bet Inkscape just compiled some kind of newer binary
[17:55:11] tubbo: also your problem makes no sense
[17:55:27] adre: has joined #RubyOnRails
[17:56:13] Ebok: Hey alidvb, are you sure you've got s3 setup right?
[17:56:45] Ebok: I dont know what happens if you make a query for something that isnt there, but getting back a 0byte null seems halfway reasonable.
[17:57:12] Ebok: walidvb*
[17:57:26] edwinvdgraaf: has joined #RubyOnRails
[17:57:59] walidvb: hm. not sure what you mean exactly?
[17:58:13] User458764: has joined #RubyOnRails
[17:58:38] startupality: has joined #RubyOnRails
[17:58:55] SteenJobs: has joined #RubyOnRails
[17:58:58] tubbo: you get an error when you query for something that isn't there
[17:59:05] GodFather_: has joined #RubyOnRails
[17:59:09] Ebok: That answers that.
[17:59:18] Ebok: I havent ever tried that so I wasnt sure.
[17:59:24] draig: has joined #RubyOnRails
[18:00:55] asheinfeld: has joined #RubyOnRails
[18:01:48] macsteps: has joined #RubyOnRails
[18:01:54] diegoviola: has joined #RubyOnRails
[18:02:01] walidvb: it is there, it's just 0 bytes
[18:02:20] tubbo: your 3-step process should be:
[18:02:25] walidvb: it seems that it is that delayed_paperclip that breaks it.
[18:02:29] tubbo: 1.) verify the params is giving you a file more than 0 bytes
[18:02:42] tubbo: 2.) once that's verified, ensure that S3 is getting the file from the correct location
[18:02:51] tubbo: actually that's #3
[18:02:57] tubbo: #2 is to make sure the file saves on the model correctly.
[18:03:12] tubbo: until you follow those 3 steps, you're just wasting your time and mine as well
[18:03:23] nanothief: has joined #RubyOnRails
[18:03:42] diegoaguilar: has joined #RubyOnRails
[18:03:42] walidvb: actually, come to think of it, at some point i had a feeling that s3 would return a 403 to heroku, and that paperclip/File would still read from it
[18:04:10] walidvb: yes tubbo, i get that. i'll try all that
[18:04:36] walidvb: need to relocate
[18:05:39] mwlang: has joined #RubyOnRails
[18:06:40] triptec: has joined #RubyOnRails
[18:07:32] walidvb: thx for your help, i'll let you know my findings!
[18:08:40] mwlang: I’m trying to offload some business logic from controller into smaller service classes. When I write specs within context of controller spec, I can pass in a session and manipulate it as expected by calling a controller’s action => “get “login”, {}, {}” for example. However, when I try to focus on unit testing the service object (i.e. not a controller spec), the session is “just a hash” and it behaves totally different
[18:08:41] mwlang: far as setting and clearing session keys go within the service object.
[18:09:25] mwlang: so question is: how can I instantiate/mock a session instance and pass it into my service class without the whole controller dressing.
[18:10:27] tubbo: mwlang: why would passing in a hash be any different from passing in a session?
[18:10:49] MachbooSS: Ebok: thank you... using git solved it. I think it was Mac folder problem. files existed there but Terminal was not reaching them for some reason. I commit the changes to a new branch and deleted it..
[18:10:53] MachbooSS: its working fine now
[18:11:02] mwlang: tubbo: I think because session is not *really* a Hash for controller — I think it’s a Singleton pattern class.
[18:11:03] MachbooSS: thanks for helping out a newb :D
[18:11:10] tubbo: mwlang: !try
[18:11:10] helpa: mwlang: Why don't you try it and find out for yourself?
[18:11:28] mwlang: tubbo: try to find out what?
[18:12:05] DoctorMonocular: has joined #RubyOnRails
[18:12:12] smathy: has joined #RubyOnRails
[18:12:20] nertzy2: has joined #RubyOnRails
[18:12:30] triangles3: has joined #RubyOnRails
[18:12:38] Craigimus: has joined #RubyOnRails
[18:13:23] tubbo: mwlang: find out whether passing a hash into your service object is good enough.
[18:13:25] mozzarel1: has joined #RubyOnRails
[18:13:34] supernov_a: has joined #RubyOnRails
[18:13:51] mwlang: tubbo: I already know it’s not good enough. :-o It’s not behaving the same in the unit tests vs. controller tests
[18:14:00] umdstu_: has joined #RubyOnRails
[18:14:17] mwlang: and sessions are, as I suspected, more than just a Hash: tubb
[18:14:24] mwlang: oops. http://www.rubydoc.info/docs/rails/4.1.7/ActionDispatch/Request/Session
[18:14:32] centrx_: has joined #RubyOnRails
[18:14:40] RedDwarf: has joined #RubyOnRails
[18:14:46] tubbo: of course they are
[18:14:54] rafaelfr_: has joined #RubyOnRails
[18:15:01] tubbo: but that doesn't mean they can't be used the same way
[18:15:05] habitullence_: has joined #RubyOnRails
[18:16:07] tubbo: mwlang: in short, you shouldn't instantiate and pass a mock session instance into your service class, because your service object shouldn't be coupled to the controller implementation.
[18:16:23] tubbo: if you need methods on the controller to do your job, why not just do what you're doing in the controller :)
[18:16:28] roamingdog: has joined #RubyOnRails
[18:16:40] norc_: has joined #RubyOnRails
[18:16:43] mwlang: tubbo: well, basically, I can’t test outside the service class the following (expect(session.has_key?(“user_id”)).to be true
[18:16:47] eyck: has joined #RubyOnRails
[18:16:53] tubbo: mwlang: why not?
[18:17:03] patrick_star_3: has joined #RubyOnRails
[18:19:16] benlieb: is there a recommend practice for customizing as_json output? I want certain values to be obfuscated for example: XXXX123
[18:19:30] mwlang: tubbo: I’m using the service class to manage what keys are set or cleared in the session, so in that sense, I’m coupling to the controller. However, I don’t want to do unit testing of the service class in the controller specs because the service class is going to be used in several controllers.
[18:19:54] FCser: has joined #RubyOnRails
[18:19:55] mwlang: I want to couple service class to the session, though, because that’s the responsibility being given to the service lass.
[18:20:07] mwlang: ugh..my typing sucks today….”service class”*
[18:20:47] zpe: has joined #RubyOnRails
[18:21:45] tubbo: > I can’t test outside the service class the following (expect(session.has_key?(“user_id”)).to be true
[18:21:50] tubbo: mwlang: tubbo | mwlang: why not?
[18:22:08] tubbo: like why can't you do service_class.session.has_key?('user_id')
[18:22:09] tvw: has joined #RubyOnRails
[18:24:08] yfeldblum: has joined #RubyOnRails
[18:24:24] mwlang: tubbo, I can do that on the service class itself.
[18:24:29] jstransky: has joined #RubyOnRails
[18:25:24] mwlang: maybe I’m just being stubburn about wanting to work with a real session object from ActionDispatch instead of Hash.
[18:25:32] smathy: benlieb, just override the as_json method, call super, munge and return.
[18:26:00] benlieb: smathy: that was my first thought, but then I thought maybe serializers are a better bet?
[18:26:06] benlieb: smathy: what do you think?
[18:26:27] benlieb: I wasn't sure if serializers work with as_json or just render json
[18:26:39] benlieb: I'm setting up now to see
[18:26:42] mwlang: I just know behavior of setting a session key on a Hash passed in is different than behavior of setting a session key on a ActionDispatch::Request::Session passed in.
[18:27:28] mwlang: and that bothers me in a test scenario where I wonder if the tests I just wrote really are durable tests.
[18:29:10] xibalba: has joined #RubyOnRails
[18:29:14] tubbo: mwlang: yes, but in a unit test all of that information is irrelevant. if you're testing the interaction between units in your app, congratulations you just wrote an integration test.
[18:30:00] tubbo: the fact remains that the public API of session is the same as the public API for Hash, at least what you're using out of it, so i don't see why it matters.
[18:30:12] mikecmpbll: has joined #RubyOnRails
[18:30:20] smathy: benlieb, you mean options other than AM::Serialization?
[18:31:44] mwlang: tubbo: you’re winning the argument — I think I’m just being stubburn about it. The idea in my head is that the service object comes into being, tweaks the session then goes away…so I wanted to expect(session.has_key?…) that is, I got the desired side-effect.
[18:33:20] mwlang: but in the unit test, I’m solely concerned about what’s inside the service object, so yes, I think you’ve made your excellent point unit vs. integration.
[18:35:24] zpe_: has joined #RubyOnRails
[18:35:27] walidvb: has joined #RubyOnRails
[18:35:42] Pazician: has joined #RubyOnRails
[18:36:30] walidvb: back. it really looks like it is once the delayed_paperclip gem kicks in that it doesn't read the file correctly. investigating now
[18:40:59] jmignault: has joined #RubyOnRails
[18:42:56] der-landgraf: does some nice person have any idea how to change the redis port in rails-- rake assets:precompile does not work
[18:43:35] tubbo: der-landgraf: well rake assets:precompile precompiles assets, it has no bearing on the redis port :)
[18:43:39] tubbo: so that's your first problem
[18:43:55] rashkov: has joined #RubyOnRails
[18:45:35] qsun: has joined #RubyOnRails
[18:45:47] tubbo: der-landgraf: but yeah, changing the redis port is a matter of finding where the redis url is configured in your app
[18:45:52] rashkov: What's the most efficient way to access deeply nested associations? Let's say I have a user, User has_many :accounts, Account has_many :receipts, Receipt has_many :items. Can I do user.items without setting up a bunch of has_many through on each level of the models?
[18:45:58] njero: has joined #RubyOnRails
[18:46:12] JoshGlzBrk: has joined #RubyOnRails
[18:46:39] rashkov: Someting like map() followed by flatten would work, but would be super inefficient... that's basically the kind of syntax I'm looking for though
[18:47:02] tubbo: does User have_many :items?
[18:47:46] tubbo: rashkov: i think you'll need a JOIN here.
[18:48:26] rashkov: tubbo: As far as the data model goes, yes, but I'm wondering if I can avoid setting up the necessary has_many_through on each association, since I'm only using this once.
[18:48:49] tubbo: rashkov: yeah, by doing a join
[18:49:12] zyzioziom: has joined #RubyOnRails
[18:49:14] bronson: has joined #RubyOnRails
[18:49:21] rashkov: tubbo: I'm not super familiar with JOINs but I will look into that! Wasn't sure it was the right thing but glad to hear that it is
[18:49:29] chouhoulis: has joined #RubyOnRails
[18:49:31] tubbo: rashkov: check out http://guides.rubyonrails.org/active_record_querying.html#joining-tables to see which one (joins or includes) you need.
[18:49:38] rashkov: tubbo: thank you
[18:49:44] rashkov: checking it out
[18:50:51] Dysp: has joined #RubyOnRails
[18:51:58] Dysp: Hey. I need a generel webdesign advice. If I am to add different data, would it formatting wise, be better to use divs or tables? I know it doesn't really concern rails, but I am used to ask in here and I am using Rails :P
[18:52:00] jenrzzz: has joined #RubyOnRails
[18:53:03] chouhoul_: has joined #RubyOnRails
[18:53:04] refinerysource: Dysp: you could use either one, but if its for data specifically then you probably want to use a table, but i dont know what your data looks like
[18:53:39] walidvb: for those who were following previous discussion about paperclip and 0 bytes, i can confirm that it is post-processing the file that breaks.
[18:53:41] Dysp: Okay, I think tables are the way to go, too. Just wanted a second opinion.
[18:54:15] walidvb: also, in my past tests, i found that doing smth lik file = open(model_instance.file.url) would often return 0 bytes files.
[18:55:18] triptec: has joined #RubyOnRails
[18:56:04] startupality: has joined #RubyOnRails
[18:59:49] mwlang: hmmm…. I smell a non-ruby developer’s effort here: return result.any?{|res| res.eql?(true)}? true : false
[19:00:28] manfrin: has joined #RubyOnRails
[19:03:21] smathy: non-developer's effort
[19:03:26] macsteps: has joined #RubyOnRails
[19:03:49] tubbo: Dysp: tables are for tabular data.
[19:03:56] tubbo: not layours.
[19:04:02] manfrin: has joined #RubyOnRails
[19:04:05] refinerysource: mwlang: using the ternary at all
[19:04:49] refinerysource: well not at all
[19:05:07] refinerysource: ternary is up there with one of the most confusing things cause you have to pay such close attention to the characters
[19:05:45] tubbo: they're so common though that i feel like you just get used to it after a while
[19:05:56] stannard_: has joined #RubyOnRails
[19:06:00] mwlang: actually, the whole method is suspect: https://gist.github.com/mwlang/565da825422b517da78fa11a036bfd87
[19:06:05] tubbo: i kinda wish you could do whatever = blah if expression? else blah2 if opposite_expression?
[19:06:17] mwlang: should’ve used ipaddr for this
[19:06:21] tubbo: whatever = blah if expression? else blah2
[19:07:03] P0w3r3d: has joined #RubyOnRails
[19:08:27] Velizar: has joined #RubyOnRails
[19:10:05] walidvb: tubbo: if you're still interested, it defo seems like it's an issue with s3
[19:10:07] maxdoubt: has joined #RubyOnRails
[19:10:26] walidvb: tubbo: coffeescript style ;)
[19:10:27] maxdoubt: is there a way to specify assets that don’t get uglified?
[19:10:33] walidvb: i like ternary
[19:10:39] codezomb: has joined #RubyOnRails
[19:11:21] tubbo: maxdoubt: don't put them in the asset pipeline.
[19:11:25] tubbo: serve them from public/
[19:11:52] smathy: Ternary is great, a ternary that has `true` and `false` as its return values is stupid.
[19:11:55] SteenJobs: tubbo: were you there yesterday for the brief email frontend templating convo?
[19:12:08] mwlang: rewrite of the above validate_ip_range: https://gist.github.com/mwlang/565da825422b517da78fa11a036bfd87
[19:13:15] SteenJobs: tubbo: i think i’m on the verge of crying. and that’s even using foundation for emails
[19:13:18] SteenJobs: you guys were NOT lying
[19:13:25] maxdoubt: tubbo: that disables fingerprinting :-(
[19:14:55] crystal77: has joined #RubyOnRails
[19:15:37] tubbo: dude would cry a lot less if he internalized what we said
[19:15:40] conta: has joined #RubyOnRails
[19:15:44] DoctorMonocular: has joined #RubyOnRails
[19:15:48] tubbo: that being: DON'T USE CSS IN EMAILS.
[19:16:34] datanoise: has joined #RubyOnRails
[19:18:43] startupality: has joined #RubyOnRails
[19:19:04] elementaru: has joined #RubyOnRails
[19:19:19] P0w3r3d: has joined #RubyOnRails
[19:19:56] elementaru: hey, on average, what is the waiting time for files to appear on github after push?
[19:20:06] maxdoubt: boo https://github.com/rails/sprockets/issues/298
[19:20:34] smathy: No CSS in emails? Now I'm crying.
[19:20:44] smathy: elementaru, splits of seconds.
[19:21:02] tubbo: elementaru: immediately.
[19:21:35] elementaru: what about bitbucket if anyone's using?
[19:21:41] alfie_max15: elementaru, same
[19:21:58] elementaru: I don't get something then
[19:22:29] elementaru: anyway, thanks
[19:23:41] refinerysource: i guess i would suggest make sure the file is getting committed and sent to the right repo, check git log and make sure your commit is there and your repo is up to date with the latest git push
[19:24:25] elementaru: well the fires do appear, but it takes them long enough
[19:26:37] chouhoulis: has joined #RubyOnRails
[19:29:52] DoctorMonocular: has joined #RubyOnRails
[19:29:52] alfie_max15: elementaru, long enough?? for both github and bitbucket?
[19:29:58] jancel: has joined #RubyOnRails
[19:30:31] SteenJobs: has joined #RubyOnRails
[19:32:11] roamingdog: has joined #RubyOnRails
[19:34:06] chouhoul_: has joined #RubyOnRails
[19:34:50] chouhoul_: has joined #RubyOnRails
[19:36:53] manfrin: has joined #RubyOnRails
[19:38:35] srinidhi: has joined #RubyOnRails
[19:38:36] cabinB: has joined #RubyOnRails
[19:40:56] startupality: has joined #RubyOnRails
[19:41:57] DoctorMonocular: has joined #RubyOnRails
[19:42:18] elementaru: alfie_max15, no, I tried only bitbucket. I change some file, commit, do git push, then refresh on bitbucket, and don't see it on the list. maybe it's because I'm using c9?
[19:42:42] tubbo: could be that you're working in a branch and by default, the source view is gonna show you master branch
[19:42:54] elementaru: did it from master as well
[19:43:02] alfie_max15: could be what tubbo said
[19:43:30] alfie_max15: but in your app overview page the last activities should be listed towards the right
[19:43:41] elementaru: for example yesterday I was refreshing for 10mins, did not see the file, went to sleep, today it's there
[19:44:07] Scriptonaut: has joined #RubyOnRails
[19:44:30] elementaru: yeah I think "last updated" says the time I did the git push
[19:44:45] elementaru: I mean it appears right away
[19:45:09] Scriptonaut: Have you guys ever had delayed_jobs just stop processing jobs? I'm on heroku, using delayed_jobs gem with postgresql. My enqueued jobs and pending jobs are 91, my working jobs are 4, and my failed jobs are 0. It's been like this for 15 minutes, just slowly encueueing more jobs, but none of them are being processed
[19:45:25] Scriptonaut: I can't figure out why they stopped processing them. I restarted the dynos, still same issue
[19:45:28] tubbo: Scriptonaut: pg out of workers?
[19:45:38] tubbo: maybe the connection pool of workers are all in use and locked up with a big query
[19:45:40] Scriptonaut: postgres has workers?
[19:45:52] tubbo: how do you think it processes multiple requests simultaneously? ;)
[19:45:54] Scriptonaut: ya that could be it I suppose
[19:46:13] tubbo: also check your `pool:` setting in database.yml and make sure it aligns with heroku's recommendations.
[19:47:08] lukec: has joined #RubyOnRails
[19:47:22] Scriptonaut: Ya, mine is 5, just like heroku recommends
[19:47:25] qejk: has joined #RubyOnRails
[19:47:37] stannard: has joined #RubyOnRails
[19:47:47] Scriptonaut: tubbo: what is the solution for this? Just wait it out?
[19:47:57] Scriptonaut: now it's at 118 jobs
[19:48:06] Scriptonaut: usually the queue never gets above 5
[19:49:10] Scriptonaut: I'm only using 40/400 connections
[19:49:15] tubbo: Scriptonaut: no, it seems like something else is wrong. like jobs are just never completing.
[19:49:23] tubbo: Scriptonaut: "my working jobs are 4,", all the same job?
[19:49:38] Cohedrin: has joined #RubyOnRails
[19:50:05] emachnic: has joined #RubyOnRails
[19:50:06] Scriptonaut: tubbo: looks like it
[19:50:10] Scriptonaut: should I just remove that job?
[19:50:32] lalalaaa: has joined #RubyOnRails
[19:55:01] Cohedrin: has joined #RubyOnRails
[19:56:33] meoblast001: has joined #RubyOnRails
[19:57:05] Scriptonaut: tubbo: ok I fixed it, removing that job unclogged the whole thing and it finished the jobs in about 10 seconds
[19:57:12] Asudem: has joined #RubyOnRails
[19:58:31] |2701: has joined #RubyOnRails
[19:59:33] jenrzzz: has joined #RubyOnRails
[20:00:50] alfie_max15: elementaru, this might be the cause : http://status.bitbucket.org/incidents/m5wvxzy2yhp4
[20:01:40] diegoviola: has joined #RubyOnRails
[20:04:17] macsteps: has joined #RubyOnRails
[20:04:22] elementaru: alfie_max15, thanks, interesting. about to try git push again, will see
[20:05:08] Asudem: Does anyone have any experience installing rails with a Japanese locale?
[20:05:09] jancel: has joined #RubyOnRails
[20:05:18] axl_: has joined #RubyOnRails
[20:05:24] macsteps_: has joined #RubyOnRails
[20:05:28] tubbo: not japanese, but i've used spanish
[20:05:51] tubbo: from a technical standpoint they should work the same, though
[20:06:04] Asudem: http://ft.trillian.im/ebd28084fd3972e7a7dab2c61aae327f48519cec/6HKEVdTHeehcKp6Vb6CsPG32zcs9X.jpg Evver experience anything like this?
[20:06:13] dionysus69: I have image urls in rails db for each item, while the images themselves are with ember/assets, ember fingerprints them with names like 01-b0fd56cf734a42131b06af250be5dd12.png while my rails api holds just 01.png, how do I approach this problem?
[20:07:15] jm3: has joined #RubyOnRails
[20:07:17] axl_: has joined #RubyOnRails
[20:07:17] elementaru: yep, instant this time :)
[20:07:31] jhass: dionysus69: well, ember gotta have some map somewhere?
[20:07:33] DoubleMalt: has joined #RubyOnRails
[20:07:45] jhass: else how do you reference them from ember?
[20:07:48] dionysus69: Asudem: I suppose not many people would since not many people use rails with windows
[20:07:53] alfie_max15: elementaru, awesome :)
[20:08:48] Asudem: I'm going to be using it on Amazon's cloud, but I really don't want to experiment development on a paid server. I'd rather have something mostly working before I start paying for hosting.
[20:08:49] dionysus69: jhass: I reference them by loading the names from rails api directly into <img src={{imagenameFromRailsApi}}>
[20:09:07] stannard_: has joined #RubyOnRails
[20:09:23] tubbo: Asudem: !i18n for how to translate to japanese in your app
[20:09:23] helpa: Asudem: http://guides.rubyonrails.org/i18n.html - Guide on i18n by Sven Fuchs and Karel Minařík
[20:09:35] alaing: has joined #RubyOnRails
[20:09:38] dionysus69: Asudem: digitalocean is 5$ month and you can have 2 months for free I can send u an invitation.
[20:09:38] alaing: has joined #RubyOnRails
[20:10:11] alaing: Hi, is it possible to conditionally set s3_permissions in the the model? This is what I have at the moment
[20:10:16] tubbo: also, check out Vagrant and using VMs for development on Windows, if you're using Windows :)
[20:10:36] alaing: basically anything thats published should be public and anything not should be private
[20:11:02] alfie_max15: dionysus69, if it's not too much trouble could you send me an invite too, would love to try out digitalocean for the new app i'm working on
[20:11:03] alaing: https://gist.github.com/aliuk2012/f1df42f1d0b097655f90f6ef33bdd733
[20:11:18] walidvb: given up on aws s3, will host my clients assets on my private ftp
[20:11:22] dionysus69: alfie_max15: sure its great
[20:11:24] jhack: has joined #RubyOnRails
[20:11:26] walidvb: it's that, or i burn the city down.
[20:11:28] Asudem: dionysus69 how many terabytes do they allow?
[20:11:53] alaing: walidvb: it cant be all that bad :-D
[20:11:59] dgynn_: has joined #RubyOnRails
[20:12:13] alfie_max15: dionysus69, i'll PM you my email_id
[20:12:17] walidvb: over 10hours on uploading files, i'd call that pretty bad
[20:12:25] dionysus69: Asudem: for terabytes of storage you will need to use S3, for 5$ dropplet on digitalocean, it comes with 20GB of SSD though
[20:12:30] walidvb: alfie_max15: did you get around to your s3 config?
[20:12:49] asheinfeld: has joined #RubyOnRails
[20:13:10] dionysus69: alfie_max15, Asudem: heres my referal just go here https://m.do.co/c/c10f5d462928
[20:13:11] gfvcastro: has joined #RubyOnRails
[20:13:46] alfie_max15: walidvb, not yet, it's for a personal project of mine, so would work on it this weekend
[20:13:50] Asudem: Sure, but I'm currently using Amazon's Elastic Beanstalk to scale my projects as necessary now, is there any benefit aside from the low cost?
[20:13:52] alfie_max15: dionysus69, thanks :)
[20:13:53] futilegames: has joined #RubyOnRails
[20:13:57] walidvb: use ftp :D
[20:14:00] dionysus69: alfie_max15: hehe np
[20:14:20] alfie_max15: walidvb, seriously? is it soo hard??
[20:14:39] walidvb: hard, no, but i'm running into too many problems that i can't find answers to
[20:14:44] Seanzie: has joined #RubyOnRails
[20:15:01] alfie_max15: what's it this time???
[20:15:07] walidvb: might just be me, somehow i can't find that many other ppl with the same issues. i don't feel i'm doing anything particularly special
[20:15:20] andrew9184: has joined #RubyOnRails
[20:15:34] walidvb: well, i use paperclip, and have added delayed_paperclip, which delays the processing to DJ
[20:15:55] alaing: walidvb: what is delayed_paperclip
[20:16:09] Asudem: It's $5, I guess I can't really complain.
[20:16:14] alaing: walidvb: i've only been using paperclip for the last 2 weeks
[20:16:26] walidvb: it looks like DJ tries to fetch the file to process it, but reads a file of 0 bytes(have seen this before when manually reading via file=open(model.file.url))
[20:16:51] walidvb: it then overwrites the original file with 0 bytes, and creates the other styles without complaining
[20:17:28] solars: has joined #RubyOnRails
[20:17:28] alfie_max15: alaing, thats plugin for paperclip to process the uploading in the background using delayedjob/resque/sidekiq
[20:17:47] alaing: ah ok, I'll try remember that if i need it
[20:17:56] hnanon: has joined #RubyOnRails
[20:17:58] walidvb: alaing: it's smth that moves processing of the files to delayed_jobs, which is handy when you want to upload a lot of files and you use heroku, as it takes a while, and requests are limited to 30s on heroku
[20:18:02] hnanon: https://gist.github.com/anonymous/2e1fce93aca8f0ffa7d306d9efd124ae
[20:18:10] hnanon: What am I not seeing there?
[20:18:34] walidvb: alfie_max15: in any case, i've spent about a 5th of the budget on this now, so there is no way i'm spending more time
[20:18:35] hnanon: Getting a syntax error on the last "end."
[20:18:35] alfie_max15: walidvb, "requests are limited to 30s on heroku" ??
[20:18:50] walidvb: alfie_max15: smth like that, correct me if i'm wrong though?
[20:18:51] alaing: walidvb: have you ever needed to conditionally set s3 permissions in your apps?
[20:19:05] walidvb: alaing: nope
[20:19:18] walidvb: alfie_max15: afaik it times out if it takes longer than that
[20:19:23] arBmind: has joined #RubyOnRails
[20:19:26] alaing: i'm just wondering how i could do it
[20:19:27] alaing: https://gist.github.com/aliuk2012/f1df42f1d0b097655f90f6ef33bdd733
[20:19:33] arthurl: has joined #RubyOnRails
[20:19:42] walidvb: so try to upload 6 3K images that have 4 different styles at once
[20:19:48] walidvb: => timeout
[20:19:58] arthurl: can someone please help me understand why this is happening: https://gist.github.com/alyssenko/8c745f6b54fb29dab8924a2ab80ac629
[20:20:25] Scriptonaut: has left #RubyOnRails: ()
[20:20:52] Seanzie: has joined #RubyOnRails
[20:20:58] lalalaaa: has joined #RubyOnRails
[20:21:25] alfie_max15: walidvb, you're right -> https://devcenter.heroku.com/articles/request-timeout
[20:21:34] alfie_max15: thanks, wasn't aware of it
[20:21:57] walidvb: another option would probably some s3_direct_upload, but.. really, for images??
[20:22:24] walidvb: or to change the form so that it uploads as soon as you add it to the form
[20:22:32] walidvb: which would imho be the best solution
[20:22:50] alaing: walidvb: have you used s3_direct_upload gem
[20:23:11] alaing: i think it pushes your files straight to s3
[20:24:06] walidvb: not sure about that, if you use paperclip && styles
[20:24:36] walidvb: smone still needs to process the files. hence the delayed_paperclip. hence my frustration when it sets the file to 0 bytes
[20:24:38] futilegames: has joined #RubyOnRails
[20:24:42] alaing: is styles purely for images?
[20:24:44] tubbo: walidvb: you're using paperclip so not sure if this applies to you, but we personally use image_optim and delay that processing until it's needed.
[20:25:03] walidvb: tubbo: open to options :)
[20:25:11] tubbo: walidvb: so i think your _main_ issue here isn't the upload of 6 images, it's the processing of those images to 4 separate styles.
[20:25:19] tubbo: walidvb: so if this was a background job queue, the number of jobs would be 6*4.
[20:25:28] tubbo: so you're creating 24 images
[20:25:32] alaing: i was wondering if I should ditch paperclip for some other upload to s3 gem
[20:25:36] tubbo: that seems like a lot for a single http request
[20:25:45] alaing: Carrierwave?
[20:25:59] walidvb: tubbo: agree, which is why i wanted to delay those images to DJ
[20:26:05] walidvb: but that misearably failed :D
[20:26:41] walidvb: tubbo: what do you use, though for file attachment then?
[20:26:53] tubbo: i think the most efficient solution would be to offload everything. direct-upload to S3 and process the images only when they're needed.
[20:27:04] tubbo: at work, we use Dragonfly. on this app i'm making for myself i'm using Refile.
[20:27:07] alaing: i need to be able to ajax a file up, return some preset values to a form based on the filename thats been uploaded and then to upload it to s3
[20:27:13] tubbo: they're basically the same thing.
[20:27:21] walidvb: i like the delaying til it's needed, had that in drupal
[20:27:41] walidvb: do you need to manually do those configs or is there a gem?
[20:27:49] alaing: tubbo Dragonfly and Refile how hard is it to use those with s3?
[20:27:51] tubbo: walidvb: we use image_optim and dragonfly, and you need to configure it in some way. https://gist.github.com/scottatron/3320781
[20:27:53] walidvb: (the whole process, i mean)
[20:28:09] tubbo: alaing: very easy. almost every file upload gem worth its shit is going to work with S3.
[20:28:21] alaing: I dont need any image processor
[20:28:34] walidvb: alaing: you probably do
[20:29:12] alaing: my app is purely to upload and serve documents to the public
[20:29:16] walidvb: tubbo: you might have just changed my life. if i can be bothered, i'll take a go at that at some point. presume Dragonfly config is in its docs
[20:29:24] walidvb: alaing: my bad, was thinking about images
[20:29:25] alaing: no images just pdf, doc type files
[20:29:30] tubbo: walidvb: yeah it's pretty well documented
[20:29:34] artto: has joined #RubyOnRails
[20:29:40] tubbo: in fact dragonfly is gonna be a lot better documented than refile
[20:29:56] alfie_max15: walidvb, you'd need dragonfly-s3_data_store with dragonfly to upload to S#
[20:29:59] moeabdol: has joined #RubyOnRails
[20:30:02] walidvb: thanks a bunch
[20:30:02] alaing: dragonfly vs paperclip?
[20:30:14] tubbo: alaing: !g dragonfly vs paperlcip
[20:30:16] tubbo: alaing: !g dragonfly vs paperclip
[20:30:39] walidvb: tubbo: the difference being that it's your app that serves the files, or?
[20:30:56] Dimik: has joined #RubyOnRails
[20:31:30] tubbo: walidvb: yeah i would say that refile & dragonfly are fundamentally different from other upload libs like paperclip and carrierwave. all the logic for processing images/files/whatever is outside of your app and located in the "dragonfly app"
[20:31:44] tubbo: which is basically either an engine or rack middleware in your app
[20:31:48] tubbo: so it's totally isolated from everything
[20:32:01] walidvb: which sucks for large apps, but is just fine for tinier ones, right?
[20:32:11] walidvb: (big in traffic)
[20:32:34] tubbo: i mean we make rather large apps and i would say dragonfly is a better choice than carrierwave.
[20:33:02] roamingdog: has joined #RubyOnRails
[20:34:13] walidvb: ultimately, though, it's better to have the requests go straight to the assets host, no?
[20:36:43] snowy: has joined #RubyOnRails
[20:39:00] startupality: has joined #RubyOnRails
[20:39:45] VeryBewitching: has joined #RubyOnRails
[20:40:29] acovrig: has joined #RubyOnRails
[20:42:01] acovrig: I have a table orders that has shipping_address_id that references addresses (id); in the migration, I’m trying t.belongs_to :address, index: true, foreign_key: ‘shipping_address_id’; but the addresses table doesn’t exist yet, what is the best practice to deal with this? add these columns in the create_table :addresses migration?
[20:43:11] arBmind: has joined #RubyOnRails
[20:43:49] universal: acovrig: add the addresses table before
[20:44:10] hnanon: acovrig: Why can't you create the addresses table first?
[20:44:38] universal: acovrig: and you probably want to save a copy of the address at the time the order was placed, else a user might change it afterwards and complain that you did not deliver it to the right address ;)
[20:45:11] hnanon: I'm getting a syntax error at the last line here: https://gist.github.com/anonymous/2e1fce93aca8f0ffa7d306d9efd124ae
[20:45:39] acovrig: I was a bit overwhelmed w/my diagram, but it looks like I can make addresses first; should I just swap the timestamp on the beginning of the db/migration/*.rb files to make it first?
[20:45:40] hnanon: It's probably something simple that I can't see.
[20:46:05] hnanon: acovrig: Yes, change the timestamp so addresses is created first.
[20:46:06] tubbo: hnanon: that's not how you define a method.
[20:46:07] badoo: has joined #RubyOnRails
[20:46:14] hnanon: It could just be the last digit.
[20:46:43] hnanon: tubbo: Ugh!
[20:46:47] hnanon: Forgot the "def"
[20:47:33] hnanon: I knew it was staring at me and I couldn't see it.
[20:48:10] centrx: has joined #RubyOnRails
[20:48:18] tubbo: hnanon: do you use syntax highlighting
[20:48:22] jmignault: has joined #RubyOnRails
[20:49:09] DoctorMonocular: has joined #RubyOnRails
[20:50:51] bronson: has joined #RubyOnRails
[20:51:28] diegoaguilar: has joined #RubyOnRails
[20:52:44] acovrig: universal, hnanon: that worked; now I guess I should put the tables in order of when they /can/ be created
[20:54:18] crystal77: has joined #RubyOnRails
[20:55:06] macsteps: has joined #RubyOnRails
[20:58:06] hnanon: tubbo: I do...sort of.
[20:58:22] tubbo: hnanon: sort-of?
[20:58:35] hnanon: It showed a mismatch for the end tag.
[20:58:48] walidvb: which was ignored :D
[20:58:55] walidvb: it's late. here, at least
[20:59:16] tubbo: hnanon: i feel like that's not a "sort-of" question, it's "yes" or "no".
[20:59:30] tubbo: syntax highlighting meaning colorized syntax, not any kind of style-checking
[20:59:50] hnanon: tubbo: Then, yes.
[21:00:02] hnanon: But no colors were off.
[21:00:13] workmad3: has joined #RubyOnRails
[21:01:24] Craigimus: has joined #RubyOnRails
[21:01:45] bb: has joined #RubyOnRails
[21:05:46] jenrzzz_: has joined #RubyOnRails
[21:06:51] triptec: has joined #RubyOnRails
[21:08:59] zpe: has joined #RubyOnRails
[21:09:15] startupality: has joined #RubyOnRails
[21:09:41] qsun_: has joined #RubyOnRails
[21:11:45] kgrz: has joined #RubyOnRails
[21:11:54] DoctorMonocular: has joined #RubyOnRails
[21:12:42] ur5us: has joined #RubyOnRails
[21:12:51] RegulationD: has joined #RubyOnRails
[21:13:44] lukec: has joined #RubyOnRails
[21:14:32] hcnewsom: has joined #RubyOnRails
[21:14:53] acovrig: I have a migration: t.belongs_to :user, index: true, foreign_key: ‘created_by’; but the migration still creates the column as ‘user_id’, any ideas why?
[21:15:46] hcnewsom: has joined #RubyOnRails
[21:17:04] asheinfeld: has joined #RubyOnRails
[21:18:37] manfrin: has joined #RubyOnRails
[21:22:25] Dbugger: has joined #RubyOnRails
[21:22:28] triptec: has joined #RubyOnRails
[21:22:28] Dbugger: Hi everyone
[21:22:49] Dbugger: Does someone know how can I limit upload file size, without using activerecord?
[21:23:00] axl_: has joined #RubyOnRails
[21:23:35] DoctorMonocular: has joined #RubyOnRails
[21:23:35] alfie_max15: dbugger, you mean without using activerecord validations?
[21:23:42] Dbugger: alfie_max15, yes
[21:23:48] alfie_max15: write your own custom validations ;)
[21:23:53] Dbugger: alfie_max15, I dont use active record at all in my project
[21:24:01] Dbugger: there is no models
[21:25:29] alfie_max15: no models?? not a rails project??
[21:27:21] tubbo: dbugger: sure, check out the docs for ActionDispatch::UploadedFile. that's what rails uses to turn the multipart form data into an object you can manipulate.
[21:29:01] acovrig: how do I change the foreign_key/index name on a belongs_to in a migration?
[21:30:21] universal: acalewin: belongs_to :foo, foreign_key: "muhkuh_id" ?
[21:30:49] acovrig: orders has a foreign key to address ‘shipping_address_id’; when I do a t.belongs_to :address, index: true, foreign_key: ‘shipping_address_id’ it creates address_id instead
[21:30:54] universal: sorry acalewin, wrong highlight
[21:31:39] acovrig: normally I’d be able to live with it, but orders has shipping_address_id and billing_address_id and other_address_id; and I can’t have 3 address_id columns...
[21:31:47] universal: acovrig: t.belongs_to :shipping_address, index: true, foreign_key: true
[21:32:24] acovrig: universal: wouldn’t that point to ‘shipping_addresses’ table?
[21:32:37] Jasaka: has joined #RubyOnRails
[21:32:46] acovrig: how would it know to point to the addresses table?
[21:33:24] universal: acovrig: it does not, you need to do it manually in that case, after the create_table
[21:33:27] universal: acovrig: http://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/SchemaStatements.html#method-i-add_foreign_key
[21:33:45] startupality: has joined #RubyOnRails
[21:33:47] universal: iirc(!) might be there is an option now to belongs_to/references
[21:33:55] acovrig: universal: OK, so t.integer :shipping_address_id, then add_foreign_key?
[21:34:30] universal: acovrig: no, t.references :shipping_address, index: true, foreign_key: false and afterwards the add_foreign_key
[21:35:14] universal: acovrig: http://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/SchemaStatements.html#method-i-add_reference :-)
[21:35:26] universal: shows the options for t.belongs_to / t.references
[21:35:49] Radar: GOOD MORNING
[21:36:46] roamingdog: Radar: well i just woke from a nap, so i suppose i can accept that, although it's 5:30pm here
[21:36:48] srinidhi: has joined #RubyOnRails
[21:40:18] tgeeky: has joined #RubyOnRails
[21:40:21] tgeeky: has left #RubyOnRails: ()
[21:41:10] acovrig: universal: thanks, that works; now what if I want event.created_by -> user.id? t.references :created_by, index: false, foreign_key: false; add_foreign_key :events, :users, column: :created_by, foreign_key: id
[21:42:18] Palsson: has joined #RubyOnRails
[21:43:05] thesubr00t: has joined #RubyOnRails
[21:44:30] user: has joined #RubyOnRails
[21:45:30] mikecmpbll: how do folks do staging environments these days?
[21:46:00] manfrin_: has joined #RubyOnRails
[21:46:07] GarethAdams: has joined #RubyOnRails
[21:46:07] mikecmpbll: finding it hard to keep the staging environment a good test-bed given the number of moving parts we use in production atm. it's all stubbed in tests and what-not, but staging is meant to be production-like
[21:46:19] mikecmpbll: do you all replicate everything in production precisely?
[21:46:26] der-landgraf: tubbo: thanks
[21:46:33] thesubr00t: I have an application that uses Devise omniauthable with facebook & twitter, since twitter does not provide the user email in the auth hash, how to fetchan already created user when autheticating from twitter
[21:46:54] thesubr00t: is there a way?
[21:48:21] mikecmpbll: thesubr00t : store something that it does return, i assume
[21:49:28] mikecmpbll: typically for multi-provider authentication i think people store a) provider b) uid from the provider
[21:49:42] mikecmpbll: that's how i've done it in the past, anyway.
[21:49:51] joevandy1: has joined #RubyOnRails
[21:50:15] thesubr00t: mikecmpbll,provider & uid are different for each authorization
[21:50:21] joevandy1: how do you guys handle utf-8 checking? we're getting some data from clients that, for example, has noncharacters or double-encoded ut8 in it.
[21:50:30] mikecmpbll: thesubr00t : what do you mean?
[21:50:34] joevandy1: it's a valid utf8 sequence
[21:50:50] thesubr00t: mikecmpbll, uid from twitter is not the same uid from facebook
[21:50:57] mikecmpbll: joevandy1 : receiving how?
[21:51:04] mikecmpbll: thesubr00t : that's why you store the provider also?
[21:51:15] mikecmpbll: provider + uid will always be unique
[21:53:18] markkraemer: has joined #RubyOnRails
[21:54:27] thesubr00t: mikecmpbll, Thats true. When I first authenticate with facebook than I signout, then autheticate with twitter, it will be a whole new user
[21:54:35] thesubr00t: mikecmpbll, check this line https://github.com/mohitjain/social-login-in-rails/blob/master/app/models/user.rb#L25
[21:54:45] jenrzzz: has joined #RubyOnRails
[21:54:52] markkraemer: Has anyone had issues with a view using CST and the controller using CDT?
[21:55:10] thesubr00t: mikecmpbll, twitter does not give emails
[21:55:28] Juanchito: has joined #RubyOnRails
[21:56:43] ziggy: has joined #RubyOnRails
[21:57:46] mikecmpbll: thesubr00t : clearly that won't work then :)
[21:57:57] gopz: has joined #RubyOnRails
[21:57:58] istrasci: has joined #RubyOnRails
[21:58:09] istrasci: Anyone know of any good tutorials on configuring a Rails Engine to test with RSpec?  I'm having a hell of a time figuring this out.
[21:58:28] mikecmpbll: i've not seen oauth integration implemented like that before, but i'm no expert on it. that has obvious limitations relying on the email like that.
[21:59:03] matthias_: has joined #RubyOnRails
[21:59:31] thesubr00t: mikecmpbll, yeah! devise rely on the email which twitter doesn't provide for oauth
[21:59:36] gingray: has joined #RubyOnRails
[22:00:10] mikecmpbll: thesubr00t : well it seems to just be that code there that's relying on it
[22:00:50] thesubr00t: mikecmpbll, I couldn't find another way since I'm using Devise
[22:00:57] clandry94: @istrasci There is an rspec O'Reilly book that is very good
[22:01:13] mikecmpbll: https://github.com/plataformatec/devise/wiki/OmniAuth:-Overview
[22:01:28] mikecmpbll: there's sample code in there which shows it using provider and uid fields on User
[22:01:36] norc_: has joined #RubyOnRails
[22:02:19] unreal: has joined #RubyOnRails
[22:02:22] thesubr00t: mikecmpbll, I'm using them too, the problem remains
[22:02:44] SteenJobs: has joined #RubyOnRails
[22:03:10] mikecmpbll: thesubr00t : what?
[22:04:00] istrasci: clandry94: And it covers Rails engines?
[22:04:51] jmignault: has joined #RubyOnRails
[22:05:08] jmignault: has joined #RubyOnRails
[22:05:28] centrx: has joined #RubyOnRails
[22:05:51] chrisja: has joined #RubyOnRails
[22:05:58] Devalo: has joined #RubyOnRails
[22:06:32] mikecmpbll: istrasci : best bet would be to check out some repo's that are engines and use rspec :)
[22:06:42] thesubr00t: user has_many authorization, if a user signup using facebook first, he will have an authorization with provider: "facebook" & uid: "some_uid_from_facebook". Now if he logout then signin using twitter he will have another authorization with provider: "twitter" & uid: "some_uid_from_twitter". when with facebook he will have email, when with twitter there is no email. thats why the problem remains
[22:06:59] mikecmpbll: istrasci : https://github.com/thredded/thredded for instance
[22:07:27] istrasci: mikecmpbll: Thanks, I'll check it out.
[22:07:28] m_antis: has joined #RubyOnRails
[22:07:35] thesubr00t: mikecmpbll, make sense?
[22:08:12] mikecmpbll: thesubr00t : so you want to have a single user that has multiple authentication providers?
[22:08:25] thesubr00t: mikecmpbll, yep
[22:08:28] mikecmpbll: that user will have to link additional auth providers to their user account in your app
[22:08:43] mikecmpbll: and you'll store your auth providers in a has_many association with your User model
[22:11:00] thesubr00t: mikecmpbll, I already did that, and it works perfectly. My problem now is when logging from facebook then logout & login with google-plus from example devise finds the user created from facebook, but in case of twitter it will create a whole new user.
[22:11:33] mikecmpbll: that's because you're looking the user up by email instead of by their provider and uid ..
[22:12:47] thesubr00t: mikecmpbll, the user does not have an authorization from twitter unless he first login with it.
[22:13:09] mikecmpbll: i'm just repeating myself now.
[22:13:27] mikecmpbll: don't really know what else to say.
[22:14:25] Cohedrin: has joined #RubyOnRails
[22:14:27] ericmeds_: has joined #RubyOnRails
[22:14:32] mikecmpbll: user signs up with twitter ---> store their twitter uid. user links their facebook account ---> store their facebook uid too. user can now log in with twitter or facbeook
[22:14:52] yfeldblum: has joined #RubyOnRails
[22:15:57] mikecmpbll: if what you want is for them to be able to log in with twitter or facebook and for it to automatically know that they are the same person, i don't know that that's possible.
[22:16:23] thesubr00t: mikecmpbll, Yes, that's what I'm looking for :)
[22:16:51] mikecmpbll: well, given that my knowledge of this situation is only what you've told me, and you've told me it's impossible because twitter doesn't give you the email address
[22:16:54] thesubr00t: mikecmpbll, otherwise that workflow s right
[22:17:49] thesubr00t: mikecmpbll, here is what you get from twitter https://github.com/arunagw/omniauth-twitter#authentication-hash
[22:18:09] moeabdol: has joined #RubyOnRails
[22:18:57] startupality: has joined #RubyOnRails
[22:19:51] mikecmpbll: thesubr00t : the only potential solution i can think of is insisting that the user enter his or her email address if they're signing in with twitter.
[22:20:24] mikecmpbll: but actually, no. that's probably completely unsafe.
[22:20:46] thesubr00t: mikecmpbll, yes that way they can hijack others acoounts
[22:22:54] crystal77: has joined #RubyOnRails
[22:23:02] mikecmpbll: i guess just accept that people may create duplicate accounts if they don't remember how they logged in before, and allow them to merge their accounts once they're logged in
[22:23:44] matthewd: Force them to provide their email address, and if there's already an account for that address, require them to authenticate to it with an existing mechanism
[22:23:47] mikecmpbll: i could test it out and see how disqus handles it, but i can't be fucked ;).
[22:24:19] mikecmpbll: matthewd : oh aye. that'd work.
[22:25:20] moei: has joined #RubyOnRails
[22:26:00] thesubr00t: matthewd, Can you please elaborate?
[22:26:38] thesubr00t: matthewd, I mean a mechanism like what?
[22:26:56] matthewd: thesubr00t: The facebook account they've already linked
[22:28:01] thesubr00t: matthewd, Looks like a solution. I'm going to test it. Thanks for the suggestion!
[22:28:10] matthewd: "Oh, that email address is already signed up; please click here to authenticate with Facebook in order to link your Twitter account"
[22:30:05] k3rn31: has joined #RubyOnRails
[22:30:41] jancel: has joined #RubyOnRails
[22:34:38] Contigi: has joined #RubyOnRails
[22:36:29] owenjones: has joined #RubyOnRails
[22:36:36] superlou: has joined #RubyOnRails
[22:36:45] quazimodo: has joined #RubyOnRails
[22:36:52] kies: has joined #RubyOnRails
[22:37:26] bb: has joined #RubyOnRails
[22:40:08] marr: has joined #RubyOnRails
[22:40:24] gfvcastro: has joined #RubyOnRails
[22:41:39] gopz: has joined #RubyOnRails
[22:44:19] manfrin: has joined #RubyOnRails
[22:44:39] Synthead: has joined #RubyOnRails
[22:45:45] maxdoubt: has joined #RubyOnRails
[22:45:53] roamingdog: has joined #RubyOnRails
[22:47:31] qsun__: has joined #RubyOnRails
[22:47:32] Synthead: this is super weird: I have an ActiveJob concern that simply won't load. right under my job's class declaration, I have "include Foo", my concern is called /app/jobs/concerns/foo.rb, and it contains "module Foo". I have other concerns in concerns/ that work fine.
[22:47:46] Synthead: Any thoughts on what the heck I could try?
[22:49:05] Synthead: oh, and this is also weird: this just seemed to start happening out of random, and if I comment-out everything in my job after the include, it still doesn't load
[22:49:30] datanois1: has joined #RubyOnRails
[22:49:36] Axilla: has joined #RubyOnRails
[22:49:43] Synthead: I'm getting uninitialized constant HelloWorldJob::Foo (NameError)
[22:50:33] benlieb: has joined #RubyOnRails
[22:51:31] gingray_: has joined #RubyOnRails
[22:53:17] qsun_: has joined #RubyOnRails
[22:57:10] mikecmpbll: Synthead: probably try stopping spring
[22:57:27] mikecmpbll: bin/spring stop
[22:57:36] centrx: has joined #RubyOnRails
[23:01:09] jstransky: has joined #RubyOnRails
[23:01:19] startupality: has joined #RubyOnRails
[23:02:52] rubyonrailed: has joined #RubyOnRails
[23:02:56] gingray: has joined #RubyOnRails
[23:05:35] Asudem: dionysus69 I do hope you're still here, I've got my digitialocean server going however in the email they said they sent me is a username and password
[23:05:40] Asudem: I never got such an email
[23:06:24] lalalaaa: Asudem: maybe try #digitalocean
[23:07:05] Asudem: I'd rather not, I will take this private with dionysus69, however
[23:08:33] JoshGlzBrk: has joined #RubyOnRails
[23:09:01] Asudem: Okay, they have outdated instructions on their site, nevermind
[23:09:19] DragonPunch: has joined #RubyOnRails
[23:10:36] jancel: has joined #RubyOnRails
[23:11:47] nickjj: Asudem, if you use ssh keys there's no user/pass
[23:12:18] Asudem: An SSH key was required to log into the SSH, and it prompted for a username to login to
[23:12:37] chouhoulis: has joined #RubyOnRails
[23:13:09] nickjj: if your ssh key is different than your current workstation's user then you'd need to include the ssh username in the ssh command
[23:13:27] kdough: has joined #RubyOnRails
[23:13:46] Asudem: Again, I am a Windows user
[23:14:47] nickjj: i didn't scroll up -- good luck!
[23:15:21] Asudem: Hahaha, thanks =P
[23:15:37] lalalaaa: The day DigitalOcean will support OpenBSD !!
[23:15:52] lalalaaa: But I digress
[23:17:15] Asudem: Cool, for some reason creating the new user and disabling root login made the server reject my key, very nice
[23:17:58] Asudem: Now I will go ahead and head over to #digitalocean
[23:20:43] lalalaaa: Their boss is MINASWAN
[23:20:52] lalalaaa: He replies to all emails
[23:21:01] Asudem: Oh cool, thanks for the heads up
[23:21:14] lictor36: has joined #RubyOnRails
[23:21:34] Asudem: Kind of wish I didn't do this though and just set up my test server as my local Win workstation instead of paying for a test server to then transfer to elastic beanstalk though.
[23:21:42] jancel: has joined #RubyOnRails
[23:22:36] lalalaaa: Doesn't work in VirtualBox?
[23:23:11] lalalaaa: Shouldn't you be paying only when it's live?
[23:23:18] blackmesa: has joined #RubyOnRails
[23:23:46] jancel_: has joined #RubyOnRails
[23:24:18] DoctorMonocular: has joined #RubyOnRails
[23:24:58] Asudem: Setting up a virtualbox is just the same as ssh-ing into some other server in my eyes. I would have rather been editing code on the fly in a Windows environment and then testing it instead of editing it in Windows, ssh-ing into the server, then trasnfering the files, then making sure the cache manually refreshes, etc...
[23:26:21] Asudem: If their instructions somehow locked me out of my server I'll just ask for a refund and have the account closed
[23:26:32] Asudem: Not like I got too far
[23:26:56] Asudem: I just wanted to install rails with a Japanese locale
[23:27:03] Asudem: I didn't want another server to manage
[23:28:36] Asudem: However, while we're waiting for digitalocean to respond, let's see if we can get what I came here for done
[23:28:51] Asudem: So I have a Japanese system local and I get this error trying to install rails
[23:29:39] Asudem: http://ft.trillian.im/ebd28084fd3972e7a7dab2c61aae327f48519cec/6HKSfJcJcLzlmWfZXK7NuUygmQ5rC.jpg
[23:30:26] smathy: has joined #RubyOnRails
[23:33:03] emachnic: has joined #RubyOnRails
[23:33:19] gfvcastro: has joined #RubyOnRails
[23:34:14] triptec: has joined #RubyOnRails
[23:35:58] gfvcastro: has joined #RubyOnRails
[23:36:28] allcentury: has joined #RubyOnRails
[23:37:30] VeryBewitching: Asudem: What's the target environment you're installing to, at the end of the day?
[23:37:48] Asudem: Amazon's Elastic Beanstalk.
[23:39:09] VeryBewitching: Asudem: Will the app live on a Linux server, Windows server..
[23:39:30] sypheren: has joined #RubyOnRails
[23:40:15] manfrin: has joined #RubyOnRails
[23:41:52] hahuang65: has joined #RubyOnRails
[23:43:51] Inside: has joined #RubyOnRails
[23:44:45] ZiggyTheHamster: has joined #RubyOnRails
[23:48:05] Asudem: I assume Elastic Beanstalk runs on Amazon's custom debian build, but it is not an SSH-able server.
[23:48:54] DoctorMonocular: has joined #RubyOnRails
[23:49:34] roamingdog: has joined #RubyOnRails
[23:49:36] triptec: has joined #RubyOnRails
[23:50:25] Synthead: mikecmpbll: this is going to sound really stupid: I'm only getting this NameError when the job starts with "Add"
[23:50:48] mikecmpbll: Synthead : heh, that's a queer one.
[23:51:05] Synthead: if I rename the job to something else (and change the filename to suit), it works without any issues
[23:51:14] Synthead: name it Add(anything) and it breaks
[23:51:16] xlegoman: has joined #RubyOnRails
[23:51:40] Synthead: I'm not doing anything hokey in my rails project either, so this ... erm
[23:51:46] Synthead: some code smell going on here
[23:52:09] Radar: !didntwork
[23:52:09] helpa: What "didn't work"? Did your server not start? Did your computer explode? Did your webpage turn bright pink? Did your client not pay your bill on time? You may have to be more specific. A Gist (http://gist.github.com) of the code that doesn't work (and the error you are getting) will be helpful.
[23:52:13] mikecmpbll: yeah, pretty difficult to figure it out without your whole app
[23:52:15] Radar: Stacktraces?
[23:52:23] lukec: has joined #RubyOnRails
[23:52:57] JoshGlzBrk: has joined #RubyOnRails
[23:53:25] baweaver: How can you force delete a record with a FK constraint? It's dev test data that got in wrong.
[23:53:39] baweaver: about to just go into SQL and do it by hand.
[23:53:58] emachnic: has joined #RubyOnRails
[23:54:56] doodlehaus: has joined #RubyOnRails
[23:56:12] pipework: Hack the gibson via sql injection.
[23:56:46] sillypog: has joined #RubyOnRails
[23:57:00] owenjones: has joined #RubyOnRails
[23:59:02] dalbusch1t: has joined #RubyOnRails