« Back to channel list

#RubyOnRails - 30 June 2015

« Back 1 day Forward 1 day »
[00:01:18] LeoDee: Miesco, try 'gem install bundle'
[00:01:31] Slogger: ...anyway it looks like manually logging in is the easiest thing to do, just redundant.
[00:01:33] Radar: Miesco: how did you install Ruby?
[00:01:33] athos_diddy: ok so i wanna lookup these debug codes for capistrano how do i do that?
[00:01:44] Miesco: Radar: From debian package manage
[00:01:47] cmisenas: has joined #RubyOnRails
[00:01:47] Aeyrix: Slogger: Not really redundant.
[00:01:47] athos_diddy: Miesco which ruby version manager are you using
[00:01:52] Radar: Miesco: welltheresyourproblem.jpg
[00:01:56] Aeyrix: Slogger: You're *integration* testing - ensuring all your parts work together.
[00:01:57] Radar: Miesco: Uninstall that.
[00:02:07] Radar: Miesco: http://ryanbigg.com/2014/10/ubuntu-ruby-ruby-install-chruby-and-you/
[00:02:09] Radar: Install that.
[00:02:21] Aeyrix: Radar: I'm going to take over Debian's ruby package
[00:02:24] Aeyrix: and make it a CC of that
[00:02:26] Aeyrix: just to spite you
[00:02:31] Radar: Aeyrix: cool story bro
[00:02:32] ararog: has joined #RubyOnRails
[00:02:35] surrealanalysis: has joined #RubyOnRails
[00:02:42] Aeyrix: No but in seriousness I think it's a good idea.
[00:02:48] Radar: To take over the package?
[00:02:53] Aeyrix: To make it clean.
[00:02:56] Radar: Or my blog post that I wrote while drunk that's still awesome to this day?
[00:03:01] rhizome: Slogger: maybe test more than one thing in a session
[00:03:03] athos_diddy: hey but seriously how can u look up these dbug codes for capistrano deploy?
[00:03:06] Aeyrix: Radar: To make the package like your blog post.
[00:03:28] Radar: athos_diddy: You're expecting us to know what "debug codes" you mean
[00:03:37] Radar: athos_diddy: sorry but it's a bit hard to read your screen from this far away
[00:03:42] Miesco: Radar: How about I just install rails and ruby from debian packages?
[00:03:45] Radar: athos_diddy: so can you please show us what you mean by "debug codes"?
[00:03:46] Radar: Miesco: no.
[00:03:52] baweaver: Radar: the best blog posts always are
[00:03:53] Radar: Miesco: Please do not do that.
[00:03:57] athos_diddy: DEBUG [e750b508] Finished in 0.062 seconds with exit status 0 (successful).
[00:04:02] Radar: baweaver: 6 ciders down by the time I finished it.
[00:04:08] rhizome: wkhtmltopdf appears to be a slow thing
[00:04:24] Radar: athos_diddy: That e750b508 there is the commit SHA of the commit that capistrano is deploying.
[00:04:30] QKO: has joined #RubyOnRails
[00:04:59] Slogger: Yeah, I guess having bigger/broader/moder inclusive integration tests so that such huge portion of each isn't just a rerun of logging in and out is reasonable.
[00:05:00] Radar: Miesco: I ask you to not do that because I've seen a lot of problems come out of using those packages.
[00:05:44] baweaver: Radar: is that all? :P
[00:05:54] Radar: baweaver: I am a lightweight :$
[00:06:02] Aeyrix: ACTION shrugs and has never had a problem with Debian's Ruby packages.
[00:06:09] kitsu: has joined #RubyOnRails
[00:06:17] Radar: Aeyrix: And how many people have you helped install Ruby?
[00:06:25] baweaver: I'm part Irish
[00:06:31] Radar: baweaver: that explains it
[00:06:38] Aeyrix: Radar: I meant personally.
[00:06:42] baweaver: Though I prefer scotch
[00:06:46] athos_diddy: Radar: ok cool i see and that hash changes every deploy
[00:07:14] kitsu: has left #RubyOnRails: ()
[00:07:31] Aeyrix: baweaver: Your go-to's, gimme!
[00:07:32] _3by8: has joined #RubyOnRails
[00:07:35] athos_diddy: i'm going to have another capistrano question
[00:07:41] Aeyrix: Also scotch only, or other whiskeys too?
[00:07:50] _3by8: Is the validates method of an ActiveRecord class run when the object is instantiated?
[00:08:06] Miesco: Aeyrix: Do you ever get errors like this?
[00:08:11] Miesco: /usr/bin/ruby2.1: No such file or directory -- /usr/share/rubygems-integration/all/gems/bundler-1.7.4/bin/bundle (LoadError)
[00:08:12] Aeyrix: Miesco: Honestly, no.
[00:08:18] baweaver: depends on the day, though mainly Scotch with a secondary to Japanese Whisky
[00:08:24] quazimodo: has joined #RubyOnRails
[00:08:27] Cache_Money: has joined #RubyOnRails
[00:08:29] kitsuneyo: has joined #RubyOnRails
[00:08:30] Aeyrix: Miesco: But my general rule is unless you know what you're doing enough to ignore Radar, just do what he suggests.
[00:08:50] Radar: Miesco: Please humour me and follow the guide that I linked you too. Thousands of people have followed it and have had success with it and I'm pretty sure you will too.
[00:08:59] Radar: Miesco: and if you don't, then you can come in here and berate me
[00:08:59] Aeyrix: The guide works flawlessly.
[00:09:08] Aeyrix: I just have this thing against installing shit outside of the package manager because I'm weird.
[00:09:17] Aeyrix: Don't ask.
[00:09:47] jfarmer: has joined #RubyOnRails
[00:09:47] kitsuneyo: Hi, could anyone help me out with a pretty simple form?
[00:09:50] Miesco: Aeyrix: I also have this thing. Debian tells me not to install anything escept for .deb files
[00:10:07] Aeyrix: Miesco: They're kind of incorrect.
[00:10:26] Aeyrix: Miesco: I mean, you can try and struggle with it if you want. For me, it just worked.
[00:10:30] Aeyrix: I also run Ruby 2.2, from the repositories.
[00:10:33] crevax: has joined #RubyOnRails
[00:10:57] kitsuneyo: I'm kind of a beginner and I know this thing isn't as hard as it seems to me....
[00:11:00] athos_diddy: https://gist.github.com/genericlady/b8cff0d50190db55ad16 for some reason when using the -L flag it fails but the -f flag passes
[00:11:06] Aeyrix: Miesco: But if you're having issues that you don't know how to resolve, you really should just listen to Radar.
[00:11:09] _3by8: Is the validates method of an ActiveRecord class run when the object is instantiated?
[00:11:11] Aeyrix: He writes books and stuff.
[00:11:13] athos_diddy: i tried using cap -h and cap deploy -h but can't get a list of the flag definitions
[00:11:17] Aeyrix: (Like, on Rails and Ruby, not just in general).
[00:11:29] Aeyrix: kitsuneyo: We don't know until you help us help you. :)
[00:11:36] Aeyrix: As in, give us your problem, and / or your code.
[00:12:05] TanyaM81: has joined #RubyOnRails
[00:12:07] athos_diddy: Miesco: why debian and not something like ubuntu?
[00:12:11] kitsuneyo: Aeyrix, shall I just describe what I'm trying to do then?
[00:12:14] Aeyrix: athos_diddy: lol
[00:12:16] Aeyrix: kitsuneyo: Yeah sure.
[00:12:22] Aeyrix: athos_diddy: just for good measure: lol
[00:13:02] Radar: _3by8: validates is run when the class is defined.
[00:13:09] dseitz: has joined #RubyOnRails
[00:13:34] lalalaaa: Isn't Debian a lot cleaner than Ubuntu? And OpenBSD a lot cleaner than Debian?
[00:13:49] helpa: http://i.imgur.com/tyViD.gif
[00:13:53] sevenseacat: has joined #RubyOnRails
[00:14:03] frishi: has joined #RubyOnRails
[00:14:27] kitsuneyo: Ok. I've got two models, games and genres. They're related by a has many through table called game_genres. In my games/new form, I've tried to use collection_select to add genres to new games records. But it doesn't work.
[00:14:39] Aeyrix: lalalaaa: Ehh
[00:14:50] Aeyrix: Ubuntu's really got itself sorted out now
[00:14:56] Aeyrix: but it (used to?) does some really stupid things
[00:15:01] yaymukund: has joined #RubyOnRails
[00:15:01] Aeyrix: especially for servers
[00:15:03] Aeyrix: in terms of packages
[00:15:06] Aeyrix: and it really irritated me
[00:15:20] kitsuneyo: I've spent hours trying to understand this, but I can't find a good guide and the documentation must be going over my head.
[00:15:38] Aeyrix: kitsuneyo: Wait, why do you have a table
[00:15:39] Aeyrix: for genres
[00:15:49] Aeyrix: Oh right, many - many
[00:15:56] Aeyrix: sorry, I interpreted that as one - many
[00:16:37] kitsuneyo: I can post everything up on pastebin or something if it would help
[00:16:40] Aeyrix: kitsuneyo: Sure.
[00:16:43] Aeyrix: Use gist.github.com
[00:16:45] Aeyrix: lalalaaa: I fucking love FreeBSD's networking stack.
[00:16:51] Aeyrix: I wish it was in the Linux kernel.
[00:16:56] chipotle: has joined #RubyOnRails
[00:17:05] Aeyrix: But the problem is, I work with virtualisation a lot. Some things can get a bit weird.
[00:17:23] lalalaaa: Hey! That's good to hear :)
[00:17:49] Aeyrix: Overall Debian's my preferred because I've actually yet to have it mess up.
[00:17:51] Glyphik: has joined #RubyOnRails
[00:19:46] Papierkorb: What makes FreeBSDs stack better than linux's stack?
[00:19:55] Papierkorb: Never used any BSD
[00:20:45] kitsuneyo: Ok, here it is: https://gist.github.com/kitsuneyo/a2117b8f54199ba243eb
[00:21:01] carlosd: has joined #RubyOnRails
[00:21:02] kitsuneyo: I would appreciate any help sooo much, it's driving me crazy
[00:21:16] JoshuaPaling: has joined #RubyOnRails
[00:21:37] Miesco: Interesting. I uninstalled debian 'ruby' package, and I still have /usr/bin/ruby2.1
[00:22:01] Aeyrix: apt-get purge ruby2
[00:23:05] Miesco: I see. Still had ruby2.1
[00:23:19] _3by8: Radar: is a class being defined the same as the class being instantiated or is definition at some point during the instantiation or do you guys have different lingo for instantatiation?
[00:23:29] workmad3: has joined #RubyOnRails
[00:24:55] Miesco: Radar: Your solution is installing ruby2.1.3
[00:25:05] Miesco: Radar: When I did 'ruby-install ruby'
[00:26:20] Radar: Miesco: The instructions say 'ruby-install ruby 2.2.0'
[00:26:58] Miesco: Radar: Well I thought that ruby 2.2.0 might be outdated, and that not mentioning a version will just install the latest
[00:27:31] Miesco: Do you know what railstutorial.org uses?
[00:27:32] Radar: 2.2.0 is only two trivial versions behind the latest. Can you try running `ruby install ruby 2.2.2` and let me know if that works for you?
[00:27:55] lupine: system ruby > *
[00:28:03] Hobogrammer: has joined #RubyOnRails
[00:28:04] Miesco: Radar: with 'ruby-install', can you uninstall?
[00:28:58] ght: Question: I am having one hell of a time getting API calls to a provider that uses XMLRPC formatting to work. I can successfully retreive the "code", use the code to get an initial authorize_key, then use that authorize key to attain a new one and new refresh_key. That's all working properly, and all with RestClient.
[00:29:02] Radar: Miesco: rm -rf ~/.rubies/ruby-2.1.3
[00:29:23] doodlehaus: has joined #RubyOnRails
[00:29:23] ght: The issue is actually calling API functions via RestClient, because RestClient will not format the requests as XML no matter what I try.
[00:29:32] Miesco: Radar: I am running 'ruby-install' as root
[00:29:43] lupine: xmlrpc is a bit different to 'rest'
[00:29:43] ght: I've called them successfully to this provider for years using their legacy API and xmlrpc/client.
[00:29:59] Radar: Miesco: I am not sure where it installs to as root.
[00:30:22] ght: My question is, does anyone have an example of calling any API method to any provider that uses oauth2 and xmlrpc, using RestClient or XMLRPC::client.new2() or .new()?
[00:30:24] Miesco: Radar: >>> Successfully installed ruby 2.1.3 into /opt/rubies/ruby-2.1.3
[00:30:35] Radar: Miesco: How did you install ruby-install?
[00:30:57] Miesco: Radar: From that website; with wget
[00:31:01] Radar: Miesco: ok.
[00:31:12] wethu: has joined #RubyOnRails
[00:31:17] Radar: Miesco: How did you get that to install ruby 2.1.3?
[00:31:32] Miesco: Radar: 'ruby-install ruby'
[00:31:42] yaymukund: has joined #RubyOnRails
[00:31:51] Radar: Miesco: Ok. I don't know why it defaults to installing 2.1.3.
[00:31:57] sleungcy: i have both ruby-debug-passenger and ruby-debug-ide in my gemfile, and they both adds the 'rake debug' task. What will happen what I use the task?
[00:32:14] Miesco: Radar: Maybe because its similar to my debian's build?
[00:32:18] drale2k: has joined #RubyOnRails
[00:32:20] sleungcy: Is there a way I can resolve this conflict?
[00:33:30] kitsuneyo: if games has a has-many-through relationship with genres through game, and i want to add genres to games in a games/new form via nested attributes, should my nested form (collection_select actually) be trying to add a genre to the game or a game_genre?
[00:34:02] bf4: has joined #RubyOnRails
[00:34:20] kitsuneyo: i mean should it add a genre to the game or a game_genre to the game?
[00:34:43] sevenseacat: whats the point of the game_genre model?
[00:35:21] kitsuneyo: the point of the game_genre model is to track the relationships between games and genres
[00:35:48] brendan-: has joined #RubyOnRails
[00:36:41] kitsuneyo: it's a many to many relationship so it's needed
[00:37:03] doodlehaus: has joined #RubyOnRails
[00:37:17] weaksauce: kitsuneyo gist the filename as .rb or .html to get good syntax highlighting...
[00:37:19] helpa: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[00:37:40] weaksauce: !gist-usage
[00:37:40] helpa: How to use Gist properly: https://github.com/radar/guides/blob/master/using-gist.markdown
[00:37:43] weaksauce: there it is
[00:37:59] kitsuneyo: ok, i'll have a go, gimme a sec
[00:39:50] Miesco: Is this what the default gem should look like (gem list --local)?: http://paste.debian.net/267520/
[00:39:55] chipotle: has joined #RubyOnRails
[00:40:18] Miesco: I ask because I deleted my debian 'rubygems', and am wondering if it deleted all the packages
[00:40:34] Miesco: s/packages/gems
[00:40:42] RegulationD: has joined #RubyOnRails
[00:41:02] weaksauce: Miesco did you update ruby itself? the gems would not be the same for a different ruby version
[00:41:15] kitsuneyo: ok, done: https://gist.github.com/kitsuneyo/a2117b8f54199ba243eb
[00:41:45] weaksauce: much nicer thanks!
[00:42:07] Miesco: weaksauce: I removed my ruby from the debian packages, and installed ruby-2.1.3 from 'ruby-install', which is a different version than from any ruby version I have ever had.
[00:42:42] weaksauce: yeah... did you delete the system ruby?
[00:43:43] Miesco: weaksauce: yes
[00:43:55] garrypolley: has joined #RubyOnRails
[00:44:08] Miesco: weaksauce: Just wondering if that is the default list of gems when you haven't used the 'gem' command before
[00:44:25] Aeyrix: Yeah pretty much.
[00:44:36] weaksauce: sounds about right
[00:45:16] kitsuneyo: how easy is cocoon to use?
[00:45:26] blackmes1: has joined #RubyOnRails
[00:45:36] kitsuneyo: does it make forms a lot easier?
[00:45:43] chintanparikh: has joined #RubyOnRails
[00:45:59] Aeyrix: I just use the standard form helpers and never have a problem.
[00:47:00] weaksauce: what's hard about forms right now that you are trying to solve?
[00:47:22] weaksauce: I like simple_form a lot
[00:47:34] kitsuneyo: Using nested_attributes
[00:48:01] one_zero: has joined #RubyOnRails
[00:48:39] sevenseacat: cocoon is awesome
[00:49:07] sevenseacat: but I don't yet know why you have a game_genre model. it would be much easier if you just assigned games to a genre directly, or vice versa
[00:49:17] rodfersou: has joined #RubyOnRails
[00:49:39] lupine: it's an m:n relationship. games don't need to be in a single genre
[00:49:52] lupine: and genres certainly have multiple games
[00:50:02] kitsuneyo: yeah games can be in lots of different genres
[00:50:06] sevenseacat: I get that. so whats wrong with HABTM?
[00:50:20] wethu: has joined #RubyOnRails
[00:50:24] lupine: *shrug* has_many :through is preferred
[00:50:35] lupine: me, at least
[00:50:37] sevenseacat: there's no point in having a model if all it has is two foreign keys
[00:50:42] lupine: the docs may prefer it also
[00:50:43] sevenseacat: just adds more complexity
[00:51:05] lupine: FSVO complexity
[00:51:12] kitsuneyo: sevenseacat, there are reasons like being able to track who creates the relationships and when
[00:51:20] lupine: if the schema is identical, it's hard to argue complexity
[00:51:32] kitsuneyo: besides, is what i'm trying to do really so complex?
[00:51:39] hmsimha_: has joined #RubyOnRails
[00:51:43] hmsimha__: has joined #RubyOnRails
[00:52:20] Aeyrix: kitsuneyo: You really should be using HABTM, it's pretty much what you want but it "just works (tm)".
[00:52:27] Aeyrix: If you want user action tracking, track user actions.
[00:53:25] kitsuneyo: are you guys telling me you don't know how to do this either?
[00:53:26] lupine: http://guides.rubyonrails.org/association_basics.html#choosing-between-has_many-through-and-has_and_belongs_to_many
[00:53:32] lupine: docs give some guidance
[00:53:40] lupine: don't recommend against habtm for the simplest case
[00:54:03] QKO: has joined #RubyOnRails
[00:54:16] sevenseacat: recommending against it != dont know how to do it
[00:54:31] lupine: personally, i'd always just :through just to reduce the amount of magic and avoid a refactor down the line when it inevitably starts acquiring extra attributes
[00:55:09] lupine: a concrete example in this case might be a relevance/ranking attribute that states how closely identified with the genre the game is
[00:55:27] lupine: but either will work
[00:55:44] sevenseacat: but thats cool, I'm not a fan of the 'insulting the people you ask for help' methodology
[00:56:29] kitsuneyo: sorry for sounding insulting, i didn't mean it that way
[00:56:43] kitsuneyo: i'm just starting to think this is actually tricky to do
[00:56:55] kitsuneyo: from what i read, i like has many through
[00:57:06] kitsuneyo: it seems more future proof
[00:57:16] weaksauce: it's fine to use.
[00:57:38] Aeyrix: sevenseacat: Studies have shown it's the best way to get help in ##linux and stuff.
[00:57:42] Aeyrix: Just claim it's super easy to do on Windows.
[00:57:53] sevenseacat: Aeyrix: yeah I know. the best way to get help on doing something is to claim its not possible
[00:59:20] hotpancakes: has joined #RubyOnRails
[00:59:25] bananaboydean: has joined #RubyOnRails
[00:59:26] kitsuneyo: What about this line from the Rails guide: "The collection of join models can be managed via the API. For example, if you assign physician.patients = patients new join models are created for newly associated objects,"
[00:59:36] QKO: has joined #RubyOnRails
[00:59:58] kitsuneyo: This is describing has_many: through
[01:00:18] weaksauce: kitsuneyo what's the error that you are getting?
[01:00:32] yaymukund: has joined #RubyOnRails
[01:00:40] sevenseacat: thats correct. however, as soon as you start adding meaning to the model in the middle - extra validations, attributes, etc. you can no longer do that.
[01:00:46] weaksauce: also, this is a good read on what has_many :through and other associations are actually doing... http://api.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.html
[01:01:04] kitsuneyo: There's no error actually, the game record saves but no game_genre records are created
[01:01:10] kitsuneyo: Thanks weaksauce
[01:02:01] sevenseacat: looking at the submitted params will tell you why, it doesnt match the params you're permitting
[01:02:30] kitsuneyo: Quite possible >.<;;
[01:02:53] kitsuneyo: I was playing around with them in desperation, but probably I never got them right in the first place
[01:04:10] kitsuneyo: Also I'm confused about whether I'm supposed to submit game_genres params or genres params
[01:04:37] sevenseacat: proper for your model structure would be game_genres
[01:04:43] ebbflowgo: has joined #RubyOnRails
[01:05:26] kitsuneyo: Atm the only game_genre param I'm permitting is :genre_id, do I need to permit them all?
[01:06:31] sevenseacat: all? what other game_genre params are there?
[01:06:35] a346: has joined #RubyOnRails
[01:06:37] gerep: has joined #RubyOnRails
[01:06:59] bronson: has joined #RubyOnRails
[01:07:04] gerep: Hi all! I'm trying to access this route but I can't, I tried as `activate_path` https://gist.github.com/anonymous/70cdb68e56d8caca9100#file-gistfile1-txt-L8
[01:07:24] sevenseacat: gerep: the route doesnt have a name, you'll have to give it one.
[01:07:32] kitsuneyo: well, just id and game_id
[01:07:37] sevenseacat: gerep: http://guides.rubyonrails.org/routing.html#naming-routes
[01:07:38] gerep: sevenseacat, ah! thanks a lot
[01:07:51] kitsuneyo: but game_id is supposed to be supplied by the newly-saved game record
[01:07:55] sevenseacat: kitsuneyo: exactly
[01:08:06] kitsuneyo: so i guess i don't have to?
[01:08:14] sevenseacat: there isnt an ID to submit
[01:09:00] kitsuneyo: ok, this is the message put out by the development web server on submission of a new game record: Genre Exists (0.2ms) SELECT 1 AS one FROM "genres" INNER JOIN "game_genres" ON "genres"."id" = "game_genres"."genre_id" WHERE "game_genres"."game_id" = $1 LIMIT 1 [["game_id", 37]]
[01:09:18] sevenseacat: its a validation query
[01:09:31] sevenseacat: have you checked the submitted params yet
[01:09:54] kitsuneyo: yeah I changed them to this: params.require(:game).permit(:title_en, :year, :description_en, game_genres_attributes: [:genre_id])
[01:10:11] sevenseacat: and what params are being submitted by your form?
[01:10:25] Sylario: has joined #RubyOnRails
[01:10:25] sevenseacat: it doesnt match that
[01:10:38] kitsuneyo: <%= collection_select(:game_genres, :genre_ids, Genre.all, :id, :name,
[01:11:01] sevenseacat: check your logs to see what params are being submitted.
[01:11:07] kitsuneyo: (I don't understand when to use plurals)
[01:11:19] kitsuneyo: Parameters: {"utf8"=>"???", "authenticity_token"=>"2BvWZOACc/tW0nDmrmtxiMsjt8jmMRGhr398CfNSX1cxnf30ZdKVqi3IH9615K1zSxh+tGDaanVNlhC+LHjMbw==", "game"=>{"title_en"=>"Hello 2", "year"=>"1964", "description_en"=>"Waahhhh"}, "genres"=>{"ids"=>["", "8"]}, "commit"=>"Save"}
[01:11:21] DoctorMonocular: has joined #RubyOnRails
[01:11:24] smathy: has joined #RubyOnRails
[01:11:58] kitsuneyo: wait up, scratch that last one
[01:12:59] gerep: sevenseacat, that's working now but I can't test that route, if possible, can you take a look? https://gist.github.com/anonymous/29c32a8c62e199bf69ca
[01:13:20] gerep: I'm getting this error: No route matches {:action=>"activate", :controller=>"users"} missing required keys: [:token]
[01:13:22] sevenseacat: gerep: and what error are you getting?
[01:13:26] gerep: But the is passed
[01:13:33] gerep: No route matches {:action=>"activate", :controller=>"users"} missing required keys: [:token]
[01:13:54] kitsuneyo: Parameters: {"utf8"=>"???", "authenticity_token"=>"2BvWZOACc/tW0nDmrmtxiMsjt8jmMRGhr398CfNSX1cxnf30ZdKVqi3IH9615K1zSxh+tGDaanVNlhC+LHjMbw==", "game"=>{"title_en"=>"Blah Game", "year"=>"2015", "description_en"=>"Ehh"}, "genres"=>{"ids"=>["", "7"]}, "commit"=>"Save"}
[01:14:05] kitsuneyo: Yeah I guess they don't match.
[01:14:12] sevenseacat: you need to pass the token as a param to the route, eg. activate_path(token: stuff)
[01:14:28] Radar: gerep: or you can do get :activate, token: user.token
[01:14:38] gerep: sevenseacat, I get it, I was following the docs: get :show, id: @article.id
[01:14:46] gerep: Radar, sevenseacat thanks a lot =)
[01:15:07] sevenseacat: Radar's way is better. using named routes in controller tests like that is a bit odd
[01:15:10] gerep: So when I use a path I need to send the variables as parameters =)
[01:15:15] sevenseacat: for testing redirects, sure
[01:15:33] crdpink: has joined #RubyOnRails
[01:17:24] startupality: has joined #RubyOnRails
[01:18:20] mary5030: has joined #RubyOnRails
[01:18:49] gerep: Radar and sevenseacat just so you know, when I use `:activate, token: user.token` I get this: URI::InvalidURIError: bad URI(is not URI?): http://www.example.com:80activate
[01:19:06] Aeyrix: The issue is like, right there.
[01:19:08] Radar: gerep: that's a different error entirely. Show us the tracktrace from that please.
[01:19:25] Aeyrix: wtf why did that go to #ror
[01:19:30] Radar: Aeyrix: PEBKAC
[01:19:32] gerep: Radar, that's just a test error, how can I get the tracktrace?
[01:19:35] Aeyrix: god i need a better irc cilent
[01:19:38] Aeyrix: a client to
[01:19:41] Aeyrix: ... i give up
[01:19:42] Radar: gerep: It should be there in the output of the test?
[01:19:52] gerep: Radar, that error message is all
[01:20:04] gerep: Radar, 1) Error:
[01:20:04] gerep: UsersSignupTest#test_valid_email_validation_token:
[01:20:04] gerep: URI::InvalidURIError: bad URI(is not URI?): http://www.example.com:80activate
[01:20:04] gerep: test/integration/users_signup_test.rb:25:in `block in <class:UsersSignupTest>'
[01:20:29] Intii: has joined #RubyOnRails
[01:20:30] Radar: gerep: what is line 25 of users_signup_test.rb?
[01:20:31] sevenseacat: and what does your code look like now
[01:20:35] Pupeno_: has joined #RubyOnRails
[01:20:42] chipotle: has joined #RubyOnRails
[01:20:50] gerep: Radar, get :activate token: user.token
[01:20:57] sevenseacat: you kinda missed a comma there
[01:20:59] gerep: sevenseacat, I just fixed that url
[01:21:10] gerep: It was a typo here
[01:21:16] gerep: In the code I have the comma
[01:21:31] sevenseacat: how do you make typos when copying and pasting code?
[01:21:38] Aeyrix: By typing it out.
[01:21:40] gerep: I didn't copy and paste
[01:21:59] gerep: Because I'm making tests with it so right now the code is different =)
[01:22:32] Intii: Hi everyone, I'm having some trouble with strong params. Here is how I define what is allowed. https://gist.github.com/anonymous/8374bad91ad72449feb5 but for some reason, when I try to create an Appointment object, I get the ForbiddenAttributesError error
[01:22:40] yfeldblum: has joined #RubyOnRails
[01:22:43] Aeyrix: you're pasting different code to us
[01:22:47] Aeyrix: than the code you're working on?
[01:22:47] Radar: Intii: what is permit_params
[01:22:58] Radar: Intii: what is the context of this call?
[01:22:59] Intii: Radar: I'm using ActiveAdmin. That's how they want to define strong params
[01:23:04] Radar: !activeadmin
[01:23:04] helpa: brb, shooting myself
[01:23:10] Aeyrix: Hey Radar, I'm having trouble with my car. If I show you this orange can you help me?
[01:23:11] Intii: I know I know -_-
[01:23:13] Radar: ACTION nbows out
[01:23:14] gerep: ararog, no, I'm not, I pasted the code that gave the error and I'm also making other tests
[01:24:04] gerep: Aeyrix, no, I'm not, I pasted the code that gave the error and I'm also making other tests
[01:24:46] crdpink: has joined #RubyOnRails
[01:25:28] neanderslob: hi everyone, I'm using cancan to mange access to a variety of features on a site. There is one page, however that should be open to all users that are signed in. Is there a way to manage that access with cancan or should I just use an if user_signed_in? in the controller
[01:26:05] kitsuneyo: I think I have permitted params and submitted params matching now
[01:26:28] kitsuneyo: Parameters: { ... "game_genre"=>{"genre_id"=>["", "7"]}, "commit"=>"Save"}
[01:26:34] gerep: Aeyrix, what happens is that it works: get activate_path(token: user.token) but this one doesn't: get :activate, token: user.token, it returns "URI::InvalidURIError: bad URI(is not URI?): http://www.example.com:80activate"
[01:26:43] kitsuneyo: <%= collection_select(:game_genre, :genre_id, Genre.all, :id, :name,
[01:26:56] crdpink2: has joined #RubyOnRails
[01:27:18] kitsuneyo: I guess the parameters are there but the program isn't doing anything with them
[01:27:18] Aeyrix: get '/activate', token: user.token
[01:27:20] sevenseacat: kitsuneyo: you need to create a nested model form
[01:27:27] sevenseacat: the params arent there, they're not nested inside the game hash
[01:27:28] Intii: So my submitted params are { appointment => { ... } } and I've permitted the appointment params I believe (don't know if the way I did it is correct)
[01:27:47] sevenseacat: eg. f.fields_for :game_genres, etc.
[01:27:57] gerep: Aeyrix, don't find the route /activate
[01:28:05] Intii: The Appointment object is being created by code
[01:28:17] kitsuneyo: wait lemme paste the whole thing: Parameters: {"utf8"=>"???", "authenticity_token"=>"MKu+ldbw3fR4Wx11b1o2Y1kBxn/30rlNWBvpLDfVkjDZLZUFUyA7pQNBck101eqY2ToPA3E5wpm68oWb6P8BCA==", "game"=>{"title_en"=>"Whaa", "year"=>"1953", "description_en"=>"ddd"}, "game_genre"=>{"genre_id"=>["", "7"]}, "commit"=>"Save"}
[01:28:18] sevenseacat: gerep: can you please gist the code and error
[01:28:28] kitsuneyo: That's not how it's supposed to look?
[01:28:32] sevenseacat: kitsuneyo: nope.
[01:28:43] Aeyrix: gerep: So <yourapp.com>/activate doesn't exist?
[01:28:44] sevenseacat: you have a game hash and a separate game_genre hash.
[01:29:53] doodlehaus: has joined #RubyOnRails
[01:30:13] Intii: I figured out the problem
[01:30:31] Intii: Should I start to migrate completely away from ActiveAdmin?
[01:31:21] sevenseacat: I think things like ActiveAdmin are more trouble than they're worth.
[01:31:32] sevenseacat: but that is my personal opinion. I know others that love gems like them.
[01:31:58] Intii: Why? I'm genuinely curious because I've heard that before.
[01:32:06] kitsuneyo: I think I had it earlier though, is this one nested? Parameters: {"utf8"=>"???", "authenticity_token"=>"Hl8Zll83AgzElTCFpDcqckNaXrNM469P8yCMaAXH8RH32TIG2ufkXb+PX72/uPaJw2GXz8oI1JsRyeDf2u1iKQ==", "game"=>{"title_en"=>"", "year"=>"", "description_en"=>""}, "game_id"=>"", "game_genre"=>{"genre_id"=>"7"}, "commit"=>"Add"}
[01:32:20] sevenseacat: kitsuneyo: no.
[01:32:42] crdpink2: has joined #RubyOnRails
[01:32:42] sevenseacat: and it won't be, with your code.
[01:32:57] cornerma1: has joined #RubyOnRails
[01:33:32] crdpink2: has joined #RubyOnRails
[01:33:33] kitsuneyo: Thanks for your help, sorry if I sounded ungrateful before
[01:33:50] kitsuneyo: I guess I'll go back to the drawing board tomorrow, nite
[01:33:56] weaksauce: Intii I have used activeadmin and also migrated a project away from it. it's nice to get a boiler plate crud backend that doesn't need much customization but it's a pain to customize
[01:34:23] Intii: weaksauce: How was the migration process?
[01:35:36] gerep: sevenseacat, sorry, I was taking my son to bed =) Here is the code
[01:35:38] gerep: https://gist.github.com/anonymous/0b5387d7c93320bee544
[01:35:57] gerep: Aeyrix, Yes, this route is expecting a parameter called :token
[01:37:55] zorak8: has joined #RubyOnRails
[01:38:26] garrypolley: has joined #RubyOnRails
[01:38:59] gerep: sevenseacat, the error message: URI::InvalidURIError: bad URI(is not URI?): http://www.example.com:80activate
[01:40:09] weaksauce: Intii it took longer than I wanted it to but it was not too terrible
[01:40:40] weaksauce: Intii one less dependency is nice.
[01:40:41] p1k: has joined #RubyOnRails
[01:40:59] Intii: Hmm.... now you got me thinking rofl
[01:42:25] szu: has left #RubyOnRails: ("ERC Version 5.3 (IRC client for Emacs)")
[01:42:38] weaksauce: you lose out on searching easily, decent looking forms, pagination, authentication, authorization, controllers etc.
[01:43:08] weaksauce: it all can be put back in and in the end I like the final product better but there is a lot of stuff you get for "
[01:45:39] doctorly: has joined #RubyOnRails
[01:46:34] frishi: has joined #RubyOnRails
[01:49:10] konsolebox: has joined #RubyOnRails
[01:50:34] frishi: has joined #RubyOnRails
[01:51:02] bullcitydev: has joined #RubyOnRails
[01:51:29] beauby: has joined #RubyOnRails
[01:52:12] annlewis: has joined #RubyOnRails
[01:52:46] idd2d: has joined #RubyOnRails
[01:56:57] Anakat: has joined #RubyOnRails
[01:58:58] earthquake: has joined #RubyOnRails
[01:59:19] hanss: has joined #RubyOnRails
[02:02:10] doodlehaus: has joined #RubyOnRails
[02:03:17] branbran: has joined #RubyOnRails
[02:05:35] microdex: has joined #RubyOnRails
[02:06:24] pothibo: has joined #RubyOnRails
[02:08:50] jesterfraud: has joined #RubyOnRails
[02:11:13] beauby: has joined #RubyOnRails
[02:12:14] workmad3: has joined #RubyOnRails
[02:15:30] ur5us: has joined #RubyOnRails
[02:15:45] dented42: has joined #RubyOnRails
[02:17:01] acovrig: has joined #RubyOnRails
[02:17:34] baweaver: has joined #RubyOnRails
[02:17:49] d1ngell: has joined #RubyOnRails
[02:18:06] RegulationD: has joined #RubyOnRails
[02:18:53] lessless: has joined #RubyOnRails
[02:22:34] Dbugger: has joined #RubyOnRails
[02:23:37] ebbflowgo: has left #RubyOnRails: ()
[02:28:09] smathy: has joined #RubyOnRails
[02:29:44] _jesterfraud: has joined #RubyOnRails
[02:30:23] DoctorMonocular: has joined #RubyOnRails
[02:31:57] chipotle: has joined #RubyOnRails
[02:37:06] hotpancakes: has joined #RubyOnRails
[02:37:33] Cache_Money: has joined #RubyOnRails
[02:38:34] Spami: has joined #RubyOnRails
[02:41:16] RegulationD: has joined #RubyOnRails
[02:41:57] RegulationD: has joined #RubyOnRails
[02:44:25] dstarh: has joined #RubyOnRails
[02:45:31] dstarh: a week or so ago we had to restart our db and our delayed_job workers hung and refused to process any more jobs. Does anyone have a strategy they use for keeping track of dead workers?
[02:46:03] frishi: has joined #RubyOnRails
[02:46:27] dstarh: We were thinking about just running script/delayed_job restart every 5-10 mins via cron but we're not sure if that's a horrible idea or a simple solution
[02:46:37] beauby: has joined #RubyOnRails
[02:46:47] bf4: has joined #RubyOnRails
[02:47:42] frishi: has joined #RubyOnRails
[02:49:13] fryguy: dstarh: only tangentially related, but there are much better more modern background processing systems that you should consider using at this point
[02:49:54] drale2k_: has joined #RubyOnRails
[02:50:13] frishi: has joined #RubyOnRails
[02:50:25] dstarh: yup i'm sure there are, but for now we're going to stick with delayed jobs, we just want to come up with some effective policy for dealing with hung workers
[02:50:37] dstarh: and we'd love to avoid monit if absolutely necessary
[02:51:13] minmax: has joined #RubyOnRails
[02:53:17] Miesco: has joined #RubyOnRails
[02:54:20] dstarh: fryguy any thoughts on dj worker restarting
[02:54:35] dstarh: *periodic
[02:55:12] fryguy: no not really
[02:55:25] fryguy: i'd probably set up a nagios alert on the queue size and alert on that
[02:56:06] idd2d: I'm trying to wrestle some javascript into working with turbolinks, but I'm getting weird behavior from my event listeners. Instead of triggering on click, it triggers when the page loads/changes, and not again until the next load. Here's the gist: https://gist.github.com/mtchllbrrn/5e074df282042999257b
[02:56:21] acti0nman: has joined #RubyOnRails
[02:56:40] dstarh: we already have a cloudwatch alarm on the queue size making sure it doesn't go above N jobs, we just want something we don't have to manually do in case one dies again
[02:57:01] fryguy: idd2d: input.on('click') instead of input.click is probably what you want
[02:57:11] dstarh: trying to build more pre-emptive tools rather than reactive
[02:57:23] microdex: has joined #RubyOnRails
[02:57:42] fryguy: dstarh: so identify the failure case, catch that, and work around it.
[02:57:43] idd2d: fryguy, I've tried that as well. Exactly the same behavior.
[02:57:56] fryguy: idd2d: show us
[02:58:37] dstarh: idd2d input.click takes a closure, you're just calling alert and passing the result of that, which I'm guessing is true, to click
[02:58:59] dstarh: true as in I believe the alert method returns true
[02:59:22] adavia: if i use @user.images.build() for creating an association then whats the corresponding method for update?
[02:59:24] dstarh: so that alert happens when input.click is interpreted, which is, on page change
[02:59:58] fryguy: adavia: what do you mean update
[02:59:59] dstarh: adavia you need a specific instance to update no?
[03:00:09] Radar: dstarh: can you switch to Sidekiq?
[03:00:25] Radar: dstarh: I ask because it has better support for monitoring than DJ has :)
[03:00:54] idd2d: dstarh, fryguy: Looks like dstarh was right, I needed the closure. Thanks for the help.
[03:01:07] dstarh: Radar as stated before can't switch at this time
[03:01:48] dstarh: Im thinking that i'll just setup a cron job to run bin/delayed_job restart
[03:01:53] Miesco: has left #RubyOnRails: ()
[03:01:56] dstarh: and see if that causes any issues
[03:01:58] Radar: ah, the Mongrel Solution
[03:03:08] dstarh: prettymuch :)
[03:03:08] Radar: (if you don't get it: a long time ago, Rails ran on a web server called Mongrel and some apps would have memory bloat and need to be restarted every X hours)
[03:03:49] Radar: dstarh: We had the same issue as you where I work and our long-term solution is to switch to Sidekiq.
[03:03:51] hotpancakes: has joined #RubyOnRails
[03:03:55] sevenseacat: or every x minutes, I heard
[03:03:57] dstarh: to be fair the only time we've ever had to do a delayed job restart was after restarting the DB cluster in a maint window. Rails did just fine with all of its connections,
[03:04:01] Radar: minutes was it? lol
[03:04:05] hahuang65: has joined #RubyOnRails
[03:04:14] Radar: We have a non-trivial amount of jobs that would require porting as well as having to move our caching from Redis to Memcached.
[03:04:45] sbhatore1: has joined #RubyOnRails
[03:05:06] dstarh: shouldn't active job make this all transparent ;)
[03:05:22] Radar: I wouldn't trust AJ as far as I could throw DHH
[03:05:46] x-light: you could always activejob the Mongrel
[03:05:58] Radar: I'm sure there's also an Inspeqtor (which is now free iirc) monitoring script for Sidekiq too.
[03:06:07] Rubie: has joined #RubyOnRails
[03:06:21] sevenseacat: if only we were using a framework that rendered most of this need for background jobs obsolete
[03:06:35] dstarh: Thanks for the info , time to sign off
[03:06:48] Radar: Too bad one like that doesn't exist in a 1.0 version yet with a large folllowing
[03:06:52] Radar: *cough supply and demand*
[03:07:29] Aeyrix: There's a 1 and a 0 and a . in there.
[03:07:30] Radar: Rails hit 0.8 before 1.0! :P
[03:07:31] Aeyrix: Basically 1.0.
[03:07:40] sevenseacat: I'mma upgrade ticketee at lunch
[03:07:43] Radar: My bad, it was 0.14.4 before they hit 1.0
[03:07:55] fryguy: what framework are you guys talking about?
[03:07:58] Radar: So if phoenix is the new Rails then it is only 5 more releases to go until 1.0
[03:08:07] Aeyrix: It's not the new rails.
[03:08:11] sevenseacat: fryguy: phoenix.
[03:08:17] Radar: fryguy: Phoenix, which is Elixir's web framework
[03:08:19] Aeyrix: Fuckin' dreamers in this channel.
[03:08:26] sevenseacat: nah chris is aiming for a July release of 1.0 afaik
[03:09:36] Radar: fancy pants
[03:09:49] Radar: So tomorrow then?
[03:11:32] sevenseacat: Aeyrix: I'd rather be a dreamer than stuck in a cynical rut tbh, which is what I was before.
[03:11:40] braincrash: has joined #RubyOnRails
[03:11:58] Aeyrix: fair enough
[03:12:05] Aeyrix: I'll stick with my Rails.
[03:12:15] beauby: has joined #RubyOnRails
[03:12:25] sevenseacat: oh I still use rails. it's my day job after all.
[03:13:20] s2013: has joined #RubyOnRails
[03:13:53] sevenseacat: and so far all I've tinkered with in phoenix is the rails-equivalent stuff
[03:14:04] sevenseacat: none of the stuff that sets it apart
[03:14:52] sevenseacat: but the ability to just spawn off processes instead of creating background jobs sounds like a good one.
[03:16:42] bin_005: has joined #RubyOnRails
[03:17:10] sbhatore: has joined #RubyOnRails
[03:18:37] Radar: "Oh I still use Java. It's my day job after all."
[03:18:41] Radar: and so the wheel of time keeps turning :D
[03:19:12] Radar: sevenseacat: the fact that you can hire Rails developers more easily than you can hire Elixir developers ...
[03:19:17] towski_: has joined #RubyOnRails
[03:19:19] Radar: I think you see where I'm going with that
[03:19:54] sevenseacat: I never said Rails would be my day job forever.
[03:20:39] Cache_Money: has joined #RubyOnRails
[03:20:57] ebbflowgo: has joined #RubyOnRails
[03:21:37] bratsche: Elixir is pretty fun.
[03:23:25] manvsmachine: has joined #RubyOnRails
[03:24:25] bf4: has joined #RubyOnRails
[03:25:26] emptyflask: has joined #RubyOnRails
[03:26:05] manvsmachine: has left #RubyOnRails: ()
[03:27:16] sbhatore1: has joined #RubyOnRails
[03:27:32] yfeldblum: has joined #RubyOnRails
[03:28:35] charliesome: has joined #RubyOnRails
[03:28:52] dan0034001: has joined #RubyOnRails
[03:29:00] dopie: has joined #RubyOnRails
[03:30:24] i: has joined #RubyOnRails
[03:31:24] dopie: has joined #RubyOnRails
[03:32:00] darrencauthon: has joined #RubyOnRails
[03:32:50] ProLoser: has joined #RubyOnRails
[03:32:56] danman: has joined #RubyOnRails
[03:33:30] dan0034001: Anyone here?
[03:34:34] dopie: dan0034001, sevenseacat is always here, she just pretends not to be here... she probably also has cats
[03:39:30] dopie: I knew it
[03:39:37] dopie: do you have more than 1?
[03:41:10] dan0034001: you guys work with emberjs at all?
[03:41:16] sevenseacat: but less than seven.
[03:41:20] sbhatore: has joined #RubyOnRails
[03:41:44] dan0034001: i am making an api for an emberjs app
[03:41:49] dan0034001: got CORS working
[03:42:01] DoctorMonocular: has joined #RubyOnRails
[03:42:05] dan0034001: having this issue tho: Refused to connect to 'localhost:3000' because it violates the following Content Security Policy directive:
[03:42:11] yfeldblum: has joined #RubyOnRails
[03:42:36] dan0034001: I have tried this example: https://github.com/rwjblue/ember-cli-content-security-policy
[03:42:39] dan0034001: but still same error
[03:42:42] s2013: has joined #RubyOnRails
[03:44:38] karmic__: has joined #RubyOnRails
[03:45:27] jenrzzz: has joined #RubyOnRails
[03:45:31] Radar: dan0034001: Did you try asking in Embers channel now?
[03:45:38] dan0034001: yea, no one there
[03:46:05] dan0034001: i jsut removed it from my package.json
[03:46:15] dan0034001: now only getting: XMLHttpRequest cannot load localhost:3000. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.
[03:46:40] dan0034001: https://gist.github.com/anonymous/21b1288dca90ceccce74
[03:46:52] dan0034001: I have that in my application.rb
[03:46:56] Radar: I don't know, sorry.
[03:47:13] sevenseacat: it sounds more ember-related.
[03:47:24] dan0034001: XMLHttpRequest cannot load localhost:3000. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.
[03:48:03] sevenseacat: if its a browser error, then yes
[03:48:24] sevenseacat: where did the http go
[03:48:26] dan0034001: I see, so my CORS has nothign to do with that error?
[03:48:32] rhizome: maybe there's a protocol specification that you've left uot
[03:48:43] sevenseacat: should be http://localhost:3000
[03:49:23] sevenseacat: do you need to configure ember to use the right host?
[03:49:24] sevenseacat: ACTION does not know ember
[03:49:34] dan0034001: now getting: XMLHttpRequest cannot load http://localhost:3000/. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:4200' is therefore not allowed access. The response had HTTP status code 404.
[03:50:05] sargas: has joined #RubyOnRails
[03:50:13] sevenseacat: ok now you might have a cors problem
[03:50:31] dan0034001: getting a routing error, looking into this now
[03:52:50] dan0034001: got it working, thanks guys
[03:53:23] sevenseacat: ACTION mumbles something about guys
[03:55:07] nyanz: has joined #RubyOnRails
[03:55:14] karmic__: how can I query with ActiveRecord from production.rb. I have a middleware that needs to be unloaded if certain value exists in a table. right now I'm just getting ActiveRecord::ConnectionNotEstablished if I try to do a simple SettingTable.find....
[03:55:24] Etriaph: sevenseacat: ...
[03:55:56] sevenseacat: karmic__: that sounds... problematic.
[03:56:26] dionysus69: has joined #RubyOnRails
[03:56:44] karmic__: sevenseacat: agreed, seems like the initialization order is not ideal for what I want to do
[03:56:46] thmsmtylr: using .where what is the best method for getting records for the current year only ?
[03:57:51] karmic__: sevenseacat: any suggestions?
[03:58:19] thmsmtylr: I've currently got https://gist.github.com/thmsmtylr/0d4836bfcd43e2843269 but only want records for the current year
[03:58:23] sevenseacat: karmic__: I'd try to avoid the problem if possible. what's so special about this middleware?
[03:59:14] doctorly: has joined #RubyOnRails
[03:59:44] karmic__: we have been using the middleware for a while, it checks that certain query params or cookie values exist, if they don't, it redirects the user to gateway
[04:01:51] robbyoconnor: has joined #RubyOnRails
[04:03:57] yaymukund: has joined #RubyOnRails
[04:07:31] hadees: has joined #RubyOnRails
[04:07:49] s2013: has joined #RubyOnRails
[04:08:56] bronson: has joined #RubyOnRails
[04:11:18] p1k: has joined #RubyOnRails
[04:13:46] michael_mbp: has joined #RubyOnRails
[04:18:10] dpg: has joined #RubyOnRails
[04:18:32] annlewis_: has joined #RubyOnRails
[04:20:14] startupality: has joined #RubyOnRails
[04:20:16] jfarmer: karmic__ Using an environment variable to control that sort of thing seems more reasonable
[04:20:35] jfarmer: karmic__ Alternatively, why can't the middleware be the database-aware thing?
[04:20:58] jfarmer: Just make sure it's invoked after the db connection is established
[04:21:54] karmic__: jfarmer: indeed, I was just doing adding the database logic to the middleware. specifically in the initialization block so it only gets called once
[04:22:26] karmic__: for some reason the rest of the team is not keen on using env vars, sigh
[04:27:18] nya: has joined #RubyOnRails
[04:31:01] Oog: has joined #RubyOnRails
[04:31:39] Oog: https://gist.github.com/gists when i do StripeCharge.new i get PG::UndefinedTable: ERROR: relation "payments" does not exist
[04:31:49] Radar: create the table
[04:31:57] Radar: Oog: And that is not a valid link
[04:32:06] Oog: https://gist.github.com/anonymous/477eda82648fd1ce5b11
[04:32:32] Oog: im doing multi table inheritance - payments table shouldnt have to exist. i set self.table_name = 'stripe_charges'
[04:32:42] s2013: has joined #RubyOnRails
[04:32:59] Oog: the guide said use set_table_name but that is dperecated but i found self.table_name which i thought was the replacement
[04:33:31] Radar: it is the replacement
[04:33:38] Radar: Oog: Try restarting your server?
[04:33:57] Oog: using rails console just started it
[04:34:06] Radar: Can you reproduce in a new app?
[04:34:20] Oog: will try right now
[04:34:24] sevenseacat: is Payment an abstract class?
[04:34:50] Oog: class Payment < ActiveRecord::Base; end
[04:35:21] Oog: is that the problem? /how do i make it one?
[04:35:27] sevenseacat: http://api.rubyonrails.org/classes/ActiveRecord/Inheritance/ClassMethods.html#attribute-i-abstract_class
[04:36:24] Radar: I thought having the table_name set on the StripeCharge class would've been enough.
[04:36:50] sevenseacat: If you are using inheritance with ActiveRecord and don't want child classes to utilize the implied STI table name of the parent class, this will need to be true.
[04:37:16] Oog: how do i make it abstract
[04:37:25] sevenseacat: Oog: by clicking the link i gave you
[04:37:26] Oog: oh wait i see
[04:38:04] p1k: has joined #RubyOnRails
[04:38:16] Oog: works! thanks
[04:41:37] Oog: https://gist.github.com/anonymous/defda7b6dec357fd158e
[04:42:18] nya: has joined #RubyOnRails
[04:42:53] Oog: is mti_get_macro the correct way to return the objects for MTI has_many
[04:43:02] ebbflowgo: has joined #RubyOnRails
[04:43:03] Oog: im using this http://dan.chak.org/enterprise-rails/chapter-10-multiple-table-inheritance/ as a starting point
[04:49:43] LiquidInsect: has joined #RubyOnRails
[04:51:59] LiquidIn1ect: has joined #RubyOnRails
[04:53:01] sevenseacat: I hope you've got tests for this.
[04:53:42] Oog: you know a better guide for MTI?
[04:53:49] Oog: or better pattern/template?
[04:54:12] Oog: first time im doing it seems pretty cool and to be working
[04:55:18] sevenseacat: i dont use it.
[04:55:18] Ropeney: radar: You do a bit of work on the spree project?
[04:55:30] chipotle: has joined #RubyOnRails
[04:55:33] Radar: Ropeney: I used to https://github.com/spree/spree/graphs/contributors
[04:56:05] Ropeney: ah so you haven't touched much of 3.0?
[04:56:12] Radar: none at all
[04:56:21] sevenseacat: 3.0 is out? oh fun
[04:56:39] Ropeney: yeah im having fun with it the last few months
[04:56:54] nobitanobi: has joined #RubyOnRails
[04:57:17] nya: has joined #RubyOnRails
[04:57:41] Oog: how do i get a 64bit integer data type is t.integer that by default with postgres?
[04:57:41] Ropeney: why did you stop or just move on in career?
[05:07:17] errakeshpd: has joined #RubyOnRails
[05:08:42] yfeldblum: has joined #RubyOnRails
[05:10:49] Oog: if im doing nested transactions and an inner transaction succeeds but an outer one fails, is there a way to make it so chagnes from the inner one are saved?
[05:10:57] bf4: has joined #RubyOnRails
[05:11:03] baweaver: has joined #RubyOnRails
[05:11:12] sevenseacat: this sounds overly complex to me.
[05:11:57] lambirdsal: has joined #RubyOnRails
[05:12:17] nya: has joined #RubyOnRails
[05:13:53] Oog: sevenseacat: yeah maybe there is a better way see this https://gist.github.com/anonymous/3496e02ae5a92e77759d
[05:13:57] yfeldblum: has joined #RubyOnRails
[05:14:23] sevenseacat: has joined #RubyOnRails
[05:14:49] Oog: basically im creating stripe charges so i want them to be in the smalles transaction that will save that id - the problem is transactions dont extend to external api calls
[05:14:56] Oog: sevenseacat: yeah maybe there is a better way see this https://gist.github.com/anonymous/3496e02ae5a92e77759d (if you missed this)
[05:17:01] sevenseacat: where's the inner transaction?
[05:17:53] sevenseacat: I'd probably create the order in two steps
[05:18:06] Oog: well its not there yet but i was going to put it around lines 4 and 5
[05:18:13] sevenseacat: create the base order, make the stripe transaction, and save the returned charge... dunno if that is optimal though
[05:18:15] Oog: but the problem is inner transactions seem to be rolled back if the outter one fails
[05:18:23] sevenseacat: isnt that what you asked for?
[05:18:39] Oog: no i want the inner one saved... i want to save that stripe id and new order even if something else fails
[05:19:02] sevenseacat: so, you dont actually want an outer transaction?
[05:19:23] sevenseacat: i'm confused.
[05:19:55] Oog: yeah i guess this doesnt really make sense
[05:21:14] mary5030: has joined #RubyOnRails
[05:22:16] guardianx: has joined #RubyOnRails
[05:23:24] guardianx: has joined #RubyOnRails
[05:23:59] Spami: has joined #RubyOnRails
[05:26:21] rvanlieshout: has joined #RubyOnRails
[05:26:28] jfarmer: has joined #RubyOnRails
[05:26:40] dhjondoh: has joined #RubyOnRails
[05:26:58] iamse7en: has joined #RubyOnRails
[05:27:18] nya: has joined #RubyOnRails
[05:27:40] Sheperson: has joined #RubyOnRails
[05:28:20] guardianx: has joined #RubyOnRails
[05:28:46] danman: has joined #RubyOnRails
[05:29:06] Sheperson: I am trying to install ruby-2.2.2 on OS X (10.10.2) using RVM, but I get an error
[05:29:23] Sheperson: ./tool/rbinstall.rb:728:in `block in <main>': stack level too deep (SystemStackError
[05:29:53] Radar: sheperson: I wrote a guide to install Ruby on Mac that many people have used: http://ryanbigg.com/2015/06/mac-os-x-ruby-ruby-install-chruby-and-you/. I would recommend that you try it out too.
[05:29:59] Radar: You'll need to implode rvm first: "rvm implode"
[05:31:06] Sheperson: Thanks Radar
[05:32:21] Sheperson: Does RVM have any problems with 2.2.2?
[05:32:52] kp666: has joined #RubyOnRails
[05:33:03] x-light: has joined #RubyOnRails
[05:33:04] Radar: No idea. I haven't used rvm for years
[05:33:29] p1k: has joined #RubyOnRails
[05:33:31] Sheperson: Is there any specific reason?
[05:34:01] Aeyrix: It's p average.
[05:34:05] Aeyrix: Use ruby-install instead.
[05:34:18] Radar: Read the postscript of my blog post
[05:34:27] Radar: I explain my reasoning for not using rvm there
[05:34:32] sevenseacat: it does far too much, and it doesnt do it well.
[05:35:12] Sheperson: this is funny
[05:35:14] Sheperson: >Even if you don't want to use Bundler (i.e. you're crazy)
[05:35:50] Aeyrix: Bundler just got irritating though.
[05:35:59] Aeyrix: Maybe someone should revise that postscript.
[05:36:35] Rubie: has joined #RubyOnRails
[05:36:41] chipotle: has joined #RubyOnRails
[05:36:45] sevenseacat: if someone comes up with something better than bundler, I'll gladly use it. until then, I'll be glad I wasn't using Ruby before bundler was around.
[05:37:00] Aeyrix: ACTION forks Bundler prior to the versioning change.
[05:38:20] Sheperson: After imploding RVM, I am trying to remove it from my . files
[05:38:40] trollga: has joined #RubyOnRails
[05:38:44] Radar: Ruby with Bundler is way better
[05:39:01] sevenseacat: so I've heard
[05:39:02] Radar: Very soon I will demonstrate how I want people to ask questions by asking my own question.
[05:39:07] Sheperson: RVM was in ~/.profile ~/.zlogin~/.bash_profile ~/.bashrc and ~/.zshrc!
[05:39:15] Radar: where is blizzy, arup_r etc when you want to teach them a lesson?
[05:39:23] Aeyrix: calling people out
[05:39:25] Aeyrix: is illegal
[05:39:36] Radar: Helping them out*
[05:39:42] sevenseacat: teaching them.
[05:39:47] Aeyrix: if you say os
[05:41:47] Radar: So I'm seeing a weird issue where I'm submitting an array of parameters to my Rails app and Rails thinks its a hash.
[05:41:47] Radar: Expected: {"features"=>{"product_features"=>["one", "two", "three"]}}
[05:41:47] Radar: Got: {"features"=>{"product_features"=>{"0"=>"one", "1"=>"two", "2"=>"three"}}}
[05:41:59] Radar: I have an app which can reproduce the issue here: https://github.com/radar/param_example
[05:42:30] p1k: has joined #RubyOnRails
[05:42:43] sevenseacat: ACTION clones repo
[05:43:22] Radar: I'm guessing either Rack or ActionController does it
[05:43:30] Radar: But I can't really be fucked diving into either this late in the day
[05:44:09] lxsameer: has joined #RubyOnRails
[05:44:45] XCMer: has joined #RubyOnRails
[05:47:12] Radar: A potential solution is to process the body through Rack::Utils.build_nested_query first, which URI encodes it
[05:47:35] Radar: I don't know if that's the "right" solution.
[05:48:07] SuMo_D: has joined #RubyOnRails
[05:48:16] nigelx344: has joined #RubyOnRails
[05:48:34] Xiti: has joined #RubyOnRails
[05:48:45] Xiti: has joined #RubyOnRails
[05:49:03] speaking1ode: has joined #RubyOnRails
[05:49:41] workmad3: has joined #RubyOnRails
[05:50:05] sevenseacat: k verified theres a problem there, I think I've seen this before somewhere
[05:50:31] Radar: nigelx344: yes it owkrs
[05:50:46] nigelx344: hi seven hi radar
[05:50:46] Aeyrix: ban for spam
[05:52:19] sevenseacat: trying to remember this problem hummmmmm
[05:52:40] konsolebox: has joined #RubyOnRails
[05:53:59] s2013: sup Radar
[05:54:06] Radar: thanks for buying Deep Dive Rails
[05:54:13] s2013: thank you for working on it
[05:54:17] s2013: when will it be done
[05:54:28] Radar: When you pay me a full-time wage to work on it full-time.
[05:54:54] s2013: i have 30 cents
[05:55:00] Radar: I'll happily write books for full-time wage.
[05:55:05] anthonys: has joined #RubyOnRails
[05:55:06] Radar: or even part-time wages
[05:55:11] Radar: 2 days book writing, 3 days working
[05:55:37] s2013: im writing a book now
[05:56:02] sevenseacat: Radar: suggest typhoeus is doing something foobared. running http://localhost:3000/?product[features][product_features][]=one&product[features][product_features][]=two&product[features][product_features][]=three gives the expected array in the controller.
[05:56:18] Radar: sevenseacat: fun fun :)
[05:56:22] s2013: what are you working on Aeyrix
[05:56:36] Radar: Going with the Rack solution until someone can come up with a better one.
[05:56:50] Aeyrix: A steampunk novella set in the 18th century.
[05:56:57] s2013: very cool. how far along are you?
[05:56:59] Aeyrix: In all seriousness, it's something infosec related.
[05:57:06] sevenseacat: Radar: https://github.com/typhoeus/typhoeus/issues/424#issuecomment-70402008 related?
[05:57:10] Aeyrix: Not hugely. Mostly skeletal.
[05:57:13] Aeyrix: I don't have heaps of time.
[05:57:17] nya: has joined #RubyOnRails
[05:57:18] s2013: oh alright
[05:57:28] s2013: im hoping to finish it by august.
[05:57:43] Aeyrix: I could probably do EOY
[05:57:45] Aeyrix: with my current schedule
[05:57:47] mbuf: has joined #RubyOnRails
[05:57:49] roolo: has joined #RubyOnRails
[05:57:53] s2013: im thinking of selling it at $30
[05:58:07] s2013: but anyways the book isnt my main goal.. its to funnel for my next venture
[05:58:08] yardenbar: has joined #RubyOnRails
[05:58:12] sevenseacat: Radar: also https://github.com/typhoeus/typhoeus/issues/210
[05:58:19] Radar: sevenseacat: thank you, that's the answer :)
[05:59:09] mbuf: I ran rake db:setup from inside a docker container in RDS and it created a new database with schema_migrations 0; but, when running rake db:migrate, it doesn't run the migrations. The log mentions SELECT `schema_migrations`.`version` FROM `schema_migrations` ","@timestamp":"2015-06-30T05:54:47.441+00:00","@version":"1","severity":"DEBUG"
[05:59:33] Sheperson: has joined #RubyOnRails
[06:00:05] s2013: Radar what do you think is the litmus test for a multi tenant application when choosing whether to use one db or multiple
[06:00:21] Radar: s2013: Do you expect to have thousands of customers?
[06:00:27] s2013: eventually, yes
[06:00:43] Radar: (and I think by databases you mean schemas)
[06:01:00] Radar: The issue with multiple schemas in the one db on postgresql is that backups can take a very long time
[06:01:08] sevenseacat: I wish I'd gone the schema approach in one app i did MT in
[06:01:16] sevenseacat: that never went live anyway so it doesnt matter.
[06:01:26] Radar: So if you're going for Web Scale(tm) then I would advise a single database + schema, with the partitioning done inside the table with an account_id keyt
[06:01:27] s2013: not multiple schemas.. i think i was reading about using multiple dbs
[06:01:44] Radar: s2013: switching between those DBs in Rails costs time
[06:02:30] Aeyrix: https://www.youtube.com/watch?v=sT0Wz-TI41E
[06:02:46] s2013: i was reading your multi tenant book.. out of all my years i havent really built a true multi tenant application
[06:05:17] Etriaph: Night folks.
[06:06:57] sandstrom: has joined #RubyOnRails
[06:08:48] bf4: has joined #RubyOnRails
[06:09:47] Sheperson: Etriaph It???s morning here!
[06:10:19] eGGsha: has joined #RubyOnRails
[06:10:24] krokuz_: has joined #RubyOnRails
[06:10:29] guardianx: has joined #RubyOnRails
[06:11:27] dented42: has joined #RubyOnRails
[06:12:17] nya: has joined #RubyOnRails
[06:15:16] alex88: has joined #RubyOnRails
[06:16:00] ebbflowgo: has joined #RubyOnRails
[06:16:07] gauke: has joined #RubyOnRails
[06:18:39] guardianx: has joined #RubyOnRails
[06:21:29] comrad: has joined #RubyOnRails
[06:21:36] emilkarl: has joined #RubyOnRails
[06:27:18] nya: has joined #RubyOnRails
[06:27:31] EXCHGR: has joined #RubyOnRails
[06:28:52] guardianx: has joined #RubyOnRails
[06:29:40] Nikamura: has joined #RubyOnRails
[06:29:42] Nikamura: Hi guys, quick question is it possible to limit how many concurent workers per queue (only for one queue) in ActiveJob using sidekiq
[06:30:07] Lightsword: has joined #RubyOnRails
[06:30:50] codeshah: has joined #RubyOnRails
[06:31:18] baweaver: sidekiq.yml works for configs
[06:31:43] baweaver: http://ruby-journal.com/how-to-integrate-sidekiq-with-activejob/
[06:31:47] Nikamura: yes but changing there it will limit for all queues
[06:31:59] Nikamura: i just need to limit one queue to lets say 5 workers and have 25 workers total
[06:32:27] baweaver: [high_priority, 2]
[06:32:44] baweaver: you could just make more workers per certain 'high priority' queues
[06:33:18] baweaver: past that I'd have to look into it myself
[06:34:43] Sheperson: Radar: What do you think about rbenv?
[06:34:47] s2013: has joined #RubyOnRails
[06:36:22] JohnBat26: has joined #RubyOnRails
[06:36:59] s2013: has joined #RubyOnRails
[06:37:19] XCMer: has joined #RubyOnRails
[06:37:30] mikecmpbll: has joined #RubyOnRails
[06:37:54] GnuYawk: has joined #RubyOnRails
[06:38:14] guardianx: has joined #RubyOnRails
[06:39:39] guardianx: has joined #RubyOnRails
[06:39:45] hahuang65: has joined #RubyOnRails
[06:39:55] annlewis: has joined #RubyOnRails
[06:40:28] gauke: has joined #RubyOnRails
[06:40:33] User458764: has joined #RubyOnRails
[06:40:35] s2013: has joined #RubyOnRails
[06:40:47] guardianx: has joined #RubyOnRails
[06:42:16] nya: has joined #RubyOnRails
[06:42:26] krz: has joined #RubyOnRails
[06:43:01] guardianx: has joined #RubyOnRails
[06:43:39] aufi: has joined #RubyOnRails
[06:45:25] kitsuneyo: has joined #RubyOnRails
[06:47:02] solars: has joined #RubyOnRails
[06:48:21] Dreamer3: has joined #RubyOnRails
[06:48:59] XCMer: has joined #RubyOnRails
[06:50:56] guardianx: has joined #RubyOnRails
[06:50:59] Lightsword: has joined #RubyOnRails
[06:52:18] ur5us: has joined #RubyOnRails
[06:54:00] guardianx: has joined #RubyOnRails
[06:55:43] hadees: has joined #RubyOnRails
[06:56:37] Spami: has joined #RubyOnRails
[06:56:48] guardianx: has joined #RubyOnRails
[06:56:51] duderonomy: has joined #RubyOnRails
[06:56:55] sevenseacat: has joined #RubyOnRails
[06:57:05] sandstrom: has joined #RubyOnRails
[06:59:17] guardianx: has joined #RubyOnRails
[07:00:38] doodlehaus: has joined #RubyOnRails
[07:02:28] doodleha_: has joined #RubyOnRails
[07:03:32] LiquidInsect: has joined #RubyOnRails
[07:04:07] Trefex: has joined #RubyOnRails
[07:04:25] doodlehaus: has joined #RubyOnRails
[07:04:37] guardianx: has joined #RubyOnRails
[07:05:02] jfoxCZ: has joined #RubyOnRails
[07:06:20] doodlehaus: has joined #RubyOnRails
[07:06:31] guardianx: has joined #RubyOnRails
[07:07:57] mbuf: Running rake db:reset creates a schema_migrations table with version 0 in it. But, then running rake db:migrate doesn't run the migrations. What could I be missing?
[07:08:18] s2013: has joined #RubyOnRails
[07:08:18] doodlehaus: has joined #RubyOnRails
[07:08:26] sevenseacat: what migrations?
[07:08:40] mbuf: sevenseacat, database migrations
[07:09:02] sevenseacat: imma pretend you didnt just say that
[07:09:11] sevenseacat: and answer my question, what migrations are you running?
[07:09:30] anthonys: has joined #RubyOnRails
[07:09:32] sevenseacat: whats an example of something that wont run?
[07:09:41] mbuf: sevenseacat, trying to bootstrap a new database by creating tables
[07:09:43] guardianx: has joined #RubyOnRails
[07:09:49] eGGsha: has joined #RubyOnRails
[07:09:50] LiquidInsect: has joined #RubyOnRails
[07:10:12] doodlehaus: has joined #RubyOnRails
[07:10:18] Radar: sheperson: I used to use rbenv and I have no problem with it. I just prefer chruby+ruby-install now
[07:10:23] guardianx: has joined #RubyOnRails
[07:10:37] jfoxCZ_: has joined #RubyOnRails
[07:11:22] bronson: has joined #RubyOnRails
[07:11:38] Bertg: has joined #RubyOnRails
[07:12:13] doodleha_: has joined #RubyOnRails
[07:12:16] mbuf: sevenseacat, http://fpaste.org/237910/ any thoughts?
[07:13:34] sevenseacat: just one. why cant people answer questions that i ask?
[07:14:03] doodlehaus: has joined #RubyOnRails
[07:14:21] EXCHGR: has joined #RubyOnRails
[07:14:23] sevenseacat: ah well, doesn't matter.
[07:14:25] mbuf: sevenseacat, sorry, I thought I answered your question; database migrations to create tables and modify them
[07:14:46] jfoxCZ_: has left #RubyOnRails: ()
[07:15:44] tvw: has joined #RubyOnRails
[07:16:01] hd1: aside from database migrations, what other types of migrations are there?
[07:16:02] doodleha_: has joined #RubyOnRails
[07:16:17] Macaveli: has joined #RubyOnRails
[07:17:55] doodlehaus: has joined #RubyOnRails
[07:18:07] benhuda: has joined #RubyOnRails
[07:18:15] yaymukund: has joined #RubyOnRails
[07:18:49] iateadonut: has joined #RubyOnRails
[07:19:13] iateadonut: why isn't /vendor in the default .gitignore file? do you put it in?
[07:19:33] rvanlieshout: i don't place anything in vendor
[07:19:53] doodleha_: has joined #RubyOnRails
[07:20:16] sevenseacat: because vendor files are needed to run the application
[07:20:23] sevenseacat: otherwise you wouldnt have a vendor folder at all
[07:20:43] iateadonut: yeah, but why would you commit them? wouldn't you just run bundle update or whatever when you put your app on a new server?
[07:20:57] sevenseacat: because vendored files are ones that dont come from gems
[07:21:32] sevenseacat: for example, if you were using some jquery libraries
[07:21:34] sevenseacat: they would go in vendor
[07:21:45] doodlehaus: has joined #RubyOnRails
[07:21:53] chenillen: has joined #RubyOnRails
[07:22:10] hanss: I need to create a multiple input form that will create a new record on a join table. Am I on the right track with putting this in the controller? Is this even a correct implementing this? https://gist.github.com/thebleakness/55f1fffad8747b1839a1
[07:22:33] iateadonut: ok. so when you make a gitignore file, do you put in /vendor/bundle then?
[07:22:42] CheckYourSix: has joined #RubyOnRails
[07:22:49] sevenseacat: I dont know what vendor/bundle is
[07:23:02] sevenseacat: don't think I've ever used it.
[07:23:04] iateadonut: or vendor/bundle is where bundler gems are stored.
[07:23:08] krokuz_: has joined #RubyOnRails
[07:23:14] sevenseacat: only if you vendor your gems
[07:23:19] sevenseacat: I don't typically do that
[07:23:33] iateadonut: you just add them to your main ruby install?
[07:23:41] doodlehaus: has joined #RubyOnRails
[07:23:52] sevenseacat: I keep one pool of gems for all my apps, yes
[07:24:30] iateadonut: and when you move your application to a production server, what do you do? keep a readme of the gems that need to be installed as dependencies?
[07:24:48] sevenseacat: I run bundle install
[07:25:41] doodleha_: has joined #RubyOnRails
[07:26:04] rvanlieshout: capistrano runs bundle install for me :)
[07:26:16] CheckYourSix: has joined #RubyOnRails
[07:26:17] sevenseacat: even better :)
[07:26:23] iateadonut: ok. i think you use the /vendor/bundle diretory then. i'm going to test and find out.
[07:26:28] sevenseacat: no, we don't.
[07:26:32] hotpancakes: has joined #RubyOnRails
[07:26:56] iateadonut: ok. my mistake. i thought that's where bundle installed gems. i'm going to test now and figure it out.
[07:27:19] nya: has joined #RubyOnRails
[07:27:23] sevenseacat: if you wanted to know where bundler installed gems, why didn't you just ask that?
[07:27:36] rvanlieshout: bundle show <gem>
[07:27:42] doodlehaus: has joined #RubyOnRails
[07:27:43] iateadonut: i wanted to know if i should .gitignore the bundler gems directory
[07:27:51] Macaveli: has joined #RubyOnRails
[07:27:51] sevenseacat: its outside your project, so no.
[07:27:55] iateadonut: that shoud've been my question.
[07:28:04] sevenseacat: check `gem env` and see what your gem paths look like.
[07:29:29] doodleha_: has joined #RubyOnRails
[07:31:22] doodlehaus: has joined #RubyOnRails
[07:32:34] EXCHGR: has joined #RubyOnRails
[07:33:18] doodleha_: has joined #RubyOnRails
[07:33:40] puppeh: has joined #RubyOnRails
[07:34:22] puppeh: I'm upgrading from 3.2.x to 4.0.x. I must set the new secret_key_base and keep the old `secret_token` too. Question is: should the new secret_key_base have the *same value* as my current secret_token?
[07:34:41] puppeh: (I want to to transparently upgrade, that's why I keep both as suggested by the offficial documentation)
[07:35:13] doodlehaus: has joined #RubyOnRails
[07:36:42] muhammadn: has joined #RubyOnRails
[07:36:49] Oog: having a very strange problem.... https://gist.github.com/anonymous/a6eedd3645223ec17ea0
[07:37:09] doodlehaus: has joined #RubyOnRails
[07:37:11] muhammadn: anyone having this problem when using mongodb: NoMethodError: undefined method `relations' for #<Class:0x0000000416d678>
[07:37:19] mbuf: has joined #RubyOnRails
[07:37:25] muhammadn: it happens when i do the '.save' method
[07:37:25] Oog: in the payments method - self.mti_get_macro doesnt seem to call the function
[07:37:29] Lightsword: has joined #RubyOnRails
[07:37:47] mbuf: what can cause rake db:reset to create a schema_migrations table with version 0? using Rails 3.x
[07:37:52] Oog: i think it might have something to do with module include im not famliar with
[07:38:10] robertfalken: has joined #RubyOnRails
[07:38:28] workmad3: has joined #RubyOnRails
[07:39:03] doodlehaus: has joined #RubyOnRails
[07:39:20] Oog: mti_get_macro seems to be memoized or something crazy
[07:39:30] Oog: it just automatically returns [] the function isnt executed i dont get it
[07:39:39] camonz: has joined #RubyOnRails
[07:40:45] jenrzzz: has joined #RubyOnRails
[07:40:58] doodleha_: has joined #RubyOnRails
[07:41:02] exadeci: has joined #RubyOnRails
[07:42:03] EXCHGR: has joined #RubyOnRails
[07:42:17] nya: has joined #RubyOnRails
[07:42:33] shortCircuit__1: has joined #RubyOnRails
[07:42:52] doodleha_: has joined #RubyOnRails
[07:42:55] sandstrom: has joined #RubyOnRails
[07:44:45] doodlehaus: has joined #RubyOnRails
[07:45:25] hahuang65: has joined #RubyOnRails
[07:45:43] mbuf: I think I have hit this problem, http://stackoverflow.com/questions/27806065/rake-dbmigrate-does-nothing-even-on-reset, but, not sure what non-special characters mean in Rails
[07:46:21] kares: has joined #RubyOnRails
[07:46:36] Macaveli: Is it possible to detect the page that send you to this current page?
[07:46:45] doodlehaus: has joined #RubyOnRails
[07:46:49] sevenseacat: sure, it would be the referer.
[07:46:54] skroon: has joined #RubyOnRails
[07:48:45] doodleha_: has joined #RubyOnRails
[07:49:00] krz: has joined #RubyOnRails
[07:49:01] acti0nman: has joined #RubyOnRails
[07:49:08] Lightsword: has joined #RubyOnRails
[07:50:34] doodlehaus: has joined #RubyOnRails
[07:52:30] doodleha_: has joined #RubyOnRails
[07:54:19] doodlehaus: has joined #RubyOnRails
[07:55:13] artto: has joined #RubyOnRails
[07:56:18] doodlehaus: has joined #RubyOnRails
[07:56:23] nya: has joined #RubyOnRails
[07:56:59] mikecmpbll: has joined #RubyOnRails
[07:58:02] Spami: has joined #RubyOnRails
[07:58:09] doodlehaus: has joined #RubyOnRails
[07:59:16] DaniG2k: has joined #RubyOnRails
[08:00:09] doodlehaus: has joined #RubyOnRails
[08:00:57] adre: has joined #RubyOnRails
[08:01:56] hotpancakes: has joined #RubyOnRails
[08:01:57] jfarmer: has joined #RubyOnRails
[08:02:02] doodlehaus: has joined #RubyOnRails
[08:02:03] Rubie: has joined #RubyOnRails
[08:03:20] jsrn_: has joined #RubyOnRails
[08:03:30] x-light: has joined #RubyOnRails
[08:03:59] doodlehaus: has joined #RubyOnRails
[08:04:02] ur5us: has joined #RubyOnRails
[08:04:13] yfeldblum: has joined #RubyOnRails
[08:05:52] doodlehaus: has joined #RubyOnRails
[08:07:14] eGGsha: has joined #RubyOnRails
[08:07:48] doodleha_: has joined #RubyOnRails
[08:09:40] doodlehaus: has joined #RubyOnRails
[08:09:52] yardenbar: has joined #RubyOnRails
[08:11:17] startupality: has joined #RubyOnRails
[08:11:22] Benni: has joined #RubyOnRails
[08:11:37] doodlehaus: has joined #RubyOnRails
[08:11:53] kares: has left #RubyOnRails: ()
[08:12:17] nya: has joined #RubyOnRails
[08:13:28] darutoko: has joined #RubyOnRails
[08:13:31] doodleha_: has joined #RubyOnRails
[08:13:39] jenrzzz: has joined #RubyOnRails
[08:14:50] anthonys: has joined #RubyOnRails
[08:15:13] arBmind: has joined #RubyOnRails
[08:15:29] doodlehaus: has joined #RubyOnRails
[08:15:50] Contigi: has joined #RubyOnRails
[08:17:22] doodlehaus: has joined #RubyOnRails
[08:17:54] emilkarl_: has joined #RubyOnRails
[08:18:57] n008f4g_: has joined #RubyOnRails
[08:19:00] aligo: has joined #RubyOnRails
[08:19:15] doodleha_: has joined #RubyOnRails
[08:21:11] doodlehaus: has joined #RubyOnRails
[08:23:07] doodlehaus: has joined #RubyOnRails
[08:23:09] eGGsha: has joined #RubyOnRails
[08:23:26] Spami: has joined #RubyOnRails
[08:25:04] doodlehaus: has joined #RubyOnRails
[08:26:02] ebbflowgo: has joined #RubyOnRails
[08:26:11] Ergo^: has joined #RubyOnRails
[08:26:13] Lightsword: has joined #RubyOnRails
[08:26:58] doodleha_: has joined #RubyOnRails
[08:27:17] nya: has joined #RubyOnRails
[08:28:53] doodlehaus: has joined #RubyOnRails
[08:30:25] bruno-: has joined #RubyOnRails
[08:30:49] doodleha_: has joined #RubyOnRails
[08:32:13] DaniG2k: has joined #RubyOnRails
[08:32:43] doodlehaus: has joined #RubyOnRails
[08:34:36] LiquidInsect: has joined #RubyOnRails
[08:34:40] doodleha_: has joined #RubyOnRails
[08:35:20] chrissonar: has joined #RubyOnRails
[08:36:33] doodlehaus: has joined #RubyOnRails
[08:38:30] doodlehaus: has joined #RubyOnRails
[08:39:01] eGGsha: has joined #RubyOnRails
[08:40:25] doodlehaus: has joined #RubyOnRails
[08:42:17] nya: has joined #RubyOnRails
[08:42:22] doodleha_: has joined #RubyOnRails
[08:44:04] emilkarl: has joined #RubyOnRails
[08:44:14] doodlehaus: has joined #RubyOnRails
[08:44:43] yaymukund: has joined #RubyOnRails
[08:46:12] doodlehaus: has joined #RubyOnRails
[08:47:30] marr: has joined #RubyOnRails
[08:47:32] Hates_: has joined #RubyOnRails
[08:47:57] cac: has joined #RubyOnRails
[08:48:03] Hates_: has joined #RubyOnRails
[08:48:06] doodlehaus: has joined #RubyOnRails
[08:48:55] pgatt: has joined #RubyOnRails
[08:50:03] doodlehaus: has joined #RubyOnRails
[08:51:59] doodleha_: has joined #RubyOnRails
[08:52:59] Lightsword: has joined #RubyOnRails
[08:53:54] doodlehaus: has joined #RubyOnRails
[08:55:52] doodlehaus: has joined #RubyOnRails
[08:57:17] nya: has joined #RubyOnRails
[08:57:33] Palsson: has joined #RubyOnRails
[08:57:48] doodlehaus: has joined #RubyOnRails
[08:58:17] michael_mbp: has joined #RubyOnRails
[08:58:27] shortCir1uit__: has joined #RubyOnRails
[08:58:43] srinidhi: has joined #RubyOnRails
[08:59:33] hotpancakes: has joined #RubyOnRails
[08:59:44] doodlehaus: has joined #RubyOnRails
[09:01:40] doodleha_: has joined #RubyOnRails
[09:03:35] shortCircuit__1: has joined #RubyOnRails
[09:03:44] doodlehaus: has joined #RubyOnRails
[09:04:27] DEA7TH_: has joined #RubyOnRails
[09:04:38] quazimodo: has joined #RubyOnRails
[09:05:11] artto_: has joined #RubyOnRails
[09:05:17] shortCircuit__1: has left #RubyOnRails: ()
[09:05:28] doodlehaus: has joined #RubyOnRails
[09:07:10] dici: has joined #RubyOnRails
[09:07:25] doodlehaus: has joined #RubyOnRails
[09:08:02] shortCircuit__1: has joined #RubyOnRails
[09:08:24] noodman: has joined #RubyOnRails
[09:09:22] doodlehaus: has joined #RubyOnRails
[09:10:25] srinidhi: Hi! I have created a file under public folder, say 12345, and want to capture HTTP headers of whoever accesses /12345 route. How can I achieve this?
[09:10:36] srinidhi: I'm using passenger to serve the rails app
[09:11:01] srinidhi: and IIRC, public files are directly served by apache
[09:11:19] doodleha_: has joined #RubyOnRails
[09:11:37] srinidhi: I've been reading about Rack::Static, but not sure how / where to put this
[09:12:15] bin_005: has joined #RubyOnRails
[09:12:17] nya: has joined #RubyOnRails
[09:12:43] lupine: srinidhi, rack will never see the requests
[09:12:47] lupine: so it's an apache log question
[09:13:07] srinidhi: lupine: yeah, reading about that as well
[09:13:13] doodlehaus: has joined #RubyOnRails
[09:13:40] lupine: some request details can be output in commonlog format, but not full request header dumps
[09:13:56] lupine: you'd probably need to get it out of apache before you can do that, if that's what you're after
[09:14:32] riotjones: has joined #RubyOnRails
[09:14:48] drale2k: has joined #RubyOnRails
[09:14:59] srinidhi: lupine: okay, thanks!
[09:15:09] doodlehaus: has joined #RubyOnRails
[09:17:08] doodleha_: has joined #RubyOnRails
[09:18:33] workmad3: has joined #RubyOnRails
[09:19:04] doodlehaus: has joined #RubyOnRails
[09:19:16] Palsson: has joined #RubyOnRails
[09:20:02] Pathfinder: has joined #RubyOnRails
[09:21:01] doodleha_: has joined #RubyOnRails
[09:22:57] doodlehaus: has joined #RubyOnRails
[09:24:50] artto: has joined #RubyOnRails
[09:24:51] doodleha_: has joined #RubyOnRails
[09:25:00] eGGsha: has joined #RubyOnRails
[09:25:27] n0nick: has joined #RubyOnRails
[09:25:34] LiquidInsect: has joined #RubyOnRails
[09:26:48] doodlehaus: has joined #RubyOnRails
[09:27:17] nya: has joined #RubyOnRails
[09:28:26] Sylario: has joined #RubyOnRails
[09:28:42] doodlehaus: has joined #RubyOnRails
[09:28:43] mbuf: sevenseacat, found the solution. When running the database migrations inside a Docker container, an env VERSION is set to indicate the container tag. But, Rails thinks that that is the database migration number
[09:28:53] mbuf: sevenseacat, unsetting the env VERSIOn solved the problem
[09:29:26] wethu: has joined #RubyOnRails
[09:29:37] speakingcode: has joined #RubyOnRails
[09:30:38] doodlehaus: has joined #RubyOnRails
[09:31:31] aceRacer: has joined #RubyOnRails
[09:32:45] aceRacer: I am being unable to convert the sql into active record query https://gist.github.com/argentum47/0b267e306fb1853e6996 plz help
[09:33:30] rvanlieshout: User.joins(shortlists: { notifications: :profiles }).where(profiles: { id: 4 })
[09:33:45] abuzze: has joined #RubyOnRails
[09:33:52] nfk: has joined #RubyOnRails
[09:34:21] skroon: has joined #RubyOnRails
[09:34:29] hahuang65: has joined #RubyOnRails
[09:35:05] aceRacer: how did you do that so fast :P
[09:36:51] aceRacer: I want to learn .. I mean I can do sql, I have been doing php for a while. will that fire multiple queries? let me check...
[09:37:14] nya: has joined #RubyOnRails
[09:37:39] rvanlieshout: that won't fire multiple queries
[09:37:42] aceRacer: um, this didn't return any result as such #<User::ActiveRecord_Relation:0x3f853f4c4d80>
[09:38:00] rvanlieshout: and note that multiple queries isn't bad
[09:38:06] rvanlieshout: it is better in quite some cases
[09:38:10] rvanlieshout: but what do you want to have?
[09:38:29] rvanlieshout: that relation-object only fetches the data when you access it
[09:39:09] aceRacer: oh i see. so I have to run a collect
[09:39:22] rvanlieshout: if you run it in a console it'll just execute it
[09:39:28] rvanlieshout: but it all depends on what you want to have
[09:39:31] rvanlieshout: what result would you want?
[09:40:22] aceRacer: I I want the users who has shortlisted a profile with a given id and the shortlisted record has a notification
[09:40:37] rvanlieshout: so that statement there would return the users
[09:40:40] rvanlieshout: if you iterate over them
[09:41:03] rvanlieshout: or do just want a list of there names or something similar?
[09:41:07] Spami: has joined #RubyOnRails
[09:41:32] aceRacer: I actually have an each serializer that will give the id, full_name and email of the users.
[09:41:52] rvanlieshout: but we can improve the query if i know what you exactly want
[09:43:14] Pupeno: has joined #RubyOnRails
[09:43:14] Pupeno: has joined #RubyOnRails
[09:43:20] aceRacer: i am using it in the api.. in the profiles index page, I have a modal that will show the list of users who has shortlisted the profile and has opted to notify the user. when the user is notifying, actually the source_id in the notiifcation table gets populated with the shortlist_id
[09:43:59] aceRacer: I mean every profile has a show shortlists link that opens the modal
[09:44:06] iateadonut: what is the default table created for managing migrations?
[09:44:20] rvanlieshout: iateadonut: schema_migrations iirc
[09:44:34] rvanlieshout: aceRacer: ah right. so what if you iterate over this collection?
[09:45:11] aceRacer: but if the list is very long then iterating wouldn't be costly ?
[09:45:39] DylanJ: how long is long
[09:46:04] rvanlieshout: that depends on how long
[09:46:08] rvanlieshout: you could fetch it in batches
[09:46:19] rvanlieshout: that could help the db
[09:46:30] rvanlieshout: but that's not relevant for let's say 100 records
[09:46:41] iateadonut: i'm building a new application on an old database, and i'm getting this error when trying to run my first migration:
[09:46:41] iateadonut: ActiveRecord::StatementInvalid: PG::InvalidSchemaName: ERROR: no schema has been selected to create in
[09:46:41] iateadonut: : CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)
[09:46:50] rvanlieshout: and you could use pluck if you don't need the model instances
[09:46:51] aceRacer: oh .. ok.. I am trying to do
[09:46:54] aceRacer: User.joins(shortlists: { notifications: :profiles }).where(profiles: { id: 4 }).pluck(:id)
[09:47:03] DylanJ: pluck id of what
[09:47:07] DylanJ: does that work even?
[09:48:16] rvanlieshout: pluck('users.id')
[09:48:20] rvanlieshout: that would just give an array
[09:48:25] rvanlieshout: but that's only helpful if you don't need the objects
[09:48:36] rvanlieshout: and iterating over a few records isn't that costly
[09:52:45] krz: has joined #RubyOnRails
[09:53:07] microdex: has joined #RubyOnRails
[09:53:11] emilkarl: has joined #RubyOnRails
[09:53:35] emptyflask: has joined #RubyOnRails
[09:55:32] annlewis_: has joined #RubyOnRails
[09:56:00] yardenbar: has joined #RubyOnRails
[09:56:43] IanV0rn2341: has joined #RubyOnRails
[09:58:57] stamina: has joined #RubyOnRails
[09:59:44] hotpancakes: has joined #RubyOnRails
[10:00:54] wethu: has joined #RubyOnRails
[10:05:03] ebbflowgo: has joined #RubyOnRails
[10:06:27] Cork: is there a clean way to do strong params .require but just returning an empty strong param if the key doesn't exist?
[10:09:46] Pupeno_: has joined #RubyOnRails
[10:11:22] rvanlieshout: Cork: isn't that why permit exists?
[10:11:33] Cork: no permit filters what keys are allowed
[10:11:58] ndrei: has joined #RubyOnRails
[10:12:04] Cork: { key: { subkey: val1, subkey2: val2 } }.require(:key) => { subkey: val1, subkey2: val2 }
[10:12:14] LiquidInsect: has joined #RubyOnRails
[10:12:18] Cork: { key: { subkey: val1, subkey2: val2 } }.permit(:key) => { key: { subkey: val1, subkey2: val2 } }
[10:12:36] rvanlieshout: .permit(:key)[:key]
[10:12:57] Cork: i want {}.optional(:key).permit(:subkey, :subkey2)
[10:13:11] Cork: so { something: value } => {} and not crash
[10:13:31] Cork: permit(:key)[:key).permit() would crash
[10:14:17] Cork: currently i have to do a messy create a new strong param and variable = params.require() unless params[:key].blank?
[10:14:23] Cork: and then use the variable in .new
[10:14:30] Cork: and it isn't pretty at all :/
[10:15:00] Macaveli: has joined #RubyOnRails
[10:15:51] Spami: has joined #RubyOnRails
[10:18:41] rvanlieshout: what should it do when :key isn't present?
[10:19:27] startupality: has joined #RubyOnRails
[10:20:32] rickmasta: has joined #RubyOnRails
[10:23:06] annlewis: has joined #RubyOnRails
[10:24:29] startupality: has joined #RubyOnRails
[10:25:50] Benni: has joined #RubyOnRails
[10:27:00] Hates_: has joined #RubyOnRails
[10:30:10] eGGsha: has joined #RubyOnRails
[10:33:22] arup_r: has joined #RubyOnRails
[10:34:14] ur5us: has joined #RubyOnRails
[10:34:26] trollga: has joined #RubyOnRails
[10:35:39] Scripore: has joined #RubyOnRails
[10:36:45] lxsameer: has joined #RubyOnRails
[10:39:27] frishi: has joined #RubyOnRails
[10:39:54] benhuda: has joined #RubyOnRails
[10:43:11] wethu: has joined #RubyOnRails
[10:46:02] alex88: has joined #RubyOnRails
[10:46:13] mostlybadfly: has joined #RubyOnRails
[10:50:01] varunwachaspati: has joined #RubyOnRails
[10:51:11] Cork: rvanlieshout: ah sorry missed the question
[10:51:25] Cork: { something: value } => {} was the answer to that
[10:51:52] mbuf: has left #RubyOnRails: ("Ex-Chat")
[10:51:56] Cork: basically i want a combination of permit and require
[10:52:04] rvanlieshout: you don't want require
[10:52:06] thelastinuit: has joined #RubyOnRails
[10:52:07] rvanlieshout: cause it's not required
[10:52:08] brahman: has joined #RubyOnRails
[10:52:14] Rubie: has joined #RubyOnRails
[10:52:23] Cork: but i want the traversal of the object like require does
[10:52:30] rvanlieshout: https://github.com/rails/rails/blob/9ab2d030209d9608a6c866d83210f5b3b7d2319e/actionpack/lib/action_controller/metal/strong_parameters.rb#L246
[10:52:39] rvanlieshout: that also just looks if it's present
[10:52:42] rodfersou: has joined #RubyOnRails
[10:52:51] rvanlieshout: so it's a similar method
[10:52:55] Cork: ya, i've already read that one
[10:52:57] rvanlieshout: where you else {}
[10:53:57] microdex: has joined #RubyOnRails
[10:55:05] emilkarl: has joined #RubyOnRails
[10:55:06] brahman: Morning, I need to run a ruby script to populate my DB with a stream of tasks. This is an ongoing thing and does not suite db/seeds.rb or even a migration. I can interact with the DB without ActiveRecord in fact the Proof of concept script which I wrote before I setup the Rails frontend does that. Having used Rails for a couple of weeks now I want to use ActiveRecord and all the nice models I created. :)
[10:55:28] brahman: I saw there are rake tasks or rails runner.
[10:55:49] brahman: Are these the only ways to access the activerecord models from outside of rails?
[10:56:35] rhizome: activerecord is "inside of rails"
[10:57:45] brahman: rhizome: Am assuming I could load the gem from within the script, although am not sure how to load the models etc. Just wondering what others do...?
[10:58:36] rhizome: "the gem?"
[10:59:04] rhizome: rake tasks often run within the rails environment
[10:59:43] brahman: rhizome: do you use rails runner?
[10:59:49] Detch: has joined #RubyOnRails
[11:00:03] rhizome: what's your real question?
[11:00:11] krz: has joined #RubyOnRails
[11:00:13] bar0n: has joined #RubyOnRails
[11:00:25] brahman: That long monologue up there?
[11:01:06] ndrei: has joined #RubyOnRails
[11:01:17] hotpancakes: has joined #RubyOnRails
[11:01:23] rhizome: either would work. ease of choice depends on your code
[11:01:40] yaymukund: has joined #RubyOnRails
[11:02:01] emilkarl: has joined #RubyOnRails
[11:02:23] doodlehaus: has joined #RubyOnRails
[11:02:50] iateadonut: i'm trying to run rake db:schema:dump to recreate my schema.rb, but the schema.rb is only filled with: enable_extension "plpgsql"
[11:03:28] brahman: rhizome: right. thanks
[11:03:38] aceRacer: I did User.where(id: object.shortlists.joins(:notification).pluck(:user_id))
[11:04:20] zorak8: has joined #RubyOnRails
[11:08:10] carlosd: has joined #RubyOnRails
[11:12:18] dhjondoh: has joined #RubyOnRails
[11:12:27] robertfalken: has joined #RubyOnRails
[11:13:21] Ropeney: has joined #RubyOnRails
[11:15:03] krokuz_: has joined #RubyOnRails
[11:17:20] krz: has joined #RubyOnRails
[11:21:40] artto: has joined #RubyOnRails
[11:21:46] aceRacer: and then by rvalieshouts idea User.joins(shortlists: :notification).where('shortlists.profile_id = 4').pluck('users.id') lala
[11:23:04] aceRacer: I have a question , is doing count(:id) better than count for the sql
[11:23:23] hahuang65: has joined #RubyOnRails
[11:24:08] universa1: aceRacer: ?
[11:25:57] ebbflowgo: has joined #RubyOnRails
[11:26:53] skroon: has joined #RubyOnRails
[11:28:57] abuzze: has joined #RubyOnRails
[11:30:29] abuzze: has joined #RubyOnRails
[11:31:32] JohnBat26: has joined #RubyOnRails
[11:31:43] robertfalken: has joined #RubyOnRails
[11:31:51] yaymukund: has joined #RubyOnRails
[11:34:00] eGGsha: has joined #RubyOnRails
[11:35:11] skroon: has joined #RubyOnRails
[11:37:08] sparr: has joined #RubyOnRails
[11:38:37] tvw: has joined #RubyOnRails
[11:38:47] Bertg: has joined #RubyOnRails
[11:38:48] alex88: has joined #RubyOnRails
[11:39:06] LiquidInsect: has joined #RubyOnRails
[11:39:23] tvw: has joined #RubyOnRails
[11:40:05] acovrig: has joined #RubyOnRails
[11:40:35] janno90: has joined #RubyOnRails
[11:40:38] Trefex: has joined #RubyOnRails
[11:41:24] krz: whats the best approach to creating an oauth2 provider? i feel like doorkeeper is a bit bulky. any other gems to consider?
[11:44:50] ldnunes: has joined #RubyOnRails
[11:45:10] lxsameer: has joined #RubyOnRails
[11:46:02] delianides: has joined #RubyOnRails
[11:46:42] aceRacer: there were oauth2 gems like google-oauth2 for googlr
[11:50:41] lucasfs7: has joined #RubyOnRails
[11:51:19] rustymyers: has joined #RubyOnRails
[11:51:54] noodman: has joined #RubyOnRails
[11:52:41] mdw: has joined #RubyOnRails
[11:53:07] cac: has joined #RubyOnRails
[11:54:54] microdex: has joined #RubyOnRails
[11:55:05] nizmow: has joined #RubyOnRails
[11:55:05] doodlehaus: has joined #RubyOnRails
[11:55:05] sandstrom: has joined #RubyOnRails
[11:58:33] lala: aceRacer: I heard lala.
[12:00:45] hotpancakes: has joined #RubyOnRails
[12:01:31] aceRacer: oh :D sorry
[12:02:41] Oog: has joined #RubyOnRails
[12:02:46] Oog: Rails.configuration.secret_key_base is nil/how do i get it at runtime?
[12:03:01] ekain: has joined #RubyOnRails
[12:03:46] mikecmpbll: Oog: are you using secrets.yml?
[12:03:51] jsrn__: has joined #RubyOnRails
[12:03:54] workmad3: has joined #RubyOnRails
[12:03:56] Oog: yeah i found it Rails.application.secrets.secret_key_base
[12:04:54] charliesome: has joined #RubyOnRails
[12:06:17] roolo_: has joined #RubyOnRails
[12:07:41] zorak8: has joined #RubyOnRails
[12:08:05] alex88: has joined #RubyOnRails
[12:10:12] charliesome: has joined #RubyOnRails
[12:10:50] Benni: has joined #RubyOnRails
[12:11:07] DylanJ: Anyone hiring Rails developers in Germany? :D
[12:11:32] aceRacer: I am using irssi for the chat, but its really difficult to see the messages admist of everything
[12:11:56] DylanJ: aceRacer: page up/page down
[12:12:05] DylanJ: also make your window bigger.
[12:14:04] lalalaaa: has joined #RubyOnRails
[12:14:09] jokke: i have a sinatra api that accesses the same db than my rails app. The rails app is for example responsible for providing fileuploads
[12:14:34] jokke: now to serve those files from the api i need x-sendfile
[12:14:41] jokke: because the files are very large
[12:15:00] jokke: any ideas on how to do this?
[12:15:09] rails514: has joined #RubyOnRails
[12:15:28] rodferso1: has joined #RubyOnRails
[12:15:32] workmad3: jokke: why not just do that from rails as well, seeing as rails already has sendfile support built in for both nginx and apache
[12:15:40] acovrig: has joined #RubyOnRails
[12:15:41] jokke: workmad3: mmh
[12:15:49] jokke: yeah i guess i'll do that
[12:15:56] lalalaaa: Hi! In production I'm getting a blank page with `net::ERR_INCOMPLETE_CHUNKED_ENCODING` in Chrome and nothing in Firefox. My JS doesn't seem to load but I have no errors to go by. Everything works fine in development. Anyone know where to go from here?
[12:16:27] rvanlieshout: lalalaaa: check the logs on the server
[12:17:10] dkphenom: has joined #RubyOnRails
[12:19:06] lalalaaa: rvanlieshout: Nothing but a normal load in production.log as far as I can tell. Everything good in log/puma/errors.log as well.
[12:19:11] arBmind1: has joined #RubyOnRails
[12:19:26] rvanlieshout: lalalaaa: and if you run it in production using rails server?
[12:19:36] bhorn1: has joined #RubyOnRails
[12:19:51] lalalaaa: rvanlieshout: Great idea!
[12:20:16] ndrei: has joined #RubyOnRails
[12:22:21] p1k: has joined #RubyOnRails
[12:22:54] rodfersou: has joined #RubyOnRails
[12:23:09] jamiely: has joined #RubyOnRails
[12:24:03] krokuz_: has joined #RubyOnRails
[12:24:22] Anakat: has joined #RubyOnRails
[12:28:14] Rukeal: has joined #RubyOnRails
[12:29:38] icehawk78: has joined #RubyOnRails
[12:30:59] lalalaaa: rvanlieshout: That was awesome man - thank you :)
[12:31:48] rvanlieshout: i find debugging easier with a server running in the foreground
[12:33:21] k4nd4lf: has joined #RubyOnRails
[12:33:51] jcromartie: has joined #RubyOnRails
[12:33:52] eGGsha: has joined #RubyOnRails
[12:34:10] Papierkorb: has joined #RubyOnRails
[12:34:39] svoop: has joined #RubyOnRails
[12:35:33] dstarh: has joined #RubyOnRails
[12:38:16] michael_mbp: has joined #RubyOnRails
[12:38:23] voker57: has joined #RubyOnRails
[12:39:34] cac: has joined #RubyOnRails
[12:40:10] sankaber: has joined #RubyOnRails
[12:40:22] n008f4g_: has joined #RubyOnRails
[12:42:47] jkamenik: has joined #RubyOnRails
[12:45:01] lalalaaa: If doing `config.assets.css_compressor = :sass` - asset precompilation will only include files that end with .scss or whatever right?
[12:46:37] muhammadn: has joined #RubyOnRails
[12:47:59] Mishke: has joined #RubyOnRails
[12:48:14] Mishke: has left #RubyOnRails: ()
[12:49:00] ebbflowgo: has joined #RubyOnRails
[12:49:39] erich: has joined #RubyOnRails
[12:49:46] mishkentus: has joined #RubyOnRails
[12:50:17] mishkentus: what place is best for presenters concern?
[12:50:22] mishkentus: with autoload
[12:50:35] cek: has joined #RubyOnRails
[12:50:37] lalalaaa: rvanlieshout: With rails server it can't find my assets so I'm not sure what to do here
[12:50:49] DylanJ: if you're talking about what i think you're talking about, you can just do app/presenters/
[12:50:53] cek: What's the reason behind Serve? Itsn't simple rails not enough?
[12:51:24] DylanJ: cek: is that a thing?
[12:51:48] mishkentus: DylanJ: i need good place for module that with using in same presenters
[12:51:51] sameerynho: has joined #RubyOnRails
[12:51:53] mishkentus: DylanJ: i need good place for module that will* using in same presenters
[12:52:25] charliesome: has joined #RubyOnRails
[12:52:51] delianides: has joined #RubyOnRails
[12:52:59] DylanJ: mishkentus: not sure what you mean. try in your native language? :(
[12:53:58] mishkentus: DylanJ: my native language is russian
[12:54:06] mishkentus: DylanJ: do you speak russian? :)
[12:54:29] DylanJ: no but i have a russian translator in my office i enjoy bugging.
[12:54:57] jeanlinux: has joined #RubyOnRails
[12:55:35] mishkentus: DylanJ: ?? ???????? ???????? ????????????????????, ?????????????? ???????? ???????????????????? ?? ?????????????????? ??????????????????????, ?? ?????? ?????????? ?????????? ?????????? ???????? ???? ????????????????, ?????? ???? ?????? ???????? ????????????????????????
[12:55:46] microdex: has joined #RubyOnRails
[12:56:01] mishkentus: DylanJ: ?? ?????? ???????? ?????????????? ??????????????, ???????????? ?????? ?????? ?? ???????????????? ????????????)
[12:56:14] mishkentus: DylanJ: hope that helps)
[12:56:19] bmurt: has joined #RubyOnRails
[12:56:47] ramortegui: has joined #RubyOnRails
[12:56:48] mishkentus: DylanJ: ?????????? ?? ???????????? ????????????????????, ?? ???????? ?????????? ??????, ?????????????? ?? ???????????? ?? ?????????????????? ???????? ?????? ???????? ?????? ???? ???????????????????????????? DRY
[12:57:18] DylanJ: right okay.
[12:57:23] DylanJ: google translate wins here.
[12:58:11] DylanJ: i'd put that in app/models/concerns/mylib.rb or lib/mylib.rb. then in your presenters just "include MyLib" in your
[12:58:18] DylanJ: that's it
[12:59:08] charliesome: has joined #RubyOnRails
[12:59:18] DylanJ: ???????????? ?????? ?? ???????? ???????????
[12:59:34] melter: has joined #RubyOnRails
[12:59:40] jrails: has joined #RubyOnRails
[12:59:41] Haegin_: has left #RubyOnRails: ()
[12:59:42] cek: ?????? ?????????? ????????????????
[12:59:53] hotpancakes: has joined #RubyOnRails
[12:59:57] d1ngell: has joined #RubyOnRails
[13:00:09] mishkentus: DylanJ: yeah, i get your point. first (a/m/concerns/%filename%.rb) is bad, because is production project)
[13:00:15] mishkentus: cek: ??????????????????
[13:00:29] griffindy: has joined #RubyOnRails
[13:00:29] arup_r: has joined #RubyOnRails
[13:00:51] ratmav: has joined #RubyOnRails
[13:01:09] Benni: has joined #RubyOnRails
[13:01:25] DylanJ: then i would put it in lib/
[13:01:42] rickmasta: has joined #RubyOnRails
[13:01:45] DylanJ: or if it's multiple files and private classes i would make a gem.
[13:01:48] drale2k: has joined #RubyOnRails
[13:03:08] mishkentus: DylanJ: here the problem. i have 3 files :)
[13:03:23] ratmav: i'm getting some kind of weird race condition in some of my tests.
[13:03:42] ratmav: i'm testing something that runs in a background thread, reads/writes to the db
[13:03:44] mishkentus: DylanJ: if i put it in lib/namespace/file.rb, lib/namespace/file2.rb it won't works
[13:03:53] ratmav: but keeping the db state in order seems to be the culprit
[13:04:01] ratmav: should i be using database cleaner for this?
[13:04:13] DylanJ: mishkentus: why doesn't it work? ;)
[13:04:32] mishkentus: DylanJ: i dont know, rly)
[13:04:45] DylanJ: you will need to require 'myfile/thing'
[13:04:58] DylanJ: require 'namespace/file'
[13:05:20] mishkentus: DylanJ: yeah, and i will have some like this: $ bundle exec sidekiq $ Cannot define multiple 'included' blocks for a Concern
[13:05:33] victortyau: has joined #RubyOnRails
[13:05:37] mishkentus: because of require and cache_classes: false
[13:05:50] XCMer: has joined #RubyOnRails
[13:05:57] lxsameer_: has joined #RubyOnRails
[13:06:18] DylanJ: try only requiring the files inside config/application.rb
[13:06:35] mishkentus: hm. rly, ok :)
[13:07:14] earthquake: has joined #RubyOnRails
[13:08:27] a346: has joined #RubyOnRails
[13:08:34] delianides: has joined #RubyOnRails
[13:10:06] pothibo: has joined #RubyOnRails
[13:11:06] bullcitydev: has joined #RubyOnRails
[13:11:59] hahuang65: has joined #RubyOnRails
[13:12:06] surrealanalysis: has joined #RubyOnRails
[13:12:35] mishkentus: DylanJ: man, thanks
[13:12:43] DylanJ: np. glad it works.
[13:13:07] mishkentus: DylanJ: in lib/namespace/*.rb that works even w/o require
[13:13:24] DylanJ: rails magic
[13:13:26] mishkentus: which is strange, because before it was not so
[13:13:52] cashnguns: has joined #RubyOnRails
[13:13:59] Bertg: has joined #RubyOnRails
[13:15:17] mishkentus: DylanJ: you working as RoR developer?
[13:15:53] robertfa_: has joined #RubyOnRails
[13:17:43] nzst: has joined #RubyOnRails
[13:18:08] artto: has joined #RubyOnRails
[13:19:59] Pazician: has joined #RubyOnRails
[13:19:59] Pazician: has joined #RubyOnRails
[13:21:18] bananaboydean: has joined #RubyOnRails
[13:22:38] doodlehaus: has joined #RubyOnRails
[13:23:30] delianid_: has joined #RubyOnRails
[13:23:35] ebbflowgo: has joined #RubyOnRails
[13:23:51] arup_r1: has joined #RubyOnRails
[13:26:18] gambl0re: has joined #RubyOnRails
[13:28:34] fmcgeough: has joined #RubyOnRails
[13:29:03] mary5030: has joined #RubyOnRails
[13:29:24] Trefex: has joined #RubyOnRails
[13:30:23] radialneon: has joined #RubyOnRails
[13:30:33] krz: has joined #RubyOnRails
[13:30:52] mary5030: has joined #RubyOnRails
[13:31:09] Pazician: has joined #RubyOnRails
[13:31:17] DylanJ: mishkentus: yeah
[13:31:32] DylanJ: unemployed in 2 months!
[13:31:36] DylanJ: ACTION is excited.
[13:31:41] mishkentus: DylanJ: why? :)
[13:32:22] charliesome: has joined #RubyOnRails
[13:32:44] delianides: has joined #RubyOnRails
[13:32:47] DylanJ: mishkentus: because the next place i go will be in a different city in europe. and so i get to experience another place :D
[13:33:46] rvanlieshout: where are you going, DylanJ?
[13:33:56] Bertg: has joined #RubyOnRails
[13:34:28] d1ngell: has joined #RubyOnRails
[13:35:29] jcromartie: has joined #RubyOnRails
[13:35:57] DylanJ: rvanlieshout: not sure yet.
[13:36:00] Lightsword: has joined #RubyOnRails
[13:36:04] erich: has joined #RubyOnRails
[13:36:14] rvanlieshout: what are the options? :)
[13:36:42] DylanJ: i would like to stay in germany only "zu wieder mein deutche lernen"
[13:36:49] DylanJ: buuut i'm open to anything
[13:37:25] DylanJ: whether that's france or the uk or poland. if the money is good and beer is too. i'm open to it.
[13:37:35] d1ngell: has joined #RubyOnRails
[13:37:38] rvanlieshout: as a rails dev?
[13:37:50] DylanJ: it's what i know well so that's easiest yeah
[13:37:53] sevenseacat: has joined #RubyOnRails
[13:37:56] Pathfinder: has joined #RubyOnRails
[13:38:10] rvanlieshout: so where are you now then?
[13:38:23] DylanJ: tiny place called saarbruecken in germany.
[13:38:48] bratsche: has joined #RubyOnRails
[13:39:05] plains: has joined #RubyOnRails
[13:39:17] rvanlieshout: so you're already in germany?
[13:39:54] DylanJ: I will probably have to fly back to Canada if I move outside of Germany though.
[13:39:58] jmimi: has joined #RubyOnRails
[13:40:18] DylanJ: Do the whole VISA nonsense again..
[13:40:23] mishkentus: DylanJ: ima RoR dev in Ukraine :)
[13:41:06] bullcitydev: has joined #RubyOnRails
[13:41:08] DylanJ: mishkentus: you mean Ukraine^H^H^H^H^H^HRussia
[13:41:16] michael_mbp: has joined #RubyOnRails
[13:41:26] Rubie: has joined #RubyOnRails
[13:41:27] mishkentus: DylanJ: what means ^H^H? :D
[13:41:35] DylanJ: backspace control character
[13:41:36] Rylee: s/(\^H)+/\w/
[13:41:44] mishkentus: DylanJ: Ukraine != Russia
[13:41:45] Rylee: s/(\^H)+/^W/
[13:42:11] DylanJ: mishkentus: yeah i know, it was a joke. cause the whole russia "invading" eastern ukraine situation.
[13:42:33] Scripore: has joined #RubyOnRails
[13:43:32] sevenseacat: probably not a good joke to make to a ukrainian person.
[13:43:39] rvanlieshout: not really no :)
[13:43:45] charliesome: has joined #RubyOnRails
[13:43:51] DylanJ: yeah sorry for being culturally insensitive mishkentus.
[13:44:02] werelivinginthef: has joined #RubyOnRails
[13:44:12] mishkentus: DylanJ: np rly)
[13:45:15] eGGsha: has joined #RubyOnRails
[13:45:39] sevenseacat: reminds me of this https://twitter.com/andrey_butov/status/426018565561401344
[13:46:12] Valien: has joined #RubyOnRails
[13:46:38] rodfersou: has joined #RubyOnRails
[13:51:02] Pathfinder: has joined #RubyOnRails
[13:51:08] eGGsha: has joined #RubyOnRails
[13:51:49] startupality: has joined #RubyOnRails
[13:52:34] Pathfinder_: has joined #RubyOnRails
[13:53:37] hackeron_: has joined #RubyOnRails
[13:54:31] matrixise: has joined #RubyOnRails
[13:54:34] XCMer: has joined #RubyOnRails
[13:56:33] microdex: has joined #RubyOnRails
[13:56:44] yaymukund: has joined #RubyOnRails
[13:57:21] paulcsmith: has joined #RubyOnRails
[13:57:56] jensel: has joined #RubyOnRails
[13:59:06] emptyflask: has joined #RubyOnRails
[13:59:34] bf4: has joined #RubyOnRails
[14:00:23] cornerma1: has joined #RubyOnRails
[14:00:37] hotpancakes: has joined #RubyOnRails
[14:01:35] boom1992: has joined #RubyOnRails
[14:03:43] a346: has joined #RubyOnRails
[14:04:59] beilabs_: has joined #RubyOnRails
[14:06:13] kitsuneyo: has joined #RubyOnRails
[14:08:21] DaniG2k: has joined #RubyOnRails
[14:08:39] dopie: has joined #RubyOnRails
[14:12:21] rjno: has joined #RubyOnRails
[14:12:46] michael_mbp: has joined #RubyOnRails
[14:12:59] victortyau: has joined #RubyOnRails
[14:13:46] toddperkinz: has joined #RubyOnRails
[14:18:51] axl__: has joined #RubyOnRails
[14:19:56] coderhs: has joined #RubyOnRails
[14:21:53] acovrig: I???m having issues with Google oAuth: https://gist.github.com/acovrig/7ca1744ead39a96e6f2c is 2 files that seem to have the issue, I???m getting an ActiveModel::ForbiddenAttributesError on line 4 of user.rb
[14:23:34] toddperkinz: Are you certain everything your posting to Google is accounted for in strong params?
[14:23:36] sevenseacat: and line 4 of user.rb is?
[14:24:46] chipotle: has joined #RubyOnRails
[14:26:02] kies: has joined #RubyOnRails
[14:26:09] mwlang: has joined #RubyOnRails
[14:26:24] tubbo: has joined #RubyOnRails
[14:26:30] acovrig: toddperkinz: strong params?
[14:26:34] kitsuneyo: Hey, I think I've improved my game-genres form, I have a nested fields_for section and I'm sure the params are nested. I think I just need to get my games_controller right: https://gist.github.com/kitsuneyo/2acead0583c9ee69c588
[14:26:35] acovrig: sevenseacat: in the gist link
[14:27:12] toddperkinz: acovrig what version of rails?
[14:27:29] garrypolley: has joined #RubyOnRails
[14:27:35] acovrig: sevenseacat: https://gist.github.com/acovrig/7ca1744ead39a96e6f2c#file-gistfile1-txt-L26
[14:27:43] acovrig: toddperkinz: Rails 4.2.1
[14:28:10] mwlang: I???m moving a few million image files from a Windows NTFS to Linux and also moving a Rails app from Windows hosted to Linux hosted. The problem I have is the Windows FS is case-insensitive and I???ve got a mixture of casing on the filenames, and a worse problem with the Rails app itself inconsistently constructing filepaths with correct casing.
[14:28:57] coderhs: has joined #RubyOnRails
[14:28:57] mwlang: So my idea is to use a bash script to downcase all folders and filenames and then jerryrig Rails??? link_to to construct only lower-cased paths.
[14:29:19] mwlang: would y???all like to skin me alive and suggest a better alternative? :-)
[14:29:28] kitsuneyo: Can anyone help me get my param names right, it's pretty confusing
[14:30:04] toddperkinz: acovrig - I think this line: genre = Genre.find(params[:game_genre][:genre_id])
[14:30:25] toddperkinz: acovrig - I think this line should be: genre = Genre.find(params[:game_genre])
[14:30:34] acovrig: toddperkinz: ^^ -> kitsuneyo ?
[14:30:39] jcromartie: has joined #RubyOnRails
[14:31:11] kitsuneyo: toddperkinz, thanks I'll try it
[14:33:11] kitsuneyo: It doesn't work, I get "ActiveRecord::RecordNotFound in GamesController#create" and "Couldn't find Genre without an ID"
[14:33:12] sevenseacat: kitsuneyo: https://gist.github.com/sevenseacat/25bea057cab1183bad9c
[14:33:21] toddperkinz: also, add game_genre to strong params: params.require(:game).permit(:game_genre, :title_en, :year, :description_en, game_genre_attributes: [:genre_id])
[14:33:40] toddperkinz: hm, ok add it back in and try ^^
[14:33:56] sevenseacat: and dont add game_genre to strong params.
[14:34:39] disgrntld: has joined #RubyOnRails
[14:35:42] kitsuneyo: sevenseacat, thanks, what did you change, did you just take out one line?
[14:35:49] IanV0rn2341: has joined #RubyOnRails
[14:35:49] sevenseacat: check the diff.
[14:36:35] kitsuneyo: ah thanks, i see it, new to this
[14:38:00] dc: has joined #RubyOnRails
[14:38:30] athos_diddy: has joined #RubyOnRails
[14:39:24] athos_diddy: should someone never use their users home folder to deploy and run an app on a server?
[14:39:38] athos_diddy: should we just keep it in something like var/www so it's not user specific?
[14:40:00] sevenseacat: actually I don't think that will work either. meh. it's late and I'm tired.
[14:40:22] sevenseacat: you'd need to build a game_genre before rendering the form
[14:40:42] Papierkorb: athos_diddy: In general, you should have a special user which is only used for rails. I guess that's a good idea in general for every kind of service you write, no matter the language.
[14:40:53] kitsuneyo: I see, in the new action?
[14:41:25] microdex: has joined #RubyOnRails
[14:41:25] acovrig: With an ForbiddenAttributesError, is there a way to see which attributes it doesn???t like?
[14:41:41] Papierkorb: athos_diddy: I don't really see an issue with having the apps code inside that users home directory. infact, that's what I do.
[14:42:10] kitsuneyo: I think I can do that with @game_genre = @game.game_genre.build ?
[14:42:14] athos_diddy: i got it to deploy but it's not loading so i'm just trying to isolate possible problems
[14:42:16] ruv: has joined #RubyOnRails
[14:42:26] athos_diddy: happy to hear it's a common practice to deploy in a user folder
[14:42:27] Papierkorb: athos_diddy: if you for example fear that the source code of your app could be manipulated by an attacker, you can as well make another user the owner of those files and give the rails user only read access.
[14:42:32] tubbo: the only real reason to keep an app outside of the home dir is to make it easier for other users to access it on the same machine
[14:42:41] tubbo: say you have a team of devs who all have their own users on the machine
[14:42:41] Rubie: has joined #RubyOnRails
[14:42:54] athos_diddy: i have a unique problem though. when i added a new user and gave it root i can't ssh newuser@ip
[14:43:04] athos_diddy: maybe i'm setting up the user wrong
[14:43:06] tubbo: athos_diddy: you can't "give a user root"
[14:43:13] tubbo: you can give it sudo access
[14:43:14] acovrig: tubbo: sudo
[14:43:15] athos_diddy: you can give it sudo
[14:43:20] ruv: has joined #RubyOnRails
[14:43:23] acovrig: lol, 3 sudos in a line???
[14:43:25] athos_diddy: ok ty for correction
[14:43:30] Benni: has joined #RubyOnRails
[14:43:43] tubbo: athos_diddy: what OS are you using?
[14:43:59] plains: has joined #RubyOnRails
[14:43:59] plains: has joined #RubyOnRails
[14:44:03] athos_diddy: it's ubuntu 14.04 trusty on a cloud openstack vm similar to heroku but it's in beta
[14:44:05] Papierkorb: tubbo: actually, you can have multiple users with root permissions on a linux system. It's just something I wouldn't do ..
[14:44:31] athos_diddy: like all those other ones digital ocean, etc
[14:44:41] Papierkorb: athos_diddy: What's the error message you're getting?
[14:45:04] athos_diddy: unfortunately there's no error. i do have errors enabled in the http block for nginx
[14:45:08] tjbiddle: has joined #RubyOnRails
[14:45:15] athos_diddy: and i checked the error.log
[14:45:24] Papierkorb: athos_diddy: if you don't get anything meaningful, try passing "-v" to ssh and try again. The log may contain data about your server though, so if you post it, check it for that
[14:45:52] darrencauthon: has joined #RubyOnRails
[14:46:01] tubbo: athos_diddy: so it just hangs there?
[14:46:04] athos_diddy: We're sorry, but something went wrong.
[14:46:04] athos_diddy: If you are the application owner check the logs for more information.
[14:46:18] athos_diddy: but which layer in the stack is telling me that
[14:46:24] tubbo: athos_diddy: no...when you try to ssh in...what's the error that happens?
[14:46:36] athos_diddy: oh the ssh problem i don't have anymore
[14:46:45] athos_diddy: i'm talking about loading the app
[14:46:49] athos_diddy: after deployment
[14:46:51] athos_diddy: after checking nginx
[14:47:00] tubbo: athos_diddy: oh you should really let us onto that becuase we can't read your mind ;)
[14:47:02] Papierkorb: athos_diddy: either way, you have set the production secret?
[14:47:11] athos_diddy: when i visit the page that's what i guess sorry i was talking about a caveat
[14:47:17] Papierkorb: athos_diddy: that's what blew up for me last time, and took an hour to figure out >_>;
[14:47:27] athos_diddy: it's a problem not logging into a user i have created and i am unsure if this is because it's beta
[14:47:29] tubbo: athos_diddy: that error basically means "zomg wtf" and it means you should check nginx's error.log first, then rails' production.log second
[14:47:38] athos_diddy: or if i did something wrong but i'll fix that user issue today
[14:47:53] Lightsword: has joined #RubyOnRails
[14:47:54] athos_diddy: i didn't check the production.log!
[14:47:55] tubbo: it could be a permissions issue as well
[14:48:07] athos_diddy: yeah i assumed so but was like dur wtf
[14:48:24] athos_diddy: get to know your log s day
[14:48:31] jrails: has joined #RubyOnRails
[14:48:39] yaymukund: has joined #RubyOnRails
[14:49:48] Papierkorb: athos_diddy: tailf both logs and restart your application and see if it already tells you that something's wrong by then. If not, try accessing your page, and have another look.
[14:50:14] Papierkorb: athos_diddy: both logs being, as tubbo said, the error.log of nginx and production.log of your app
[14:50:56] Papierkorb: Anyone in here ever used Arcadia, the ruby IDE written in ruby?
[14:51:23] athos_diddy: Papierkorb: ty
[14:51:29] athos_diddy: and anyone else :P
[14:51:38] roolo: has joined #RubyOnRails
[14:51:53] sandstrom: has joined #RubyOnRails
[14:52:12] athos_diddy: it's trying to use my apps name 'myapp' @ localhost to access the db
[14:52:17] athos_diddy: that's not going to work
[14:53:06] jeanlinux: has joined #RubyOnRails
[14:54:22] herenow: has joined #RubyOnRails
[14:54:33] Fire-Dragon-DoL: has joined #RubyOnRails
[14:56:37] arBmind1: has left #RubyOnRails: ()
[14:57:45] pontiki: Papierkorb: i've never heard of it before, having a look
[14:57:58] chouhoulis: has joined #RubyOnRails
[14:59:14] glundgren: has joined #RubyOnRails
[14:59:30] plains: has joined #RubyOnRails
[14:59:30] plains: has joined #RubyOnRails
[14:59:39] glundgren: hey guys, good morning
[15:00:29] glundgren: i have a security question, in older versions, i believe rails had a method called attr_protected, to avoid user set some values via form
[15:00:47] hahuang65: has joined #RubyOnRails
[15:00:59] hotpancakes: has joined #RubyOnRails
[15:01:04] glundgren: with strong parameters, this kind of method to protect some attributes are needed?
[15:02:39] DylanJ: mwlang: do the files need to keep their filenames?
[15:02:57] DylanJ: you could always rename the files to the hash of their contents.
[15:02:58] kitsuneyo: I have a really strange output for :game_genres params now: https://gist.github.com/kitsuneyo/2acead0583c9ee69c588, it's like "game_genres_attributes"=>{"0"=>{"genre_id"=>"1"}}}
[15:03:35] tubbo: glundgren: you don't need attr_protected/attr_accessible anymore if you use strong parameters.
[15:03:53] startupality: has joined #RubyOnRails
[15:03:53] glundgren: tubbo: cool, thanks
[15:04:11] Lightsword: has joined #RubyOnRails
[15:05:06] Scripore: has joined #RubyOnRails
[15:05:29] acti0nman: has joined #RubyOnRails
[15:06:07] cashnguns: has joined #RubyOnRails
[15:06:09] frek818: has joined #RubyOnRails
[15:07:26] Papierkorb: Anyone in here uses Opal?
[15:08:12] kitsuneyo: has joined #RubyOnRails
[15:09:57] athos_diddy: can someone explain to me why this capistrano deployment is giving me this error? I don't know what the -L flag is https://gist.github.com/genericlady/b8cff0d50190db55ad16
[15:10:14] kitsuneyo: my form select id is a little screwy as well: <select class="form-control" name="game[game_genres_attributes][0][genre_id]" id="game_game_genres_attributes_0_genre_id">, added the html output here https://gist.github.com/kitsuneyo/2acead0583c9ee69c588
[15:10:21] artto: has joined #RubyOnRails
[15:10:24] athos_diddy: it finishes deployment but there are some errors that i should try to fix before i continue working out why the app isn't loading
[15:10:56] athos_diddy: and it seems whenever the -L flag is used with a command it fails
[15:11:33] mikecmpb_: has joined #RubyOnRails
[15:13:47] chouhoulis: has joined #RubyOnRails
[15:14:04] eggoez: has joined #RubyOnRails
[15:19:01] tfittsy: I'm using Resque to run jobs in the background. After a few days, one of my jobs keeps failing with Errno::EIO Input/output error @ io_write - <STDERR>. Any idea what would cause it to start happening seemingly randomly but after it happens it doesn't work again until I kill and restart the worker
[15:21:09] jeanlinux: has joined #RubyOnRails
[15:22:34] paulcsmith_: has joined #RubyOnRails
[15:23:56] jeanlinux: has joined #RubyOnRails
[15:25:33] IanV0rn2341: has joined #RubyOnRails
[15:26:02] manvsmachine: has joined #RubyOnRails
[15:26:55] chintanparikh: has joined #RubyOnRails
[15:30:16] emptyflask: has joined #RubyOnRails
[15:30:24] El3k0n: has joined #RubyOnRails
[15:32:27] aamador: has joined #RubyOnRails
[15:32:50] tubbo: Papierkorb: nope. interested to see how it might work though.
[15:33:43] Papierkorb: tubbo: already thought that you could technically abuse that to write nodejs pages ..
[15:34:00] tubbo: Papierkorb: wat?
[15:34:14] tubbo: you're talking about opal, the ruby to JS compiler?
[15:34:31] tubbo: ACTION has personally never had enough of a problem with JS to need to use a whole different lang to write it
[15:34:50] tubbo: i kinda like JS the way it is, especially with ES6 (ES2015)
[15:35:01] Papierkorb: Sometimes, it's a good idea to do something just because you can. No one's saying that you actually have to use it in production later on ..
[15:35:05] DylanJ: tubbo: butbutbut. in a world before es6.
[15:35:22] eGGsha: has joined #RubyOnRails
[15:35:22] DylanJ: js was frightning. js meant jquery to a lot of people.
[15:35:30] tubbo: yeah but that was then
[15:35:42] tubbo: i've moved on, dunno about the rest of you guys ;)
[15:35:44] DylanJ: and today weve got symbols in js.
[15:35:45] Papierkorb: well, coffeescript already makes a huge difference
[15:35:51] DylanJ: so today is good.
[15:35:56] tubbo: yeah definitely
[15:36:26] DylanJ: coffeescript is cool until you want to write something that turns into a simple for loop
[15:36:35] DylanJ: like, js simple. not coffescript simple.
[15:36:44] DylanJ: why is my loop 6 lines of code?
[15:37:00] Papierkorb: got an example?
[15:37:03] adavia: has joined #RubyOnRails
[15:37:24] bar0n_: has joined #RubyOnRails
[15:38:38] Papierkorb: DylanJ: in the end, what coffee calls a 'for loop' is basically Array#map
[15:39:02] DylanJ: it seems the cs->js repl on coffeescript.org makes okay loops now.
[15:39:13] DylanJ: i remember a huge mess. maybe i remember wrong.
[15:39:24] tubbo: Papierkorb: i am definitely interested in seeing what happens with opal though
[15:39:26] Papierkorb: js2.coffee is also useful. yes, that's the domain name
[15:39:28] pothibo: has joined #RubyOnRails
[15:39:45] El3k0n: has joined #RubyOnRails
[15:39:58] sonofdirt: has joined #RubyOnRails
[15:40:09] Papierkorb: tubbo: same here. My service is super small and is my personal 1-dev project, so I'm in the position to just try it heh
[15:40:20] jmimi: has joined #RubyOnRails
[15:40:31] El3k0n_: has joined #RubyOnRails
[15:40:33] tubbo: in the past, rails tried to do this with something called RJS. it was basically ruby code that would execute js code.
[15:40:41] tubbo: there's still remnants of it (remote: true in forms and links)
[15:41:03] tubbo: it failed catastrophically, mostly because the way JS/the web moves and the way Ruby moves are fundamentally different
[15:41:13] manvsmachine: Any chance I can run a sanity check past you guys real quick? Running into some??? interesting ActiveRecord behaviour.
[15:41:31] tubbo: things change so much faster on the web than RJS was prepared for :)
[15:41:41] tubbo: manvsmachine: !gist what you got
[15:41:41] helpa: manvsmachine: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[15:42:42] rjno: has joined #RubyOnRails
[15:42:44] j4d: has joined #RubyOnRails
[15:43:29] Papierkorb: tubbo: yeah tell me. Like, at my last gig the javashop I worked at still used MooTools - in a outdated version. PHP version 5.0 or something. I hated webdev. But now with rails and coffee and scss and all that jazz, it's not my new love but absolutely enjoyable. And I was actually really baffled before why anyone would want to create any webservice..
[15:44:15] Tempesta: has joined #RubyOnRails
[15:44:19] tubbo: it's funny how things work out
[15:44:52] tubbo: 15 years ago, i bet half of the people that i train here at work (who are all 20 years older than me) would have been laughing me off as "not a real programmer" because all i knew was CSS, JS, HTML and PHP.
[15:45:05] manvsmachine: here you go: https://github.atl.pdrop.net/gist/dwoodley/c385bd74caebe36a3eae
[15:45:13] pontiki: that's all just syntax
[15:45:15] tubbo: "learn a real language like Java, something that will actually be around by the time you need a job" ;)
[15:45:33] Papierkorb: Java and PHP. languages you can only do for the money.
[15:45:51] Cache_Money: has joined #RubyOnRails
[15:46:06] pontiki: that's sad
[15:46:12] pontiki: true, but sad
[15:46:21] bronson: has joined #RubyOnRails
[15:46:30] codepete: has joined #RubyOnRails
[15:46:31] manvsmachine: some background: the column being updated is a MySQL Set type; upgrading from Rails 4.1 to 4.2 introduced this error.
[15:47:10] Papierkorb: manvsmachine: your link doesn't work
[15:47:18] tfittsy: manvsmachine: broken here too
[15:47:26] tubbo: manvsmachine: link didn't work
[15:47:31] tubbo: what is github.atl.pdrop.net?
[15:47:38] Papierkorb: The domain doesn't even resolve. Is that some intranet-only enterprise github instance?
[15:47:44] manvsmachine: oh shit, posted to our internal GH instead of GH.com
[15:48:01] xploshioon: has joined #RubyOnRails
[15:48:03] tubbo: manvsmachine: you are officially the cool kid in the channel (github enterprise must be sweet...i wish we had that rather than stupid old JIRA)
[15:48:22] manvsmachine: we have both actually, all internally hosted
[15:48:31] Papierkorb: tubbo: It is as sweet as you think it is if you like Github.
[15:48:37] tubbo: i like github
[15:48:50] shinnya: has joined #RubyOnRails
[15:48:58] tubbo: manvsmachine: damn you guys must spend like $10k/month just to host your code! ;)
[15:49:23] manvsmachine: that???s what VC is for
[15:49:27] tubbo: oh i see why now, just went to your company's homepage
[15:49:30] tubbo: better keep that shit secure
[15:49:49] manvsmachine: ha yeah. it???s kinda important
[15:51:05] Hates_: has joined #RubyOnRails
[15:51:15] Papierkorb: manvsmachine: is that SS7 based?
[15:51:15] manvsmachine: https://gist.github.com/manvsmachine/2c8d884317941a6b731a
[15:51:38] bmurt: has joined #RubyOnRails
[15:53:26] s2013: has joined #RubyOnRails
[15:53:49] manvsmachine: nah, we interface with the call center infrastucture rather than at the trunk and whatnot
[15:56:20] manvsmachine: it???s kinda hard to explain quickly, but if you???re interested we were on an episode of TWiT recently: https://www.youtube.com/watch?v=GvSRcDPF2tU
[15:57:01] emilkarl: has joined #RubyOnRails
[15:58:07] mwlang: manvsmachine: heh???phone fraud???it???s the reason I no longer have relay service (for the deaf)
[15:58:09] slava_: has joined #RubyOnRails
[15:58:50] momomomomo: has joined #RubyOnRails
[15:59:05] slava_: hey guys, i am using globalize 4.0... for some reason it doesn't pull the translated data for form_for. does anybody know a solution to that? can i pass a locale to form_for or something?
[15:59:07] jeanlinux: has joined #RubyOnRails
[15:59:12] mwlang: most of my financial institutions (who hold my mortgages) wouldn???t even speak to me via relay operator and before the relay service was shutdown a few months back, I learned the main reason was phone fraud.
[15:59:51] mwlang: then the federal gov???t tried to force my relay service provider to record all phone calls and the provider shutdown rather than complied
[15:59:57] Spami: has joined #RubyOnRails
[16:00:47] benlieb_: has joined #RubyOnRails
[16:01:12] hotpancakes: has joined #RubyOnRails
[16:01:24] rjno: has joined #RubyOnRails
[16:01:31] towski_: has joined #RubyOnRails
[16:01:37] paulcsmith: has joined #RubyOnRails
[16:03:21] Scripore: has joined #RubyOnRails
[16:05:30] manvsmachine: yeah, since I started working here I???ve realized how insane the amount of fraud that occurs is
[16:05:37] momomomomo: has joined #RubyOnRails
[16:05:55] drale2k: has joined #RubyOnRails
[16:06:03] manvsmachine: oh, btw did the second link work?
[16:06:14] tubbo: yes manvsmachine
[16:06:43] tubbo: manvsmachine: why are you using update_columns instead of update_attributes?
[16:06:46] manvsmachine: I think the problem is due to the overhauled type casting that was introduced in 4.2
[16:06:52] manvsmachine: but I???m not sure how to be sure
[16:07:16] manvsmachine: or rather, I???m not sure what exactly to do about it
[16:07:40] tubbo: manvsmachine: one more thing... geo_id starts as 0, and it's an integer in the DB...you're trying to set it to a String. that seems like a problem to me.
[16:07:45] tubbo: brb, gotta restart to install OS X 10.10.4
[16:08:40] umgrosscol: has joined #RubyOnRails
[16:08:42] manvsmachine: Yeah, so that???s part of the issue. We have some fields that are MySQL sets and enums.
[16:08:50] mwlang: hmmm???is there a simple way to host case-insensitive paths on Linux? (migrating from windows where case-sensitivity isn???t a problem and I have a mess bringing up same on Linux)
[16:10:05] manvsmachine: so for example, type_id, type_claim, geo_id, and geo_claim are all of Set datatype, but Rails is casting them as integers apparently
[16:11:01] manvsmachine: I know sets aren???t officially supported by ActiveRecord, but it works up to and including 4.1
[16:11:48] baweaver: has joined #RubyOnRails
[16:11:57] AzaToth: has joined #RubyOnRails
[16:12:43] manvsmachine: tubbo: I was using update_columns just so I could isolate the source of the error. I wanted to make sure itr wasn???t the result of a callback or something like that.
[16:13:26] mwlang: DylanJ: I don???t think I want to go to a hash key name. I just found that most of the inconsistency in casing is coming from WYSIWYG HTML where users are typing URLs for the images and I would have better success with a script that downcases src and href attributes rather than substituting. Plus, I need to process a few million files (about 30m!).
[16:16:00] findaway: has joined #RubyOnRails
[16:16:51] griffindy: has joined #RubyOnRails
[16:18:23] andhof-mt: has joined #RubyOnRails
[16:18:36] chouhoulis: has joined #RubyOnRails
[16:18:42] andhof-mt: It's been a while, how's the channel been?
[16:20:02] n008f4g_: has joined #RubyOnRails
[16:22:23] hadees: has joined #RubyOnRails
[16:22:54] andhof-mt: So my app basically is a video viewing site for fan made views for a certain genre
[16:23:03] andhof-mt: I have several videos, 3-5 per letter
[16:23:11] mwlang: andhof-mt: depends on the time of day ??? quiet for long spells, then chatty and sometimes catty with a few yellow cards on MINASWAN
[16:23:12] Kedric: has joined #RubyOnRails
[16:23:26] zendrix: has joined #RubyOnRails
[16:23:33] Kedric: Having issues with testing controllers in an engine: Rails 4.2, Ruby 2.2 https://gist.github.com/anonymous/ff0874dc6bcc120546cf
[16:23:44] smathy: has joined #RubyOnRails
[16:23:46] andhof-mt: I have sorting "playlists" A,B,C,D,E... etc. Should I do that or do A-E, F-J, etc?
[16:24:27] momomomomo: has joined #RubyOnRails
[16:24:36] Kedric: here is the gist with the engine routes as well: https://gist.github.com/anonymous/30192bcbdf5affa4cf12
[16:25:15] griffindy: has joined #RubyOnRails
[16:25:34] rjno: has joined #RubyOnRails
[16:26:30] mwlang: andhof-mt: I think I would just do an each_slice(10) or so and then dynamically determine the range to show that way, the max and min (except last group) is 10 items.
[16:26:39] Ergo^: has joined #RubyOnRails
[16:27:47] paulcsmith: has joined #RubyOnRails
[16:27:52] mwlang: that is, if the expected number of videos under each letter is expected to remain low over the life of the site.
[16:28:00] drale2k: has joined #RubyOnRails
[16:29:36] mwlang: andhof-mt: on second thought, forget each_slice???edge cases too hard to deal with elegantly
[16:30:46] michael_mbp: has joined #RubyOnRails
[16:33:16] Pazician: has joined #RubyOnRails
[16:33:24] Ergo^: has joined #RubyOnRails
[16:33:32] alex88: has joined #RubyOnRails
[16:33:45] alex88: has joined #RubyOnRails
[16:33:45] Pazician: has joined #RubyOnRails
[16:35:07] shortCircuit__: has left #RubyOnRails: ()
[16:35:49] Ergo: has joined #RubyOnRails
[16:36:51] Bertg: has joined #RubyOnRails
[16:37:11] smathy: andhof-mt, I'd do the A-F, G-whatever stuff.
[16:37:16] hotpancakes: has joined #RubyOnRails
[16:37:17] jrails: has joined #RubyOnRails
[16:37:30] Kedric: nevermind, I had namespacing/layout issues within the project!
[16:37:32] ivanskie: has joined #RubyOnRails
[16:37:42] konsolebox: has joined #RubyOnRails
[16:38:10] jsrn_: has joined #RubyOnRails
[16:40:10] findaway: has joined #RubyOnRails
[16:40:12] sandstrom: has joined #RubyOnRails
[16:40:31] dopie: has joined #RubyOnRails
[16:42:00] cnk: has joined #RubyOnRails
[16:42:36] slava_: for globalize3, any ideas why form_for reads :en localization record from the default table instead of reading it from the translations table? the translations table has :en record...
[16:43:34] slava_: globalize version 4.0.3
[16:44:29] annlewis: has joined #RubyOnRails
[16:44:37] bullcitydev: has joined #RubyOnRails
[16:46:22] mdw: has joined #RubyOnRails
[16:46:45] [H]unt3r: has joined #RubyOnRails
[16:47:03] hotpancakes: has joined #RubyOnRails
[16:47:08] towski_: has joined #RubyOnRails
[16:49:25] anthonys: has joined #RubyOnRails
[16:49:30] hahuang65: has joined #RubyOnRails
[16:49:48] tubbo: has joined #RubyOnRails
[16:50:27] dideler: has joined #RubyOnRails
[16:52:49] Kedric: is there a better rails way to increment a hash value then hash[key] = (hash[key] || 0) + increment_val
[16:53:18] tubbo: hash[key] += 1?
[16:53:32] tubbo: kedric: ^
[16:53:40] Kedric: if it doesn???t exist
[16:53:42] Kedric: in the hash it breaks
[16:54:25] tubbo: kedric: scope creep ;)
[16:54:32] hardtail: has joined #RubyOnRails
[16:54:32] Kedric: tubbo: lol, sorry about that
[16:54:56] momomomomo_: has joined #RubyOnRails
[16:55:12] tubbo: i'd probably do something like hash[key] ||= 0; hash[key] += 1
[16:55:26] tubbo: it's two lines but i think it's a lot easier to read
[16:55:42] tubbo: saying "if hash[key] doesn't already exist, set it to 0", then "increment hash[key] (whatever that may be) by 1"
[16:58:05] nzst: has joined #RubyOnRails
[16:58:33] charliesome: has joined #RubyOnRails
[16:59:07] erich: has joined #RubyOnRails
[16:59:13] Kedric: tubbo: noted, thanks.
[17:00:46] dkphenom: has joined #RubyOnRails
[17:02:19] cek: h[:key] = h.fetch(:key, 0) + 1
[17:03:13] tubbo: kedric: please note cek's infinitely better code :)
[17:03:21] tubbo: do it like that :)
[17:03:59] bronson: has joined #RubyOnRails
[17:04:13] roolo_: has joined #RubyOnRails
[17:04:21] Kedric: tubbo: cek agreed! thanks
[17:05:49] greengriminal: has joined #RubyOnRails
[17:06:15] Spami: has joined #RubyOnRails
[17:06:38] smathy: hash = Hash.new 0
[17:07:10] djbkd: has joined #RubyOnRails
[17:08:30] Anakat: has joined #RubyOnRails
[17:08:36] cmisenas: has joined #RubyOnRails
[17:08:47] CheckYourSix: Just out of random curiosity, is there a cheaper (but still GOOD) alternative to Heroku? Or is that like trying to win the lottery?
[17:09:07] iateadonut: i'm using a geocoder gem (http://www.rubygeocoder.com/), and it says:
[17:09:15] tubbo: CheckYourSix: yeah there's actually this service that PAYS YOU $15/month to host on their servers.
[17:09:21] iateadonut: Given a Venue model with known street address, automatically fetch coordinates after validation and store in latitude and longitude attributes:
[17:09:21] iateadonut: # app/models/venue.rb
[17:09:22] iateadonut: geocoded_by :address
[17:09:22] iateadonut: after_validation :geocode
[17:09:25] gauke: has joined #RubyOnRails
[17:09:28] tubbo: CheckYourSix: (that's the only cheaper alternative to heroku's free plan i can think of)
[17:09:38] tubbo: iateadonut: !paste
[17:09:38] helpa: iateadonut: Please do not paste code to the channel. It makes it hard to read and respond, especially if everyone does it. Use https://gist.github.com to share your code and errors. Thank you!
[17:09:56] CheckYourSix: tubbo: I'm saying for production sites. Above the free tier.
[17:09:58] tubbo: iateadonut: i know it wasn't code but don't do any more multi-line pastes or you might get auto-k-lined from the network :)
[17:10:35] iateadonut: i'm wondering if given those instructions if i could make my relationships so that geocoded_by went to a joined table instead of the same table?
[17:10:39] tubbo: CheckYourSix: when you say "alternative to Heroku", are you just saying any generic VPS hosting or something along the lines of a PaaS where you pretty much have to `git push` and it all works?
[17:11:13] tubbo: iateadonut: mmm...i *wouldn't* but i don't see why not. i think that :address just refers to a method, so if you defined a method on the object that read a value from a join table, it might work.
[17:11:25] tubbo: the problem with that is i can see it blowing up pretty easily and causing hard-to-debug problems
[17:11:51] CheckYourSix: tubbo: Well, I'm really just asking because so many things to do with Rails say to deploy on Heroku. So I was just seeing if there was something that operated just as well but for cheaper
[17:12:01] iateadonut: i'm new to ruby and was wondering if there was some kind of magic
[17:12:15] iateadonut: so i guess i just loop through in a controller
[17:12:45] iateadonut: now i'm creating an object like this: geocode1 = Geocoder.search( customer.street + ' ' + customer.zip )
[17:13:13] iateadonut: and when i echo geocode1, it gives me: => [[#<Geocoder::Result::Google:0x000000035b99f8 @data={"address_components"...
[17:13:15] tubbo: CheckYourSix: pretty much any VPS host will operate just as well as heroku for cheaper, but you don't get the nice deployment things heroku provides
[17:13:27] CheckYourSix: tubbo: I figured as much
[17:13:29] iateadonut: i'm having a hard time accessing any of the fields it's giving me.
[17:13:32] tubbo: CheckYourSix: you'd have to code all that deployment stuff yourself, figure out how to set up the server and save the configuration so it will be rebuilt
[17:13:50] yaw: has joined #RubyOnRails
[17:13:53] tubbo: CheckYourSix: but you can also use redhat's openshift https://www.openshift.com/ it's kinda like heroku
[17:14:36] nzst: Hi, how do I raise an exception in a controller and have it the server return a specific status and message to the end user?
[17:14:42] rjno: has joined #RubyOnRails
[17:14:44] tubbo: that's the only other PaaS i would recommend for rails honestly, never used anything else
[17:14:50] tubbo: i host my stuff on Amazon
[17:15:20] Kedric: CheckYourSix: If you do go self hosted, I highly recommend using an automation tool like asible, chef, salt
[17:15:25] tubbo: nzst: check out rescue_from in the action_controller docs.. http://api.rubyonrails.org/classes/ActiveSupport/Rescuable/ClassMethods.html#method-i-rescue_from
[17:15:42] nzst: tubbo: Thank you :)
[17:16:13] CheckYourSix: tubbo: kedric: Ok. It was more of a question cause I was curious. Thanks for the info.
[17:16:52] leofrozenyogurt: has joined #RubyOnRails
[17:17:48] dopie: has joined #RubyOnRails
[17:17:54] tfittsy: iateadonut: use pry and access it in the console
[17:18:40] djellemah_: has joined #RubyOnRails
[17:19:14] leofrozenyogurt: So i am running a pretty big data app and was wondering how to cache a giant query to be able to load it effeciently on a search
[17:19:16] leofrozenyogurt: https://gist.github.com/leofrozenyogurt/59dc7994ca52c52ed29b
[17:19:19] chouhoulis: has joined #RubyOnRails
[17:19:25] leofrozenyogurt: here is my current method in the model in a gist
[17:19:40] leofrozenyogurt: if anyone has any experience with low level cahcing i'd really appreciate the help
[17:19:43] tubbo: leofrozenyogurt: can you fix the indentation on that? it's very hard to read.
[17:20:26] leofrozenyogurt: tubbo: https://gist.github.com/leofrozenyogurt/59dc7994ca52c52ed29b
[17:20:43] tubbo: ehhh...better ;)
[17:20:50] funnymanva: has joined #RubyOnRails
[17:20:58] tubbo: leofrozenyogurt: also, when you say low-level caching you mean on the DB level right?
[17:21:11] Valien: has left #RubyOnRails: ()
[17:21:32] leofrozenyogurt: so if i do Rails.cache.fetch("allerge_group_products")
[17:21:46] yaw: leofrozenyogurt that's not caching on the DB
[17:22:25] leofrozenyogurt: it loads pretty fast in the console like 2 seconds, but in the index view because of the images associated with it it takes about 40 seconds
[17:22:29] leofrozenyogurt: which is a big no no
[17:22:42] tubbo: leofrozenyogurt: images?
[17:22:45] Hates_: leofrozenyogurt: so cache the view fragments for each product?
[17:22:49] tubbo: leofrozenyogurt: your code says nothing about images
[17:22:59] leofrozenyogurt: Product has_many :images
[17:23:10] leofrozenyogurt: which are displayed on the index page
[17:23:25] leofrozenyogurt: i can do an includes
[17:23:37] leofrozenyogurt: Product.includes(:images).where(id: @products_ids)
[17:23:44] findaway: has joined #RubyOnRails
[17:23:47] leofrozenyogurt: the issue is that there is there more then 1 allergen group
[17:24:00] leofrozenyogurt: so eventually i will put this in a worker and set it in the application level
[17:24:17] gusrub: has joined #RubyOnRails
[17:24:18] leofrozenyogurt: and 24 hours it will recache the data based on allergen groups
[17:24:39] tubbo: leofrozenyogurt: so TLDR, the code here is not causing your problem
[17:24:52] Hates_: leofrozenyogurt: so why not cache the views instead of caching the data?
[17:25:02] leofrozenyogurt: so it will be like Rails.cache.fetch("#{allergen_group_id}_cached_products")
[17:25:11] tubbo: leofrozenyogurt: this query takes 2 seconds, every time. the other 38 seconds you're spending in the browser is probably the actual image files being fetched and rendered in the browser...
[17:25:38] leofrozenyogurt: tubbo: so in order to fix that would the include in the cache work?
[17:25:43] tubbo: if you do want to use each Product's image, you'd need to have includes(:images) in that query, so you can just do product.image
[17:26:12] fschuindt: has joined #RubyOnRails
[17:26:13] leofrozenyogurt: will try now in the console
[17:26:20] RegulationD: has joined #RubyOnRails
[17:26:22] tubbo: leofrozenyogurt: well, it's still going to take some time to load the actual image files and render them in the browser. but you can at least save some N+1 querying by doing includes() and eager-loading the image data into @products
[17:26:32] dideler92: has joined #RubyOnRails
[17:26:42] leofrozenyogurt: so in my controller i will just call @products= Rails.cache.fetch("allerge_group_products")
[17:26:57] tubbo: leofrozenyogurt: also if you don't need those variables outside of that method, please make them local variables. by making them instance variables you are attaching them to the object and you could be polluting its state in unexpected ways.
[17:27:06] tubbo: leofrozenyogurt: !caching
[17:27:06] helpa: leofrozenyogurt: Caching with Rails Guide - http://guides.rubyonrails.org/caching_with_rails.html - by Aditya Chadha
[17:27:15] tubbo: leofrozenyogurt: have you read that?
[17:27:48] tubbo: then you already know the answer to your last question.
[17:28:16] tubbo: check the code examples in that guide and see if they match up to your code.
[17:28:38] jkamenik1: has joined #RubyOnRails
[17:29:15] meoblast001: has joined #RubyOnRails
[17:29:28] leofrozenyogurt: I am recaching right now with an includes to see if the images will load faster
[17:30:12] noodman: has joined #RubyOnRails
[17:30:32] leofrozenyogurt: tubbo: https://gist.github.com/leofrozenyogurt/59dc7994ca52c52ed29b
[17:30:41] leofrozenyogurt: so you can see my comment at the bottom
[17:30:58] leofrozenyogurt: its still doing an Image Load for each image
[17:31:43] tubbo: leofrozenyogurt: something else that jumps out at me, there's no SELECT FROM "products" query there
[17:32:00] tubbo: leofrozenyogurt: so how is it getting those product ids?
[17:32:09] tubbo: where is that SELECT FROM 'categories' query coming from?
[17:32:12] tubbo: i don't see that in your code at all.
[17:32:24] oflannabhra: has joined #RubyOnRails
[17:32:36] benlieb_: has joined #RubyOnRails
[17:32:54] leofrozenyogurt: tubbo: thats a great question
[17:33:25] leofrozenyogurt: tubbo: @product.category is in the view
[17:33:31] leofrozenyogurt: time to include everything
[17:33:41] leofrozenyogurt: .includes(:images, :categories)
[17:33:53] emptyflask: has joined #RubyOnRails
[17:34:28] jkamenik: has joined #RubyOnRails
[17:35:14] McDude91: has joined #RubyOnRails
[17:35:41] Kedric: Why does User.where.not(roles_mask: 2) not include nil roles_mask entries?
[17:36:57] manvsmachine: has joined #RubyOnRails
[17:37:33] iateadonut: is there a 'history' command in the irb like in a shell?
[17:40:18] leofrozenyogurt: i included it all
[17:40:20] bricker: has joined #RubyOnRails
[17:40:22] leofrozenyogurt: still happening
[17:40:28] leofrozenyogurt: the endless load
[17:40:40] leofrozenyogurt: im not even asking for the image on the index page anymore
[17:40:49] dopie: Question: why is namespacing used?
[17:41:15] dopie: like inside an app/controllers there is another folder called admin so it would be app/controllers/admin
[17:41:20] dopie: what is the purpose of thaT?
[17:41:31] chelbs: has joined #RubyOnRails
[17:42:01] chipotle: has joined #RubyOnRails
[17:42:03] smathy: dopie, the word "name space" doesn't give it away for you?
[17:42:17] oflannabhra: has joined #RubyOnRails
[17:42:22] tubbo: dopie: it's a space for names.
[17:42:29] tubbo: but seriously, it's just a way to organize code
[17:42:49] smathy: If "organize code" means to create spaces for names.
[17:44:05] carlosd: has joined #RubyOnRails
[17:45:17] smathy: dopie, it's the same reason we put files in folders, have countries, states, cities and streets, have surnames (have first names), top level domain names, country codes, or generally why we segment any naming system into subsections.
[17:46:07] dopie: thank you
[17:47:10] broman: has joined #RubyOnRails
[17:47:44] broman: can someone help me? using cucumber, im trying to follow a link WITHIN #projects tag... the tag is there but cucumber shows me error.. what can i do?
[17:48:30] rjno: has joined #RubyOnRails
[17:49:14] konsolebox: has joined #RubyOnRails
[17:49:22] anjen: has joined #RubyOnRails
[17:49:24] maddox_: has joined #RubyOnRails
[17:49:33] chipotle: has joined #RubyOnRails
[17:50:27] smathy: leofrozenyogurt, for the select from images by product_id to take 26ms I'm guessing that you have a lot of images and no DB index on `product_id`
[17:50:36] towski_: has joined #RubyOnRails
[17:52:27] leofrozenyogurt: smathy: add_reference :images, :product, index: true
[17:52:47] jobewan: has joined #RubyOnRails
[17:52:53] leofrozenyogurt: i do have a butt ton of images
[17:52:59] leofrozenyogurt: i have a database of 600k products
[17:53:01] iateadonut: has left #RubyOnRails: ()
[17:53:07] Wolland: has joined #RubyOnRails
[17:53:07] leofrozenyogurt: with about 1.3mil images
[17:53:22] tubbo: haha "i wonder why its taking so long" ;)
[17:53:35] tubbo: leofrozenyogurt: you also have to remember that loading the actual image files synchronously is going to take some time
[17:53:39] tubbo: until we get HTTP2 that is!
[17:53:56] tubbo: so a lot of that 40x increase in speed could just be the browser fetching files
[17:54:03] tubbo: the query itself should take about the same time to execute every time
[17:54:10] symbol: has joined #RubyOnRails
[17:54:17] smathy: leofrozenyogurt, ok, so the solution here, as Hates_ pointed out ages ago, is going to be view caching.
[17:54:41] leofrozenyogurt: smathy but how can i view cache on a stored variable
[17:54:42] delianides: has joined #RubyOnRails
[17:54:43] acti0nman: has joined #RubyOnRails
[17:54:54] smathy: ...and then, if you know you're happy with a 24 hour refresh on that then set the browser (http) cache headers for that.
[17:55:12] leofrozenyogurt: but the group that a user queries by can change
[17:55:53] smathy: leofrozenyogurt, is the URL different?
[17:56:20] leofrozenyogurt: yes it will have different params
[17:56:25] momomomomo: has joined #RubyOnRails
[17:56:31] leofrozenyogurt: http://localhost:3000/products?commit=submit&search%5Ballergen%5D=&search%5Bcategory%5D=&search%5Bdefault%5D=&search%5Bgroups%5D=2&search%5Bingredients%5D=&utf8=%E2%9C%93
[17:56:36] smathy: leofrozenyogurt, well that's the key that the browser uses for its local cache.
[17:56:45] konsolebox: has joined #RubyOnRails
[17:56:49] smathy: ...so all you need to be sure of is that you use the same things in your server-side cache.
[17:57:02] leofrozenyogurt: ill look into it
[17:57:22] leofrozenyogurt: so if the allergengroup is 3 set the view cache to a specific url
[17:57:33] smathy: Hint: "allerge_group_products" is not going to work as a cache key.
[17:57:43] chouhoulis: has joined #RubyOnRails
[17:57:46] leofrozenyogurt: how will pagination play into that? or will it cache it for each page
[17:58:26] smathy: leofrozenyogurt, that you're asking these questions tells me that you either haven't actually read the caching guide you were linked to above, or you didn't understand it. Read it (again).
[17:59:19] jkamenik: has joined #RubyOnRails
[17:59:39] baweaver: has joined #RubyOnRails
[18:01:40] nzst: Is there a global setting to make exception messages better? e.g. I have an ActiveRecord::RecordInvalid that sends the message unprocessable entity to the frontend of my application, I'd like the message that shows in the logs about the Validation failure that caused it, as a part of that message
[18:01:59] Rubie: has joined #RubyOnRails
[18:02:51] leofrozenyogurt: smathy: what would be the diffrence between cache and the cache(action: 'recent', action_suffix: 'all_products')
[18:02:55] manvsmachine: has joined #RubyOnRails
[18:03:36] hanss: has joined #RubyOnRails
[18:03:45] smathy: nzst, in development? Look at the `better_errors` gem.
[18:04:09] cashnguns: has joined #RubyOnRails
[18:04:16] nzst: smathy: production, I have a rails app with an api endpoint and when an exception is raised in the controller I'd like the messages to be more verbose
[18:04:43] nzst: smathy: that gem is nice though
[18:04:55] tubbo: nzst: didn't i just link you to rescue_from?
[18:05:12] tubbo: rescue_from StandardError, with: :my_custom_action if Rails.env.production?
[18:06:16] tubbo: nzst: i typically do `rescue_from ActiveRecord::RecordNotValid, with: :not_found` and then define the not_found action to just render json: { error: t(action_name) }, status: action_name
[18:06:20] tubbo: because :not_found will resolve to 404
[18:06:24] smathy: leofrozenyogurt, the first is the name of the method, and the second is an example of calling the method with two hash-based parameters.
[18:06:57] tubbo: leofrozenyogurt: if you're talking about the guide (the `cache do`) part, i think it just uses the default args to the method.
[18:07:32] leofrozenyogurt: smathy: unfortantely it still doesnt make sense; do i remove the controller code and put it all in the view now? or do i leave it in the controller cached as well
[18:07:33] nzst: tubbo: is there a way to just 'enhance' the default message and behavior, I just want the message to be more verbose with little customization
[18:07:55] smathy: nzst, the default message (as far as I can see and know) shows the validation error with it in the logs.
[18:07:56] DoctorMonocular: has joined #RubyOnRails
[18:08:17] smathy: nzst, you sure you're not rescuing the exception yourself without a re-raise and hence short-circuiting that default process?
[18:08:20] nzst: smathy: correct! for some reason that doesn't get carried with the html payload
[18:08:23] tubbo: not for RecordNotFound...it would say something like "Could not find <MODEL> with ID=<NUM>
[18:08:28] Schalla: has joined #RubyOnRails
[18:08:57] smathy: nzst, oh, sorry, I misread. You want to show that log message to the end user.
[18:09:12] boom1992: has joined #RubyOnRails
[18:09:16] nzst: smathy: basically, the verbose part with the validation error
[18:09:27] smathy: nzst, why are you using the exception versions of the persistence methods then? Just use the boolean versions (without the `!`) and return the message you want.
[18:10:10] nzst: smathy: too many cases and too much customization, rails default behavior for the exception versions are almost what I need
[18:10:49] smathy: leofrozenyogurt, what doesn't make sense? The question you asked about `cache` vs `cache(action: 'recent', action_suffix: 'all_products')` and your subsequent question about "do i remove the controller code and put it all in the view now" doesn't gel. One has nothing to do with the other.
[18:10:59] smathy: leofrozenyogurt, do you have a specific question about the caching guide?
[18:11:30] Etriaph: has joined #RubyOnRails
[18:11:39] jeanlinux: has joined #RubyOnRails
[18:11:42] smathy: nzst, then rescue the exceptions and return/render what you need to, and re-raise to get the default behavior.
[18:12:48] jeanlinux: has joined #RubyOnRails
[18:13:09] kitsuneyo: has joined #RubyOnRails
[18:13:57] snicers-work: has joined #RubyOnRails
[18:14:28] kitsuneyo: I think I'm so close with my embedded form, would anyone take a look at my gist and help me get it working? There's an explanation of what I'm doing at the top: https://gist.github.com/kitsuneyo/b442cf16947f28785c2f
[18:14:34] snicers-work: I have a database column that is json data, is it possible for me to craft an active record query that tries to match a key's value out of that json column?
[18:14:51] leofrozenyogurt: smathy: Yes so first of all ; should i do controller cache aka low level do fragment caching with cache("allergen_group_cache) do ; in the view
[18:15:08] chouhoulis: has joined #RubyOnRails
[18:15:09] jkamenik: has joined #RubyOnRails
[18:15:31] Cork: has joined #RubyOnRails
[18:15:50] leofrozenyogurt: smathy: https://gist.github.com/leofrozenyogurt/59dc7994ca52c52ed29b
[18:16:22] manvsmachine: has joined #RubyOnRails
[18:16:30] adavia: so how can i do this is rails 4.2 Image.update_all({ :is_primary => false }, :user_id => self.user_id)
[18:16:37] leofrozenyogurt: https://gist.github.com/leofrozenyogurt/59dc7994ca52c52ed29b
[18:16:45] workmad3: has joined #RubyOnRails
[18:19:23] IanV0rn2341: has joined #RubyOnRails
[18:19:33] dopie: mindblown equip $ rake db:schema:load
[18:19:33] dopie: rake aborted!
[18:19:34] dopie: PG::Error: FATAL: database "equip_development" does not exist
[18:19:40] dopie: with am i doing wrong?!@#
[18:21:40] manvsmachine: has joined #RubyOnRails
[18:21:41] mary5030: has joined #RubyOnRails
[18:21:56] bf4: has joined #RubyOnRails
[18:22:34] tubbo: dopie: your database doesn't exist
[18:22:41] l0oky: has joined #RubyOnRails
[18:22:50] Etriaph: dopie: createdb equip_development
[18:23:11] mary5030: has joined #RubyOnRails
[18:23:24] Slogger: I'm trying to make an association in factory girl like the example:
[18:23:24] Slogger: association :author, factory: :user, last_name: "Writely"
[18:23:24] Slogger: only I'd like to pass a value from the current factory like
[18:23:24] Slogger: association :author, factory: :user, last_name: last_name
[18:23:24] Slogger: however, passing something the 2nd way causes "Trait not registered."
[18:23:45] leofrozenyogurt: tubbo or smathy ; how does that look
[18:26:02] jrails: has joined #RubyOnRails
[18:27:08] Lightsword: has joined #RubyOnRails
[18:27:15] hotpancakes: has joined #RubyOnRails
[18:28:18] leofrozenyogurt: yea its still taking as long of a load
[18:29:23] Lightsword: has joined #RubyOnRails
[18:31:15] hahuang65: has joined #RubyOnRails
[18:31:27] leofrozenyogurt: so its deff reading the fragment
[18:31:28] leofrozenyogurt: Read fragment views/allergen_group_products_2/5e29f18cb151c5de1cc73402ef7c4d6f (8.0ms)
[18:31:43] leofrozenyogurt: thats pretty much at the end
[18:31:52] leofrozenyogurt: so the controller is still getting qued
[18:33:06] smathy: leofrozenyogurt, yeah, that's the idea. Not sure how well that key is going to work for you.
[18:33:12] baweaver: has joined #RubyOnRails
[18:34:01] l0oky: In what format is ActionController::Parameters sent ? JSON?
[18:34:24] leofrozenyogurt: smathy: what seems wrong with the key?
[18:34:32] djbkd: has joined #RubyOnRails
[18:34:39] smathy: l0oky, in what context?
[18:35:17] l0oky: I want to POST manually to a page with parameters
[18:35:40] tjbiddle: has joined #RubyOnRails
[18:35:49] l0oky: ActionController::Parameters.new(group: { name: 'Family' }, group_plan: { id: 0 })
[18:36:04] smathy: leofrozenyogurt, just that you're rendering a collection of @products in there, and then you're labeling that cache "allergen_group_products_2" - it seems to me that products are related to `AllergenGroup.find(params[:search][:groups])` - which comes in from the user, and yet you have a static cache key.
[18:36:16] drale2k: has joined #RubyOnRails
[18:36:25] Lightsword: has joined #RubyOnRails
[18:36:48] l0oky: So when I post manually all I have to do is make it to json? {"group":{"name":"Family"}..ect}
[18:36:52] leofrozenyogurt: yea i will update it per param but for now in order for speed testing i want to use a static one
[18:37:03] dopie: Etriaph, aren't i supposed to run rake db:schema:load and it loads the schema??
[18:37:05] leofrozenyogurt: smathy: its stiill being 10 seconds slow
[18:37:23] mkc: has joined #RubyOnRails
[18:37:51] mkc: does anyone know how to remove duplicate sidekiq jobs in redis?
[18:37:57] smathy: l0oky, generally you just use a hash and call .to_query on it. Depends on the lib you're using though, many (like httparty) just take the hash directly.
[18:38:15] l0oky: I am using Postman extension in chrome :)
[18:38:22] centrx: has joined #RubyOnRails
[18:38:24] freezevee: has joined #RubyOnRails
[18:38:42] freezevee: can anyone help me with nginx rails and passenger ?
[18:38:51] smathy: l0oky, so you're posting to an API endpoint? So send whatever it expects.
[18:38:52] freezevee: I get a 403 page when visiting my app.
[18:39:06] manvsmachine: has joined #RubyOnRails
[18:39:21] bf4: has joined #RubyOnRails
[18:39:24] l0oky: I just pass key value pairs? sounds suspicious because I have parameters that are grouped like {group:{name:blabl},group2:{id:0}}
[18:39:27] freezevee: ubuntu server 14.04/nginx/rails/passenger/mysql is my stack and it has been working for months not
[18:39:42] freezevee: suddenly I get 403 on all of my rails apps
[18:40:03] smathy: leofrozenyogurt, the first time, or every time? I'm sure you read the guide now, so I'm sure you set the right config var for caching to be performed in dev.
[18:41:16] leofrozenyogurt: smathy: every time
[18:41:33] leofrozenyogurt: config.action_controller.perform_caching = true in development.rb
[18:41:57] smathy: freezevee, gist your nginx config.
[18:42:30] smathy: leofrozenyogurt, restart your app? Restart spring. I dunno.
[18:42:31] doodlehaus: has joined #RubyOnRails
[18:42:42] tubbo: SPRIIIIIING! </khan>
[18:42:59] nertzy: has joined #RubyOnRails
[18:43:05] freezevee: smathy: https://gist.github.com/chrisvel/729eb2a43aff17e53427
[18:43:09] dopie: tubbo, aren't i supposed to run rake db:schema:load and it loads the schema??
[18:43:12] pothibo: has joined #RubyOnRails
[18:43:16] adavia: so how can i do this is rails 4.2 Image.update_all({ :is_primary => false }, :user_id => self.user_id)
[18:43:18] tubbo: dopie: loads the schema to where? :P
[18:43:22] tubbo: dopie: the database that doesn't exist?
[18:43:34] dopie: ok now i did that
[18:43:36] djbkd: has joined #RubyOnRails
[18:43:40] dopie: now its asking for another table
[18:43:51] tubbo: dopie: *shrug*
[18:43:53] dopie: ctiveRecord::StatementInvalid: PG::Error: ERROR: relation "profiles" does not exist
[18:43:53] dopie: LINE 5: WHERE a.attrelid = '"profiles"'::regclass
[18:44:01] dopie: rake db:migrate
[18:44:02] freezevee: smathy: I updated the gist with my server file - one of them which are not working with a 403
[18:45:02] leofrozenyogurt: smathy: ill post a git of the runtime console 1 sec
[18:45:16] tubbo: dopie: it sounds like you probably wanna drop your db, then just use db:migrate to re-create it. your schema seems like its out-of-date with your migrations. sometimes rails doesn't catch that.
[18:45:57] Lightsword: has joined #RubyOnRails
[18:46:11] annlewis_: has joined #RubyOnRails
[18:46:13] erichu: has joined #RubyOnRails
[18:46:15] dopie: tubbo, ok i did dropdb equip_development
[18:46:22] benlieb_: has joined #RubyOnRails
[18:46:25] dopie: than i did a rake db:migrate
[18:46:34] dopie: and it gave me that the database doesn't exist
[18:46:36] tubbo: can anyone guess what's going to happen now?
[18:46:42] smathy: adavia, Image.where( user_id: user_id).update_all is_primary: true
[18:46:53] workmad3: has joined #RubyOnRails
[18:47:00] tubbo: dopie: now what?
[18:47:09] dopie: ActiveRecord::StatementInvalid: PG::Error: ERROR: relation "profiles" does not exist
[18:47:10] dopie: LINE 5: WHERE a.attrelid = '"profiles"'::regclass
[18:47:21] freezevee: smathy: any ideas
[18:47:24] smathy: dopie, stop pasting multi-lines into the chat please.
[18:47:42] adavia: smathy: thnks
[18:47:43] dopie: yeah sorry bout that
[18:47:56] tubbo: dopie: no, i mean...now what do you do? you already know the answer, i'm not giving it to you
[18:47:58] tubbo: dopie: !migrations
[18:47:58] helpa: dopie: http://guides.rubyonrails.org/migrations.html - Migrations Guide by Frederick Cheung
[18:48:04] tubbo: read that. learn some shit.
[18:48:06] mkc: dopie: Are your migrations in order? Sometimes if you work with multiple people they might not get there that way
[18:48:10] tubbo: stop askign the same stupid question over and over again.
[18:48:50] Etriaph: And when you want to show us something
[18:48:51] smathy: freezevee, probably your `my_username` user doesn't have access to either /home/hyp3rkyd/.rvm/gems/ruby-2.2.2/gems/passenger-5.0.9 or /var/www/bleebleep/public
[18:48:52] helpa: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[18:49:04] dopie: tubbo, :)
[18:49:12] tubbo: dopie: i'm sorry to be a little short but this isn't your first rodeo. i've helped you a lot, and this is a common problem.
[18:49:13] mkc: dopie: You are obviously performing some query on a table or field that doesn't exist yet
[18:49:27] freezevee: smathy: it does, I did a 777 and a chown username:username -R for both and double checked
[18:49:29] smathy: adavia, you're welcome.
[18:50:07] freezevee: smathy: *2 directory index of "/var/www/bleebleep/public/" is forbidden is the error of nginx
[18:50:25] zendrix: has joined #RubyOnRails
[18:50:27] benlieb_: has joined #RubyOnRails
[18:50:29] smathy: freezevee, right, as I said, your `my_username` user doesn't have access to that.
[18:50:38] l0oky: How does params.require(:person).permit(:name, :age) look like when posting to api endpoint?
[18:50:45] freezevee: smathy: I've checked that
[18:51:14] smathy: freezevee, you've checked it how?
[18:51:25] freezevee: smathy: ls -ll
[18:51:25] erts: has joined #RubyOnRails
[18:51:53] centrx: l0oky, You mean like { :person => [:name, :age] } ?
[18:52:09] centrx: l0oky, { person: ['name', 'age'] } would be the JSON I think
[18:52:17] l0oky: what does it look like in key value pairs?
[18:52:22] centrx: actuallywould be double-quotes on all
[18:52:34] l0oky: keyparam = { person: ['name', 'age'] }
[18:53:03] Lightsword: has joined #RubyOnRails
[18:53:31] centrx: Are you asking what it would look like in JavaScript, or Ruby?
[18:54:22] Etriaph: l0oky: params.inspect
[18:54:32] smathy: freezevee, instead of doing that, do this: sudo -u my_username ls /var/www/bleebleep/public
[18:55:09] adavia: smathy: is it the same self.user_id than user_id
[18:55:24] smathy: Sorry centrx, that's not accurate.
[18:55:40] ratmav: has joined #RubyOnRails
[18:55:56] smathy: l0oky, { person: { name: "value for name", age: "value for age" } } will be the hash.
[18:55:57] ratmav: hey, can callbacks access private methods?
[18:56:02] leofrozenyogurt: apparently there is a limit to how long a file can be in gist
[18:56:10] smathy: l0oky, .to_json it if you need it for an API endpoint that's expecting JSON.
[18:56:18] smathy: ratmav, yes.
[18:56:29] ratmav: thanks smathy. sanity check
[18:57:18] Rubie: has joined #RubyOnRails
[18:58:19] zautke: has joined #RubyOnRails
[18:58:47] freezevee: smathy: says Sessions still open, not unmounting
[18:59:20] jkamenik1: has joined #RubyOnRails
[18:59:22] l0oky: smathy: Look, install postman extenstion It will provide you with url and key value pairs if you want to post
[19:00:04] l0oky: I want to post manually with that chrome extension, how do I recreate parameters { person: { name: "value for name", age: "value for age" } }
[19:00:12] Xiti: has joined #RubyOnRails
[19:00:15] l0oky: All I get is key value pairs
[19:00:18] dopie: tubbo, smathy thank you
[19:00:23] freezevee: smathy: I believe the permissions and ownership is ok
[19:00:23] dopie: smathy, :)
[19:03:56] Rubie: has joined #RubyOnRails
[19:04:26] freezevee: anyone please ?
[19:04:45] nzst: Okay, I am using a begin/rescue block to catch a specific exception, but I want to re-raise all others, how do I do that?
[19:06:09] solars: has joined #RubyOnRails
[19:06:30] DLSteve: has joined #RubyOnRails
[19:06:47] srinidhi: has joined #RubyOnRails
[19:06:54] nzst: If I just catch a specfic exception, will others bubble out of the begin/rescue block?
[19:07:02] mikecmpbll: has joined #RubyOnRails
[19:09:58] sleungcy: has joined #RubyOnRails
[19:10:13] eLobato: has joined #RubyOnRails
[19:11:44] eLobato: question - if I'm on Rails 3 using strong_params, and I have several controllers that need to use xxxxxx_params, what would be a good way to share the 'params.require.etc...' part across controllers?
[19:12:00] nzst: eLobato: a concern
[19:12:21] nzst: eLobato: I guess a module since you're on rails 3
[19:12:23] eLobato: nzst: I was just about to write that ideally something other than a concern
[19:13:02] eLobato: because this happens for every controller in my application (api v1, api v2, regular controller all need to permit parameters)
[19:13:03] manvsmachine: has joined #RubyOnRails
[19:13:23] nzst: do you have a base or application controller you can add the info to?
[19:13:31] nzst: something the others inherit from
[19:14:25] bin_005: has joined #RubyOnRails
[19:14:44] qejk: has joined #RubyOnRails
[19:14:47] eLobato: nzst: yes, thought about that but it can get unwieldy imo, getting all 'permit' definitions all in one file
[19:15:15] mwlang: Does anyone know where in the Rails stack ???render??? keeps it???s output up until it???s ready to actually send it as a response? I???m looking for it in Rails 1.2 (you know???the long dead version???)
[19:15:26] mikecmpbll: evening folks. is there a way I can add/remove middleware at runtime?
[19:16:15] eLobato: nzst: I think this is what you're suggestin, sort of https://github.com/theforeman/foreman/pull/1819/files
[19:16:19] mwlang: I basically need to commit the greatest sin of all???regexp replace src href links with lower cased versions of same.
[19:17:16] mikecmpbll: mwlang: also why do you want to do that? why can't you change the views
[19:17:36] tenderlove: has joined #RubyOnRails
[19:17:55] mwlang: mikecmpbll: because it???s coming out of the database. there???s about 50 fields across just about as many tables attached to WYSIWYG editor.
[19:18:16] yardenbar: has joined #RubyOnRails
[19:18:18] ivanskie: has joined #RubyOnRails
[19:18:22] mwlang: and there???s about 200 views or thereabouts referencing all this.
[19:18:23] mikecmpbll: do a sql update?
[19:18:31] waseem_: mwlang: Couldn't you change it in the db? ^
[19:18:39] mikecmpbll: if it's in the db it's almost easier than modifying views
[19:18:51] sandstrom: has joined #RubyOnRails
[19:18:52] lapide_viridi: has joined #RubyOnRails
[19:18:54] mwlang: I???m contemplating a db change???but it???s getting unweildy fast.
[19:19:18] mikecmpbll: the db change is definitely the thing to do.
[19:19:18] mwlang: so I was thinking just grab the rendered response body and guarantee I miss nothing.
[19:19:26] mikecmpbll: and then fix the "issue" whatever that is, so it doesnt recur.
[19:19:39] fschuindt: has joined #RubyOnRails
[19:19:56] mwlang: mikecmpbll: yeah, that???s what I normally do, but the fix so it doesn???t recur is not easy on this whacked out codebase.
[19:19:57] mikecmpbll: that's a really poor solution, not only is it harder, it's patching over the shit.
[19:20:16] mwlang: mikecmpbll: well, they want the whole thing rewritten in Rails 4.
[19:20:24] mwlang: but its crashing a lot right now hosted on Windows.
[19:20:31] mikecmpbll: i don't think even the legacy rails companies support 1.2, haha.
[19:20:38] mikecmpbll: that shit won't have had security releases for years.
[19:20:44] mwlang: and it appears to be some segfault thing I haven???t been able to snuff out.
[19:21:15] mwlang: but I got the whole thing ported to Ruby 1.8.7 and Rails 1.2 (from Ruby 1.8.6 and Rails 1.1)
[19:21:23] mikecmpbll: man, don't go in steps
[19:21:33] mwlang: so???my aim is to patch, get it stable so I can focus on the rewrite.
[19:21:34] Lightsword: has joined #RubyOnRails
[19:21:36] mikecmpbll: each step will be as hard as the the step to 4.2
[19:22:02] mikecmpbll: okidokes ... welllll
[19:22:06] nertzy: has joined #RubyOnRails
[19:22:11] mwlang: mikecmpbll: I support Rails 1.2. ;-) As long as you also sign me up to rewrite the sucker in 4.x. :-D
[19:22:42] mikecmpbll: does rails 1.2 use rack?
[19:22:52] mwlang: nope. That was my first hope.
[19:23:02] mwlang: I was just gonna drop a simple middleware in.
[19:23:05] mikecmpbll: i think it started using rack when it merged with merb
[19:23:09] mikecmpbll: could be wrong, it's before my time.
[19:23:19] Aswebb_: has joined #RubyOnRails
[19:23:29] mwlang: yeah, that???s about right???sometime in the 2.x to 3.0 timeframe.
[19:23:40] tubbo: rails was a rack app before the merb berge
[19:24:00] mikecmpbll: mwlang: so i guess you're looking at the response.body ?
[19:24:23] zautke: has joined #RubyOnRails
[19:24:28] mwlang: If the darn thing wasn???t also hosted on MS SQL Server, I???d just do something like a mysqldump or postgres dump and grep for everywhere a url and/or filename exists.
[19:24:44] mwlang: that would help me identify all the tables and fields affected, then I???d script it up.
[19:24:58] mwlang: mikecmpbll: yeah, that???s what I???m chasing.
[19:25:01] zautke_: has joined #RubyOnRails
[19:25:28] mwlang: mikecmpbll: dpm
[19:25:36] mwlang: oops???. (cat on keyboard)
[19:26:15] mwlang: don???t laugh, but I also backported TinyTDS because ya can no longer install freetds + unixodbc on modern Linux at the version Rails 1.2 requires.
[19:26:41] waseem_: mwlang: Why aren't you updating it?
[19:26:45] mwlang: so, we???re 95% there. last hurdle is the case-sensitive paths.
[19:26:58] mwlang: waseem_: rewriting it.
[19:26:59] lalalaaa: has joined #RubyOnRails
[19:27:07] rubyonrails298: has joined #RubyOnRails
[19:27:13] waseem_: mwlang: Yeah, update to new Rails version.
[19:27:56] mwlang: waseem_: If it weren???t going to take 6 months to rewrite, I???d say, let the sucker keep crashing (it restarts itself), but they???re getting too much traffic for that.
[19:28:22] waseem_: mwlang: I feel your pain.
[19:28:29] fschuindt: has joined #RubyOnRails
[19:28:54] mikecmpbll: i don't think you can hook into and change the response easily from the controller.
[19:29:01] mikecmpbll: you may have to monkey patch rails
[19:29:26] mikecmpbll: or use some technique that's afforded to you in whatever was pre-rack
[19:29:36] mwlang: mikecmpbll: monkeypatching is fine???I???ve already bastardized Rails quite a bit
[19:29:56] mwlang: mikecmpbll: oh! good idea for search term.
[19:30:56] mwlang: too late???Rails Metal was 2008.
[19:31:05] mwlang: and came with Rack integration.
[19:31:14] mikecmpbll: oh right, well off the mark again then.
[19:32:20] bf4: has joined #RubyOnRails
[19:33:37] skroon: has joined #RubyOnRails
[19:34:04] djbkd: has joined #RubyOnRails
[19:34:13] erichu: has joined #RubyOnRails
[19:34:15] mary5030: has joined #RubyOnRails
[19:34:47] Guest69782: has joined #RubyOnRails
[19:35:25] mary5030: has joined #RubyOnRails
[19:35:48] smathy: l0oky, I've never used it, but I'm sure there'll be a way to enter just a string of JSON.
[19:36:03] mwlang: I think I finally found the file I???m interested in???actionpack???s controller base file.
[19:36:05] gauke: has joined #RubyOnRails
[19:36:50] eggoez: has joined #RubyOnRails
[19:37:45] mwlang: wow, I never even knew you could undo renders???.erase_render_results :-o
[19:37:53] zautke: has joined #RubyOnRails
[19:38:00] tubbo: mwlang: who needs turbolinks ;)
[19:38:28] mwlang: that basically resets the render outputs so you can render again.
[19:38:41] mwlang: tubbo: heh???is that how that was implemented?
[19:38:49] tubbo: lol noooo
[19:39:13] mwlang: as in, build the whole thing???if it matches a cached result, erase and just render changes.
[19:39:43] yaw: has joined #RubyOnRails
[19:40:46] dopie: https://gist.github.com/staycreativedesign/e9ea7e7bf363485be6e9
[19:40:55] dopie: why is my shoulda matcher not working
[19:40:58] brenop: has joined #RubyOnRails
[19:41:07] bricker: because u dum
[19:41:07] workmad3: has joined #RubyOnRails
[19:41:37] mwlang: note to all y???all beginning rails today: build with TDD. Nothing like an 8+ year old app with no automated tests to give you headaches.
[19:41:50] l0oky: I have `params.require(:group).permit(:name)` and `params.require(:group_plan).permit(:id)` so now I want to call group :name all I do is params[:name] right? and when I want to call group_plan id I do params[:id] right? the key doesn't matter
[19:41:54] Lightsword: has joined #RubyOnRails
[19:41:58] mikecmpbll: don't have to use TDD to get automated tests :) /rants
[19:42:06] dopie: bricker, awesome!
[19:42:38] dopie: bricker, I wish there was a point system for awesome answers in the chat
[19:42:41] cmisenas: has joined #RubyOnRails
[19:42:43] mwlang: mikecmpbll: heh???build them tests however you do it.
[19:42:47] dopie: that would net you 100+ points
[19:42:49] l0oky: mwlang: BDD is better
[19:42:53] smathy: l0oky, no, the key matters.
[19:42:57] tubbo: there is, it's called brickercoins
[19:43:09] dopie: tubbo, booo...
[19:43:29] l0oky: smathy: Soo params[:group => :name] ?
[19:43:29] mwlang: BDD == TDD, different vocabulary.
[19:43:38] Frem: has joined #RubyOnRails
[19:43:52] rhizome: bdd is cucumber
[19:43:57] smathy: l0oky, logger.debug params.inspect
[19:43:59] l0oky: mwlang: so is it different or `==` XD
[19:44:15] mikecmpbll: they're both crappy! fight!
[19:44:15] mwlang: rspec == bdd, too.
[19:44:15] l0oky: smathy: oh right thanks
[19:44:27] mikecmpbll: jk, test how you like but make sure you test.
[19:44:35] l0oky: smathy: but wait I do not pass parameters yet
[19:44:38] mikecmpbll: i test afterwards, yo
[19:44:41] rhizome: some use of rspec i haven't come across
[19:45:02] smathy: mwlang, many people make the mistake of equating TDD with "writing automated tests" - they're not the same thing.
[19:45:05] l0oky: can you tell me how will it look in advance? ty:D
[19:45:24] smathy: l0oky, I have no idea what you're talking about.
[19:45:37] smathy: l0oky, why don't I just write the app for you.
[19:46:03] bricker: dopie: yes, brickercoins
[19:46:03] l0oky: noo :( I didn't mean it like that sorry
[19:46:19] hotpancakes: has joined #RubyOnRails
[19:46:21] l0oky: I cant inspect params variable yet
[19:46:30] mwlang: smathy: true. I was rantin??? when I wrote that. I know there???s unit, integration, interactive capture/playback and all that jazz.
[19:46:38] l0oky: i want to get this params.require(:group).permit(:name)
[19:46:50] l0oky: To do that I just params[:name] ?
[19:47:06] l0oky: or params[:group => :name] something like that
[19:47:40] smathy: mwlang, you lost me there. Jumped from the difference between TDD and automated tests to the different types of (automated) tests.
[19:47:57] mwlang: most apps, I don???t have a problem figuring out how to get them under some sort of continuous integration build, but this one takes the cake???.it has a single controller action to handle all the actions in the app???more than 10k lines long. and just one matcher in the config/routes.rb file.
[19:48:04] smathy: mwlang, my point is really that TDD is a development process, just because you don't use TDD doesn't mean you don't write tests.
[19:48:48] rhizome: much easier to refactor than some metamonster
[19:48:50] mwlang: smathy: Ah???yeah???the whole write a test that fails and make it pass???yeah, that???s a fair point. I have kind of stopped thinking in those terms.
[19:49:37] l0oky: https://gist.github.com/l0oky/fcd9b80c3c543451c627
[19:50:17] mwlang: the tests come more or less naturally for me these days sometimes the test comes first, other times after the fact to ???freeze??? the solution to the current behavior and then other times it???s hand in hand as I work through the problem and solution.
[19:50:24] dopie: bricker, no :)
[19:50:26] mwlang: mostly the latter nowadays.
[19:50:35] bricker: dopie: no what
[19:50:39] bricker: dopie: brickercoins exist
[19:50:47] bricker: dopie: you have none sorry
[19:51:02] bricker: dopie: where is the "validate" matcher supposed to come from?
[19:51:24] fschuindt: has joined #RubyOnRails
[19:53:01] dopie: bricker, from brickercoins
[19:53:11] kitsuneyo: has joined #RubyOnRails
[19:53:26] smathy: mwlang, yeah, as I mentioned, I think a lot of people are using the term "TDD" in the way you did - to just mean writing tests.
[19:53:33] bricker: dopie: well brickercoins doesn't provide that method, so that's why it's not working
[19:53:34] smathy: *misusing ;)
[19:53:34] paulcsmith: has joined #RubyOnRails
[19:53:52] l0oky: Still trying to wrap my head around on what does the params.require.permit do..
[19:54:07] dopie: where is the brickercoin wiki
[19:54:23] bricker: dopie: on the official brickercoin website
[19:54:32] dopie: which is?
[19:54:35] smathy: l0oky, logger.debug user_group_params.inspect
[19:54:44] bricker: dopie: it's the same URL as the brickercoin wiki
[19:54:55] smathy: l0oky, stop asking us questions that your ruby interpreter will tell you in an instant.
[19:54:56] dopie: 99 - cowboyjob.com
[19:54:57] sandstrom: has joined #RubyOnRails
[19:55:16] dopie: Eve Bricker - Historical records and family trees - MyHeritage
[19:55:32] bricker: That's me, "Eve Bricker"
[19:56:05] mwlang: agreed now that I reflect on your point.
[19:56:20] baweaver: has joined #RubyOnRails
[19:56:41] l0oky: smathy: actually I already did that `undefined method `permit' for "{ name: 'Family' }":String`
[19:56:43] reptilain_brain: has joined #RubyOnRails
[19:57:04] eLobato: has left #RubyOnRails: ("WeeChat 1.2")
[19:58:06] reptilain_brain: How can I achieve this: Receive request from Client -> wait till the file is processed (server side) -> send file to client. All without breaking connection (so no polling from Client, just 1 request)..
[19:59:00] dc1: has joined #RubyOnRails
[19:59:04] Papipo: has joined #RubyOnRails
[19:59:07] reptilain_brain: is ???throw :async??? the way to go for it? Or something like Celluloid?
[19:59:10] brahman: just to confirm before I embark on rewriting my backend tasks import job, is rails runner a suitable way to use the Models without the requirement of having a rails app running? All web chats/posts seem to confirm this. What do you guys usually use runner for?
[19:59:21] l0oky: NoMethodError (undefined method `permit' for "test":String):
[19:59:38] Papipo: Do you know if there is any gem to add frontend admin capabilities to a rails app? something semantic, via presenters or something like that
[19:59:59] Pazician: has joined #RubyOnRails
[20:00:03] reptilain_brain: Papito activeAdmin ?
[20:00:09] l0oky: has joined #RubyOnRails
[20:00:15] reptilain_brain: Papipo, sorry ActiveAdmin?
[20:00:29] kitsuneyo: i almost fixed my nested form... i removed "validates :game_id, presence: true" from the game_genre model and it works... because game_id isn't created til after save. i want the validation though, anyone know how to work around it?
[20:00:35] Papipo: I meant to edit the content from the frontend
[20:00:43] Papipo: from the public website
[20:01:01] tubbo: has joined #RubyOnRails
[20:01:34] Zadrel: has joined #RubyOnRails
[20:01:42] kitsuneyo: anyone encountered this issue before?
[20:04:00] zendrix: has joined #RubyOnRails
[20:04:38] bin_005_e: has joined #RubyOnRails
[20:05:51] cmisenas: has joined #RubyOnRails
[20:07:14] kitsuneyo: "Nested records are validating the presence of their nesting parent record???s foreign key. If you do this, you cannot create a new parent record together with a new child record and will need to save the parent before you can save the child. You can opt to only show the nested child form when the parent has been saved before, or simply let go of the validation. <-- this correct?"
[20:07:25] Lightsword: has joined #RubyOnRails
[20:10:05] jmignault: has joined #RubyOnRails
[20:10:31] benlieb_: has joined #RubyOnRails
[20:12:12] Zadrel: hello there. anyone knows how do i ask if a string exists inside an Array? like "rails, does @category.title exists inside category_array?"
[20:13:24] bricker: Zadrel: http://ruby-doc.org/core-2.2.0/Array.html#method-i-include-3F
[20:13:24] yaymukund: has joined #RubyOnRails
[20:13:47] jenrzzz: has joined #RubyOnRails
[20:14:48] jrails: has joined #RubyOnRails
[20:16:11] sdwrage: has joined #RubyOnRails
[20:18:09] arBmind: has joined #RubyOnRails
[20:20:11] x-light: has joined #RubyOnRails
[20:20:39] mitchless: has joined #RubyOnRails
[20:22:34] ruv: has joined #RubyOnRails
[20:24:11] reptilain_brain: has left #RubyOnRails: ()
[20:24:12] bruno-: has joined #RubyOnRails
[20:26:14] baweaver: has joined #RubyOnRails
[20:28:23] dopie: class Video < ActiveRecord::Base
[20:28:23] dopie: belongs_to :category
[20:28:23] dopie: validates :title, :description, presence: true
[20:28:23] dopie: def self.search_by_title(search_term)
[20:28:23] dopie: where("title LIKE ?", "#{search_term}")
[20:28:30] dopie: wrong window
[20:28:50] dopie: https://gist.github.com/staycreativedesign/e822a25c9e99735847da
[20:30:22] kadoppe: has joined #RubyOnRails
[20:30:23] bricker: dopie: there are two Futurama videos in your database, one didn't get cleared out from a previous test probably
[20:30:47] Glyphik: has joined #RubyOnRails
[20:31:02] dopie: bricker, should I nuke the test database?
[20:31:29] gusrub: hey guys is there a way to do left outer joins without explicitly using SQL text?
[20:31:50] tfittsy: gusrub: pretty sure there isn't
[20:32:14] gusrub: tfittsy, right :/
[20:32:51] ev`: has joined #RubyOnRails
[20:32:58] bricker: welcome to rails, omakase, everything you need except the stuff we don't think you need
[20:33:19] bricker: (and if you need the stuff we don't think you need, you're doing it wrong)
[20:33:43] dopie: bricker, thank you... so overtime I do a video create it creates a new entry on the test database?
[20:33:52] ivanskie: has joined #RubyOnRails
[20:33:55] cac: has joined #RubyOnRails
[20:34:12] bricker: dopie: you should be clearing out your database after each test, one way or another
[20:34:25] bricker: database_cleaner gem, or rpsec-rails can do it for you
[20:35:30] pipework: Psh, cool kids don't even base their data.
[20:36:50] cac: has joined #RubyOnRails
[20:37:02] workmad3: has joined #RubyOnRails
[20:37:49] tubbo`: has joined #RubyOnRails
[20:39:04] yfeldblum: has joined #RubyOnRails
[20:40:50] vickleton: has joined #RubyOnRails
[20:42:02] cac: has joined #RubyOnRails
[20:42:26] gerep: has joined #RubyOnRails
[20:42:41] roolo: has joined #RubyOnRails
[20:42:42] annlewis: has joined #RubyOnRails
[20:42:50] ur5us: has joined #RubyOnRails
[20:44:30] Jasaka: has joined #RubyOnRails
[20:45:11] podman: has joined #RubyOnRails
[20:45:26] smathy: l0oky, which means you're passing in a string in params[:group]
[20:45:59] doodlehaus: has joined #RubyOnRails
[20:46:17] smathy: l0oky, based on your previous questions I'm guessing that means that you're still using Postman, and still using the key/value UI, and you're trying to paste Ruby hashes into the value field.
[20:47:12] dopie: bricker, i was using .eql instead of eq
[20:47:23] dopie: what is the difference between the two?
[20:47:24] smathy: gusrub, yes, `includes` and `references`: http://devdocs.io/rails/activerecord/querymethods#method-i-includes
[20:48:18] bricker: dopie: "eq" calls "==
[20:48:24] bricker: dopie: "eql" calls "eql?
[20:48:56] bricker: dopie: eql? and == are the same
[20:50:07] dopie: when I run eq([futurama]) it gives me the AR relation
[20:50:22] dopie: when I run eq it gives me the object
[20:51:08] dopie: https://gist.github.com/staycreativedesign/91ed6206868df59bea41
[20:51:35] bricker: dopie: maybe active record defines the two methods differently
[20:52:05] bricker: dopie: for testing queries like that I always call to_a on the relation
[20:52:08] bricker: to eliminate doubt
[20:52:49] centrx: smathy, JSON hash uses double quotes
[20:53:59] dopie: bricker, did I just find a bug?
[20:54:02] smathy: dopie, as per the docs http://www.relishapp.com/rspec/rspec-rails/v/3-3/docs/matchers/activerecord-relation-match-array you need to use match_array with AR::Relations
[20:54:08] bricker: dopie: doubt it
[20:54:25] smathy: dopie, as usual you found another opportunity to read more docs.
[20:54:33] dopie: I'm ready more docs
[20:54:40] dopie: https://www.relishapp.com/rspec/rspec-expectations/v/2-0/docs/matchers/equality-matchers#compare-using-eql-(eql?)
[20:55:02] dopie: a == b # object equivalence - a and b have the same value with type conversions
[20:55:11] smathy: dopie, excellent, so you'd know that the result of an AR query is not an array.
[20:55:34] dopie: its an object
[20:55:53] dopie: correct? hehe
[20:56:59] dopie: ok... so eq basically makes the AR search into an array?
[20:57:17] dopie: or make the array into an object?
[20:57:28] rubyonrailed: has joined #RubyOnRails
[20:57:36] momomomomo: has joined #RubyOnRails
[20:58:56] nobitanobi: has joined #RubyOnRails
[20:59:11] mordocai: has joined #RubyOnRails
[20:59:26] nobitanobi: How does rails/assets pipeline know that it needs to compile the assets (js) whenever I change a JS file?
[21:00:01] bricker: nobitanobi: the filesystem knows when a file was last changed. sprockets uses that
[21:01:41] cac_: has joined #RubyOnRails
[21:01:56] nobitanobi: but which folders sprockets uses?
[21:01:58] Guest67: has joined #RubyOnRails
[21:02:10] nobitanobi: like, if I have a js file in a lib, for example
[21:02:50] dopie: smathy, using .eq works
[21:02:52] bricker: nobitanobi: rails configures sprockets to look in specific places
[21:02:54] mwlang: yeah! it actually works and is not overly aggressive messing with the page contents: https://gist.github.com/mwlang/b8b90a7e5497f2b472f5
[21:03:04] dopie: my question is why it works...
[21:03:10] nobitanobi: bricker: is there any way I can add more places to use?
[21:03:42] mwlang: mikecmpbll: thanks for the think-out-loud session.
[21:03:51] mikecmpbll: mwlang: how'd you get on? :)
[21:04:38] mwlang: mikecmpbll: got it working ??? see gist just above.
[21:04:47] bruno-_: has joined #RubyOnRails
[21:05:20] rubyonrailed: Does anyone have any good articles on refactoring giant methods full of conditionals? I have so many if statements in one method, I don't have any clue on how to try apply the sandi metz rule to it.
[21:05:21] bricker: nobitanobi: yes, add any path to Rails.application.config.assets.paths
[21:05:35] baweaver: has joined #RubyOnRails
[21:05:36] mwlang: turns out pretty much everything else is handled in the Rails controller no matter the case-mix of the request, so that needed to be left alone and only files being handled outside Rails needed downcasing.
[21:06:15] mwlang: now I just need to rsync 30 million files and rename them to downcased versions.
[21:06:18] mikecmpbll: ah, missed that. sweet! ????
[21:07:04] mwlang: this oughta hold water for ~six months
[21:07:37] Oog: has joined #RubyOnRails
[21:07:44] annlewis_: has joined #RubyOnRails
[21:07:52] Oog: Order.group(:user_id).having('count(*) > 1') - i want to count the number of users that have places more than 1 order
[21:08:05] Oog: ERROR: column "orders.id" must appear in the GROUP BY clause or be used in an aggregate function
[21:08:32] centrx: Oog, Use .select() in combination with group
[21:08:52] centrx: Oog, Generally, with a group by every column in the SELECT must either be in the GROUP BY, or be an aggregate column
[21:09:03] centrx: Oog, Specify the group columns, and the aggregation (COUNT(*)) in the select
[21:09:45] djbkd: has joined #RubyOnRails
[21:10:21] Oog: got it thanks
[21:10:21] __butch__: has joined #RubyOnRails
[21:11:19] Scriptonaut: does anyone know if there's a special case validation?
[21:11:27] Scriptonaut: as in, a validation I can pass in to apply when I save
[21:11:40] MrPunkin: has joined #RubyOnRails
[21:11:47] MrPunkin: has left #RubyOnRails: ()
[21:12:03] Bertg: has joined #RubyOnRails
[21:12:10] Scriptonaut: usually people (the Person model) don't need unique emails. However, I have a mass import feature, and some people are accidentally creating thousands of duplicates. The most efficient way to deal with this is validations, but I don't know how to apply them conditionally
[21:13:02] Hates_: Scriptonaut: most validations can be passed an if attribute
[21:13:13] Hates_: Scriptonaut: http://guides.rubyonrails.org/active_record_validations.html#conditional-validation
[21:13:57] Scriptonaut: ya, but how do I pass in something determining the result of that if when I save?
[21:14:22] Scriptonaut: like: person.save(unique: true)
[21:14:26] Scriptonaut: can you do anything like that?
[21:14:33] Hates_: Scriptonaut: the first example shows you how
[21:15:05] Hates_: Scriptonaut: you need a flag like :allow_unique_emails and then check that as part of your validation option
[21:15:06] djbkd: has joined #RubyOnRails
[21:15:28] Rubie: has joined #RubyOnRails
[21:15:35] Scriptonaut: ah, so I'm going to have to add an attribute
[21:16:21] Scrivener: has joined #RubyOnRails
[21:20:26] hotpancakes: has joined #RubyOnRails
[21:22:33] s2013: has joined #RubyOnRails
[21:23:54] moeabdol: has joined #RubyOnRails
[21:24:40] DCameronMauch: has joined #RubyOnRails
[21:25:12] Coldblackice: has joined #RubyOnRails
[21:25:39] Scripore: has joined #RubyOnRails
[21:26:19] erich: has joined #RubyOnRails
[21:26:36] vasilakisfil_: has joined #RubyOnRails
[21:27:26] hotpancakes: has joined #RubyOnRails
[21:27:44] paulcsmith: has joined #RubyOnRails
[21:29:40] kara_sweets: has joined #RubyOnRails
[21:29:47] moeabdol: has joined #RubyOnRails
[21:30:28] ivanskie: has joined #RubyOnRails
[21:31:03] gambl0re: has joined #RubyOnRails
[21:31:12] moeabdol: has joined #RubyOnRails
[21:31:34] zorak8: has joined #RubyOnRails
[21:31:35] moeabdol: has joined #RubyOnRails
[21:31:36] s2013: has joined #RubyOnRails
[21:32:50] blackmesa: has joined #RubyOnRails
[21:35:58] DoctorMonocular: has joined #RubyOnRails
[21:36:01] nfk: has joined #RubyOnRails
[21:37:16] bullcitydev: has joined #RubyOnRails
[21:39:15] Radar: GOOD MORNING
[21:39:44] l0oky: GOOD NIGHT :D
[21:41:03] gambl0re: has joined #RubyOnRails
[21:41:25] netzfisch: has joined #RubyOnRails
[21:41:27] l0oky: llakey: Stealing nicknames again? :D jk
[21:43:09] dc1: has joined #RubyOnRails
[21:44:33] ernesto_jimenez: has joined #RubyOnRails
[21:44:37] eggoez: has joined #RubyOnRails
[21:45:59] chelbs: has joined #RubyOnRails
[21:47:42] jfarmer: has joined #RubyOnRails
[21:50:05] Oog_: has joined #RubyOnRails
[21:51:59] User458764: has joined #RubyOnRails
[21:52:47] hahuang65: has joined #RubyOnRails
[21:52:50] carlosd: has joined #RubyOnRails
[21:53:53] ndrei: has joined #RubyOnRails
[21:54:34] carlosd: I'm using a gem that define some models, but I need to change some validations used in they
[21:54:36] carlosd: I duplicate the model in my project source tree and changed the validations
[21:54:40] carlosd: from the console it's appear that everything is working fine
[21:54:48] carlosd: but I'm afraid that this can cause drawbacks
[21:55:06] manvsmachine: has joined #RubyOnRails
[21:56:08] carlosd: I would like to hear about this from rails ninjas :)
[21:56:50] __butch__: has joined #RubyOnRails
[21:57:24] Wizek: has joined #RubyOnRails
[21:57:34] rhizome: has joined #RubyOnRails
[21:57:40] DoctorMonocular: has joined #RubyOnRails
[21:58:01] wethu: has joined #RubyOnRails
[21:59:03] jfarmer: carlosd What gem are you using that defines its own models?
[21:59:23] jfarmer: carlosd And yes, it's risky, because you're not overwriting the model, you're re-opening the class and augmenting it.
[21:59:25] hotpancakes: has joined #RubyOnRails
[21:59:58] jfarmer: It's weird for a gem to outright define models like that.
[22:01:13] carlosd: jfarmer, it's a CMS engine: https://github.com/comfy/comfortable-mexican-sofa
[22:02:39] jfarmer: Ah, a Rails engine, ok
[22:02:58] jfarmer: carlosd The best way to do this sort of thing depends on the way they've set up the gem
[22:03:14] jfarmer: The best ones have officially-sanctioned ways of doing what you want.
[22:03:31] jfarmer: Which model's validations are you wanting to change?
[22:03:32] jrails: has joined #RubyOnRails
[22:05:00] solars: has joined #RubyOnRails
[22:05:07] carlosd: I'm adding multitenancy and I need to scope the uniqueness validation to the tenant
[22:05:26] cmisenas: has joined #RubyOnRails
[22:05:30] nobitanobi: has joined #RubyOnRails
[22:05:58] rhizome: whitelabel mexican sofa
[22:06:08] hotpancakes: has joined #RubyOnRails
[22:07:53] ararog: has joined #RubyOnRails
[22:09:07] carlosd: I didn't uderstand the pun :(
[22:09:21] rhizome: it wasn't very good
[22:09:25] tbuehlmann: uh, didn't know that: Product.where(ActionController::Parameters.new(title: 'foo')) will raise an ActiveModel::ForbiddenAttributesError
[22:09:49] rhizome: gotta pass it thru strong params i'm sure
[22:10:36] tbuehlmann: I knew I have to for building models, but not for querying
[22:10:53] rhizome: hm, good point
[22:12:32] carlosd: I'm thinking in checking out the gem in /vendor and instruct Gemfile to use it from there, so I can change it freely without worries (but introduce my own bugs)
[22:12:43] kinduff: has joined #RubyOnRails
[22:12:43] kinduff: has joined #RubyOnRails
[22:13:51] voker57: has joined #RubyOnRails
[22:13:55] mikecmpbll: has joined #RubyOnRails
[22:14:48] DEA7TH_: has joined #RubyOnRails
[22:14:48] tetraktys: has joined #RubyOnRails
[22:16:33] Radar: tbuehlmann: why are you using it for querying? seems weird
[22:16:47] cnk: has joined #RubyOnRails
[22:16:53] tetraktys: hey guys, broad question: i'm developing a portal for sports teams (field hockey in paticular). Often games are recorded and i'd like to share snippets (and complete games) with my players and staff. I know video storing and transcoding can be a bitch. Which are good cloud services and do i need to store the transcoded videos myself or with said service?
[22:17:16] tetraktys: particular*
[22:17:26] Radar: tetraktys: https://zencoder.com/en/
[22:17:40] ur5us: has joined #RubyOnRails
[22:17:45] mkc: has joined #RubyOnRails
[22:18:38] tetraktys: thanks Radar, i've been looking into that. they only encode the data right? i still need to store it somewhere
[22:19:32] tbuehlmann: Radar, I'm passing a slice of params into a .where query
[22:22:39] tbuehlmann: it's part of a library I'm writing in order to refactor messy controller index actions
[22:23:23] nfk: has joined #RubyOnRails
[22:24:50] rhizome: tetraktys: youtube is another
[22:25:28] Radar: tetraktys: I am not sure. I haven't looked too deeply at it.
[22:25:37] Radar: tbuehlmann: I think it's an intentional design decision.
[22:28:30] constantinexvi: has joined #RubyOnRails
[22:28:59] tetraktys: rhizome, it doesn't seem youtube is very suitable. i know i can allow my app to view edit upload through the api (and within my app i can authorize users) but it's not the same
[22:29:28] tetraktys: especially when a knowledgeable user intercepts the api key and starts messing around
[22:30:00] rhizome: you mean all the stuff you didn't mention
[22:30:18] ivanskie: has joined #RubyOnRails
[22:33:52] momomomomo: has joined #RubyOnRails
[22:37:47] startupality: has joined #RubyOnRails
[22:38:24] tetraktys: rhizome, correct. I'm having a hard time finding information, especially since i don't have my question well formed yet
[22:39:06] tetraktys: but, given this information, do you still think youtube is an option? i'd like to keep options open
[22:39:12] bricker: has joined #RubyOnRails
[22:42:49] workmad3: tetraktys: hmm... how would a knowledgeable user intercept your YT API key? That shouldn't appear in a user-accessible place
[22:43:48] tetraktys: workmad3, good question, i was thinking ajax request through the browsers console, but ofcourse that stuff happens server side
[22:45:09] Pupeno: has joined #RubyOnRails
[22:45:35] jas02: has joined #RubyOnRails
[22:46:52] hotpancakes: has joined #RubyOnRails
[22:47:31] BobfromDallas: has joined #RubyOnRails
[22:47:35] SanguineAnomaly: has joined #RubyOnRails
[22:48:52] drale2k: has joined #RubyOnRails
[22:49:52] arBmind1: has joined #RubyOnRails
[22:50:50] d5sx43: has joined #RubyOnRails
[22:51:10] mary5030: has joined #RubyOnRails
[22:54:06] s2013: has joined #RubyOnRails
[22:54:45] kies: has joined #RubyOnRails
[22:58:38] baweaver: has joined #RubyOnRails
[22:58:46] bar0n: has joined #RubyOnRails
[22:59:00] nobitanobi: has joined #RubyOnRails
[22:59:58] Pazician: has joined #RubyOnRails
[23:04:25] momomomomo_: has joined #RubyOnRails
[23:05:36] Ropeney: has joined #RubyOnRails
[23:06:16] michael_mbp: has joined #RubyOnRails
[23:09:41] crevax: has joined #RubyOnRails
[23:11:55] bananaboydean: has joined #RubyOnRails
[23:12:51] pgatt: has joined #RubyOnRails
[23:15:10] bruno-: has joined #RubyOnRails
[23:16:14] rickmasta: has joined #RubyOnRails
[23:16:15] drale2k: has joined #RubyOnRails
[23:18:09] hotpancakes: has joined #RubyOnRails
[23:18:16] darrencauthon: has joined #RubyOnRails
[23:18:40] nobitanobi: has joined #RubyOnRails
[23:19:04] zendrix: has joined #RubyOnRails
[23:19:07] jeanlinux: has joined #RubyOnRails
[23:19:37] Scriptonaut: does anyone know the proper place to put a csv file for fixtures? For some reason when I put a csv file in my fixtures folder, it errors out and says: No such file or directory @ rb_sysopen - /home/veezus/code/core/spec/fixtures/dupe_people.yml (Errno::ENOENT)
[23:19:55] Scriptonaut: however when I name the file something else, it is fine
[23:19:57] Scriptonaut: just doesn't like .csv
[23:20:24] eggoez: has joined #RubyOnRails
[23:21:10] lictor36: has joined #RubyOnRails
[23:22:04] tercenya: has joined #RubyOnRails
[23:24:19] delianides: has joined #RubyOnRails
[23:24:39] FernandoBasso: has joined #RubyOnRails
[23:26:11] bruno-: has joined #RubyOnRails
[23:26:55] drale2k: has joined #RubyOnRails
[23:28:01] erich: has joined #RubyOnRails
[23:28:28] s2013: has joined #RubyOnRails
[23:31:08] bruno-: has joined #RubyOnRails
[23:31:09] Pazician: has joined #RubyOnRails
[23:31:12] RegulationD: has joined #RubyOnRails
[23:31:51] Pazician: has joined #RubyOnRails
[23:31:51] Radar: Scriptonaut: Go into your terminal, run `file /home/veezus/code/core/spec/fixtures/dupe_people.yml` and tell me what that outputs.
[23:33:24] Scriptonaut: Radar: I ended up moving the file to fixtuers/files
[23:33:24] s2013: has joined #RubyOnRails
[23:33:31] Scriptonaut: and that was fine, it just didn't like non yml files in the root of fixtures
[23:33:51] thews: has joined #RubyOnRails
[23:33:55] Radar: Scriptonaut: Whatever method you were calling was trying to load a .yml file
[23:33:58] Radar: That was the problem
[23:34:04] delianid_: has joined #RubyOnRails
[23:34:05] Radar: the error was fine
[23:35:18] baweaver: has joined #RubyOnRails
[23:35:27] noodman: has joined #RubyOnRails
[23:35:48] s2013: has joined #RubyOnRails
[23:38:26] bruno-: has joined #RubyOnRails
[23:38:28] dici: has joined #RubyOnRails
[23:39:39] fmcgeough: has joined #RubyOnRails
[23:39:47] cogsbox_: has joined #RubyOnRails
[23:41:03] bricker: has joined #RubyOnRails
[23:41:46] Radar: cogsbox_: it doesn't work. Please try again
[23:42:07] Radar: Scriptonaut: my guess is that you were trying to do fixture :dupe_people, instead of something like File.read(fixture_path + "dupe_people.csv")
[23:42:49] Scriptonaut: no, I hadn't even made a call to File.read yet
[23:42:53] Scriptonaut: it was breaking all of my tests
[23:43:08] Scriptonaut: including totally different features
[23:43:14] Radar: fixtures :all maybe>
[23:43:30] Scriptonaut: ya, I use that
[23:43:33] Scriptonaut: ah, that makes sense
[23:43:42] roamingdog: has joined #RubyOnRails
[23:44:28] nobitanobi: has joined #RubyOnRails
[23:45:25] cogsbox_: I am getting 17 errors similar to "QuestionTest#test_difficulty_id_should_be_present: ActiveRecord::StatementInvalid: SQLite3::SQLException: table questions has no column named questionType:" I have been trying to figure this out but I have hit a wall. This is my gist https://gist.github.com/anonymous/88c25b85db7cc9043dc7 I appreciate any help. Thanks
[23:46:37] Radar: where should questionType be coming from?
[23:46:59] one_zero: has joined #RubyOnRails
[23:47:03] Radar: cogsbox_: is there a stacktrace for that error?
[23:48:12] cogsbox_: sorry, I seemed to fix that error. This is the error I am currently getting "QuestionTest#test_subject_should_be_greater_than_0: ActiveRecord::StatementInvalid: SQLite3::SQLException: table questions has no column named subsection_id:"
[23:48:35] cogsbox_: the questionType was something I fixed earlier
[23:49:27] radialneon: has joined #RubyOnRails
[23:50:19] Radar: cogsbox_: my last question still stands: show us a stacktrace for that error please
[23:50:43] Radar: Looks like it might be happening because the field in your database is sub_section_id and the fixture calls it as subsection_id.
[23:50:48] Radar: https://gist.github.com/anonymous/88c25b85db7cc9043dc7#file-question-yml-L8
[23:52:47] moeabdol: has joined #RubyOnRails
[23:52:52] cogsbox_: what is a stacktrace?
[23:53:54] cogsbox_: let me fix the sub_section_id and see what happens
[23:54:22] djbkd: has joined #RubyOnRails
[23:56:58] cogsbox_: okay that fixed it. I can't believe problems like that hold me up so long. I really appreciate that help. Thanks!
[23:57:52] bf4: has joined #RubyOnRails
[23:57:54] quazimodo: has joined #RubyOnRails
[23:57:55] smathy: has joined #RubyOnRails
[23:58:38] nobitanobi: has joined #RubyOnRails