« Back to channel list

#RubyOnRails - 28 October 2015

« Back 1 day Forward 1 day »
[00:00:17] northfurr: has joined #RubyOnRails
[00:01:00] manfrin_: has joined #RubyOnRails
[00:03:40] riotjones: has joined #RubyOnRails
[00:03:42] sevenseacat: has joined #RubyOnRails
[00:04:02] bratsche: has joined #RubyOnRails
[00:08:53] RegulationD: has joined #RubyOnRails
[00:10:08] rgrmatt: has joined #RubyOnRails
[00:13:15] shock_one: has joined #RubyOnRails
[00:13:24] ivanskie: has joined #RubyOnRails
[00:13:28] chipotle: has joined #RubyOnRails
[00:16:41] bender_unit: has joined #RubyOnRails
[00:17:02] arthurix_: has joined #RubyOnRails
[00:17:59] neanderslob: hi everyone, I'm attempting to create a devise user in such a way that a corresponding Company is automatically generated for that user
[00:18:36] neanderslob: the user generates just fine but I get an unpermitted param error for "company"
[00:18:42] neanderslob: code is here: https://gist.github.com/BigMcLargeHuge/63ea1cf1e491848e122e
[00:20:16] Ropeney: neanderslob: is it a has_one :company?
[00:20:23] jgt2: has joined #RubyOnRails
[00:20:34] neanderslob: Ropeney: users actually has_many :companies
[00:20:37] pontiki: has joined #RubyOnRails
[00:21:29] Ropeney: neanderslob: can you gist the whole error
[00:22:18] neanderslob: Ropeney: sure thing; one moment
[00:22:56] ror15: has joined #RubyOnRails
[00:23:46] ja: has joined #RubyOnRails
[00:24:03] vrlogrs: has joined #RubyOnRails
[00:24:26] vrlogrs: im stuck - hoping to get some help ..
[00:24:59] vrlogrs: i have a route, "post 'register', to: 'users#create'"
[00:26:21] vrlogrs: i am also preventing people from accessing any page, other than "['/', '/login', '/register'].include?(request.path)" in the application controller
[00:26:57] vrlogrs: now, im trying to test :create in users_controller
[00:27:19] vrlogrs: but, because the path isn't /register, it keeps redirecting me away
[00:27:26] Ropeney: vrlogrs: gist :)
[00:27:29] vrlogrs: what would be the best way to solve this
[00:27:53] vrlogrs: Ropeney: gist?
[00:28:17] neanderslob: Ropeney: alright, it's in there, unfortunately there's not too much to work with
[00:29:09] hephaestus_rg: has joined #RubyOnRails
[00:29:14] smathy: vrlogrs, !gist your routes.rb and application_controller.rb
[00:29:14] helpa: vrlogrs: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[00:29:28] Jasaka: has joined #RubyOnRails
[00:30:11] Ropeney: neanderslob: can you try :companies for the simple_fields_for and put accepts_nested_attributes :companies in the user model
[00:31:20] neanderslob: Ropeney: accepts_nested_attributes :companies is in the user model but I'll try :companies in simple_fields_for
[00:31:49] ellisTAA: has joined #RubyOnRails
[00:33:33] vrlogrs: can you access this? https://gist.github.com/RaviPatel/006d9e408861e8fac151
[00:34:07] vrlogrs: https://gist.github.com/RaviPatel/73fd2e49861fe703ed30
[00:34:14] smathy: neanderslob, yeah, it has to be :companies or @user.companies
[00:34:20] neanderslob: Ropeney: apparently the same old problem
[00:34:31] Ropeney: neanderslob: whats that mean?
[00:35:06] neanderslob: Ropeney: still got the error
[00:35:25] rgrmatt: has joined #RubyOnRails
[00:35:32] neanderslob: smathy: hmmm, that's good to know
[00:36:06] dmz: has joined #RubyOnRails
[00:36:06] dmz: has joined #RubyOnRails
[00:36:43] vrlogrs: Ropeney, smathy: is this viewable for you? https://gist.github.com/RaviPatel/73fd2e49861fe703ed30
[00:36:51] northfurr: has joined #RubyOnRails
[00:37:28] n1lo: has joined #RubyOnRails
[00:37:36] neanderslob: Ropeney: ah, never mind; restarted my server reloaded everything and it's working now
[00:37:46] Ropeney: neanderslob :D
[00:37:50] neanderslob: Ropeney: many thanks!
[00:38:02] Ropeney: was looking at it going... but why?
[00:38:16] neanderslob: smathy: and thanks for the explanation; I'll see if I can remember that in the future
[00:38:33] FailBit: https://i.imgur.com/FvVVpoF.png what happens when you remove mongodb
[00:38:50] Ropeney: vrlogrs: u only put 1/3 of the things u said in gist
[00:39:15] vrlogrs: ahh .. sorry .. 1 min
[00:39:35] adaedra: has joined #RubyOnRails
[00:39:52] northfurr: has joined #RubyOnRails
[00:41:31] Radar: FailBit: What did you replace it with?
[00:41:52] vrlogrs: updated: https://gist.github.com/RaviPatel/73fd2e49861fe703ed30
[00:42:01] FailBit: Radar: postgresql
[00:42:04] Radar: FailBit: neat
[00:42:10] prasselpikachu: has joined #RubyOnRails
[00:42:15] Radar: turns out mongodb isn't webscale
[00:42:16] Radar: who would've thought
[00:43:01] manfrin_: has joined #RubyOnRails
[00:43:11] FailBit: postgres is more webscale than mongodb will ever be
[00:43:13] Fire-Dragon-DoL: has joined #RubyOnRails
[00:43:18] FailBit: I just found out that pg_shard is a thing
[00:43:45] sevenseacat: nicer than i was expecting.
[00:45:33] vrlogrs: any ideas guys? :/
[00:46:02] JayM: has joined #RubyOnRails
[00:46:08] Radar: vrlogrs: !rule10
[00:46:08] helpa: vrlogrs: Do not beg / plead with people to help you. This includes asking questions like "Any ideas?" after posting your original question.
[00:46:20] Radar: I have a routing question to ask of you all. Details are in this Gist: https://gist.github.com/radar/f4e2544f63072cc666ac
[00:46:57] Radar: https://gist.github.com/RaviPatel/73fd2e49861fe703ed30#file-application_controller-rb-L50-L54
[00:47:11] Radar: Why not just put a before_action :authenticate_user in each controller like sane people do?
[00:47:32] vrlogrs: i thought it would be better to put in the app controller to reduce code
[00:47:36] vrlogrs: is that not preferred?
[00:47:46] Radar: vrlogrs: Favour explicitness over implicitness.
[00:48:06] vrlogrs: but then you have to remember to add it to every controller you create
[00:48:13] vrlogrs: if you forget, you leave it open :S
[00:48:14] FailBit: use a controller concern
[00:48:15] Radar: Aaaand you have tests for that, so it's OK.
[00:48:29] Radar: Inherit from a common controller
[00:48:43] Radar: class AuthenticatedController < ApplicationController; before_action :authenticate_user!; end
[00:49:31] vrlogrs: hmm, just seems like extra work..
[00:49:40] vrlogrs: does nobody do it this way?
[00:49:45] Radar: It is not preferred.
[00:50:48] Radar: In one of my apps, I have a controller for essentially this purpose: https://github.com/radar/twist/blob/my-saas/app/controllers/accounts/base_controller.rb#L1-L4
[00:50:56] Radar: Any Accounts:: namespaced controllers inherit from that controller.
[00:51:11] pontiki: the tao of radar
[00:51:33] workmad3: has joined #RubyOnRails
[00:51:39] Radar: I do it this way and so you should do it this way too because not doing it my way upsets my OCD.
[00:51:41] pontiki: this is a *proper* use of inheritance
[00:51:54] Radar: And it is a bit messy to be shoving everything into ApplicationController
[00:52:21] gambl0re: has joined #RubyOnRails
[00:52:25] vrlogrs: any chance this method is documented somewhere?
[00:52:39] vrlogrs: i may need to prove to my teammates that this is the 'preferred' way
[00:52:49] vrlogrs: writing less code is what they 'prefer'
[00:52:59] helpa: Multitenancy With Rails - https://leanpub.com/multi-tenancy-rails-2 - An excellent book that teaches you about building a Multitenanted Rails application. Written by Ryan Bigg.
[00:53:02] Radar: I wrote a book about it.
[00:53:22] Radar: The benefit of this is that you can make those controllers inherit from a common controller
[00:53:30] Radar: Your ApplicationController isn't messier as a result
[00:53:46] Radar: and it's clearer that, because ThisOtherController inherits from AuthenticatedController that it has Special Things It Does
[00:54:15] Radar: I'm sorry but my "Radar stamp of approval" has gone missing (will need to buy a new one) so you'll just need to tell your colleagues that an experienced Rails developer who's a complete stranger suggested this was a good idea.
[00:54:55] vrlogrs: if im restricting users#index and users#show but making visible users#create
[00:55:05] vrlogrs: i will still need a before_action within this controller
[00:55:45] Radar: skip_before_action :authenticate_user, only: [:create]
[00:56:57] vrlogrs: couldn't i just add skip_before_filter to my current users controller?
[00:57:30] Radar: but then you have this magical before_action callback which is currently running before every. single. action that checks if the path is a certain specific thing
[00:57:48] Radar: Which is bad practice, because every time those paths change (and they _might_ change) you'll need to update that list of paths
[00:58:16] vrlogrs: hmm .. so the inheritance would be faster than this path check?
[00:58:24] Radar: I believe so.
[00:59:23] darrencauthon: has joined #RubyOnRails
[00:59:46] djbkd: has joined #RubyOnRails
[01:00:37] tedstriker: has joined #RubyOnRails
[01:00:38] juanca_: has joined #RubyOnRails
[01:00:41] djbkd: has joined #RubyOnRails
[01:01:10] vrlogrs: going to be alot of work Radar, but I'll give it a try
[01:01:13] vrlogrs: thanks for the help
[01:01:18] Radar: I think you'll like it.
[01:01:32] vrlogrs: I may .. not sure about teammates :P
[01:01:43] craysiii: has joined #RubyOnRails
[01:01:44] bruno-: has joined #RubyOnRails
[01:01:58] Radar: Tell them Radar said it was OK. If that's not good enough, tell them he wrote some books about Rails too.
[01:02:20] pontiki: sandi sez it's okay too, although not directly to this specific use
[01:02:42] vrlogrs: haha - ill try Radar ;)
[01:02:55] Radar: There is some INSANE amount of collaboration happening today in the office around lunch choices. I need to go join that. Bye :)
[01:03:11] pontiki: inheritance, composition, these are *good* ways to organize code; removing conditionals, this is a *good* thing for code
[01:03:33] craysiii: i feel like i missed something good
[01:04:05] lacrymology: has joined #RubyOnRails
[01:04:52] lacrymology: I'm following the getting started guide, and at this point: http://guides.rubyonrails.org/getting_started.html#adding-a-second-model I'm a bit confused.. WHY does the foreign key point to an Article?
[01:05:57] wldcordeiro: has joined #RubyOnRails
[01:06:39] khyrul: has joined #RubyOnRails
[01:06:50] l_tonz: has joined #RubyOnRails
[01:08:00] sevenseacat: lacrymology: because the point of the exercise is to allow comments on an article?
[01:08:08] sevenseacat: I'm a bit confused by the question
[01:08:24] lacrymology: sevenseacat: I mean what makes the FK point to the Article model, specifically
[01:08:32] l_tonz: has joined #RubyOnRails
[01:08:42] sevenseacat: the line in the migration that adds the foreign key
[01:08:53] vrlogrs: has left #RubyOnRails: ()
[01:08:53] lacrymology: but there's no reference to the model
[01:09:07] sevenseacat: right, because foreign keys are between database tables
[01:09:14] d34th4ck3r: has joined #RubyOnRails
[01:09:17] sevenseacat: `t.references :article, index: true, foreign_key: true`
[01:09:27] sevenseacat: The t.references line creates an integer column called article_id, an index for it, and a foreign key constraint that points to the articles table.
[01:09:48] tolo123: has joined #RubyOnRails
[01:10:41] lacrymology: yes.. why does it point to the "articles" table
[01:10:55] sevenseacat: because you've written `t.references :article`
[01:11:05] sevenseacat: and rails conventions take care of all of the inferences
[01:11:12] sevenseacat: if you wanted to make it explicit, you could do so
[01:11:31] lacrymology: sevenseacat: okay, that's the answer I was looking for
[01:11:41] sevenseacat: rails is all about convention over configuration.
[01:12:51] NBarnes: has joined #RubyOnRails
[01:12:57] tolo123: has left #RubyOnRails: ()
[01:14:29] shock_one: has joined #RubyOnRails
[01:15:48] jerry_tao: has joined #RubyOnRails
[01:16:04] samgranieri: has joined #RubyOnRails
[01:17:06] lacuna: has joined #RubyOnRails
[01:18:10] FailBit: I'm all about that thug life
[01:22:53] wildlander: has joined #RubyOnRails
[01:23:30] wildlander: has joined #RubyOnRails
[01:23:59] l_tonz: has joined #RubyOnRails
[01:24:15] pontiki: has joined #RubyOnRails
[01:26:53] Black_Knight: has joined #RubyOnRails
[01:27:50] chipotle: has joined #RubyOnRails
[01:28:42] Aswebb_: has joined #RubyOnRails
[01:29:02] Black_Knight: has joined #RubyOnRails
[01:30:34] Hazim: has joined #RubyOnRails
[01:31:08] Hazim: has joined #RubyOnRails
[01:34:19] Maletor: has joined #RubyOnRails
[01:38:29] northfurr: has joined #RubyOnRails
[01:42:08] l_tonz: has joined #RubyOnRails
[01:48:40] northfurr: has joined #RubyOnRails
[01:50:10] Pupeno: has joined #RubyOnRails
[01:50:45] snurfery: has joined #RubyOnRails
[01:52:32] Motoservo: has joined #RubyOnRails
[01:53:20] andersoldahl: has joined #RubyOnRails
[01:53:39] mozzarella: has joined #RubyOnRails
[01:54:54] northfurr: has joined #RubyOnRails
[01:55:31] SeanLazer: has joined #RubyOnRails
[01:56:15] mozzarella: how do people automatically launch their rails website? I kind of run "puma ???" every time (manually)
[01:57:01] rhizome: run it within a web server that runs all the time
[01:57:57] sevenseacat: i dont automatically launch mine in development
[01:58:03] mozzarella: what do you mean? that I??should get nginx to launch puma, or that I??should stop using puma?
[01:58:11] smathy: has joined #RubyOnRails
[01:58:23] rails785: has joined #RubyOnRails
[01:58:26] baweaver: relevant question: what environment?
[01:58:30] mozzarella: no, this is production
[01:58:58] baweaver: normally in an init.d script or the like that gets run as a daemonized service.
[01:58:59] ror15: has joined #RubyOnRails
[01:59:05] lacuna_: has joined #RubyOnRails
[01:59:20] baweaver: sudo service puma restart
[01:59:41] rails785: is anyone down to do a basic rails project together
[01:59:49] rails785: damnit why is my name this
[01:59:54] pwnd_nsfw: rails new butts
[02:00:01] mozzarella: so, init script is the recommended approach?
[02:00:12] darrencauthon: has joined #RubyOnRails
[02:00:14] craysiii: you laugh but i was thinking of making a site called buttr lol
[02:00:26] pwnd_nsfw: What would that be about? :P
[02:00:38] codesoda: has joined #RubyOnRails
[02:00:58] Aeyrix: /r/subredditdrama aggregator
[02:01:32] IrishGringo: has joined #RubyOnRails
[02:02:46] bruno-: has joined #RubyOnRails
[02:04:24] mozzarella: https://github.com/puma/puma/tree/master/tools/jungle
[02:04:46] baweaver: https://www.digitalocean.com/community/tutorials/how-to-deploy-a-rails-app-with-puma-and-nginx-on-ubuntu-14-04
[02:04:57] baweaver: that seems to be fairly straightforward
[02:05:00] mozzarella: will that even work with systemd?
[02:05:14] sevenseacat: geez, we have to do *all* the work?
[02:05:17] rhizome: i don't think 14.04 uses systemd
[02:05:48] EminenceHC: has joined #RubyOnRails
[02:07:58] rshetty: has joined #RubyOnRails
[02:09:53] rshetty_: has joined #RubyOnRails
[02:10:30] Radar: mozzarella: I use an init script to launch unicorn on my server. I guess the same would work for Puma.
[02:10:35] Bloomer: has joined #RubyOnRails
[02:12:16] hightower4: has joined #RubyOnRails
[02:13:01] moeabdol1: has joined #RubyOnRails
[02:13:55] SteenJobs: has joined #RubyOnRails
[02:14:06] annlewis: has joined #RubyOnRails
[02:14:58] darrencauthon: has joined #RubyOnRails
[02:15:44] shock_one: has joined #RubyOnRails
[02:17:00] jgt2: has joined #RubyOnRails
[02:17:33] stardiviner: has joined #RubyOnRails
[02:17:57] Cervajz: has joined #RubyOnRails
[02:19:01] northfurr: is there a best practice for ordering rails restful actions in controllers?
[02:19:01] ivanskie: has joined #RubyOnRails
[02:19:13] Radar: northfurr: index, show, new, create, edit, update, destroy.
[02:19:31] Radar: Some might like to resemble CRUD, so they'd do new, create, index, show, edit,update, destroy.
[02:20:17] sunya7a: has joined #RubyOnRails
[02:20:19] northfurr: Radar: thanks!
[02:20:19] rails785: Does anyone wanna be rails learning partners?
[02:20:36] rhizome: rails785: that's what the channel's for
[02:20:48] rhizome: to a degree
[02:21:26] Radar: I would encourage all newbies to ask questions here
[02:21:30] mois3x: has joined #RubyOnRails
[02:21:53] mozzarella: will the real newbie please stand up
[02:22:17] sevenseacat: I typically do index, new, create, show, edit, update, destroy. no particular reason.
[02:22:53] Radar: Machete order: destroy, create, update, index, new, edit, show
[02:23:10] northfurr: has joined #RubyOnRails
[02:23:16] rhizome: hah, i'm watching SW in machete order these days
[02:23:43] rhizome: maybe with the phantom edit
[02:23:53] Radar: You could also put it in the order so that each action's first letter spells out "induces": index, new, destroy, update, create, edit, show.
[02:24:24] rhizome: B E N G H A Z I
[02:24:26] Radar: tbh it really boils down to personal preference. Action ordering doesn't matter too much
[02:24:49] Radar: But if you put private methods at the top of your controller and then the actions defined underneath a public keyword then you and I are going to have to have words ;)
[02:25:19] sevenseacat: oooh that's a paddlin'
[02:25:20] rhizome: just switch back and forth, stream of consciousness style. that's what they're for
[02:25:37] brendan-: has joined #RubyOnRails
[02:26:17] Radar: I haven't seen anyone abuse the public keyword in a long time.
[02:26:54] sevenseacat: I miss typing defp
[02:28:32] mozzarella: why is private not the default access level, and then use defp to mean "def public"
[02:28:45] Radar: mozzarella: Because most of the time what you want is a public method.
[02:28:46] rhizome: is this a php thing
[02:28:54] Radar: https://gist.github.com/radar/67cb19786d87d1473e3d
[02:29:09] sevenseacat: defp is the elixir way of defining private methods :)
[02:29:18] mozzarella: Radar: not really? when working with a web framework, sure, but otherwise???
[02:29:42] Radar: mozzarella: So you'd say that > 50% of the methods you've defined in pure-Ruby code are private, not public?
[02:30:03] mozzarella: most of them are public because I'm lazy
[02:30:18] Radar: Would the code break if they were private?
[02:30:22] mozzarella: but you're more likely to forget to put something to private
[02:30:38] rhizome: just add it to the top!
[02:30:54] mozzarella: if it's already private and you forget to make it public, you'll know
[02:31:34] Radar: I really hope that Rails uses symbols as param keys instead of strings.
[02:31:38] Radar: Death to HWIA.
[02:31:42] mozzarella: also, stuff should be immutable by default, when applicable
[02:31:48] sevenseacat: +1 to death to HWIA
[02:32:03] sevenseacat: know your data.
[02:33:14] Radar: Oh it's already a thing!
[02:34:22] Cervajz: has joined #RubyOnRails
[02:36:01] mozzarella: while we're at it, I've got another question
[02:36:32] darrencauthon: has joined #RubyOnRails
[02:37:07] jerry_tao: has joined #RubyOnRails
[02:37:20] hmsimha_: has joined #RubyOnRails
[02:38:44] northfurr: has joined #RubyOnRails
[02:39:04] mozzarella: how should I handle the secret key? is this the proper way?
[02:39:05] mozzarella: RAILS_ENV=production SECRET_KEY_BASE=$(cat ~/.secret_key) rails server
[02:39:42] workmad3: has joined #RubyOnRails
[02:39:51] Radar: mozzarella: You can define it as an env var at the top of your init script
[02:40:00] Radar: env SECRET_KEY_BASE=<key>
[02:40:04] Radar: env RAILS_ENV=production
[02:41:00] mozzarella: what's the secret key for, again? I don't remember
[02:41:21] rhizome: secret config stuff
[02:41:42] smathy: Encrypting things like cookie based sessions.
[02:41:59] mozzarella: if I change it, will it invalidate my users' cookies?
[02:42:10] smathy: ...and signing things like encrypted cookie based sessions and other cookies.
[02:43:27] smathy: Maybe also generating authenticity tokens.
[02:45:41] mozzarella: is that for CSRF protection?
[02:47:51] dikaio: has joined #RubyOnRails
[02:47:58] greengriminal: has joined #RubyOnRails
[02:55:17] Bloomer: has joined #RubyOnRails
[02:57:29] pcpanic_: has joined #RubyOnRails
[02:57:30] pcpanic_: has left #RubyOnRails: ()
[03:03:34] xtagon: has joined #RubyOnRails
[03:03:49] bruno-: has joined #RubyOnRails
[03:07:41] northfurr: has joined #RubyOnRails
[03:09:33] Jasaka|NA: has joined #RubyOnRails
[03:11:55] Radar: I don't think I would've been able to write this fix without tests today.
[03:12:11] Radar: As in, I wouldn't have been able to complete it today with 100% assuredness that all the different routes were mapped correctly.
[03:12:22] Radar: https://gist.github.com/radar/f4e2544f63072cc666ac
[03:13:57] pawnbox: has joined #RubyOnRails
[03:15:10] annlewis: has joined #RubyOnRails
[03:16:47] Aswebb_: has joined #RubyOnRails
[03:17:52] Bloomer: has joined #RubyOnRails
[03:18:12] SteenJobs: has joined #RubyOnRails
[03:19:14] lacuna: has joined #RubyOnRails
[03:19:14] lacuna: has joined #RubyOnRails
[03:20:06] hephaestus_rg: has joined #RubyOnRails
[03:22:29] gambl0re: has joined #RubyOnRails
[03:22:34] dopieee: has joined #RubyOnRails
[03:30:27] craysiii: has joined #RubyOnRails
[03:31:09] wkoszek: has joined #RubyOnRails
[03:32:33] d34th4ck3r: has joined #RubyOnRails
[03:38:38] codesoda: has joined #RubyOnRails
[03:40:56] lacuna: has joined #RubyOnRails
[03:43:18] codesoda: has joined #RubyOnRails
[03:43:23] acti0nman: writing tests is good
[03:44:23] skiz: has joined #RubyOnRails
[03:46:48] losvedir: has joined #RubyOnRails
[03:49:05] yfeldblum: has joined #RubyOnRails
[03:50:18] Pupeno: has joined #RubyOnRails
[03:50:23] Hazim: has joined #RubyOnRails
[03:51:07] craysiii: does anyone have an opinion on simple_token_authentication vs devise_token_auth gems
[03:51:07] yfeldblum: has joined #RubyOnRails
[03:53:03] pydave6367: has joined #RubyOnRails
[03:53:49] hephaestus_rg: has joined #RubyOnRails
[03:54:00] lacuna: has joined #RubyOnRails
[03:56:16] sadaf2606: has joined #RubyOnRails
[03:56:45] tweeeaks: craysiii: i've used simple a couple times... its simple and does the trick, never tried the other
[03:56:50] unreal_: has joined #RubyOnRails
[03:57:08] crankharder: can anyone explain why this header isn't being passed through to rails? vanilla webrick, pretty vanilla curl request, not much fancy going on, except the header isn't showing up https://gist.github.com/crankharder/fe009bd37e77df6f4191
[03:57:55] lytol_: has joined #RubyOnRails
[03:58:18] rshetty: has joined #RubyOnRails
[03:58:38] rromanchuk: has joined #RubyOnRails
[03:59:44] towski_: has joined #RubyOnRails
[04:00:00] wildtroll: has joined #RubyOnRails
[04:00:53] rhizome: maybe you have the call wrong. try just logging headers.inspect
[04:02:11] enkristoffer: has joined #RubyOnRails
[04:02:58] pawnbox: has joined #RubyOnRails
[04:03:05] AnomalousBit: has joined #RubyOnRails
[04:04:59] btriley: has joined #RubyOnRails
[04:06:19] SteenJobs: has joined #RubyOnRails
[04:07:21] djbkd: has joined #RubyOnRails
[04:08:18] AnomalousBit: Hello, has anyone loaded sqlite dynamic extensions using rails' initializers? I've come across the fantastic extension-functions.c module that allows you to run stdev and variance calcs in sqlite, but am getting SQLException: not authorized when trying to call "SELECT load_extension...;" in rails
[04:09:02] AnomalousBit: works great from "rails dbconsole" though... :(
[04:10:12] l_tonz: has joined #RubyOnRails
[04:10:23] braincrash: has joined #RubyOnRails
[04:10:27] RegulationD: has joined #RubyOnRails
[04:14:12] rhizome: how are you calling it from rails?
[04:15:58] annlewis: has joined #RubyOnRails
[04:16:15] pydave6367: has joined #RubyOnRails
[04:16:17] l_tonz: has joined #RubyOnRails
[04:16:40] AnomalousBit: hi rhizome, right now I'm just trying to get it to work in rails console using 'ActiveRecord::Base.connection.execute("SELECT load_extension()...")'
[04:17:13] btriley: has joined #RubyOnRails
[04:17:14] AnomalousBit: I figured if I can just get it working there I can pop it into an initializer and all my models can then use the extensions ::fingers crossed::
[04:17:38] gamov: has joined #RubyOnRails
[04:17:41] jgt2: has joined #RubyOnRails
[04:17:50] shock_one: has joined #RubyOnRails
[04:18:06] Hazim: has joined #RubyOnRails
[04:20:08] rhizome: https://github.com/sparklemotion/sqlite3-ruby/issues/39
[04:21:28] chipotle: has joined #RubyOnRails
[04:21:38] gamov: Hi the Pros. I've been looking at a way to show the user the existing DB record when uniqueness validation fails so he can merge them manually. However, the construction of the relation to load the existing record in ActiveRecord::Validations::UniquenessValidator is far from trivial (https://github.com/rails/rails/blob/428d47adfed8d6aa7b21aec2bf5ad890961c9de3/activerecord/lib/active_record/validations/uniqueness.rb). I wonder if I have any other way than
[04:21:39] gamov: duplicate the code so I can load the record...
[04:21:49] AnomalousBit: thanks rhizome, your google-foo must be better than mine, I thought I had checked under most every rock
[04:23:44] btriley: has joined #RubyOnRails
[04:24:58] Hazim: has joined #RubyOnRails
[04:26:15] pawnbox: has joined #RubyOnRails
[04:27:54] workmad3: has joined #RubyOnRails
[04:30:11] Motoservo: has joined #RubyOnRails
[04:30:20] kp666: has joined #RubyOnRails
[04:30:40] bruno-: has joined #RubyOnRails
[04:31:15] EminenceHC: has joined #RubyOnRails
[04:31:24] pawnbox: has joined #RubyOnRails
[04:35:26] Oog: has joined #RubyOnRails
[04:36:25] Oog: i have a resource when posting to it with json format data it seems to automatically create a parameter of the name of the model type and parse out the params - how can i stop that?
[04:36:34] colleenmcguckin: has joined #RubyOnRails
[04:38:18] Oog: looks like i need to disable ParamsWrapper
[04:41:14] ror15: has joined #RubyOnRails
[04:42:04] Radar: Oog: send it through with the right Content-Type header.
[04:42:25] Oog: the header was right the problem is the auto nesting.
[04:42:39] Oog: i disabled it it in wrap_parameters.rb initializer
[04:42:45] Oog: #wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
[04:44:03] m3_del: has joined #RubyOnRails
[04:50:11] dopie: has joined #RubyOnRails
[04:50:27] dopie: In Rails can I have a method definition called response
[04:50:27] willardg: has joined #RubyOnRails
[04:50:54] sevenseacat: not a controller action.
[04:50:59] sevenseacat: at the very least.
[04:51:02] dopie: booyah...
[04:51:05] dopie: i figured
[04:51:12] dopie: i was getting a no header error
[04:51:37] sevenseacat: ACTION once tried to define a method called `send`. it didn't work very well.
[04:52:18] dopie: Response is mostly a Ruby on Rails framework implement detail, and should never be used directly in controllers. Controllers should use the methods defined in ActionController::Base instead.
[04:54:08] dopie: Well 20 minutes to figure that out isn't THAT bad
[05:02:36] Radar: dopie: You're getting better :)
[05:02:52] Radar: Normally it'd be 20 minutes for us to get the code out of you and 20 seconds for us to tell you that using response as a method is a bad idea.
[05:03:52] daffy_duck_2: has joined #RubyOnRails
[05:04:56] Aswebb_: has joined #RubyOnRails
[05:04:57] dopie: I agree on that
[05:07:05] pawnbox: has joined #RubyOnRails
[05:10:41] d34th4ck3r: has joined #RubyOnRails
[05:11:59] nemo_: has joined #RubyOnRails
[05:12:09] RegulationD: has joined #RubyOnRails
[05:13:57] jenrzzz: has joined #RubyOnRails
[05:15:36] woods: has joined #RubyOnRails
[05:16:45] annlewis: has joined #RubyOnRails
[05:19:01] trautwein: has joined #RubyOnRails
[05:19:05] shock_one: has joined #RubyOnRails
[05:19:22] roxtrongo: has joined #RubyOnRails
[05:23:10] mheld: has joined #RubyOnRails
[05:27:09] Lytol: has joined #RubyOnRails
[05:29:07] tlarevo: has joined #RubyOnRails
[05:30:56] bruno-: has joined #RubyOnRails
[05:31:41] benlieb: has joined #RubyOnRails
[05:32:16] krz: has joined #RubyOnRails
[05:32:44] m3_del: has joined #RubyOnRails
[05:34:44] helpa: has joined #RubyOnRails
[05:36:19] tejasmanohar: was rails the first popular project to follow resourceful routing / provide helpers for it?
[05:36:23] tejasmanohar: or was it from another project?
[05:37:32] hephaestus_rg: has joined #RubyOnRails
[05:37:58] choke: has joined #RubyOnRails
[05:38:37] SteenJobs: has joined #RubyOnRails
[05:39:43] ibouvousaime: has joined #RubyOnRails
[05:40:30] tlarevo: has left #RubyOnRails: ()
[05:43:32] shinenelson: has joined #RubyOnRails
[05:43:40] Radar: tejasmanohar: https://en.wikipedia.org/wiki/Representational_state_transfer
[05:43:44] skiz: has joined #RubyOnRails
[05:45:15] rromanch_: has joined #RubyOnRails
[05:45:18] pawnbox: has joined #RubyOnRails
[05:47:54] htmldrum: has joined #RubyOnRails
[05:53:50] pawnbox: has joined #RubyOnRails
[05:54:45] annlewis: has joined #RubyOnRails
[05:55:25] montagesoftware: has joined #RubyOnRails
[05:55:40] rvanlieshout: has joined #RubyOnRails
[05:57:04] Radar: good morning rvanlieshout
[05:57:25] draig: has joined #RubyOnRails
[05:57:39] lxsameer: has joined #RubyOnRails
[05:58:23] Guest87: has joined #RubyOnRails
[05:59:32] Radar: Had a 10 line method rewritten into a 1-line regex by a co-worker today.
[05:59:37] Radar: Confidence in own abilities is not definitely not "up"
[05:59:51] sevenseacat: we still like you.
[05:59:56] Radar: thanks :)
[06:00:41] sameerynho: has joined #RubyOnRails
[06:01:02] rvanlieshout: hmm. that was an alias
[06:01:13] rvanlieshout: regex rocks.. brings back memories :)
[06:01:52] Mia: has joined #RubyOnRails
[06:02:06] Guest87: has left #RubyOnRails: ()
[06:02:58] Guest87: has joined #RubyOnRails
[06:03:40] Guest87: has joined #RubyOnRails
[06:03:45] euphoriaa: has joined #RubyOnRails
[06:03:45] euphoriaa: has joined #RubyOnRails
[06:03:59] arup_r: has joined #RubyOnRails
[06:05:41] Axy: has joined #RubyOnRails
[06:07:39] tejasmanohar: Radar: yeah RESTful design is pre-Rails. that, I know, but what about jsut being able to name "resources" in a router and having it guess functions by show/create/ and whatnot
[06:07:47] tejasmanohar: i think that started in rails, no?
[06:07:52] spooky_pumpkin: has joined #RubyOnRails
[06:08:44] riotjones: has joined #RubyOnRails
[06:11:14] Radar: It is a rails-ism, sure.
[06:12:02] cgfbee: has joined #RubyOnRails
[06:12:51] youngbaks: has joined #RubyOnRails
[06:12:52] pydave6367: has joined #RubyOnRails
[06:13:16] RegulationD: has joined #RubyOnRails
[06:15:19] MartinElvar: has joined #RubyOnRails
[06:15:33] shock_one: has joined #RubyOnRails
[06:15:58] workmad3: has joined #RubyOnRails
[06:17:56] yfeldblum: has joined #RubyOnRails
[06:18:02] kerunaru: has joined #RubyOnRails
[06:18:25] jgt2: has joined #RubyOnRails
[06:18:43] gingray: has joined #RubyOnRails
[06:21:47] chrissonar: has joined #RubyOnRails
[06:23:52] fedexo: has joined #RubyOnRails
[06:26:48] colleenmcguckin: has joined #RubyOnRails
[06:27:47] johnflux: has joined #RubyOnRails
[06:27:47] johnflux: has joined #RubyOnRails
[06:27:54] baweaver: Radar: on a scale of 1 to Unix Neckbeard how gnarly was that regex?
[06:28:12] Radar: pretty tame actually
[06:28:33] Radar: `%r{(/-)+$}`
[06:28:42] baweaver: Admittedly I have a twitch when someone says they replaced a ton of lines with regexp
[06:28:53] kies^: has joined #RubyOnRails
[06:29:15] Radar: It's used to replace all /- at the end of a URL with nothingness.
[06:29:27] Radar: so we have URLs that were /s/bikes/-/- which are now /s/bikes
[06:29:36] Radar: I over engineered it because I was dumb
[06:29:51] baweaver: eh, monday hits us all hard
[06:29:59] baweaver: it's Tuesday
[06:30:04] baweaver: ......some harder than others
[06:30:05] george2: has left #RubyOnRails: ()
[06:30:08] Radar: Not good enough imo
[06:30:23] baweaver: that happens too often
[06:30:36] baweaver: One time I made it to Wednesday before realizing a week had started.
[06:30:40] djbkd_: has joined #RubyOnRails
[06:32:02] bruno-: has joined #RubyOnRails
[06:32:05] Radar: I meant that I was not good enough today :(
[06:32:13] Radar: It's super obvious in retrospect
[06:32:18] wethu: has joined #RubyOnRails
[06:32:34] baweaver: eh, happens to us all
[06:32:40] baweaver: that's what code reviews are for
[06:33:09] pawnbox: has joined #RubyOnRails
[06:34:33] sevenseacat: its so not even Tuesday
[06:38:49] aganov: has joined #RubyOnRails
[06:40:36] lxsameer_: has joined #RubyOnRails
[06:41:13] tvw: has joined #RubyOnRails
[06:43:00] norc: has joined #RubyOnRails
[06:45:02] ElSif: has joined #RubyOnRails
[06:45:21] norc: So Im really beginning to wonder what controller tests are useful for. The more I think about it, the more I realise that I want request tests.
[06:45:45] rhizome: you should do that then
[06:47:10] tagrudev: has joined #RubyOnRails
[06:47:18] norc: I mean, what possible gain do I get from testing my controllers separately.
[06:47:21] riotjones: has joined #RubyOnRails
[06:48:06] baweaver: even that ends up tied into view rendering though
[06:48:59] Macaveli: has joined #RubyOnRails
[06:49:25] craysiii: has joined #RubyOnRails
[06:50:33] norc: I mean even the peeking into assigns(...) like the automatically generated controller specs do seems like looking into internals that a behavior test should not know anything about.
[06:52:37] norc: baweaver: Indeed. Request specs seem to do nothing else than passing parameters, and looking how the state of the DB changes and test for response codes.
[06:53:02] Aswebb_: has joined #RubyOnRails
[06:53:40] tlarevo: has joined #RubyOnRails
[06:53:47] shock_one: has joined #RubyOnRails
[06:53:52] yogeshrt: has joined #RubyOnRails
[06:54:45] pawnbox: has joined #RubyOnRails
[06:56:34] tlarevo: has joined #RubyOnRails
[06:56:41] Hazim: has joined #RubyOnRails
[07:00:19] annlewis: has joined #RubyOnRails
[07:00:22] tlarevo: has joined #RubyOnRails
[07:00:53] Icey: has joined #RubyOnRails
[07:01:52] tlarevo: has joined #RubyOnRails
[07:02:44] Bloomer: has joined #RubyOnRails
[07:04:09] tlarevo: has joined #RubyOnRails
[07:04:21] towski_: has joined #RubyOnRails
[07:04:42] yardenbar: has joined #RubyOnRails
[07:04:48] zpe: has joined #RubyOnRails
[07:06:02] tlarevo: has joined #RubyOnRails
[07:06:38] kerunaru: has joined #RubyOnRails
[07:08:11] tlarevo_: has joined #RubyOnRails
[07:08:30] pawnbox: has joined #RubyOnRails
[07:10:50] srinidhi: has joined #RubyOnRails
[07:13:33] ych: has joined #RubyOnRails
[07:14:11] tlarevo: has joined #RubyOnRails
[07:14:55] RegulationD: has joined #RubyOnRails
[07:16:27] Axilla: has joined #RubyOnRails
[07:17:00] tlarevo: has joined #RubyOnRails
[07:20:01] tlarevo: has joined #RubyOnRails
[07:20:39] benlieb: has joined #RubyOnRails
[07:21:30] blackhuey: has joined #RubyOnRails
[07:24:07] GJdan: has joined #RubyOnRails
[07:24:43] emilkarl: has joined #RubyOnRails
[07:26:07] pydave6367: has joined #RubyOnRails
[07:27:04] tak1n: has joined #RubyOnRails
[07:27:32] matcouto: has joined #RubyOnRails
[07:27:56] matcouto: has joined #RubyOnRails
[07:33:41] bruno-: has joined #RubyOnRails
[07:35:53] dikaio: has joined #RubyOnRails
[07:37:29] sagax: how to autostart rails projects when system load, reload and other?
[07:37:55] sagax: what the tools might this?
[07:39:12] dopie: Ok I'm trying to use scopes and I don't know why I'm getting undefined method is_paid_member for user
[07:39:22] dopie: https://gist.github.com/staycreativedesign/702331298b10d7382fd5
[07:39:35] sevenseacat: dopie: scopes are class methods.
[07:39:50] dopie: Yes don't i call it on the user class?
[07:40:00] norc: dopie: Nope you dont.
[07:40:01] sevenseacat: ` user.is_paid_member?` no.
[07:40:23] dopie: current_user.is_paid_member?
[07:40:25] moeabdol: has joined #RubyOnRails
[07:40:34] dopie: wouldn't work
[07:40:37] sevenseacat: thats not the User class, thats an instance of a user.
[07:41:19] sevenseacat: why do you need a scope if you already have the record with the is_paid attribute? whats wrong with just calling user.is_paid?
[07:41:32] dopie: just figuring out scopes
[07:42:29] netzfisch: has joined #RubyOnRails
[07:43:40] dopie: Adds a class method for retrieving and querying objects. A scope represents a narrowing of a database query, such as where(color: :red).select('shirts.*').includes(:washing_instructions).
[07:43:44] Ergo: has joined #RubyOnRails
[07:44:20] sevenseacat: the docs are pretty good, arent they :)
[07:44:42] dopie: yes they are
[07:44:49] dopie: #rubyonrails is live docs
[07:45:19] blackmesa: has joined #RubyOnRails
[07:47:12] dhjondoh: has joined #RubyOnRails
[07:47:27] solars: has joined #RubyOnRails
[07:50:37] craysiii: I am really confused. I am commenting a line in a migration file that is being tracked by git, but when i do so git doesn't say there is anything to commit
[07:50:52] htmldrum: has joined #RubyOnRails
[07:51:55] Macaveli: good morning
[07:52:46] rvanlieshout: craysiii: git diff <file> shows anything?
[07:52:52] craysiii: no it doesn't
[07:53:03] rvanlieshout: craysiii: cat <file> shows your change?
[07:53:06] rshetty: has joined #RubyOnRails
[07:53:15] craysiii: it finally dose
[07:53:31] craysiii: i dont know what i did differently this time -.-
[07:53:36] rvanlieshout: vagrant + virtualbox or something simlar?
[07:55:08] craysiii: no just my plain ubuntu box
[07:55:29] tlarevo: has joined #RubyOnRails
[07:56:08] sininen: has joined #RubyOnRails
[07:56:17] OyoKooN: has joined #RubyOnRails
[07:56:37] netzfisch: has joined #RubyOnRails
[07:58:14] DoubleMalt: has joined #RubyOnRails
[07:58:57] darutoko: has joined #RubyOnRails
[07:59:37] weckl: has joined #RubyOnRails
[08:00:34] rshetty: has joined #RubyOnRails
[08:00:49] Bloomer: I got a question, if I want to add user_id to my users model so I can updat my user column base on user_id, How can I do that? add_indedx :users, :user_id, :integer is right?
[08:01:04] annlewis: has joined #RubyOnRails
[08:01:17] rvanlieshout: add_column would make more sense
[08:01:31] norc: Bloomer: rails g migration AddUserToFoos user:references
[08:01:45] norc: Bloomer: Dont manually add indices unless you have a reason for it imho.
[08:01:56] HayesHimself: has joined #RubyOnRails
[08:04:04] workmad3: has joined #RubyOnRails
[08:04:35] Bloomer: if I use add_column, the user_id column will increse the number itself??
[08:04:50] rvanlieshout: Bloomer: what?
[08:04:59] rvanlieshout: Bloomer: the user_id will just be a column
[08:05:03] Bloomer: for example, user_id for first user is 1
[08:05:05] rvanlieshout: a foreign key
[08:05:12] rvanlieshout: Bloomer: it's not the primary key
[08:05:16] rvanlieshout: with an auto increment
[08:05:21] nfk|laptop: has joined #RubyOnRails
[08:05:27] rvanlieshout: your users table should already have an id column
[08:05:30] rvanlieshout: why add an user_id?
[08:05:38] Bloomer: if I create second user, the user_id column of this user will set to 2 automatically?
[08:05:46] Radar: Bloomer: why do you need a user_id column?
[08:05:51] d34th4ck3r: has joined #RubyOnRails
[08:05:58] Radar: Bloomer: tables in rails apps already have an id column unless you explicitly tell it not to do that
[08:06:43] Bloomer: the reasone why i need user_id is because I need to update user base on this id
[08:06:47] Bloomer: is this make sense?
[08:07:18] Bloomer: or I can just use if of users table?
[08:07:37] Bloomer: use id , sorry
[08:07:43] rvanlieshout: that makes no sense
[08:07:52] rvanlieshout: the id of the users table is a unique reference
[08:07:55] rvanlieshout: what do you need?
[08:08:13] Bloomer: right now i am going to build a rails API
[08:08:41] Bloomer: i am thinking, if mobile app ask my API to update user information
[08:08:44] Bloomer: how can I do that
[08:09:29] dionysus69: has joined #RubyOnRails
[08:09:33] annlewis: has joined #RubyOnRails
[08:09:51] Bloomer: I thought mobile app can send me user_id and also information which need to be updated to me
[08:09:55] MartinElvar: has joined #RubyOnRails
[08:10:08] rvanlieshout: it can send you anything
[08:10:12] Bloomer: then i can find the user in database by user_id then updated information
[08:10:38] rvanlieshout: it doesn't mean you have to directly use that given param as the reference in your table
[08:11:06] Radar: Bloomer: Please just run "rails g model user"
[08:11:11] Radar: Bloomer: then run "rake db:migrate"
[08:11:21] norc: I want to extend RSpec with some custom matchers. Where would I ideally place them?
[08:11:23] Radar: Bloomer: If you look at the table that is created from that, you'll see that it already has an id column.
[08:11:26] Bloomer: I already have user model
[08:11:28] norc: (This is for now specific to my rails application)=
[08:11:28] Radar: norc: spec/support has been my go-to.
[08:11:32] workmad3: has joined #RubyOnRails
[08:11:34] Radar: Bloomer: Ok, so look in the users table. It already has an ID.
[08:11:38] Bloomer: i know there is a id column
[08:11:46] Radar: So why are you obsessing about user_Id?
[08:11:52] Radar: what does user_id do that id does not?
[08:11:54] norc: Radar: Even for Matchers and not just Helpers?
[08:12:05] norc: Guess that could work. :)
[08:12:25] pawnbox: has joined #RubyOnRails
[08:12:27] Bloomer: hmm.....ok ... it seems like i can use id instead user_id
[08:12:41] rvanlieshout: Bloomer: i don't think you really understand what you have already
[08:12:44] rvanlieshout: you might want to get that clear first
[08:13:35] Bloomer: i know i have a id in user model, i just want to use user_id , because every model all have id column
[08:13:39] Bloomer: may confuse them
[08:13:56] Radar: it won't confuse them
[08:13:58] Radar: this is just standard rails
[08:14:11] sevenseacat: it appears you ar ethe one confused.
[08:14:12] rshetty: has joined #RubyOnRails
[08:14:19] rvanlieshout: Bloomer: and what you have in your db doesn't have to match what you expose using an api
[08:14:37] Bloomer: lol, they let me get confused
[08:14:43] roxtrongo: has joined #RubyOnRails
[08:15:25] Bloomer: rvan, i have everyhing i need, i just wonder if i can user user_id instead id
[08:15:47] weckl: Bloomer: some_user.id or some_other_model.user_id if it has a reference to user
[08:15:51] rvanlieshout: Bloomer: use it where?
[08:16:21] RegulationD: has joined #RubyOnRails
[08:16:55] jerry_tao: has left #RubyOnRails: ()
[08:17:05] Bloomer: rvan, mobile app can send me like {"user_id": "1", "email": "text@gmail.com"}
[08:17:27] rvanlieshout: and how is that related to your internal db scheme?
[08:17:30] Bloomer: so i will know I need to find the user which user_id is 1 then updated his email
[08:17:48] rvanlieshout: User.find(params[:user_id]).update email: params[:email]
[08:17:59] vigintas: has joined #RubyOnRails
[08:18:01] rvanlieshout: there is absolutly no relationship between those params you'll get and the actual db schema
[08:18:38] Bloomer: email is also in user model
[08:18:47] norc: http://pastie.org/10512969 --
[08:18:51] Bloomer: so i can update it
[08:19:04] norc: Any opinions on this simplistic matcher? I do this in all my models, so I thought to dry it up.
[08:19:09] jgt2: has joined #RubyOnRails
[08:19:11] sevenseacat: norc: why are you testing the tests
[08:19:33] rvanlieshout: whould't an invalid factory cause several issues? you'll notice that
[08:19:44] tvw: has joined #RubyOnRails
[08:20:04] norc: By that argumentation I might as well save model and routing tests, because integration tests should catch them all, no?
[08:20:14] Bloomer: so I just use id, right?
[08:20:29] rvanlieshout: Bloomer: where?
[08:20:37] rvanlieshout: Bloomer: do you even understand what's happing where?
[08:20:41] norc: I mean I understand your point, guess I just blindly copied the existing "must have existing factory" tests from the templates..
[08:20:53] rvanlieshout: norc: correct
[08:20:56] Bloomer: rvan, mobile app send me like {"id": "1", "email": "text@gmail.com"}
[08:21:05] sevenseacat: norc: there are no such existing templates
[08:21:12] rvanlieshout: Bloomer: what a mobile app sends is not related to your db schema
[08:21:14] Bloomer: so i can find the user by id then update it
[08:21:23] rvanlieshout: Bloomer: _you_ process that arguments in a controller action
[08:21:27] Bloomer: rvan, what you mean?
[08:21:38] rvanlieshout: Bloomer: they could also send "use_this_great_user_id": "1"
[08:21:45] rvanlieshout: it's up to you to handle that in the controller
[08:22:01] Bloomer: ohohohohohohoh
[08:22:06] Bloomer: i understand now
[08:22:10] sevenseacat: they could also send 'user_id': 2 when their user_id is actually 1
[08:22:13] norc: sevenseacat: Mmm, must have been my awesome copy and paste skills then.
[08:22:14] sevenseacat: you've got bigger problems
[08:22:23] Bloomer: params[:user_this_greate_id]
[08:22:27] Bloomer: in my controller
[08:22:53] rvanlieshout: Bloomer: just try it.. and see how far ou get
[08:23:04] rvanlieshout: without the y
[08:23:19] Bloomer: rvan, really appreciate u
[08:23:23] craysiii: i think what sevenseacat is trying to say is you can't trust the requests that are coming to you, you need to validate what you are receiving before trusting it
[08:23:36] rvanlieshout: the name is Rene btw, the van is something dutch
[08:23:41] tlarevo_: has joined #RubyOnRails
[08:23:45] nemo_: has joined #RubyOnRails
[08:23:51] rvanlieshout: craysiii: and that you'll have to map them to match your own db schema
[08:24:10] norc: rvanlieshout: You said correct. So you try to focus only on request specs?
[08:24:22] tbuehlmann: rvanlieshout, you shouldn't have described the name. it's burned in my brain that I have to pronounce it indian
[08:24:40] craysiii: how does that look indian o.O
[08:24:40] rvanlieshout: norc: well no.. i prefer to test some logic purly in models too.. just because i find them easier to write and to make sure calculations are performed correctly
[08:24:58] FailBit: quick question, you guys mind a 2-line paste?
[08:25:17] arBmind: has joined #RubyOnRails
[08:25:21] FailBit: okay so, I have this in my Tag model
[08:25:24] FailBit: belongs_to :aliased_tag, class_name: 'Tag', validate: false, inverse_of: :aliases
[08:25:26] FailBit: has_many :aliases, foreign_key: :aliased_tag_id, class_name: 'Tag', validate: false
[08:25:36] FailBit: when I do t.aliased_tag I get
[08:25:39] FailBit: NoMethodError: undefined method `aliased_tag' for #<Tag::ActiveRecord_Relation:0x007fcc852a7430>
[08:25:47] FailBit: what's up with that
[08:25:58] rvanlieshout: thejoecarroll: https://en.wikipedia.org/wiki/Tussenvoegsel
[08:26:10] rvanlieshout: FailBit: reloaded your console?
[08:26:17] norc: rvanlieshout: Ah well. Im beginning to realize that for the size of my application, having a few extraneous tests cant hurt. :)
[08:26:18] FailBit: I'm an idiot
[08:26:37] FailBit: I did t=Tag.where(name: 't')
[08:26:39] FailBit: instead of find_by_name
[08:26:41] norc: ACTION is beginning to like testing all the things he can
[08:26:55] dionysus69: hello everyone, I am stuck at this annoying problem. If you have any ideas why this might be happening? I am getting this error param is missing or the value is empty: admin_product, here are my controller and form erbs https://gist.github.com/webzorg/0be3cb13a91bd67aeff2
[08:27:18] dionysus69: error happens on submit create/update actions
[08:27:25] norc: FailBit: where is fine too, just remember that is returns a Relation object.
[08:28:03] norc: dionysus69: What parameters does the controller get?
[08:28:33] dionysus69: norc: all the parameters that I gisted in the form.erb
[08:28:55] norc: dionysus69: Include the server log from that request then.
[08:29:01] Aswebb_: has joined #RubyOnRails
[08:30:38] dionysus69: heres the log but I didn't notice anything helpful https://gist.github.com/webzorg/93f4ca19df4c5f0fb313
[08:31:22] norc: dionysus69: I asked because I wanted to see what parameters the controller receives...
[08:31:54] comrad: has joined #RubyOnRails
[08:32:23] dionysus69: I don't see params in this log so error happens before that I guess
[08:32:32] norc: dionysus69: Are you in development mode?
[08:32:46] tak1n: has joined #RubyOnRails
[08:33:05] norc: dionysus69: and log/development.log is empty?
[08:33:08] Palsson: has joined #RubyOnRails
[08:33:11] Pupeno: has joined #RubyOnRails
[08:33:11] Pupeno: has joined #RubyOnRails
[08:33:13] dionysus69: everything was working before, I am setting up dev env second time due to OS failure and now I am getting unexpected error like this
[08:33:47] dionysus69: one second let me filter that log its quite bloated
[08:34:00] norc: dionysus69: Or just copy the parameters from your rails error page
[08:34:09] norc: or byebug it
[08:35:48] dionysus69: heres both the log and params from error page https://gist.github.com/webzorg/e9831758032fbbe54043
[08:37:22] tetraktys: has joined #RubyOnRails
[08:38:23] norc: dionysus69: There you go. Your strong parameters is looking for an { :admin_product => {} } , but you are passing { :product => {} }
[08:38:46] pawnbox: has joined #RubyOnRails
[08:39:03] dionysus69: ok thats expected, but heres what my form for looks like <%= form_for ([:admin, @admin_product]) do |f| %>
[08:39:22] dionysus69: doesnt this imply it should pass params to controller which is in admin namespace named @admin_product?
[08:40:02] norc: dionysus69: That is for namespaced routes.
[08:40:14] dionysus69: yes and I have it namespaced
[08:40:53] dionysus69: heres my routes
[08:40:54] dionysus69: https://gist.github.com/webzorg/92f56db59d54c929bbb5
[08:41:05] rvanlieshout: dionysus69: namespacing routes has no effect on params
[08:41:26] norc: dionysus69: You can pass as: :admin_product to form_for to change how it names the object in your params I believe.
[08:41:49] dionysus69: will try that one sec
[08:41:55] norc: (Or change your strong parameters)
[08:42:07] artto: has joined #RubyOnRails
[08:43:08] rvanlieshout: best approach imo
[08:43:14] dionysus69: change strong parameters to use products instead of admin products?
[08:43:41] dionysus69: ye that sounds better because :admin_product approach gave me some new error
[08:44:31] rshetty: has joined #RubyOnRails
[08:44:54] ror15: I'm trying to reorder bin content in ActiveAdmin using collection_action :sort, :method => :post do. collection_action should create a route for me but when I reload the page I get a routing error: No route matches [GET] "/admin". Why is collection_action not creating the route?
[08:45:35] ror15: (I know they have their own channel but it isn't active)
[08:46:47] tlarevo: has joined #RubyOnRails
[08:47:18] kitsuneyo: has joined #RubyOnRails
[08:47:42] shilon: has joined #RubyOnRails
[08:48:14] ruurd: has joined #RubyOnRails
[08:48:29] dopie: When using the carrier wave gem it asks for host: what would I put for host?
[08:48:36] shilon: has left #RubyOnRails: ()
[08:48:40] tlarevo: has joined #RubyOnRails
[08:48:43] rvanlieshout: dopie: where does it ask you for a host?
[08:49:08] dionysus69: ok so now it gives me an on redirect, after create action :\ https://gist.github.com/webzorg/189600b94211f9e29dd0
[08:49:12] dopie: https://gist.github.com/staycreativedesign/44beeb57ae8ee81c95ca
[08:49:38] rvanlieshout: dopie: read the documentaion about your fog provider
[08:50:00] rvanlieshout: read the documentation about that
[08:50:08] norc: dionysus69: Use an explicit route helper
[08:50:28] dionysus69: what ? I dont know whats that
[08:51:41] ibouvousaime: has joined #RubyOnRails
[08:52:40] norc: dionysus69: Can you attach the output of rake routes please?
[08:52:57] pawnbox: has joined #RubyOnRails
[08:53:04] dionysus69: https://gist.github.com/webzorg/3248c898d42382c60f25 here
[08:53:30] Bloomer: has joined #RubyOnRails
[08:53:48] kimegede: has joined #RubyOnRails
[08:54:05] Juanchito: has joined #RubyOnRails
[08:54:31] norc: dionysus69: admin_product_path(@admin_product) will give you the correct route then because of the nesting.
[08:56:30] Pumukel: has joined #RubyOnRails
[08:56:34] dionysus69: norc: ok now it became responsive at least i will deal with it, thanks allot! ))
[08:57:22] Peg-leg: has joined #RubyOnRails
[08:58:50] big|bad|wolf: has joined #RubyOnRails
[08:59:38] shilon: has joined #RubyOnRails
[08:59:53] mark3: has joined #RubyOnRails
[09:00:25] workmad3: has joined #RubyOnRails
[09:00:28] goldbug: has joined #RubyOnRails
[09:00:56] Pumukel: has joined #RubyOnRails
[09:03:22] goldbug: Hello, I want to join a bunch of strings together with spaces but only if the strings are non-empty. I had thought this would do it, but it's adding an extra space for every empty string: [first_name_prefix, first_name, middle_name_1, middle_name_2, middle_name_3, surname_prefix, surname, surname_suffix].reject(&:nil?).join(' ')
[09:03:35] rvanlieshout: reject(&:blank?)
[09:03:41] G: has joined #RubyOnRails
[09:03:42] goldbug: Ah, perfect.
[09:04:17] goldbug: Sorted, thank you (:
[09:05:00] mikecmpbll: has joined #RubyOnRails
[09:05:26] codezomb: has joined #RubyOnRails
[09:06:15] Ergo^: has joined #RubyOnRails
[09:08:01] duncannz: has joined #RubyOnRails
[09:08:05] dionysus69: in which case does this trigger if @product.save , where product has same id which db generates as a primary key in db?
[09:08:08] marr: has joined #RubyOnRails
[09:09:00] Peg-leg: has joined #RubyOnRails
[09:09:11] duncannz: has joined #RubyOnRails
[09:09:14] mark3: has joined #RubyOnRails
[09:09:16] Peg-leg: has joined #RubyOnRails
[09:09:31] jsrn_: has joined #RubyOnRails
[09:10:25] Stoge88: has joined #RubyOnRails
[09:10:31] annlewis: has joined #RubyOnRails
[09:10:51] sadaf2606: has joined #RubyOnRails
[09:14:20] AzaToth: has joined #RubyOnRails
[09:14:23] pawnbox: has joined #RubyOnRails
[09:14:54] workmad3: has joined #RubyOnRails
[09:15:39] n1ck7: has joined #RubyOnRails
[09:18:00] RegulationD: has joined #RubyOnRails
[09:21:30] shock_one: has joined #RubyOnRails
[09:22:44] tlarevo: has joined #RubyOnRails
[09:24:21] hd1: has joined #RubyOnRails
[09:24:45] tlarevo: has joined #RubyOnRails
[09:25:50] nya: has joined #RubyOnRails
[09:26:41] ddv: FailBit: pebcak
[09:27:04] hd1: peback always!
[09:27:18] tlarevo_: has joined #RubyOnRails
[09:27:19] lxsameer_: has joined #RubyOnRails
[09:27:36] FailBit: ddv: when devise can't find the user id specified in the cookie, it just throws
[09:27:41] jgt2: has joined #RubyOnRails
[09:28:03] hd1: has left #RubyOnRails: ()
[09:28:30] sevenseacat: seen that before
[09:29:17] jvanbaarsen: has joined #RubyOnRails
[09:29:32] tlarevo: has joined #RubyOnRails
[09:29:34] adre: has joined #RubyOnRails
[09:29:38] ddv: FailBit: complaining in here doesn't solve your problem
[09:30:56] d34th4ck3r: has joined #RubyOnRails
[09:33:00] goldbug: What does this mean? (In a generated test): @person = people(:one)
[09:33:01] tlarevo: has joined #RubyOnRails
[09:33:12] goldbug: Specifically, what does :one mean?
[09:33:45] sevenseacat: its the tag in the fixture
[09:33:51] sevenseacat: the people fixture
[09:34:00] ddv: how deep is your love
[09:34:31] goldbug: Ahh - thanks.
[09:35:01] bruno-: has joined #RubyOnRails
[09:36:20] sameerynho: has joined #RubyOnRails
[09:37:40] big|bad|wolf: has joined #RubyOnRails
[09:38:33] dionysus69: can anyone explain to me what the error message means? https://gist.github.com/webzorg/412cee4916d415a74ff5, on line 10 it says unknown attribute double single quote or single double quote, how can I inspect exactly what params are being passed? I am passing a csv rows and I dont have neither quotes in any row
[09:41:25] bruno-: has joined #RubyOnRails
[09:44:11] Peg-leg: has joined #RubyOnRails
[09:44:26] Peg-leg: has joined #RubyOnRails
[09:45:53] mark3: has joined #RubyOnRails
[09:47:51] bonemind: has joined #RubyOnRails
[09:50:45] A124: has joined #RubyOnRails
[09:51:21] kerunaru: dionysus69, you can always make a logger.debug params.inspect somewhere in your code to see what is coming to your ProductsController
[09:51:44] n1ck7: has joined #RubyOnRails
[09:52:00] dionysus69: thanks will look into it!
[09:53:05] arBmind: has joined #RubyOnRails
[09:56:35] rodfersou: has joined #RubyOnRails
[09:59:59] teclator: has joined #RubyOnRails
[10:00:26] tlarevo: has joined #RubyOnRails
[10:00:35] wethu: has joined #RubyOnRails
[10:01:11] hd1: has joined #RubyOnRails
[10:01:21] workmad3: has joined #RubyOnRails
[10:02:11] vasilakisFiL: has joined #RubyOnRails
[10:02:12] stamina: has joined #RubyOnRails
[10:03:08] vasilakisFiL: are Model.reflections and Model.reflect_on_all_associations slow ? I have some API param filters based on those and I call them almost in every request
[10:04:51] sevenseacat: i wouldnt do it.
[10:05:12] hd1: is the assets pipeline disabled in production?
[10:05:24] FailBit: no of course not
[10:05:33] FailBit: vasilakisfil: I doubt it
[10:05:35] Papierkorb: I need to run JS code on the server (using therubyracer gem) and the same code on the client. Where should I put the JS files?
[10:05:54] sevenseacat: well, parts of it are.
[10:06:02] sevenseacat: the auto-compilation is
[10:07:44] vasilakisFiL: you think it's a bad practice what I do ?
[10:07:55] big|bad|wolf: has joined #RubyOnRails
[10:08:24] vasilakisFiL: do you have something else to suggest ?
[10:08:37] kp666_: has joined #RubyOnRails
[10:08:53] pawnbox: has joined #RubyOnRails
[10:09:03] vasilakisFiL: I would like to give as much freedom as I can to the client, just like facebook does with GraphQL
[10:09:10] sevenseacat: without knowing what you're doing or why? no
[10:09:13] kp666_: has joined #RubyOnRails
[10:10:18] kp666_: has joined #RubyOnRails
[10:11:02] kp666_: has joined #RubyOnRails
[10:11:17] annlewis: has joined #RubyOnRails
[10:11:38] kp666_: has joined #RubyOnRails
[10:12:36] kp666_: has joined #RubyOnRails
[10:12:58] shibabu: has joined #RubyOnRails
[10:14:08] norc: Okay, I need some debugging guidance. I have a validates :foo, format: /some_regex/ in my model, that somehow is not properly respected by Rails.
[10:14:26] norc: All my controllers seem to bypass that validation entirely
[10:14:53] DaniG2k: has joined #RubyOnRails
[10:15:03] jgt2: has joined #RubyOnRails
[10:16:31] norc: Manual calls in the rails console #create produce no valid record with the invalid parameters, updating however works.
[10:16:45] norc: Im a bit clueless, dont even know how to debug this.
[10:18:45] dionysus69: trying to dry this code up, I want to remove lines 7 through 11 except line 10 because duplicate is present in create action in controller. but when I do remove it, create action still creates duplicates in that case. what am I missing? https://gist.github.com/webzorg/f5bb956824d3419b452c
[10:19:50] RegulationD: has joined #RubyOnRails
[10:20:14] Cervajz: has joined #RubyOnRails
[10:20:28] rickmasta: has joined #RubyOnRails
[10:20:36] User458764: has joined #RubyOnRails
[10:20:40] dionysus69: basically product_hash I am passing doesn't get checked by this line @admin_product = Product.find_by(sku: admin_product_params["sku"]) and controller skips all logic and creates products
[10:20:44] norc: Gah I found the bug. That was a stupid one. :(
[10:21:01] Papierkorb: dionysus69: lines 2-8, there's Model#find_or_create_by and friends: http://apidock.com/rails/v4.0.2/ActiveRecord/Relation/find_or_create_by
[10:21:14] wethu: has joined #RubyOnRails
[10:22:33] stamina: has joined #RubyOnRails
[10:23:13] Papierkorb: dionysus69: line 4, be aware that public/ is most likely publicly visible, which may not be what you want. You can use tmp/ instead.
[10:24:06] Papierkorb: lines 4-end of model.rb: Same goes here wrt ::find_or_create_by
[10:24:57] arBmind: has joined #RubyOnRails
[10:25:40] dionysus69: Papierkorb: that public thing is ok, I am removing those pictures anyway after import, it was demo hehe
[10:26:54] TPBallbag: has joined #RubyOnRails
[10:27:43] annlewis: has joined #RubyOnRails
[10:28:21] Papierkorb: dionysus69: no idea what you'd want to change about the render if in the action though. I think it's fine, the stuff being done for each case is quite different from the others.
[10:28:51] dionysus69: good to know find_or_create exists thanks for that :D
[10:29:02] ych: has joined #RubyOnRails
[10:29:47] dionysus69: I thought the create action and passing hash from model would have to go through same logic in controller thats why I thought I might be able to remove logic in model
[10:32:34] aganov: Hi, I'm wondering where is the right place, within rails app, to initialize ConnectionPool https://github.com/mperham/connection_pool
[10:35:16] Pazician: has joined #RubyOnRails
[10:35:28] rshetty: has joined #RubyOnRails
[10:36:01] ldnunes: has joined #RubyOnRails
[10:36:22] chrislotix: has joined #RubyOnRails
[10:36:42] rgrmatt: has joined #RubyOnRails
[10:36:44] basldex: has joined #RubyOnRails
[10:37:11] basldex: are there any best practices to auto-reload local gems in dev mode? I found some hacks and some gems, but those seem to be quite unmaintained
[10:38:16] pwnd_nsfw: basldex, restarting the server
[10:38:29] artto: has joined #RubyOnRails
[10:38:46] vigintas: has joined #RubyOnRails
[10:39:22] basldex: pwnd_nsfw, that's not what I asked for
[10:39:54] pwnd_nsfw: What's the problem doing that, though?
[10:40:07] pwnd_nsfw: Takes two seconds to reload the server manually.
[10:40:19] basldex: yeah, whatever
[10:40:22] basldex: still not what I was asking for
[10:40:30] pwnd_nsfw: ACTION shrugs.
[10:40:52] tlarevo: has joined #RubyOnRails
[10:41:03] workmad3: basldex: what you're asking for is something that lacks 'best practices' because it's a pretty bad idea in general
[10:41:16] workmad3: basldex: pwnd_nsfw's answer is therefore the 'best practice'
[10:41:50] basldex: but in reality it sucks, especially when you're developing app and engine at the same time
[10:42:10] pwnd_nsfw: Does it really suck that much?
[10:42:11] workmad3: basldex: if restarting manually is painful, consider using something like Guard to watch for changes in Gemfile.lock (or whatever else you want) and trigger restarts of the server through that
[10:42:11] chrislotix: How do i go about destroying a database entry after certain amount of time? (15mins) I want to create temporary "lobbies" which last for 15 mins since the creation.
[10:42:39] tlarevo: has joined #RubyOnRails
[10:42:46] basldex: workmad3, but rails console would need manual restart still
[10:43:17] sevenseacat: has joined #RubyOnRails
[10:43:21] norc: chrislotix: Id say the easiest way would be to have a rake task do your thing with the gem whenever
[10:43:22] rshetty: has joined #RubyOnRails
[10:43:36] universa1: chrislotix: why not check on access if they're still valid? and have some background job / cron task regularly clean up old records
[10:43:40] ddv: basldex: You can call reload! in a rails console? Or does this not work?
[10:43:49] workmad3: basldex: yup... but reloading gems is something that isn't supported, is a bad idea in general and would require pretty major hacks to rubygems to work... just autoloading and reloading rails code in your app is problematic enough
[10:43:53] basldex: ddv, it reloads the app but not the engine
[10:44:26] basldex: workmad3, even local gems?
[10:44:38] workmad3: basldex: all gems are local when you load them :P
[10:45:00] ddv: You could have restarted your app by now, basldex :p
[10:45:03] tlarevo: has joined #RubyOnRails
[10:45:21] basldex: ddv, I did the last 2 years while working on that project. I'm quite fed up now
[10:45:28] matthewd: aganov: An initializer?
[10:46:03] universa1: guard works like a charm... ...with tests i don't spend so much time in the console anyways ;)
[10:46:14] chrislotix: universal1: I will give it a go, i've been looking for some options. Thank you.
[10:46:18] workmad3: basldex: btw, that sort of annoyance is why I typically suggest that engines are something you extract out of an app once you have a stable chunk, rather than something you start out with :)
[10:46:24] matthewd: basldex: If it's an engine and you use require_dependency, that might work.. maybe?
[10:47:44] basldex: matthewd, I'll give it a try, thanks
[10:47:51] bonhoeffer: has joined #RubyOnRails
[10:47:58] comm64x: has joined #RubyOnRails
[10:48:17] matthewd: Noting I say that in the context of it already being established that best practice is "don't do that" -- no promises :)
[10:49:38] comm64x: I notice in some CMS's the 'admin' section of the site is separate from the rest of the site (think wordpress), is there a best practice for this in rails
[10:50:16] FailBit: namespaces
[10:50:24] tlarevo: has joined #RubyOnRails
[10:50:27] FailBit: also if someone says "best practice" again I swear I'm going to shoot them
[10:50:33] ddv: comm64x: rails is not a cms, so it's up to you
[10:52:27] kyrul_fil_qaryah: has joined #RubyOnRails
[10:52:28] chills42: has joined #RubyOnRails
[10:52:35] bruno-: has joined #RubyOnRails
[10:54:04] rshetty: has joined #RubyOnRails
[10:55:03] comm64x: I ask because I wanted to make a cms with rails. I noticed there are already a couple gems that do this but I'd rather roll my own for the experience. Anyone have a suggestion as to which of those cms gems are good vs bad examples to learn from
[10:56:12] comm64x: of course that would assume someone in here had extensive experience with a broad range of such gems....so nevermind bad question
[10:56:30] tlarevo: has joined #RubyOnRails
[10:56:47] norc: FailBit: Best practice is to practice.
[10:56:50] ddv: comm64x: if you want to keep it simple create a separate admin namespace
[10:57:47] Diabolik: if i have a query, for instance RubyOnRailsQuery, and RubyOnRailsQuery.new.count == 10, how can i access the contents of that query?
[10:57:59] weihan_: has joined #RubyOnRails
[10:58:29] Diabolik: im trying to filter out certain results
[10:58:31] allcentury: has joined #RubyOnRails
[10:59:20] ddv: Diabolik: why such a weird model name?
[10:59:35] Diabolik: im using it as an example
[10:59:44] rshetty: has joined #RubyOnRails
[10:59:51] ddv: Diabolik: what is your real problem?
[10:59:58] gregf_: has joined #RubyOnRails
[11:00:04] ddv: what are you trying to achieve and why?
[11:00:23] tlarevo: has joined #RubyOnRails
[11:00:33] Diabolik: I have a summary table that is populated by a query. I want to move some of the items found by that query to another summary table
[11:01:41] comm64x: ddv: makes sense, thanks
[11:01:41] kitsuneyo: has joined #RubyOnRails
[11:01:44] ddv: Diabolik: call the model again with a different scope?
[11:02:28] Diabolik: what model?
[11:02:35] Diabolik: My query is a query object
[11:02:49] ddv: Diabolik: the model you use to fill the table
[11:05:05] syath: has joined #RubyOnRails
[11:05:53] annlewis: has joined #RubyOnRails
[11:06:32] Cervajz_: has joined #RubyOnRails
[11:07:21] tlarevo: has joined #RubyOnRails
[11:08:05] kimegede: has joined #RubyOnRails
[11:08:47] dionysus69: is there find_or_create_by but like this? update_or_create_by?
[11:08:53] matthewd: Diabolik: A query object isn't a standard Rails concept, so I think you're going to need to provide more information, if your question is "how do I access the contents of [a thing no-one has seen]"
[11:09:10] tlarevo: has joined #RubyOnRails
[11:10:09] matthewd: dionysus69: It doesn't really make sense without the "find". What do you want to do?
[11:10:28] dionysus69: if it finds, to update, if it doesnt find then create :)
[11:10:33] workmad3: dionysus69: so you want to provide some attributes and, if you find a record, update it to have those attributes...
[11:10:37] dionysus69: right now I tested it and it just found without updating
[11:10:38] workmad3: dionysus69: how will that work?
[11:11:10] workmad3: dionysus69: after all, in order to find it, that record will already have the attributes you provided...
[11:11:39] matthewd: dionysus69: You probably want find_or_initialize_by(..).update(..)
[11:12:06] dionysus69: isn't this the same find_or_initialize_by as find_or_create_by
[11:12:25] danneu: i'd assume that the first one doesn't cause a db insert
[11:12:29] dionysus69: I will chain it with update I guess that makes sense, thats behaviour I was aiming for
[11:12:44] pawnbox: has joined #RubyOnRails
[11:12:50] tlarevo: has joined #RubyOnRails
[11:13:40] dionysus69: but I actually want it to write to db if it couldnt be found, and if found updated
[11:13:56] dionysus69: find_or_create_by().update() << will this do it?
[11:14:08] workmad3: dionysus69: yup, so will find_or_initialize_by
[11:14:21] nettoweb: has joined #RubyOnRails
[11:14:29] workmad3: (with the chained update())
[11:14:30] dionysus69: hmm ok i ll look both up )) thanks !
[11:14:52] nettoweb: guys, is it possible to delete all fragments cache starting with "article_" ? Im using this: ActionController::Base.new.expire_fragment(...)
[11:15:32] FailBit: I don't think so
[11:16:11] qejk: has joined #RubyOnRails
[11:16:49] Detch: has joined #RubyOnRails
[11:16:57] workmad3: nettoweb: you might be able to depending on your cache store (you could probably achieve it with redis, for example), but the basic interface supported by rails won't allow it as not all cache stores provide the ability to do prefix searches
[11:19:00] nettoweb: workmad3 Im actually doing lthis way: <% cache("article_#{@article.id}", :expires_in => 1.day) do %> and could remove one instance with ActionController::Base.new.expire_fragment("article_12345")
[11:19:28] workmad3: nettoweb: yes, I'd figured that out
[11:20:03] nettoweb: workmad3 but now I want to expire all of these caches, I dont knwo if I can do it
[11:20:39] workmad3: nettoweb: yes, again that was pretty clear from what you said
[11:20:42] workmad3: nettoweb: hence the answer I gave
[11:21:28] RegulationD: has joined #RubyOnRails
[11:21:59] mikecmpbll: dionysus69: if you find by the values, what exactly are you updating?
[11:22:05] mikecmpbll: oops, i was scrolled up
[11:22:18] workmad3: mikecmpbll: haha :) get with the program!
[11:22:57] dionysus69: mikecmpbll: no problem, i am still figuring this out haha
[11:22:59] nettoweb: workmad3 im not using redis. so it wont possible?
[11:23:47] workmad3: nettoweb: it depends on what your cache store is, as I said... meaning you'll need to figure it out, but you won't be able to do it without interacting with the store directly as the rails interface won't let you
[11:23:59] tlarevo: has joined #RubyOnRails
[11:24:20] workmad3: nettoweb: `for example` doesn't mean `it won't work if you're not doing exactly this` last time I checked, after all...
[11:25:51] dionysus69: getting this error now :s undefined method `save' for true:TrueClass heres the code https://gist.github.com/webzorg/016e127b807ec11a9fd4 is the chaining done in an incorrect way?
[11:25:54] Guest39: has joined #RubyOnRails
[11:26:15] dionysus69: this is when I try create a new product with a same sku
[11:26:27] tlarevo: has joined #RubyOnRails
[11:26:32] norc: dionysus69: update returns true or false depending on whether the record is valid
[11:26:35] Guest39: has left #RubyOnRails: ()
[11:26:41] cornerma1: has joined #RubyOnRails
[11:26:46] agit0: has joined #RubyOnRails
[11:27:03] dionysus69: so I should use update! ?
[11:27:25] norc: dionysus69: or better do something like: if @product.update(params)
[11:27:27] dionysus69: or what I dont get it
[11:27:48] fbernier: has joined #RubyOnRails
[11:28:14] norc: dionysus69: If you use update! it will unwind the stack and not use the responders in that action.
[11:28:17] norc: (if it fails)
[11:28:32] norc: Which by default will end up showing internal error messages and what not.
[11:28:39] rshetty: has joined #RubyOnRails
[11:28:50] workmad3: norc: well, by default in production it'll just show a `500 something went wrong` error page
[11:29:10] tlarevo: has joined #RubyOnRails
[11:29:41] norc: workmad3: Close enough. It certainly is not very helpful. :)
[11:29:58] mikecmpbll: nettoweb: expire_fragment takes regexp for the key if the underlying cache store supports the `delete_matched` interface.
[11:30:26] sankaber: has joined #RubyOnRails
[11:30:28] rshetty_: has joined #RubyOnRails
[11:30:48] nettoweb: mikecmpbll I'll try, thank you
[11:31:28] workmad3: mikecmpbll: ah, cool :)
[11:31:36] insu: has joined #RubyOnRails
[11:31:42] mikecmpbll: lol @ postgres docs: "Note: Strictly speaking, this process is iteration not recursion, but RECURSIVE is the terminology chosen by the SQL standards committee."
[11:31:52] fbernier: Could anyone help me explain this activerecord sorcery? I am getting crazy. https://www.refheap.com/f1ee88a6a203efd9e1c26f439
[11:32:00] mikecmpbll: a.k.a. "sorry, not our fault it's called this"
[11:32:55] dionysus69: is this neatest it can get? I got this working https://gist.github.com/webzorg/21161b7f8a2e98f16c26
[11:32:59] seank_: has joined #RubyOnRails
[11:33:21] mikecmpbll: dionysus69: you don't need the if ...
[11:33:44] dionysus69: what why? as I said before I tried chaining and it didnt work :\
[11:34:01] dhjondoh: has joined #RubyOnRails
[11:34:01] mikecmpbll: you said you chained .save on to an .update
[11:34:28] workmad3: dionysus69: no, change the `@admin_product.save` in your original gist with `@admin_product.update(params)`
[11:35:28] mikecmpbll: you can chain the update to the find_or_initialize_by if you want to save it there and then (and if it's valid), or use assign_attributes instead
[11:35:31] dionysus69: ugh I get it now... sorry for being super noob sometimes my knowledge of ruby is poor thanks all!
[11:35:34] Cervajz_: has joined #RubyOnRails
[11:36:37] Cervajz: has joined #RubyOnRails
[11:37:44] blackmesa: has joined #RubyOnRails
[11:37:52] mikecmpbll: fbernier: you'll need to shown your models too
[11:38:36] sakshi_: has joined #RubyOnRails
[11:39:25] fbernier: mikecmpbll: User has_many pen_names, and user is using devise. The field I am updating has no is not used in the reference between the two models though.
[11:41:19] mikecmpbll: fbernier: well, there's definitely something about that attribute going on, so like i said i need to see the model
[11:41:22] sakshi_: has left #RubyOnRails: ()
[11:41:47] fbernier: mikecmpbll: If I do update_attribute on any other attribute, the very same thing happen :/
[11:42:08] mikecmpbll: it inserts a row into pen_names?
[11:42:56] mikecmpbll: regardless, like i said, i'd need to see the model
[11:43:03] mikecmpbll: most likely you have a callback.
[11:45:56] fbernier: yeah it inserts a row into the model... currently investigating for callbacks but there are none of my own on the two models. Might be a devise one.
[11:45:58] tlarevo: has joined #RubyOnRails
[11:46:08] fbernier: a row into pen_names***
[11:46:16] fbernier: which just doesn't make sense
[11:46:36] mikecmpbll: it'll make sense when you find the code that inserts a row in to pen names whenever an attribute is updated on the user.
[11:48:06] fbernier: hehe I know ... but I really don't understand why it's not happening after one insert is made in a request even if I rerun the update_attributes
[11:48:17] rshetty: has joined #RubyOnRails
[11:49:54] ror15: has joined #RubyOnRails
[11:50:21] stamina: has joined #RubyOnRails
[11:52:08] norc: So I added (yet another) factory to my project. Running rake spec now generates the error message: "Factory already registered: loop_pathway_rollout_zone_association"
[11:52:29] norc: Which is completely bizarre. If I remove that factory, its not registered - so its not a duplicate definition in another file.
[11:52:33] norc: It seems like the file is loaded twice.
[11:53:47] Pazician: has joined #RubyOnRails
[11:54:20] ruurd: has joined #RubyOnRails
[11:55:45] matthewd: norc: A puts would confirm that pretty trivially
[11:58:43] goldbug: Hello, I'm struggling to know what I'm doing wrong here. My controller test keeps failing. I'm sure there's a very straightforward explanation, but it'll take me hours of Googling to find it so thought I'd ask here first. https://gist.github.com/classicgoldbug/0424c3aa05b110243fe7
[11:59:48] tetraktys: has joined #RubyOnRails
[11:59:48] norc: goldbug: When you have routing issues, look at the routes that "rake route" shows
[12:00:47] bmalum: has joined #RubyOnRails
[12:00:56] fbernier: mikecmpbll: changed my relation for has_many :pen_names, autosave: false on User and I don't have my problem anymore.
[12:01:01] mikecmpbll: goldbug: you're not persisting @person, so it doesn't have an ID
[12:01:14] norc: matthewd: unsure at why, but during the initialization of spec all my factory files get loaded 2 times, while this one factory file gets loaded 3 times.
[12:01:45] norc: goldbug: Oh indeed, Im sorry.
[12:01:47] meoblast001: has joined #RubyOnRails
[12:02:24] goldbug: mikecmpbll: Ah. I knew it would be something obvious like that!
[12:02:37] goldbug: mikecmpbll: Next question: how do I persit @person?
[12:02:37] chills42: has joined #RubyOnRails
[12:02:59] mikecmpbll: goldbug: https://gist.github.com/classicgoldbug/0424c3aa05b110243fe7#file-people_controller_test-rb-L5 see if you can figure it out
[12:03:25] kimegede: has joined #RubyOnRails
[12:04:32] jsrn_: has joined #RubyOnRails
[12:04:45] matthewd: norc: Look at `caller` then, I guess
[12:05:11] norc: matthewd: Ah, figured it out. I had "spec" in the filename. That made rspec behave differently there. :)
[12:05:12] goldbug: mikecmpbll: I could figure it out! I am the man.
[12:05:16] mikecmpbll: fbernier: i suspect that's not actually solving your issue, just stopping the save
[12:05:19] goldbug: mikecmpbll: Thanks (:
[12:05:37] Icey: has joined #RubyOnRails
[12:05:42] fbernier: I know it's not ... but I now know more what to look for :/
[12:05:56] tlarevo: has left #RubyOnRails: ()
[12:06:13] mikecmpbll: the user model.
[12:06:15] goldbug: Still getting this error however: https://gist.github.com/classicgoldbug/0424c3aa05b110243fe7#file-console-L20
[12:06:35] mikecmpbll: goldbug: i'm sure you can fathom that one on your own
[12:07:20] Hazim: Need help, why are my nested form not rendering after validation error. I managed to figure that my association model returned null too. My code -> https://gist.github.com/hazim78/6f0791039d212df4ebb0
[12:07:22] fbernier: aaaaaannnnd I think I found it
[12:08:07] njero: has joined #RubyOnRails
[12:11:38] rshetty_: has joined #RubyOnRails
[12:12:11] pawnbox: has joined #RubyOnRails
[12:12:39] goldbug: mikecmpbll: You'd think, wouldn't you? I'm a little stuck though. The full_name_by_surname method works fine in console. I assume then it's something to do with assigning stuff in the controller test?
[12:15:58] annlewis: has joined #RubyOnRails
[12:16:24] dhjondoh: has joined #RubyOnRails
[12:16:46] bitsapien: has joined #RubyOnRails
[12:20:14] bitsapien: has joined #RubyOnRails
[12:20:53] matthewd: goldbug: Check the documentation of the upcase! method
[12:21:21] pawnbox: has joined #RubyOnRails
[12:21:56] joshua75: has joined #RubyOnRails
[12:22:55] RegulationD: has joined #RubyOnRails
[12:23:42] gerep: has joined #RubyOnRails
[12:24:41] gerep: Anyone here that uses Pusher know if it is possible to change the its host? I'm using Poxa on a server and I'd like the Pusher library to point there instead of their own server
[12:24:50] gaussblurinc1: has joined #RubyOnRails
[12:25:27] gaussblurinc1: hi! should I use pg gem in development environment or it is better to choose something like sqlite3?
[12:25:43] rvanlieshout: gaussblurinc1: your dev environment should match your production environment
[12:25:46] rvanlieshout: as much as possible
[12:27:14] rahul: has joined #RubyOnRails
[12:27:29] Hazim: hi, i need help with my nested form validation errors
[12:27:34] Macaveli: has joined #RubyOnRails
[12:27:49] Hazim: the nested form doesn't get rendered after validation error
[12:28:02] rvanlieshout: hazim: cause your nested object isn't present
[12:28:04] Classic: has joined #RubyOnRails
[12:28:15] Classic: has left #RubyOnRails: ()
[12:28:18] Hazim: that's true, but why isn't the object present?
[12:28:22] goldbug: has joined #RubyOnRails
[12:28:33] rvanlieshout: hazim: why should it be present?
[12:28:46] andersoldahl: has joined #RubyOnRails
[12:28:50] Hazim: should I rebuild it after?
[12:29:10] rvanlieshout: it's weird. your nested form should relate to a nested object, not to an other object
[12:29:13] rvanlieshout: but what object is nil?
[12:29:59] Hazim: because when the form has errors, it detects the validation error on the nested object, but the object is empty and can't render the fields_for
[12:30:25] rikkipitt: has joined #RubyOnRails
[12:30:58] rikkipitt: hey everyone, is there a find_or_build equivalent to find_or_create on belongs_to relationships?
[12:31:14] rvanlieshout: hazim: you have a form_for a @staff
[12:31:17] rvanlieshout: and fields_for :staff
[12:31:21] rvanlieshout: does your @staff have a .staff?
[12:31:38] Hazim: when new is called, it renders perfectly
[12:31:49] rvanlieshout: so staff belongs_to :staff
[12:32:06] Hazim: lemme check, this whole engine thing is confusing me
[12:32:06] rvanlieshout: that doesn't mean your new action is right
[12:32:55] Hazim: what's wrong with my new action
[12:33:06] joshua75: has joined #RubyOnRails
[12:33:08] rvanlieshout: well.. check if staff belongs_to staff first
[12:33:09] Hazim: i created @staff from Subscribem:User
[12:33:44] rvanlieshout: use f.fields_for :staff
[12:33:52] rvanlieshout: without @staff.staff
[12:33:54] Hazim: then @staff.build_staff which get's :staff to @staff
[12:33:58] rvanlieshout: cause it will use staff.staff
[12:34:06] Hazim: i did that already
[12:34:21] Hazim: lemme try again
[12:34:26] rvanlieshout: then add a raise @staff.staff after the @staff = account.users.create(staff_params)
[12:34:29] rvanlieshout: it it present there?
[12:34:35] rvanlieshout: does staff_params even contain the nested staff attributes?
[12:35:08] Hazim: staff_params has staff_attributes
[12:35:34] rvanlieshout: and @staff.staff is present after the .create
[12:36:22] bitsapien: I'm using the form builder and my submit button gets disabled on click. I do not want that to happen, can this be done without using javascript
[12:36:44] Hazim: lemme check
[12:36:51] rvanlieshout: the fact that it gets disabled is caused by js, bitsapien
[12:37:27] bitsapien: like, is there a parameter that might prevent that javascript from running
[12:37:38] rvanlieshout: it's something that's not done by default
[12:37:44] rvanlieshout: so you're better off just removing it
[12:38:01] bitsapien: how do I remove it?
[12:38:08] Hazim: rvanlieshout yes @staff.staff is present on create action. @staff.staff
[12:38:09] Hazim: => #<Staff id: nil, username: "kk", name: "kk", workid: "kk", access_level: 0, status: 1, jawatan: "kk", email: nil, department_id: 1, created_at: nil, updated_at: nil, staffpic: nil, subscribem_users_id: nil, user_id: nil>
[12:38:23] pawnbox: has joined #RubyOnRails
[12:38:27] Hazim: those are the values from the form
[12:38:29] rvanlieshout: hazim: so what happens if you render the form again now?
[12:38:36] rvanlieshout: without the fields_for :staff, @staff.staff
[12:38:42] rvanlieshout: just the plain fields_for :staff
[12:38:44] bitsapien: thanks though :)
[12:38:53] Hazim: same, doesn't render fields_for :staff
[12:39:12] rvanlieshout: and line above that
[12:39:16] rvanlieshout: = debug f.object.staff
[12:39:24] rgrmatt: has joined #RubyOnRails
[12:39:26] rvanlieshout: <%= debug f.object.staff %>
[12:39:32] Hazim: ok i'll try that
[12:39:40] chrislotix: How does setting cron task to check for db entries every minute impact apps performance? Is it significant?
[12:39:42] jgt2: has joined #RubyOnRails
[12:39:56] rvanlieshout: chrislotix: what if that task takes > 1 minute?
[12:40:00] rvanlieshout: then all goes down...
[12:40:21] kitsuneyo: has joined #RubyOnRails
[12:41:16] Hazim: rvanlieshout, it shows the same values in create --- !ruby/object:Staff
[12:41:17] Hazim: attributes:
[12:41:17] Hazim: username: kk
[12:41:17] chrislotix: rvanlieshout: Can you elaborate? Wouldn't it just redo the task in the next minute?
[12:41:17] Hazim: workid: kk
[12:41:19] Hazim: access_level: 0
[12:41:21] Hazim: status: 1
[12:41:23] Hazim: jawatan: kk
[12:41:28] Hazim: department_id: 1
[12:41:30] Hazim: created_at:
[12:41:32] Hazim: updated_at:
[12:41:32] mwlang: has joined #RubyOnRails
[12:41:34] Hazim: staffpic:
[12:41:36] Hazim: subscribem_users_id:
[12:41:49] Hazim: does the user_id need to have value of the parent object?
[12:42:56] rvanlieshout: hazim: the fact that it's present should be enough for the fields_for to render
[12:43:13] rvanlieshout: hazim: cand within that fields for
[12:43:18] rvanlieshout: = debug ff.object
[12:43:54] ritic: has joined #RubyOnRails
[12:44:14] bitkiller: has joined #RubyOnRails
[12:44:40] MartinElvar: has joined #RubyOnRails
[12:45:02] bruno-: has joined #RubyOnRails
[12:45:58] artto: has joined #RubyOnRails
[12:47:10] Hazim: rvanlieshout, you mean put debug within fields_for? it doesn't enter there
[12:47:56] MartinElvar: has joined #RubyOnRails
[12:48:08] rvanlieshout: hazim: could you gist your form again?
[12:48:24] Pazician: has joined #RubyOnRails
[12:49:22] koprom: has joined #RubyOnRails
[12:49:51] Hazim: rvanlieshout, ok sure, just updated _form.html.haml
[12:50:06] Hazim: https://gist.github.com/hazim78/6f0791039d212df4ebb0
[12:50:19] rvanlieshout: and your staff model?
[12:50:23] joshua75: has anyone ever heard of one month rails?
[12:50:32] rvanlieshout: does it have accepts_nested_attributes_for thign?
[12:50:45] SeanLazer: has joined #RubyOnRails
[12:52:27] Hazim: staff model https://gist.github.com/hazim78/6f0791039d212df4ebb0#file-staff-rb
[12:52:45] Hazim: user has accepts_nested_attributes
[12:52:46] rvanlieshout: ah.. staff doesn't have a .staff
[12:52:53] MartinEl_: has joined #RubyOnRails
[12:53:03] Hazim: but staff doesn't have belonts_to?
[12:53:07] rvanlieshout: @staff is a user
[12:53:08] n1lo: has joined #RubyOnRails
[12:53:10] rvanlieshout: then call it @user
[12:53:26] Hazim: not following you
[12:53:27] rvanlieshout: there is so much wrong with this all :)
[12:53:31] rvanlieshout: account = Subscribem::Account.find_by!(subdomain: request.subdomain)
[12:53:32] rvanlieshout: @staff = account.users.create(staff_params)
[12:53:42] rvanlieshout: add the user model
[12:53:49] rvanlieshout: and think about rewriting this all using normal names
[12:53:56] rvanlieshout: that refer to what they actually are
[12:54:08] Hazim: sorry :) embarrassed
[12:54:10] mwlang: has joined #RubyOnRails
[12:54:33] Hazim: add user model where?
[12:54:35] Hazim: in staff?
[12:54:41] ChuckieBGoode: has joined #RubyOnRails
[12:54:44] rvanlieshout: @staff != Staff
[12:54:48] rvanlieshout: @staff = User
[12:55:12] Hazim: ok i know what you mean now
[12:55:13] rvanlieshout: also submitting a user to staff_url or staff_path is
[12:55:28] Hazim: but i did that before
[12:55:29] njero: has joined #RubyOnRails
[12:55:44] Hazim: @user = Subscribem::User
[12:55:50] rvanlieshout: anything is possible
[12:55:54] rvanlieshout: but that's just wrong
[12:55:56] Hazim: @staff = @user.build_staff
[12:56:00] rvanlieshout: and too much work for me to dive in
[12:56:00] dionysus69: has joined #RubyOnRails
[12:56:12] rvanlieshout: @staff is a user object in your create action
[12:56:16] rvanlieshout: i hope it's the same on your new action
[12:57:57] treehug88: has joined #RubyOnRails
[12:58:25] koprom: has left #RubyOnRails: ()
[12:58:39] pawnbox: has joined #RubyOnRails
[13:02:01] pawnbox: has joined #RubyOnRails
[13:02:29] jkamenik: has joined #RubyOnRails
[13:03:41] mag42c: has joined #RubyOnRails
[13:04:34] acti0nman: has joined #RubyOnRails
[13:05:19] roxtrongo: has joined #RubyOnRails
[13:05:37] rshetty: has joined #RubyOnRails
[13:05:54] Hazim: changed naming conventions
[13:06:26] Hazim: what does :staff in fields_for :staff refer to actually?
[13:06:36] MartinElvar: has joined #RubyOnRails
[13:06:37] Hazim: is the staff model?
[13:06:40] josh: has joined #RubyOnRails
[13:06:57] rvanlieshout: to your form object .staff
[13:07:04] Guest95814: I have a question
[13:07:06] rvanlieshout: so your form object (that user) should accepts_nested_attirubtes for
[13:07:07] ElFerna: has joined #RubyOnRails
[13:07:33] Hazim: you mean in user.rb accepts_nested_attributes_for :staff
[13:07:49] Hazim: but it does have it
[13:08:24] Hazim: and @user.staff has value before the field_for
[13:08:42] rvanlieshout: and the user has the accepts_nested_attributes_for ?
[13:08:47] rvanlieshout: that Subscribem::User
[13:11:38] Hazim: https://gist.github.com/hazim78/6f0791039d212df4ebb0#file-user-rb
[13:11:51] railsrunner: has joined #RubyOnRails
[13:12:04] pawnbox: has joined #RubyOnRails
[13:12:38] rvanlieshout: hazim: and what if we try fields_for :staff, f.object.staff again?
[13:13:10] Hazim: Subscribem::User is in an engine
[13:13:22] Hazim: ok I'll try that again
[13:13:47] ramortegui: has joined #RubyOnRails
[13:13:54] pawnbox: has joined #RubyOnRails
[13:14:10] pawnbox: has joined #RubyOnRails
[13:15:16] Hazim: it still won't render
[13:15:26] Hazim: but f.object.staff has value
[13:15:39] Hazim: how do I refer a model in the main_app from the engine?
[13:15:59] Hazim: has_one :staff, :dependent => :destroy
[13:16:18] roxtrongo: has joined #RubyOnRails
[13:16:27] Hazim: should I write has_one :staff, class_name:"main_app::staff", :dependent => :destroy
[13:16:33] annlewis: has joined #RubyOnRails
[13:16:45] rvanlieshout: i'm not that familiar with references in engines
[13:16:50] rvanlieshout: but the .staff is set
[13:16:56] Hazim: yep it is
[13:16:58] rvanlieshout: is it set to a staff object?
[13:17:11] Hazim: how would i check?
[13:17:23] rvanlieshout: = debug f.object.staff.class
[13:18:05] Hazim: this is the output --- !ruby/class 'Staff'
[13:18:15] rvanlieshout: so the object is righ
[13:18:33] rvanlieshout: strange.. you might want to dive in the source for fields_for and trace it step by stap to find out where it can't find a thing
[13:18:51] Hazim: ok, i'll try that
[13:19:15] Hazim: sorry forgot that i'm a newbie, can you give me pointers on how to do that
[13:19:40] rvanlieshout: = debug f.method(:fields_for).source_location
[13:19:49] rvanlieshout: and edit that file to add debug things in it
[13:20:00] Hazim: before the fields_for line?
[13:20:26] koos303: has joined #RubyOnRails
[13:20:41] rvanlieshout: yeah. to find out where it's defined
[13:21:40] Hazim: ok thanks rvanlieshout, really appreciate this
[13:22:40] Guest39: has joined #RubyOnRails
[13:22:57] sankaber: has joined #RubyOnRails
[13:24:18] Palsson: has joined #RubyOnRails
[13:24:31] koprom: has joined #RubyOnRails
[13:26:31] pawnbox: has joined #RubyOnRails
[13:26:33] RegulationD: has joined #RubyOnRails
[13:29:18] darrencauthon: has joined #RubyOnRails
[13:29:24] youngbaks: has joined #RubyOnRails
[13:31:19] roxtrongo: has joined #RubyOnRails
[13:33:37] darutoko: has joined #RubyOnRails
[13:33:50] alaing: has joined #RubyOnRails
[13:34:38] pawnbox: has joined #RubyOnRails
[13:35:20] Fire-Dragon-DoL: has joined #RubyOnRails
[13:35:53] Hazim: rvanlieshout,
[13:35:57] Hazim: i found it
[13:36:13] losvedir: has joined #RubyOnRails
[13:36:25] sifi: has joined #RubyOnRails
[13:37:04] sifi: If I use `schema_format = :sql` do I need to keep my `db/schema.rb` file around?
[13:37:15] sevenseacat: sifi: you'll have a structure.sql instead.
[13:37:39] sifi: sevenseacat: I know that, but wasn't sure if I should remove `db/schema.rb` from the repo or just leave it around.
[13:37:50] sevenseacat: remove it. you want one or the other.
[13:39:33] nettoweb: has joined #RubyOnRails
[13:39:35] n1ck7: has joined #RubyOnRails
[13:39:42] pawnbox: has joined #RubyOnRails
[13:39:58] kitsuneyo: has joined #RubyOnRails
[13:41:31] MartinElvar: has joined #RubyOnRails
[13:44:27] annlewis: has joined #RubyOnRails
[13:45:20] blackmesa: has joined #RubyOnRails
[13:46:28] jerry_tao: has joined #RubyOnRails
[13:49:15] Hazim: rvanlieshout, i really want you to know what went wrong :)
[13:49:32] voker57: has joined #RubyOnRails
[13:49:58] mattc007: has joined #RubyOnRails
[13:51:34] umgrosscol: has joined #RubyOnRails
[13:54:41] siddart: has joined #RubyOnRails
[13:56:44] kyrul_fil_qaryah: has joined #RubyOnRails
[13:57:11] fletch`: has joined #RubyOnRails
[13:57:31] jgpawletko: has joined #RubyOnRails
[13:57:34] fletch`: has left #RubyOnRails: ()
[13:58:34] n1ck7: has joined #RubyOnRails
[13:58:48] krz: has joined #RubyOnRails
[13:59:20] Guest53: has joined #RubyOnRails
[13:59:28] dici: has joined #RubyOnRails
[14:03:42] sunya7a: has joined #RubyOnRails
[14:07:00] HalcyonicStorm: has joined #RubyOnRails
[14:07:31] MartinElvar: has joined #RubyOnRails
[14:08:02] sunya7a: has joined #RubyOnRails
[14:12:15] dopamean_: has joined #RubyOnRails
[14:12:31] leehambley: has joined #RubyOnRails
[14:12:32] pawnbox: has joined #RubyOnRails
[14:14:32] Guest53: has joined #RubyOnRails
[14:15:09] ElFerna: has joined #RubyOnRails
[14:15:32] jondkinney_: has joined #RubyOnRails
[14:15:54] jondkinney_: has left #RubyOnRails: ()
[14:16:45] blackmesa: has joined #RubyOnRails
[14:16:51] ja: There's no way to ???add fields??? to subclasses in single-table inheritance, right? (Is that what's called multi-table inheritance?)
[14:16:57] lele: has joined #RubyOnRails
[14:17:22] rvanlieshout: STI is a wrong approach in 99% of the cases i see here
[14:17:57] pwnd_nsfw: There's alternatives where you should just avoid STI
[14:18:34] ritic: has joined #RubyOnRails
[14:18:36] ja: hrmmm ???
[14:18:48] sharkman: i need to make a form. there is a pulldown menu where a person selects an article from my table of articles. after that is selected, a new form should be populated on the same page where i can edit article.date, article.headline, article.content
[14:18:49] ja: yeah, it can be solved by using polymorphism and cleverly-named models, I suppose?
[14:19:08] sharkman: is that possible? any advise on what i want to look into for this?
[14:19:33] sunya7a: has joined #RubyOnRails
[14:19:35] ja: rvanlieshout: I don't think I've ever heard anyone actually recommend STI
[14:19:42] pwnd_nsfw: sharkman, yes
[14:19:44] ja: Why does it even exist?
[14:19:57] rvanlieshout: ja: because anything exists?
[14:20:02] n1ck7: has joined #RubyOnRails
[14:20:12] pwnd_nsfw: sharkman, probably using javascript to make all of that happen
[14:20:37] sharkman: one way i am thinking to do it is after a person selects from the drop down menu, it could enter that article into a "SelectedArticle" table, then the page an refresh and build the form based on whatever is in the selectdArticle table
[14:20:46] amortimer: has joined #RubyOnRails
[14:20:47] ja: haha, touch??, rvanlieshout
[14:21:04] rvanlieshout: sharkman: why not make it a two step thing? select, submit and render form
[14:21:05] pwnd_nsfw: that's a bit rough sharkman
[14:21:14] pwnd_nsfw: Maybe store in session
[14:21:30] rvanlieshout: sessions are evil
[14:21:33] sharkman: rvanlieshout, a two step thing, like how i just described? or do you mean something different?
[14:21:54] sharkman: two step like, 1 select article, refresh page, 2 edit article selected
[14:22:02] rvanlieshout: sharkman: just a list of articles with a link to the edit page
[14:22:12] dhjondoh: has joined #RubyOnRails
[14:22:14] sharkman: ah yes i see
[14:22:21] ja: pwnd_nsfw: What would you suggest I use instead of STI? Just polymorphism?
[14:22:35] sharkman: so that is similar but your idea is similar, cause it wouldnt require the selected article table. i would just pass the selected article in params
[14:22:35] rvanlieshout: ja: it depends on why you're using STI in the first place
[14:22:39] pwnd_nsfw: Well, exactly what are you doing ja?
[14:22:43] chills42: has joined #RubyOnRails
[14:22:46] pawnbox: has joined #RubyOnRails
[14:22:48] amortimer: With Active Jobs, you set up a Job with a #perform(*args) instance method, but then you enqueue that Job by calling it like a class method DoWorkJob.perform_later(args). How does that even work?
[14:23:06] tetraktys: has joined #RubyOnRails
[14:23:08] rvanlieshout: amortimer: DoWorkJob.method(:perform_later).source_location
[14:23:31] ja: rvanlieshout: I want Order to have many Subscriptions which could be either TelephonySubscriptions, InternetSubscriptions, or HostingSubscriptions. All three subclasses need special fields.
[14:23:54] rvanlieshout: ja: then just a plain polymorphic assocation would do fine i guess
[14:23:58] ja: But there are also share??? Wait??? I'm forgetting concerns exist
[14:24:20] Aswebb_: has joined #RubyOnRails
[14:24:27] ja: rvanlieshout: Polymorphic association + a concern for the fields which need to be in all three models, I suppose?
[14:24:34] Guest53: has joined #RubyOnRails
[14:24:41] ja: But then I need to duplicate those fields to three tables instead of just having them in one `subscriptions` table :<
[14:24:46] rvanlieshout: if they have some logic fr it
[14:24:51] rvanlieshout: and what's wrong with duplicating those fields?
[14:24:56] rvanlieshout: do you even know whta impact that has on your db?
[14:25:00] ruurd: has joined #RubyOnRails
[14:25:05] arup_r: has joined #RubyOnRails
[14:25:07] ja: I just hate duplicaiton for irrational reasons
[14:25:22] rvanlieshout: so you use STI for everything that has a name attribute too?
[14:25:26] pwnd_nsfw: Can't be too anal about everything
[14:25:38] ja: haha, you're just full of nice comebacks, rvanlieshout
[14:25:39] amortimer: Thank you rvanlieshout, working on groking that.
[14:25:44] ja: chuck full!
[14:25:45] qejk: has joined #RubyOnRails
[14:25:47] pwnd_nsfw: MY CODE IS DRY-ER THAN A DESERT
[14:26:23] ja: lol, yes, that's me
[14:26:29] ja: to a fault
[14:26:55] The_Phoenix: has joined #RubyOnRails
[14:27:29] jobewan: has joined #RubyOnRails
[14:27:46] RegulationD: has joined #RubyOnRails
[14:27:52] pawnbox: has joined #RubyOnRails
[14:29:03] axl_: has joined #RubyOnRails
[14:29:09] The_Phoenix: has joined #RubyOnRails
[14:29:17] chrislotix: What kind of sensitive data should i avoid pushing to github besides db files?
[14:29:57] matthewd: chrislotix: API keys, secrets.yml
[14:30:14] ja: thanks, pwnd_nsfw and rvanlieshout
[14:30:22] sharkman: pwnd_nsfw lol your DRY comment
[14:30:28] roxtrongo: has joined #RubyOnRails
[14:31:22] smathy: has joined #RubyOnRails
[14:31:50] ja: rvanlieshout: come to think of it, it should have virtually zero overhead on my database, seeing it's structure, not data, that I'm duplicating duplicating, right?
[14:32:14] ja: haha, oh ffs, this lagging train connection made me duplicate the word ???duplicate???
[14:32:22] chrislotix: matthewd: thank you, i was unaware of secrets.yml
[14:32:43] Fire-Dragon-DoL: has joined #RubyOnRails
[14:32:50] ja: (thank god for mosh, but jeez, this is laggy)
[14:34:32] njero: has joined #RubyOnRails
[14:34:40] corioliss: has joined #RubyOnRails
[14:35:03] rshetty: has joined #RubyOnRails
[14:35:50] teclator: has joined #RubyOnRails
[14:35:53] startupality: has joined #RubyOnRails
[14:36:04] dvdchr: has joined #RubyOnRails
[14:38:05] Guest53: has joined #RubyOnRails
[14:40:53] rgrmatt: has joined #RubyOnRails
[14:41:48] mag42c: has anyone ever dealt with asset pipline ripping out your js function? In my file I have a function, but when rails serves it up, and I look at the file in view page source, the file contains (function() {
[14:41:49] mag42c: }).call(this);
[14:42:13] mag42c: I???m at a complete loss
[14:42:35] lxsameer: has joined #RubyOnRails
[14:45:33] polishdub: has joined #RubyOnRails
[14:47:46] skinux: has joined #RubyOnRails
[14:48:03] northfurr: has joined #RubyOnRails
[14:48:11] skinux: Anyone happen to use Ubuntu and can help me? I'm not getting an answer in #ubuntu
[14:48:42] skinux: Trying to install jquery-rails and getting this https://gist.github.com/skinuxgeek/5584fee6eb5b08d9a47
[14:48:45] mikecmpbll: mag42c: gist the original source?
[14:48:48] djbkd: has joined #RubyOnRails
[14:49:50] arthurix: has joined #RubyOnRails
[14:50:04] skinux: skinuxgeek/5584fee6eb5fb08d9a47
[14:50:54] EminenceHC: has joined #RubyOnRails
[14:51:06] reckoner: has joined #RubyOnRails
[14:51:53] tbuehlmann: skinux, this should do the trick: sudo apt-get install zlib1g-dev
[14:51:54] reckoner: if i break of a large monolith into smaller applications. are mini apps e.g. - not engines
[14:52:08] mag42c: mikecmpbll: what would you like to see in the gist?
[14:52:23] mikecmpbll: mag42c: your javascript file before precompilation
[14:52:35] northfurr: anyone use solarized light theme for their terminal?
[14:52:41] tbuehlmann: skinux, oh, and libxslt-dev libxml2-dev
[14:52:43] reckoner: for example rails_root/ --> core/ api/ cms/ ...etc
[14:53:11] mikecmpbll: presumably there aren't any errors during compilation? how're you viewing the javascript that's been served?
[14:53:55] mikecmpbll: reckoner: what's the question?
[14:54:37] mag42c: mikecmpbll: https://gist.github.com/michaelginalick/c4d7cdfafa49af283a11
[14:54:47] reckoner: mikecmpbll breaking up a large application into components like core/ api/ cms/
[14:54:51] reckoner: e.g- mini applications
[14:54:57] mikecmpbll: i don't see a question mark
[14:55:23] mikecmpbll: still don't know what the question is
[14:55:38] reckoner: anyone else?
[14:55:43] reckoner: there's a question mark for you.
[14:56:19] mikecmpbll: i asked what's the question, and you replied with a statement which doesn't remotely resemble a question
[14:56:48] reckoner: that's because in english, it's normal to reply with a statement. not answer with a question
[14:57:03] reckoner: let me put a period on that.
[14:57:04] mikecmpbll: unless the question is what's the question?
[14:57:05] TPBallbag: has joined #RubyOnRails
[14:57:38] lindii_: has joined #RubyOnRails
[14:57:40] jahbrewski: has joined #RubyOnRails
[14:58:02] reckoner: can anyone tell me if breaking up a large application into smaller apps like - core/, api/, backend/, frontend/ is a good idea?
[14:58:20] reckoner: an appilcation i'm working on now is out of control.
[14:58:49] mikecmpbll: breaking a monolithic app into multiple applications is often referred to as service oriented architecture
[14:58:57] mikecmpbll: monolithic vs SOA is a point of contention for web devs ;)
[14:59:39] mikecmpbll: both have their pros and cons, too much to delve in to in an IRC discussion, but much has been written/spoken on the subject.
[15:00:01] Fire-Dra_: has joined #RubyOnRails
[15:00:12] reckoner: has left #RubyOnRails: ()
[15:01:17] i: has joined #RubyOnRails
[15:02:07] banister: has joined #RubyOnRails
[15:06:48] Sigfrid: has joined #RubyOnRails
[15:07:38] rickmasta: has joined #RubyOnRails
[15:07:46] mary5030: has joined #RubyOnRails
[15:08:39] pawnbox: has joined #RubyOnRails
[15:09:34] mary5030: has joined #RubyOnRails
[15:10:28] mary5030: has joined #RubyOnRails
[15:12:07] ruurd: has joined #RubyOnRails
[15:12:08] erich: has joined #RubyOnRails
[15:12:16] Rinzlit1: has joined #RubyOnRails
[15:13:21] bronson: has joined #RubyOnRails
[15:13:22] EminenceHC: has joined #RubyOnRails
[15:14:05] Fire-Dragon-DoL: has joined #RubyOnRails
[15:14:22] bruno-: has joined #RubyOnRails
[15:15:07] symbol: has joined #RubyOnRails
[15:16:51] pawnbox: has joined #RubyOnRails
[15:16:56] ritic: has joined #RubyOnRails
[15:17:06] skinux: How can I fix this? Could not find gem 'Passenger (>= 0) x64-mingw32' in any of the gem sources listed in your Gemfile or available on this machine.
[15:17:10] ritic: has joined #RubyOnRails
[15:18:10] kies^: has joined #RubyOnRails
[15:20:29] Maletor: has joined #RubyOnRails
[15:20:41] mikecmpbll: skinux: i don't think passenger will run on windows.
[15:20:42] brendan-: has joined #RubyOnRails
[15:21:34] disgrntld: has joined #RubyOnRails
[15:22:32] dikaio: has joined #RubyOnRails
[15:22:52] sharkman: how do i pre-enter text into a f.text_field
[15:22:52] RegulationD: has joined #RubyOnRails
[15:22:55] jgt2: has joined #RubyOnRails
[15:23:02] HayesHimself: has joined #RubyOnRails
[15:24:00] arup_r: sharkman: Use value: 'text'
[15:24:02] naftilos76: has joined #RubyOnRails
[15:24:12] arup_r: to have a preloaded text in the text filed
[15:24:24] mikecmpbll: or set the values on the object.
[15:24:42] arup_r: yes. when building the object
[15:24:49] arup_r: set the value as mikecmpbll said
[15:25:00] arup_r: then you don't need to use value: "text" thing
[15:25:09] moty66: has joined #RubyOnRails
[15:26:18] sharkman: like this, <%= f.text_field(:url, size: 10, value: "one") %> ?
[15:27:19] arup_r: yes, or as the mikecmpbll said
[15:27:41] sharkman: i must be doing something wrong causee that doesnt change it for me
[15:28:01] arup_r: sharkman: U don't need `(.. )` We don't use Ruby if REALLY not needed :D
[15:28:03] pawnbox: has joined #RubyOnRails
[15:28:36] sharkman: sorry i dont understand arup_r?
[15:28:42] Macaveli: has joined #RubyOnRails
[15:28:49] skinux: Okay, so, can Apache be setup to work with RoR without Passenger?
[15:29:06] mikecmpbll: skinux: if you use another application server, sure
[15:29:07] arup_r: ok. puts("welcome") can be written as puts "welcome"
[15:29:19] mikecmpbll: skinux: apache doesn't know how to talk to a Rack application
[15:29:40] towski_: has joined #RubyOnRails
[15:30:07] sharkman: ohhh i see arup_r
[15:30:22] arup_r: sharkman: But that is not related to your issue, it is just Ruby thing,
[15:30:46] skinux: mikecmpbll: What options are there other than Passenger?
[15:31:03] allcentury: has joined #RubyOnRails
[15:31:43] mikecmpbll: webrick, thin, unicorn, puma
[15:31:51] naftilos76: hi, i am trying to validate the format of domain names before they are stored in the db but it is not working. Here is the model validation line: validates_format_of :name, with: /\A[a-z0-9]\.[a-z0-9]\Z/, on: [:update, :save]
[15:31:59] naftilos76: Do you see any errors?
[15:32:41] naftilos76: I just want to avoid the non-existance of the dot
[15:32:41] mwlang: Is there a way to limit the tables database_cleaner operates on? I???ve started a new Rails 4.x project and the database schema has about 300+ tables???so the specs are already sloooooooooww.
[15:33:06] arup_r: sharkman: If you want, checkout the Ruby style guide when get some time..
[15:33:10] skinux: I've heard of Webrick, didn't know it was a web server type app though.
[15:33:15] mikecmpbll: naftilos76: presumably you want to permit more than one character before and after the dot
[15:33:44] arup_r: mwlang: new project.. good :D
[15:33:56] naftilos76: mikecmpbll, i need at least one dot
[15:34:02] arup_r: sharkman: is your problem resolved now ?
[15:34:22] mwlang: arup_r: it???s a rewrite of a Rails 1.2 project. :-D
[15:34:34] mwlang: but at least its a rewrite!
[15:34:40] sharkman: no. i see the html that rails is generating is now <input ... value="one">, however in my browser i do not see the text "one"
[15:34:41] arup_r: ah.. then it is a huge work for yo
[15:35:19] arup_r: sharkman: :(
[15:35:39] mikecmpbll: naftilos76: depends on the exact semantics that you're after, but you can ensure at least one dot, with at least one character either side, like: /\A.+\..+\z/
[15:35:54] mwlang: arup_r: yeah. 59 models down, another 240ish to go???
[15:35:55] mikecmpbll: that will obviously permit invalid domain names too.
[15:36:08] jahbrewski: has joined #RubyOnRails
[15:36:27] mwlang: and it would go a heckuva lot faster if database cleaner could be made to operate only on a limited subset of tables.
[15:36:44] arup_r: mwlang: congratulation.. I like your TDD approach. But :(
[15:36:59] mikecmpbll: mwlang: afaik database_cleaner records which tables have had insertions
[15:37:01] mikecmpbll: and only cleans those
[15:37:12] tbuehlmann: mwlang, have you considered using database_rewinder?
[15:37:15] darrenca_: has joined #RubyOnRails
[15:37:17] mikecmpbll: that's how database_rewinder works anyway and that's based on database_cleaner
[15:37:21] Cache_Money: has joined #RubyOnRails
[15:37:35] mwlang: tbuehlmann: first I???ve heard of???
[15:37:45] mices: i need to write a form that changes when a user changes the country is that gonna be an ajax thing
[15:37:47] Cervajz_: has joined #RubyOnRails
[15:37:56] tbuehlmann: mikecmpbll, are you sure it's _based_ on database_cleaner?
[15:38:09] mikecmpbll: i thought it was anyway. the API is the same :)
[15:38:20] mikecmpbll: maybe i assumed too much.
[15:38:20] arup_r: sharkman: Let me know where you are..
[15:38:46] ritic: has joined #RubyOnRails
[15:38:50] sharkman: http://ashmanreport.com/admin
[15:39:17] xtagon: has joined #RubyOnRails
[15:39:22] sharkman: that is my page, if you look at source, and control-f for "one" you will see the text field has the value set, but not showing the text on the form
[15:39:48] brendan-: has joined #RubyOnRails
[15:40:20] rshetty: has joined #RubyOnRails
[15:40:20] arup_r: sharkman: You are trying to put the text in the url field of the "Add New Article" section
[15:41:00] sharkman: the idea is in the "Edit Article" section. first a person will choose an article. then the edit article form will populate itself with the data already stored for a given article
[15:41:23] kerunaru: has joined #RubyOnRails
[15:41:44] arup_r: because in "Edit Article" section i see a value
[15:42:09] arup_r: and the value is asdfone in the url field
[15:42:11] sharkman: you do see a value on your browser?
[15:42:17] sharkman: weird, my browser doesnt show it
[15:42:37] Cervajz: has joined #RubyOnRails
[15:42:57] arup_r: yes, i see in the edit section
[15:43:06] arup_r: try then other browser.. to confirm
[15:43:07] l_tonz: has joined #RubyOnRails
[15:43:13] tubbo: definitely doesn't do that for me :)
[15:43:26] sharkman: i will investigate more
[15:43:38] tubbo: sharkman: what i mean is that when i do what you tell me, i don't get the expected result.
[15:43:58] tubbo: i selected 'hacking: Hacked.', then clicked the 'lol' button, and it just refreshed the page
[15:45:00] ivanskie: has joined #RubyOnRails
[15:45:07] willardg: has joined #RubyOnRails
[15:45:11] woods: has joined #RubyOnRails
[15:45:17] sharkman: oh thanks tubbo. did that for me too.
[15:45:43] woods: has left #RubyOnRails: ()
[15:45:55] pawnbox: has joined #RubyOnRails
[15:45:57] mwlang: ok, database_rewinder definitely faster.
[15:46:01] krz: has joined #RubyOnRails
[15:47:00] Guest53: has joined #RubyOnRails
[15:47:24] ivanskie: has joined #RubyOnRails
[15:47:36] mices: i have two forms us and international sign-up, the default is us and in the country drop down list if someone changes the country to another country then the form for international has to be loaded ... i wanna use select_tag :onchange => i was looking for the code but all the examples i see are how to call a javascript function from onchange i just wanna load the other form
[15:47:53] jessemcgilallen: has joined #RubyOnRails
[15:48:11] tlarevo: has joined #RubyOnRails
[15:51:22] wldcordeiro: has joined #RubyOnRails
[15:51:29] tubbo: mices: you don't want to use onchange, it's recommended now to bind an event handler to that form in javascript that does what you want
[15:52:02] tubbo: mices: for example, in jQuery this could be $('#country-dropdown').on('change', function() { $('#us-form').hide(); $('#intl-form').show(); });
[15:54:22] eugene_k: has joined #RubyOnRails
[15:56:31] Motoservo: has joined #RubyOnRails
[15:57:38] Guest39: has joined #RubyOnRails
[15:57:46] Cervajz: has joined #RubyOnRails
[15:58:58] hansss: has joined #RubyOnRails
[15:59:11] ruurd: has joined #RubyOnRails
[16:00:23] Cervajz_: has joined #RubyOnRails
[16:02:30] troyready: has joined #RubyOnRails
[16:03:29] Ergo: has joined #RubyOnRails
[16:03:36] MartinElvar: has joined #RubyOnRails
[16:03:57] SeanLazer_: has joined #RubyOnRails
[16:04:16] brendan-: has joined #RubyOnRails
[16:04:20] pawnbox_: has joined #RubyOnRails
[16:04:58] pawnbox: has joined #RubyOnRails
[16:05:26] wldcordeiro: has joined #RubyOnRails
[16:06:56] MartinElvar: has joined #RubyOnRails
[16:07:18] bricker: has joined #RubyOnRails
[16:07:22] mrtomme: has joined #RubyOnRails
[16:07:33] blackmesa: has joined #RubyOnRails
[16:07:39] chills42: has joined #RubyOnRails
[16:07:51] arthurix_: has joined #RubyOnRails
[16:08:24] towski_: has joined #RubyOnRails
[16:08:28] lapide_viridi: has joined #RubyOnRails
[16:09:53] [Butch]: has joined #RubyOnRails
[16:11:53] cstyles: has joined #RubyOnRails
[16:12:29] kerunaru: has joined #RubyOnRails
[16:13:42] voker57: has joined #RubyOnRails
[16:15:00] dionysus69: has joined #RubyOnRails
[16:15:16] darrencauthon: has joined #RubyOnRails
[16:15:58] baweaver: has joined #RubyOnRails
[16:16:03] sarink: has joined #RubyOnRails
[16:17:44] Cervajz__: has joined #RubyOnRails
[16:18:33] testaccount: has joined #RubyOnRails
[16:18:43] Lytol: has joined #RubyOnRails
[16:18:52] testaccount: has left #RubyOnRails: ()
[16:19:01] Bloomer: has joined #RubyOnRails
[16:19:27] The_Phoenix: has joined #RubyOnRails
[16:19:28] willardg: has joined #RubyOnRails
[16:19:35] SteenJobs: has joined #RubyOnRails
[16:20:39] EminenceHC: has joined #RubyOnRails
[16:21:07] dionysus69: has joined #RubyOnRails
[16:21:17] arup_r: Bloomer: 0/
[16:21:34] Bloomer: arup_r: hi
[16:21:45] Bloomer: arup_r: seems like u always here
[16:22:01] mary5030: has joined #RubyOnRails
[16:22:12] Bloomer: thanks for told me this place
[16:22:18] Bloomer: really had fun so far
[16:22:20] sarink: whenever i try to start my rails console, i get an error that its missing minitest. bundle show minitest reports the correct path.... what gives?
[16:22:25] Bloomer: so many people here to help me
[16:22:35] Bloomer: and have been learn a lot here
[16:23:11] arup_r: Bloomer: Yes, only 631
[16:23:18] bruno-: has joined #RubyOnRails
[16:23:26] arup_r: we never reach beyond 1000
[16:23:37] Bloomer: what is that mean?
[16:23:39] arup_r: people logged in
[16:23:46] arup_r: average 500 always will be here
[16:23:47] roxtrongo: has joined #RubyOnRails
[16:23:54] Bloomer: i think that is kind a lot already
[16:25:10] chipotle: has joined #RubyOnRails
[16:27:12] ruurd: has joined #RubyOnRails
[16:32:22] tubbo: is there really 500 people here?
[16:32:46] tubbo: wow there's over 600, didn't even realize that
[16:34:14] nertzy: has joined #RubyOnRails
[16:34:28] weckl: lotta players here :)
[16:35:40] EminenceHC: has joined #RubyOnRails
[16:35:44] based_pdev: has joined #RubyOnRails
[16:35:45] ivanskie: has joined #RubyOnRails
[16:36:34] sarink: anyone have any ideas on why my bundler is posessed?
[16:36:37] beauby: has joined #RubyOnRails
[16:37:00] sarink: i've reinstalled bundler, i've deleted gemfile.lock and reinstalled all the gems, i'm not sure what else to try
[16:37:36] bricker: sarink: google the error, I've had the same problem before and so did a lot of other people. It was some discrepency in Ruby 2 and Rails or Rspec or something
[16:37:57] ritic: has joined #RubyOnRails
[16:38:52] arthurix: has joined #RubyOnRails
[16:39:14] sarink: bricker: the googles just tell me to update bundler itself, which i've done
[16:39:46] bricker: sarink: can you gist the error please, and your Gemfile
[16:40:06] shinnya: has joined #RubyOnRails
[16:41:08] Macaveli: has joined #RubyOnRails
[16:42:36] Butch128: has joined #RubyOnRails
[16:42:41] Butch128: 'm writing rspec controller tests right now. When I pass: request.headers[:HTTP_ACCEPT_LANGUAGE] = :fr ... once... its stuck like that for all remaining tests... always in french... even when i set HTTP_ACCEPT_LANGUAGE to something else
[16:42:44] Fuzzybot_: has joined #RubyOnRails
[16:43:24] smathy: has joined #RubyOnRails
[16:43:55] rshetty: has joined #RubyOnRails
[16:43:56] baweaver: has joined #RubyOnRails
[16:44:09] Maletor: has joined #RubyOnRails
[16:45:37] bruno-: has joined #RubyOnRails
[16:46:13] tlarevo: has joined #RubyOnRails
[16:48:41] marr: has joined #RubyOnRails
[16:49:32] arup_r: tubbo: We are growing.. yeah
[16:49:38] aaronr: has joined #RubyOnRails
[16:49:50] roxtrongo: has joined #RubyOnRails
[16:52:32] AnomalousBit: has joined #RubyOnRails
[16:53:01] marr: has joined #RubyOnRails
[16:54:16] maxz: has joined #RubyOnRails
[16:55:23] lacuna: has joined #RubyOnRails
[16:55:36] arthurix: has joined #RubyOnRails
[16:56:10] willardg: has joined #RubyOnRails
[16:57:20] lacrymology: has joined #RubyOnRails
[16:58:46] chipotle: has joined #RubyOnRails
[16:59:17] sarink: bricker: https://gist.github.com/sarink/ecc4903dde8a97ccb4d0
[16:59:19] skinux: has joined #RubyOnRails
[16:59:50] ibouvousaime_: has joined #RubyOnRails
[17:00:37] ibouvousaime_: has joined #RubyOnRails
[17:01:49] safety_cut: has joined #RubyOnRails
[17:05:22] arup_r: Will it be good to put inside the application.rb ? ( config.action_mailer.preview_path = "#{Rails.root}/lib/mailer_previews"
[17:05:28] arup_r: http://api.rubyonrails.org/v4.1.0/classes/ActionMailer/Base.html#class-ActionMailer::Base-label-Previewing+emails
[17:05:28] Scriptonaut_: has joined #RubyOnRails
[17:05:32] bruno-_: has joined #RubyOnRails
[17:05:49] The_Phoenix: has joined #RubyOnRails
[17:06:13] polishdub: has joined #RubyOnRails
[17:06:45] kp666: has joined #RubyOnRails
[17:06:49] _djbkd: has joined #RubyOnRails
[17:06:49] workmad3: arup_r: anything wrong with the default of `test/mailers/previews`?
[17:07:04] workmad3: arup_r: or maybe changing it to `spec/mailers/previews` if you're using rspec ;)
[17:07:17] arBmind: has joined #RubyOnRails
[17:07:52] arup_r: No, actually I want to show a preview of my emails inside some editors
[17:08:00] arup_r: to do so this class will be best idea
[17:08:08] arup_r: because it gives a message object
[17:08:14] arup_r: and I will call message.body
[17:08:21] arup_r: and I will show it there
[17:08:24] northfurr: has joined #RubyOnRails
[17:08:48] arup_r: That is why I am trying to keep it in a good place. My goal is not for test
[17:09:25] Icey: has joined #RubyOnRails
[17:09:44] kitsuneyo: can i use string interpolation in yaml?
[17:09:50] rakm: has joined #RubyOnRails
[17:10:01] kitsuneyo: say i wanted to insert current_user.username in a yaml string
[17:10:13] kitsuneyo: is it like %{} ?
[17:10:17] workmad3: arup_r: you probably don't need to worry about the `preview_path` then... that appears to be relevant for giving rails a place to know about them for the `rails/mailers` path
[17:11:28] kitsuneyo: there's no way to use erb, is there?
[17:11:42] bricker: has joined #RubyOnRails
[17:12:09] arup_r: workmad3: you mean the default path is ok
[17:12:51] arup_r: Can I call like NotifierPreview.welcome inside my controller without changing the path ?
[17:13:01] Guest39: has joined #RubyOnRails
[17:13:14] arup_r: ** @body = NotifierPreview.welcome.body
[17:13:28] workmad3: arup_r: I'm saying you could create your own directory like `app/previewers` and put your previewers in there, and not worry about the preview_path
[17:13:29] arup_r: if the preview email is inside the test/*
[17:13:40] snurfery: has joined #RubyOnRails
[17:14:24] arup_r: I can put any directory inside the app/ without telling Rails. does Rails autload from app/ custom dirs also?
[17:14:33] tubbo: arup_r: yes
[17:14:34] arup_r: humm let me try it
[17:14:36] tubbo: i think it does
[17:14:53] baweaver: has joined #RubyOnRails
[17:14:55] arup_r: Once I tried it didn't I had to say it explicitly..
[17:14:56] tubbo: i mean, i have all my service classes in app/services and i reference them like Reviews::Client.new and OMS::Order.find, etc.
[17:15:36] workmad3: arup_r: it does... but you need to stop spring because spring sucks
[17:16:01] tubbo: workmad3: someone doesn't know about spring-watcher-listen :P
[17:16:02] nettoweb: guys, I have an app that visitors can create their company objetc but from different pages/contexts... in this case whats best to do? create an metrod just for create the user, apart from controller?
[17:16:05] arup_r: ok. Without seeting the preview path I think the url http://localhost:3000/rails/mailers wouldn't work
[17:16:10] towski_: has joined #RubyOnRails
[17:16:21] shinenelson: has joined #RubyOnRails
[17:16:24] arup_r: so need to tell config.action_mailer.preview_path = "#{Rails.root}/app/mailer_previews"
[17:16:31] nettoweb: because nowaday a repeat the code Company.new(params[company]) on many places and I want to organize this)
[17:16:34] nemo_: has joined #RubyOnRails
[17:16:53] workmad3: tubbo: I try to not know about spring at all... and if the out-the-box configuration of something in the default gemset fails in pretty trivial circumstances, I'm gonna just throw it out ;)
[17:17:05] nettoweb: sometimes I create a company from an modal, and ometimes with the complete information, and so on
[17:17:22] SeanLazer: has joined #RubyOnRails
[17:17:22] chipotle: has joined #RubyOnRails
[17:17:33] m712: has joined #RubyOnRails
[17:17:47] tubbo: arup_r: oh shit i didn't realize you were using mailer previews....yeah i do think you need to change that setting. i'm just talking about normal circumstances
[17:17:56] tubbo: if ActionMailer is providing a config setting it's probably being used *somewhere* :D
[17:18:05] arup_r: Hum I get you
[17:18:09] teclator_: has joined #RubyOnRails
[17:18:24] agit0: has joined #RubyOnRails
[17:18:26] workmad3: arup_r: from what you were saying, it didn't sound like you needed `rails/mailers` either
[17:18:28] arup_r: I am going to put it in the application.rb
[17:18:43] gingray: has joined #RubyOnRails
[17:18:44] tubbo: nettoweb: ideally, you only want one place where a Company can be changed.
[17:18:45] workmad3: arup_r: because you were interested in using the previewers elsewhere, not for testing purposes
[17:18:58] workmad3: arup_r: hence why I said you could probably ignore it
[17:19:00] tubbo: and/or created
[17:19:07] arup_r: workmad3: yes, but if my UX/UI designer see it, he will be happy
[17:19:37] arup_r: he can see the preview without trigerring emails..
[17:19:44] SeanLazer: has joined #RubyOnRails
[17:19:54] arup_r: That is why I am opening that path too
[17:20:04] nettoweb: tubbo usually I see pre-registration, and then ask for more details in other steps.. this make easier for some tasks
[17:20:51] nettoweb: for examplo, now Im creating a page for users create product, but I dont ask for login, only at final step I ask for login or creating a company for example.
[17:20:56] Butch128: has left #RubyOnRails: ()
[17:21:12] nemo_: has joined #RubyOnRails
[17:21:12] nettoweb: it seems normal for me, I see this startegy a lot on internet
[17:21:22] tubbo: workmad3: i *think* it's because the listen gem isn't supported on all platforms, so you need a different watcher if you want to use windows
[17:21:24] tubbo: or something
[17:23:04] RegulationD: has joined #RubyOnRails
[17:26:03] lacuna: has joined #RubyOnRails
[17:26:16] Junaos: has joined #RubyOnRails
[17:26:32] Klumben: has joined #RubyOnRails
[17:28:05] iateadonut: has joined #RubyOnRails
[17:28:42] Cervajz_: has joined #RubyOnRails
[17:28:58] SteenJobs: has joined #RubyOnRails
[17:29:32] Cervajz__: has joined #RubyOnRails
[17:31:03] axl__: has joined #RubyOnRails
[17:32:37] ChuckieBGoode: has left #RubyOnRails: ()
[17:32:53] cnk: has joined #RubyOnRails
[17:33:25] losvedir: has joined #RubyOnRails
[17:34:31] skinux: I've heard Ruby/Rails pushes for use of CoffeeScript. How true is this?
[17:34:34] s2013: has joined #RubyOnRails
[17:34:45] nettoweb: tubbo in this case, any suggestion?
[17:34:57] arup_r: anyway NotifierPreview.welcome wouldn't work.. :( I need to take another route. It is called by rails if you hit those urls.
[17:35:00] arup_r: not manually
[17:35:00] skinux: Does Ruby/Rails complain about use of JavaScript directly?
[17:35:05] matthewd: skinux: It's supported by default, but you can just choose not to use it
[17:35:08] arup_r: my all efforts lost
[17:35:48] skinux: I personally haven't found why CoffeeScript is better, especially since it's logic seems to me to be backwards.
[17:36:41] s2013: hello everyone.. for some reason if my record creation fails it renders the form correctly but with the default template.. https://gist.github.com/ss2k/fb0b7c01b13d0cda1abc
[17:37:00] s2013: probably missing something obvious
[17:37:05] losvedir: has joined #RubyOnRails
[17:37:17] hd1: has left #RubyOnRails: ()
[17:38:36] pawnbox: has joined #RubyOnRails
[17:41:05] naftilos76: Does this seem right for a format validation? validates_format_of :name, with: /\A.+\..+\z/, on: [:create, :update]
[17:41:45] naftilos76: I want to make sure the attribute 'name' has one dot
[17:42:06] naftilos76: and validate on creation and on updating
[17:42:31] naftilos76: i am using default rails routes
[17:43:07] naftilos76: for this case it is: resources :dns_zone_files
[17:44:13] naftilos76: So far it does not work
[17:44:43] tubbo: naftilos76: ensure it does using rubular.com
[17:44:52] tubbo: skinux: how so?
[17:45:01] tubbo: skinux: also, no...coffeescript is totally optional
[17:46:02] skinux: their examples...eat whatever for...instead of for whatever eat
[17:46:16] eugene_k: has left #RubyOnRails: ("Textual IRC Client: www.textualapp.com")
[17:46:17] smathy: naftilos76, \/./ will ensure a single dot is present somewhere.
[17:46:22] smathy: ...sorry /\./
[17:46:36] yogeshwar_: has joined #RubyOnRails
[17:46:43] naftilos76: smathy, rubular reports that the regex is fine
[17:47:24] smathy: naftilos76, yep, it's more than you need, but shouldn't break. Maybe explain more what "does not work" means.
[17:47:37] s2013: tubbo smathy any clue re: for some reason if my record creation fails it renders the form correctly but with the default template.. https://gist.github.com/ss2k/fb0b7c01b13d0cda1abc
[17:47:49] naftilos76: but i do not know why i can do @instance.save and get true instead of false when the attribute is 'test' instead of 'test.com'
[17:47:59] marr: has joined #RubyOnRails
[17:49:08] darrencauthon: has joined #RubyOnRails
[17:49:49] kerunaru: has joined #RubyOnRails
[17:50:19] smathy: s2013, when you say "default template" do you mean layout?
[17:50:26] s2013: yea soryr
[17:51:03] Guest39: has joined #RubyOnRails
[17:51:31] erich: has joined #RubyOnRails
[17:51:39] yardenbar: has joined #RubyOnRails
[17:51:44] pawnbox: has joined #RubyOnRails
[17:52:09] beauby: has joined #RubyOnRails
[17:52:09] m712: has joined #RubyOnRails
[17:52:24] tubbo: s2013: not sure where you are telling rails to not render the layout
[17:52:30] s2013: im not either
[17:52:35] s2013: so im confused as hell
[17:52:41] smathy: s2013, so when it fails it does `render 'complimentary'` - but it uses a default layout? Why would you expect it to use a different layout?
[17:52:56] sankaber: has joined #RubyOnRails
[17:53:17] s2013: so basically it will rerender the form with the errors like its supposed to. but it renders that form with the default layout of the site
[17:53:28] tubbo: i believe `render 'complimentary'` won't actually hit the `complimentary()`, it will just render the template 'complimentary'
[17:53:30] njero: has joined #RubyOnRails
[17:55:12] RegulationD: has joined #RubyOnRails
[17:55:30] podman: has joined #RubyOnRails
[17:56:30] rrror: has joined #RubyOnRails
[17:57:03] s2013: let me try something else
[17:57:21] smathy: s2013, ok, I got that bit. Why would you think it would do anything else?
[17:57:33] smathy: s2013, you're telling it: `render 'complimentary'`
[17:57:45] s2013: yeah which is the action right
[17:57:54] s2013: and since the action says to use the layout i figured it would do that
[17:59:05] s2013: anyways i solved it by moving everythign to a brand new controller
[18:00:36] pawnbox: has joined #RubyOnRails
[18:01:02] tubbo: s2013: you're welcome
[18:01:24] arBmind: has joined #RubyOnRails
[18:01:27] rrror: has left #RubyOnRails: ()
[18:01:34] ElFerna: has joined #RubyOnRails
[18:01:37] smathy: s2013, no, it's the view.
[18:02:03] smathy: You pass the name of a view to render, it's nothing to do with the action that happens to be named the same.
[18:02:15] tubbo: your solution sucks :P
[18:02:43] n008f4g_: has joined #RubyOnRails
[18:02:43] s2013: so what would the solution have been
[18:02:45] smathy: ...that's why you have to set @vars in update/create actions, so that if the render happens the ivars exist for the view.
[18:03:06] smathy: s2013, I've given you all the information you need.
[18:03:10] yogeshwar: has joined #RubyOnRails
[18:03:44] yogeshwar: hi , I am getting NoMethodError in a has_one association in rails , can some one please help ? http://www.fpaste.org/284521/14460545/
[18:04:16] tubbo: you just need to add the layout configuration to the `render` call in your other action
[18:04:18] tubbo: not complimentary
[18:04:27] tubbo: then it should use the correct layout
[18:04:30] smathy: tubbo, OMG, spoon feeder!!!~
[18:04:38] tubbo: not really
[18:05:23] tubbo: smathy: you just explained why his solution wouldn't work. you didn't explain how to make it work.
[18:05:32] tubbo: wouldn't/isn't
[18:05:58] beauby: has joined #RubyOnRails
[18:06:06] smathy: yogeshwar, !ask please read
[18:06:06] helpa: yogeshwar: How to ask good questions and get great answers: http://www.mikeash.com/getting_answers.html
[18:06:37] tubbo: yogeshwar: because `current_user.personal_information` hasn't been set yet, it will return `nil`, which means you can't run the build() method on it
[18:06:52] smathy: tubbo, exactly, that's the difference between giving the information for him to work it out himself, and spoon feeding him the answer.
[18:07:10] tubbo: smathy: disagreed.
[18:07:20] smathy: tubbo, noted.
[18:07:48] nertzy: has joined #RubyOnRails
[18:08:13] yogeshwar: tubbo : thanks for replying , how can I set that , can you please help ?
[18:08:24] yogeshwar: http://www.fpaste.org/284525/44605548/
[18:08:25] tubbo: yogeshwar: http://guides.rubyonrails.org/association_basics.html#the-belongs-to-association read that
[18:08:54] tubbo: it tells you the right way of building a belongs_to or has_one association. spoiler alert: it's not the same thing as a has_many
[18:09:02] s2013: tubbo i did that before as well.. but might have had issues.. i guess render action: 'complimentary', layout: 'new/interested' shoudl work
[18:09:14] s2013: either way i appreciate both of your help smathy tubbo
[18:09:22] tubbo: s2013: `render action:` i think will actually render the action :D
[18:09:44] tubbo: i've had the best luck just providing the view template name as `render 'complimentary'`...not sure why you want to add that `action: ` in there
[18:09:45] ModusPwnens: has joined #RubyOnRails
[18:10:00] tubbo: but judging from that piece of code, i would say your biggest problem is over-complicating relatively simple solutions
[18:10:08] tubbo: that code is way too explicit for what it's actually doing
[18:10:17] ModusPwnens: We have a service returning resources with slashes in the id, which is messing up all our routing. Is there some standard rails way of dealing with this?
[18:10:36] debajit: has joined #RubyOnRails
[18:10:46] tubbo: like all you're doing is saving a big JSON document as a bunch of records using nested attributes. rails does that already.
[18:10:51] pawnbox_: has joined #RubyOnRails
[18:11:01] mikecmpbll: has joined #RubyOnRails
[18:11:47] yogeshwar: tubbo : I've read that earlier also and what I got is that the model whose table contains foreign key should have belongs_to and other one has_one , which is what I have done.
[18:11:58] tubbo: yogeshwar: you didn't read the whole thing
[18:12:30] _djbkd: has joined #RubyOnRails
[18:12:32] tubbo: yogeshwar: you might have missed it, i can't link to it but here's the section:
[18:12:33] tubbo: "4.2 has_one Association Reference
[18:12:46] tubbo: cmd+F for that and you'll find what i'm talking about
[18:13:03] tubbo: and note that `association` in the code examples maps to whatever the has_one is
[18:13:37] andrewk: has joined #RubyOnRails
[18:14:01] towski_: has joined #RubyOnRails
[18:14:26] kitsuneyo: has joined #RubyOnRails
[18:15:03] safety_cut: has joined #RubyOnRails
[18:15:07] Y_Ichiro: has joined #RubyOnRails
[18:15:13] rhizome: ModusPwnens: it's not standard to have path separators in a parameter, so it depends on what you need to deal with.
[18:15:18] Guest53: has joined #RubyOnRails
[18:15:19] aarkerio: has joined #RubyOnRails
[18:15:36] Bloomer: has joined #RubyOnRails
[18:16:24] ahegyi: has joined #RubyOnRails
[18:16:57] baweaver: has joined #RubyOnRails
[18:18:08] ModusPwnens_: has joined #RubyOnRails
[18:18:10] ewilliam: hi all, how do you implement form_for magic for form_objects? here's my code: https://gist.github.com/ewilliam/a2e2e1328014669f811e
[18:18:35] manfrin: has joined #RubyOnRails
[18:19:37] ModusPwnens: has joined #RubyOnRails
[18:20:05] ModusPwnens: rhizome: We just need to be able to route to show actions properly. Right now the only thing we can think to do is just whitelist all characters in the path
[18:20:22] ModusPwnens: but that means that we won't be able to have any routes nested underneath that, which works for now but is less than ideal.
[18:20:37] dmarr: are there docs for the $.rails object?
[18:22:36] tubbo: dmarr: not really, there's http://guides.rubyonrails.org/working_with_javascript_in_rails.html which is JS documentation and i've just been using the wiki and reading source at https://github.com/rails/jquery-ujs for anything else i need to know
[18:22:51] roxtrongo: has joined #RubyOnRails
[18:23:12] Macaveli: has joined #RubyOnRails
[18:23:43] Aherin: has joined #RubyOnRails
[18:24:11] Macaveli: has joined #RubyOnRails
[18:25:05] ruurd: has joined #RubyOnRails
[18:25:45] yogeshwar: tubbo : I've changed current_user.personal_information.build to current_user.build_personal_information , but still same error . changed code : http://www.fpaste.org/284535/05658014/
[18:25:54] chills42: has joined #RubyOnRails
[18:26:31] EminenceHC: has joined #RubyOnRails
[18:27:12] tubbo: god that is the slowest paste site ever lo
[18:27:32] AnomalousBit: lol everyone on the channel just hit it at once
[18:27:46] tubbo: oh that's fedora pastebin
[18:27:47] tubbo: AnomalousBit: lies
[18:27:57] blackmesa: has joined #RubyOnRails
[18:28:04] tubbo: yogeshwar: you're gonna hate me.
[18:28:10] tubbo: yogeshwar: `has_one :peronsal_information, dependent: :destroy` can you see the error in that line
[18:29:41] arup_r: has joined #RubyOnRails
[18:30:25] arooni: has joined #RubyOnRails
[18:30:46] gavit: can anyone explain what repo_path does in capistrano? I'm looking for something more elaborate than 'The repository path according to the context'
[18:30:54] arooni: has joined #RubyOnRails
[18:31:01] s2013: anyway to check if a record can be saved without actually saving it?
[18:31:21] tubbo: s2013: valid?
[18:31:26] smathy: has left #RubyOnRails: ("Textual IRC Client: www.textualapp.com")
[18:31:28] tubbo: but you knew that already ;)
[18:31:31] smathy: has joined #RubyOnRails
[18:31:38] TPBallbag: has joined #RubyOnRails
[18:31:43] tubbo: the answer is no, you can't "fake save" a record to the database. errors would have to be caught in your validatins
[18:31:45] tubbo: validations*
[18:31:52] s2013: ah yea thanks
[18:32:06] s2013: but wait does valid? return errors
[18:32:06] Icey: has joined #RubyOnRails
[18:32:34] tubbo: gavit: isn't that where capistrano clones the repo down on your remote machine? i think repo_url tells it what URL to pull from
[18:32:39] workmad3: s2013: no, it returns true/false... but if it returns false, errors will be on the `model.errors` object
[18:32:51] tubbo: s2013: it's used in save
[18:32:52] s2013: oh ok cool. thanks
[18:32:52] raldu: has joined #RubyOnRails
[18:34:12] fryguy: tubbo: off-track a bit (just use valid?) but assuming you are using a transactional engine, you could just run save in a transaction and then rollback the transaction, right?
[18:34:25] fryguy: to catch validations that occur only at database level (like foreign-key constraints)
[18:34:56] workmad3: fryguy: you could, but that's fairly heavyweight in terms of a check
[18:35:13] gavit: tubbo: aah, yeah, I had configged it already apparently :'(
[18:35:50] s2013: currently thats how we do it but i rather check if its valdi and all that
[18:36:02] workmad3: fryguy: you also need to either have nested transactions or trust to savepoints in your db, as `.save` wraps the DB calls in a transaction too
[18:36:16] smathy: has joined #RubyOnRails
[18:36:39] workmad3: (AR does handle that for you, but it's worth being aware of :) )
[18:36:49] yogeshwar: tubbo : sorry , but I don't find any error in that line , can you please point out ?
[18:37:40] mordocai: has joined #RubyOnRails
[18:37:59] SteenJobs: has joined #RubyOnRails
[18:38:22] startupality: has joined #RubyOnRails
[18:39:34] naftilos76: Can i change the value of an attribute in the model with Proc or any other way? Basically i want to validate format of one attribute and change the default value of another if the validation is succesfull. I am sure it is doable but i am not sure how.
[18:39:39] Macaveli: Anyone ever dealt with an upgrade from Foundation 4 tot Foundation 5?
[18:40:43] stesind: has joined #RubyOnRails
[18:43:43] CanTonic: has joined #RubyOnRails
[18:44:43] aarkerio: naftilos76, before_save method ?
[18:46:08] naftilos76: aarkerio, no sure if that method exists
[18:46:18] tubbo: Macaveli: a long time ago
[18:46:21] ewilliam: hi, how do you implement form_for magic for form_objects? i cant figure out how to map the form_for form object to an existing record so it will show existing model field inputs in the view, and PERSIST inputted user data when errors show. here's my code: https://gist.github.com/ewilliam/a2e2e1328014669f811e
[18:46:31] Macaveli: tubbo any idea where I should place the bower file?
[18:46:43] Macaveli: I'm following this tubbo http://foundation.zurb.com/docs/upgrading.html
[18:47:44] aarkerio: http://api.rubyonrails.org/classes/ActiveRecord/Callbacks.html
[18:48:10] naftilos76: aarkerio, thanks, that took me somewhere else
[18:49:04] Sigfrid: has joined #RubyOnRails
[18:49:07] kerunaru: has joined #RubyOnRails
[18:49:57] lacuna: has joined #RubyOnRails
[18:50:34] tubbo: Macaveli: i didn't use bower, i used foundation-rails to bring the assets in.
[18:50:52] Macaveli: tubbo in the text it says it used to run on compass
[18:50:58] Macaveli: but now switched to bower.. ?
[18:51:43] l1meon: has joined #RubyOnRails
[18:51:43] yogeshwar: tubbo : sorry, my spelling was wrong , you helped me solve two issues , thanks a lot , buddy!
[18:51:49] tubbo: Macaveli: *shrug* i've always used it with rails, it always worked within the asset pipeline. never had to mess with that stuff. assuming it's for folks who aren't using rails.
[18:51:59] tubbo: yogeshwar: :D
[18:52:08] Macaveli: aight tubbo
[18:52:34] s2013: has joined #RubyOnRails
[18:52:43] workmad3: Macaveli: if you're using the gem, you can pretty much ignore the next section
[18:52:51] Macaveli: okey workmad3
[18:53:15] _djbkd: has joined #RubyOnRails
[18:53:33] aarkerio: has left #RubyOnRails: ("Verlassend")
[18:55:43] nemo__: has joined #RubyOnRails
[18:55:47] kadoppe: has joined #RubyOnRails
[18:56:18] l1meon: Hello, I have a problem with nginx, puma, and private_pub. After configuring everything and starting everything, there is an error message in nginx that connection refused for faye at http://x.x.x.:4110/faye, and I cant understand why, when I visit the page I can type Faye in the web console and it shows that is connected. Does somebody had something similar ?
[18:57:23] craysiii: is there a gem like whenever but where i can define a job with something like 100.times.per.hour. I am trying to do match a cron job with a limit on an external api
[18:58:31] SteenJobs: has joined #RubyOnRails
[18:59:09] tlarevo: has joined #RubyOnRails
[19:00:24] Lightsword: has joined #RubyOnRails
[19:03:48] fryguy: craysiii: resque_scheduler supports cron-like syntax for how often to run jobs
[19:04:01] fryguy: i'm sure there are similar gems for sidekiq if that is your background processor of choice
[19:04:11] fryguy: and there's activejob_scheduler, but I don't know how well that one works
[19:04:15] craysiii: i dont have a preference yet
[19:04:21] jessemcgilallen: has joined #RubyOnRails
[19:05:38] netzfisch: has joined #RubyOnRails
[19:06:40] nemo_: has joined #RubyOnRails
[19:06:52] JarekTkaczyk: has joined #RubyOnRails
[19:07:00] JarekTkaczyk: has left #RubyOnRails: ()
[19:08:05] nettoweb: has joined #RubyOnRails
[19:08:49] chipotle: has joined #RubyOnRails
[19:09:46] bruno-: has joined #RubyOnRails
[19:10:11] AnomalousBit: Anyone using free / open source scrum (sprint/task/kanban) software? I've been using taiga.io, just looking to see what else is out there.
[19:10:26] tubbo: craysiii: we're about to start using sidekiq-cron here, rather than sidetiq which seems to be unmaintained...
[19:10:38] tubbo: sidekiq-cron uses rufus-scheduler, just like resque-scheduler
[19:11:44] craysiii: im looking for something thats light on dependencies, i want to weigh all options
[19:12:25] nemo_: has joined #RubyOnRails
[19:12:50] craysiii: is there a good read someone could recommend in terms of sidekiq vs resque
[19:12:55] arup_r: AnomalousBit: trello
[19:13:33] rgrmatt: has joined #RubyOnRails
[19:13:52] AnomalousBit: Thanks arup_r, I'll give it a shot
[19:15:34] centrx: has joined #RubyOnRails
[19:16:05] gaussblurinc1: has joined #RubyOnRails
[19:17:01] kitsuneyo: has joined #RubyOnRails
[19:17:16] nemo_: has joined #RubyOnRails
[19:17:44] sankaber: has joined #RubyOnRails
[19:19:41] kitsuneyo: has joined #RubyOnRails
[19:19:49] Maletor: has joined #RubyOnRails
[19:21:01] nemo_: has joined #RubyOnRails
[19:21:23] yfeldblum: has joined #RubyOnRails
[19:22:28] roxtrongo: has joined #RubyOnRails
[19:23:37] ngscheurich: has joined #RubyOnRails
[19:25:41] nemo_: has joined #RubyOnRails
[19:27:50] _djbkd: has joined #RubyOnRails
[19:28:32] rromanchuk: has joined #RubyOnRails
[19:29:37] kerunaru: has joined #RubyOnRails
[19:31:30] nemo_: has joined #RubyOnRails
[19:33:29] speakingcode: has joined #RubyOnRails
[19:33:59] zoo-zed: has joined #RubyOnRails
[19:35:09] EminenceHC: has joined #RubyOnRails
[19:35:21] beauby: has joined #RubyOnRails
[19:36:24] sankaber: has joined #RubyOnRails
[19:37:48] bmalum: has joined #RubyOnRails
[19:37:50] havenwood: has joined #RubyOnRails
[19:39:28] kimegede: has joined #RubyOnRails
[19:39:28] napcae: has joined #RubyOnRails
[19:40:35] hd1: has joined #RubyOnRails
[19:41:04] jessemcgilallen: has joined #RubyOnRails
[19:41:14] nemo_: has joined #RubyOnRails
[19:41:19] blackmesa: has joined #RubyOnRails
[19:41:58] VeryBewitching: has joined #RubyOnRails
[19:42:18] napcae: has left #RubyOnRails: ()
[19:43:00] nemo_: has joined #RubyOnRails
[19:43:47] kerunaru: has joined #RubyOnRails
[19:43:48] northfurr: has joined #RubyOnRails
[19:44:48] hd1: i have a two column table... the 2nd of which is a checkbox and a heading "Complete?" how do i set the width of this column to the minimum nonwrapping width and the other column to the rest of it
[19:45:19] safety_cut: has joined #RubyOnRails
[19:45:36] hd1: probably better suited for #css, come to think of it
[19:45:49] hd1: so, i'll ask there, sorry for the confusion
[19:45:50] hd1: has left #RubyOnRails: ()
[19:46:02] arup_r: yes hd1 ask there :D
[19:46:13] baweaver: has joined #RubyOnRails
[19:46:28] lacuna: has joined #RubyOnRails
[19:47:08] nemo_: has joined #RubyOnRails
[19:47:14] Cervajz_: has joined #RubyOnRails
[19:47:22] rgrmatt: has joined #RubyOnRails
[19:48:57] zoo-zed: has joined #RubyOnRails
[19:48:58] jahbrewski: has joined #RubyOnRails
[19:49:09] ruurd: has joined #RubyOnRails
[19:49:53] nemo_: has joined #RubyOnRails
[19:51:39] nemo_: has joined #RubyOnRails
[19:52:03] northfurr: has joined #RubyOnRails
[19:52:15] zoo-zed: has joined #RubyOnRails
[19:52:42] gavit: where does capistrano get git-ssh.sh from?
[19:52:43] lacuna: has joined #RubyOnRails
[19:52:43] lacuna: has joined #RubyOnRails
[19:54:29] nemo_: has joined #RubyOnRails
[19:56:22] kerunaru: has joined #RubyOnRails
[19:57:18] willardg: has joined #RubyOnRails
[19:57:39] tubbo: gavit: your hard drive
[19:58:10] manfrin_: has joined #RubyOnRails
[19:58:12] kitsuneyo: has joined #RubyOnRails
[19:58:25] tubbo: craysiii: well, the main diff is that resque workers are implemented as forked processes, while sidekiq workers are run in threads of the same process.
[19:58:33] kimegede: has joined #RubyOnRails
[19:58:36] bricker1: has joined #RubyOnRails
[19:58:38] rgrmatt: has joined #RubyOnRails
[19:59:44] Guest53: has joined #RubyOnRails
[20:00:13] craysiii: tubbo so if i wanted to run this rails app on heroku, would it be more expensive to run forked processes instead of seperate threads?
[20:00:44] tubbo: for new apps, ActiveJob takes care of that
[20:01:23] tubbo: err, AJ takes care of the implementation so you can switch between queue backends
[20:01:26] nemo_: has joined #RubyOnRails
[20:01:28] gavit: tubbo: apparently it couldnt find the file cause I specified tmp as ~/tmp rather than /home/username/tmp
[20:01:41] elusiveother: has joined #RubyOnRails
[20:01:44] tubbo: gavit: hmm, maybe you're not using the user you think you're using :)
[20:01:58] craysiii: whats the general opinion of crono gem
[20:02:04] bricker1: has left #RubyOnRails: ()
[20:02:17] bricker: has joined #RubyOnRails
[20:02:26] gavit: tubbo: I was, I changed it to /user/username and it runs 'further'
[20:02:35] gavit: apparently capistano doesnt like ~
[20:02:58] baweaver: has joined #RubyOnRails
[20:03:05] nemo_: has joined #RubyOnRails
[20:03:12] gavit: now I got a problem with my env vars :(
[20:03:19] tubbo: craysiii: never heard of it. just googled it. seems like reinventing cron
[20:03:44] axl__: has joined #RubyOnRails
[20:05:55] rgrmatt: has joined #RubyOnRails
[20:06:41] kitsuneyo: has joined #RubyOnRails
[20:07:02] Pupeno: has joined #RubyOnRails
[20:07:12] AnoHito_: has joined #RubyOnRails
[20:07:28] ruurd: has joined #RubyOnRails
[20:08:28] lacuna: has joined #RubyOnRails
[20:10:45] EminenceHC: has joined #RubyOnRails
[20:11:28] lacuna: has joined #RubyOnRails
[20:13:34] hustler: has joined #RubyOnRails
[20:14:16] cesarstafe: has joined #RubyOnRails
[20:14:36] willardg: has joined #RubyOnRails
[20:14:38] lacuna: has joined #RubyOnRails
[20:15:26] stamina: has joined #RubyOnRails
[20:15:53] EminenceHC: has joined #RubyOnRails
[20:17:42] dmarr: would i be able to do this =link_to 'Report Bug:', 'report', data: { toggle: "modal", target: "#ajax-modal" } but have it generate a button?
[20:17:43] hustler: has left #RubyOnRails: ()
[20:18:08] cesarstafe: hi ppl, I am trying to use carrierwave to upload multiple files on rails 4.2 and ruby 2.2.3 .. but I see a bug there when I try to get all files uploaded .. "SystemStackError: stack level too deep" ... more details here at http://pastie.org/10514376
[20:18:34] cesarstafe: have somebody deal with a similar issue?
[20:18:35] lacuna: has joined #RubyOnRails
[20:18:35] lacuna: has joined #RubyOnRails
[20:19:15] cesarstafe: using carrierwave for multiple upload? I have follow next link as documentation to implement ithttps://www.codementor.io/tips/8367241728/carrierwave-now-natively-supports-multiple-file-uploads-in-rails-gotchas
[20:19:43] Aherin: has joined #RubyOnRails
[20:19:50] dmarr: although rhizome that makes an input type='submit'
[20:19:55] Axilla: has joined #RubyOnRails
[20:20:36] rhizome: i use css to make links look like buttons if that'
[20:20:41] rhizome: that's all you need
[20:20:42] sankaber: has joined #RubyOnRails
[20:21:27] sankaber: has joined #RubyOnRails
[20:21:43] dmarr: i think bootstrap buttons don't do that
[20:21:55] rhizome: who said anything about bootstrap?
[20:21:57] lacuna: has joined #RubyOnRails
[20:23:02] tubbo: dmarr: with bootstrap you can apply classes to make the link appear as a button. check the bootstrap docs for info on how to do that.
[20:23:13] craysiii: bootstrap totally does that. you can use class 'btn btn-X' to stylize a link to a button.
[20:23:23] hahuang65: has joined #RubyOnRails
[20:23:48] craysiii: http://getbootstrap.com/css/#buttons
[20:24:06] Radar: GOOD MORNING
[20:24:08] _djbkd: has joined #RubyOnRails
[20:24:17] blackmesa: has joined #RubyOnRails
[20:24:20] craysiii: good afternoon!
[20:24:54] havenwood: good mornin'
[20:25:19] northfurr: has joined #RubyOnRails
[20:27:09] tubbo: good night
[20:27:17] Radar: \o/ 3 timezones
[20:27:22] dmarr: got it, i was applying my classes wrong.. ie, i needed to do 'btn btn-primary' instead of 'btn.btn-primary'
[20:27:28] zpe: has joined #RubyOnRails
[20:27:33] Palsson: has joined #RubyOnRails
[20:27:54] alex88: has joined #RubyOnRails
[20:28:05] tris: has joined #RubyOnRails
[20:28:11] rhizome: #bootstrap
[20:30:18] dmarr: its actually ##bootstarp
[20:30:24] dmarr: err, ##bootstrap
[20:32:01] tubbo: it's actually ##bootstrapqueen
[20:32:20] tubbo: created by boba_fetty_wap
[20:32:31] lacuna: has joined #RubyOnRails
[20:32:38] kitsuneyo: has joined #RubyOnRails
[20:33:00] craysiii: moderated by seventeen38bot
[20:33:09] pmadd: has joined #RubyOnRails
[20:33:34] dmarr: 2manymemes
[20:33:43] EminenceHC: has joined #RubyOnRails
[20:34:16] northfurr: has joined #RubyOnRails
[20:35:04] arthurix_: has joined #RubyOnRails
[20:35:11] ss_much: has joined #RubyOnRails
[20:35:21] rgrmatt: has joined #RubyOnRails
[20:36:50] Radar: I have a flash message in my application which is persisting after multiple refreshes. I am only setting it in one controller, and it's not the controller which is serving my request.
[20:37:07] Radar: https://github.com/radar/twist/tree/my-saas
[20:37:16] safety_cut: has joined #RubyOnRails
[20:37:21] lacuna: has joined #RubyOnRails
[20:38:11] ivanskie: has joined #RubyOnRails
[20:38:41] Radar: Along with that, https://github.com/radar/twist/blob/my-saas/app/controllers/accounts_controller.rb#L18 this sign_in isn't persisting to the next request.
[20:38:43] SteenJobs: has joined #RubyOnRails
[20:38:52] Radar: It's like something is toying with my session, but I don't know what. I am sure that this was working a week ago.
[20:38:58] northfurr: has joined #RubyOnRails
[20:39:26] Radar: I suspect it's something on my own machine.
[20:39:47] tubbo: Radar: did you try passing sign_in @user, store: true (you shouldn't need to, just curious)
[20:39:53] tubbo: i know store: false prevents it from being saved to the session
[20:39:54] Radar: tubbo: no, not yet
[20:40:10] Radar: I'm testing it on Firefox now instead of Chrome to rule it out being a browser issue.
[20:40:19] Radar: It works fine on Firefox. So it might be Chrome.
[20:40:36] Radar: And the tests work fine still too.
[20:41:30] polishdub: has joined #RubyOnRails
[20:41:43] Radar: Restarting Chrome has seemingly fixed the issues. Well, that's been a fun two days.
[20:42:27] tubbo: Radar: i've been thinking of writing something that just automatically restarts chrome every day on my machine
[20:42:36] tubbo: i mean they update it like every day..
[20:42:47] Radar: tubbo: at 0:00 shutdown ? ;)
[20:42:49] tubbo: because i have had that bite me enough times for it to matter
[20:43:09] Radar: First time this has bitten me. Chrome's been a great browser.
[20:43:19] Radar: First Tweetbot goes rogue on me, and now Chrome.
[20:45:05] craysiii: chrome has been giving me issues lately, its sad :(
[20:45:20] tubbo: Radar: well you don't typically live on the edge of JS features.
[20:45:23] rgrmatt: has joined #RubyOnRails
[20:45:46] mozzarella: why use chrome? firefox is superior
[20:45:52] Radar: mozzarella: lies and deceit
[20:45:57] tubbo: mozzarella: how so
[20:46:04] Radar: You have spoken lies and now we must _fight to the death_
[20:46:18] Radar: My memory bloat is smaller than your memory bloat ;)
[20:46:23] mozzarella: it is more extensible, it doesn't spy on you the way chrome does, etc.
[20:46:26] petersaints: has joined #RubyOnRails
[20:46:36] Radar: It spies on you in new and exciting ways ;)
[20:46:54] bricker: Chrome when I
[20:46:56] bricker: I'm plugged in
[20:46:59] bricker: Safari otherwise
[20:47:02] tubbo: mozzarella: how is it "more extensible"?
[20:47:03] bricker: the one true answer
[20:47:13] tubbo: bricker: that batt life doeeee
[20:47:19] mozzarella: tubbo: addons are allowed to modify the UI, unlike on chrome
[20:47:22] bricker: tubbo: exactly
[20:47:42] tubbo: mozzarella: greeeeat that's what i need some asshole in belarus serving ads to my toolbar ;)
[20:47:43] mozzarella: you can't hide the toolbar or make the bookmark bar bigger, you can't add vertical tabs, etc.
[20:47:53] tubbo: mozzarella: i'd rather have assholes from silicon valley serve ads to my browser :D
[20:48:15] tubbo: i'm saying that addons allowing one to modify the UI is not a "feature" in my opinion
[20:48:18] mozzarella: toolbar being where the address bar is
[20:48:21] nfk: has joined #RubyOnRails
[20:48:25] mozzarella: not the IE crap kind of toolbar
[20:48:40] mozzarella: how is it not a feature
[20:49:01] mozzarella: have you ever installed an addon accidentally? lol
[20:49:55] tubbo: mozzarella: no
[20:50:10] chipotle: has joined #RubyOnRails
[20:50:37] tubbo: mozzarella: i like the relatively minimal UI of chrome, and letting addons fuck that up would be a bad thing IMHO.
[20:50:46] mozzarella: then don't install addons which add ads to your UI, that's it
[20:51:02] craysiii: firefox's UI feels cluttered running vanilla
[20:51:09] tubbo: mozzarella: mostly i don't use FF because last i checked, the javascript engine was slower than chrome's
[20:51:23] mozzarella: tubbo: don't install addons you don't want?
[20:51:29] tubbo: plus i use V8 on the server side when i make things in node.js
[20:51:46] rhizome: because you're cool
[20:52:27] tubbo: mozzarella: but yeah i think firefox and chrome have relatively the same feature sets, or negligible differences between feature sets. the main difference is the engine used to render HTML and the engine used to interpret/execute JS
[20:52:37] mozzarella: http://arewefastyet.com/
[20:52:38] tubbo: to me, anywya.
[20:52:50] rhizome: chrome is less flaky with livereload for me
[20:53:10] helpa: http://i.imgur.com/tyViD.gif
[20:53:20] rhizome: FF has better ad blocking
[20:53:22] Maletor: has joined #RubyOnRails
[20:53:40] rhizome: so FF is my "reading" browser, chrome my "doing" one.
[20:53:44] mozzarella: firefox is slower because it still renders everything in a single thread, but saying that javascript runs slower on it is simply not true
[20:53:50] craysiii: radar i hope you shake your head all sassy-like IRL
[20:53:54] jessemcgilallen: has joined #RubyOnRails
[20:53:56] VeryBewitching: Chrome is my "Hey, can I have my RAM back now?" browser
[20:54:10] darrencauthon: has joined #RubyOnRails
[20:54:17] rhizome: each tab kills FF just a little more
[20:54:18] Radar: craysiii: mmmmmmmmmhhmmmmmmm
[20:54:49] K3VA: has joined #RubyOnRails
[20:54:51] mozzarella: new popcorn gif?
[20:54:53] VeryBewitching: rhizome: Same with Chrome, but I've never seen FF grow to 2GB in memory in my most active uses of it
[20:55:02] tubbo: mozzarella: that's fine. when i use firefox, it's slower. therefore, it's slower.
[20:55:07] tubbo: and it runs JS slower. so yes, it's slower.
[20:55:20] rgrmatt: has joined #RubyOnRails
[20:55:21] tubbo: i mean in terms of my own observations, and of course this was a couple years ago
[20:55:22] rhizome: who you going to believe, me or your lying eyes?
[20:55:24] northfurr: has joined #RubyOnRails
[20:55:25] EminenceHC: has joined #RubyOnRails
[20:55:34] Radar: Now time for real questions
[20:55:40] Radar: How do I get errors out of a Braintree::ErrorResult
[20:55:45] kimegede: has joined #RubyOnRails
[20:55:45] Radar: It has an .errors method, which is an empty string
[20:55:58] tubbo: no one has successfully gotten me to switch my browser ever in my life. i've always switched browsers on my own accord, not because someone on the internet wanted to engage me in an argument
[20:56:09] rhizome: content_tag :div, Braintree::ErrorResult.inspect
[20:56:24] rhizome: cap deploy
[20:56:33] wkoszek: has joined #RubyOnRails
[20:56:45] tubbo: [ci skip]
[20:56:57] wkoszek: has joined #RubyOnRails
[20:58:37] Radar: rhizome: too bad it doesn't contain any user-useful info :)
[20:58:40] Radar: https://gist.github.com/radar/dff1ea490c6dd9b9954e
[20:59:11] Cervajz: has joined #RubyOnRails
[20:59:32] Radar: Ugh, it's result.message which contains the thing that I want, not result.errors.
[20:59:42] Radar: Of course I find this out after I send the email to Braintree support.
[20:59:59] boombadaroomba: has joined #RubyOnRails
[21:01:12] craysiii: dont you just wish there was an unsend button?
[21:01:15] slash_nick: Dear Braintree, sorry for the ripping of a new one, til next time, X
[21:03:57] safety_cut: has joined #RubyOnRails
[21:04:07] rhizome: I AM LOSING $363484 PER MINUTE THIS IS DOWN
[21:06:28] chills42: has joined #RubyOnRails
[21:06:50] yogeshwar: has joined #RubyOnRails
[21:08:18] rgrmatt: has joined #RubyOnRails
[21:08:19] Cervajz_: has joined #RubyOnRails
[21:08:37] LambdaSource: has joined #RubyOnRails
[21:09:09] Pupeno: has joined #RubyOnRails
[21:09:27] northfurr: has joined #RubyOnRails
[21:11:12] mois3x: has joined #RubyOnRails
[21:11:58] kerunaru: has joined #RubyOnRails
[21:14:32] CJKinni: has joined #RubyOnRails
[21:14:39] Pupeno: has joined #RubyOnRails
[21:16:57] skinux: has joined #RubyOnRails
[21:17:34] roxtrongo: has joined #RubyOnRails
[21:18:54] slash_nick: rhizome: oh who are you losing that to? i'll invest in them
[21:18:58] rromanchuk: has joined #RubyOnRails
[21:19:44] slash_nick: oh, too steep
[21:19:52] LambdaSource: has joined #RubyOnRails
[21:20:47] arup_r: any good eyes to help me to understand from where this permission object is getting created https://gist.github.com/aruprakshit/621d37367f43a0c7c900#file-log-txt-L10
[21:21:02] Axilla: has joined #RubyOnRails
[21:21:07] arup_r: I am not seeing it.. Or myself don't know what else need to look for to find this out
[21:21:18] LambdaSource: has joined #RubyOnRails
[21:22:48] Coldblackice: has joined #RubyOnRails
[21:23:03] kiloreux_: has joined #RubyOnRails
[21:24:34] skinux: has joined #RubyOnRails
[21:25:31] pwnd_nsfw: arup_r, inheret_parent_permission in an after_create
[21:26:37] shilon: has joined #RubyOnRails
[21:26:41] arup_r: no it is not
[21:27:06] arup_r: pwnd_nsfw: ^^ because I confirmed it through those logger.info ".."
[21:27:22] arup_r: it didn't go inside the `if` logic
[21:28:17] arup_r: if it go inside the `if` I wouldn't debug it. The point is here, it is not going inside the `if` still permission is getting created.
[21:28:23] arup_r: and I dunno how
[21:30:24] pwnd_nsfw: No other code messes with permissions?
[21:31:31] matthewd: arup_r: The code you pasted is not the code you're running
[21:31:41] arup_r: What do you mean ?
[21:31:51] arup_r: I gave the controller action..
[21:31:53] matthewd: The ends don't match
[21:32:11] skinux: Umm...I'm trying to follow RoR Getting Started, it's telling me to use 'ruby bin/rails generate'. However, I'm using 'thin' not rails, so is there a 'thin' equivelant or do I have to use rails for that part?
[21:32:12] pwnd_nsfw: Good eyes, matthewd
[21:32:14] arup_r: That is probably when cut paste in Gist. let me see there
[21:32:35] Owner: has joined #RubyOnRails
[21:32:41] rhizome: skinux: separate thing. thin only touches "rails server"
[21:32:49] Pupeno: has joined #RubyOnRails
[21:32:49] Pupeno: has joined #RubyOnRails
[21:33:10] skinux: Oh, so 'thin' uses rails??
[21:33:15] Owner: So...how do people do log rotation with Passenger/Rails applications? is restart.txt totally graceful and wont drop connections??
[21:33:27] rhizome: skinux: rails server will use thin if it's in the gemfile
[21:33:30] arup_r: matthewd: That is gone when I was editing Gist. sorry, let me add there
[21:33:43] skinux: What exactly does thin do then????
[21:33:49] skinux: Wait, maybe I can look that up.
[21:33:51] rhizome: skinux: replaces webrick
[21:34:09] skinux: And WEBrick is technically the web server of rails right?
[21:34:22] rhizome: it's just the one that comes with
[21:34:35] Radar: skinux: It's a webserver from Ruby
[21:34:42] kerunaru: has joined #RubyOnRails
[21:34:49] skinux: Sorry, I'm pretty much all new to this stuff. I know a little bit of Ruby, but pretty much starting from scratch.
[21:34:54] annlewis: has joined #RubyOnRails
[21:34:55] skinux: I come from PHP.
[21:35:14] Radar: we will educate you :)
[21:35:22] kraytul: has joined #RubyOnRails
[21:35:38] Owner: i think i figured it out :)
[21:35:54] nertzy: has joined #RubyOnRails
[21:36:00] kraytul: is it possible to specifiy indidividual environment variables to rails on the commandline rather than them being in a file?
[21:36:07] kraytul: like, at start
[21:36:14] skinux: If I can get into RoR well enough (and within reasonable amount of time) then I'll move to using RoR as my primary web programming language and JRuby for non-web app programming.
[21:36:31] mostlybadfly: has joined #RubyOnRails
[21:36:39] Guest39: has joined #RubyOnRails
[21:36:49] Radar: kraytul: RAILS_ENV=production rails s
[21:37:12] skinux: I learned to use Laravel PHP Framework in between 3-7 days. I'm hoping I can learn RoR within 2 weeks since I'm not spending as much time on it as I did with Laravel.
[21:37:37] skinux: Plus, I don't remember everything from when I learned Ruby language itself.
[21:37:49] jord: has joined #RubyOnRails
[21:37:57] skinux: And I don't remember which site it was that had the interactive online tutorial.
[21:38:08] skinux: Maybe codeacademy.com
[21:38:13] matthewd: arup_r: Hmm.. dunno. My next step would probably be to jump into the AR adapter, and hack in a raise when it tries to run the unexpected SQL, to get the backtrace.
[21:38:15] Radar: Maybe it was http://tryruby.org/levels/1/challenges/0
[21:38:33] Icey: has joined #RubyOnRails
[21:38:42] skinux: Nah, the site I used teaches Ruby, JavaScript, jQuery and maybe even some others.
[21:38:54] arup_r: matthewd: Ahh, nice advise. Can you tell me where to do it ?
[21:39:11] arup_r: What do you mean by AR adapter ?
[21:39:20] Radar: skinux: Oh, yeah probably codeacademy then
[21:39:31] skinux: Anyway...does rails generate generate both controller and model always or can I tell it to only generate a controller when I don't need a model?
[21:39:52] Radar: arup_r: http://ryanbigg.com/2013/06/finding-sql-queries-in-rails/
[21:40:09] Radar: arup_r: That code goes in a new config/initializers/sql_logging.rb file.
[21:40:23] pwnd_nsfw: rails g controller
[21:40:25] pwnd_nsfw: rails g model
[21:40:37] pwnd_nsfw: rails g scaffold (both)
[21:40:49] pwnd_nsfw: both + views 'n shit
[21:40:59] Radar: ACTION crosses fingers and hisses at the mention of scaffold
[21:41:04] asianMike: has joined #RubyOnRails
[21:41:09] pwnd_nsfw: Yeah, I didn't really want to do it
[21:41:09] Guest39: has joined #RubyOnRails
[21:41:13] skinux: Why is scaffold a bad word?
[21:41:14] craysiii: Radar why dont you like scaffold?
[21:41:23] pwnd_nsfw: It does more harm than good lol
[21:41:36] adaedra: rails code_me_my_app_im_lazy
[21:41:38] pwnd_nsfw: I usually end up replacing more code than I would do writing
[21:41:39] Radar: craysiii: People use it without learning what it actually does.
[21:41:43] baweaver: has joined #RubyOnRails
[21:42:08] gambl0re: has joined #RubyOnRails
[21:42:54] matthewd: arup_r: Yeah, do Radar's thing.. that's much more sensible than mine, which was to just shove a line in (your local version's equivalent of) https://github.com/rails/rails/blob/master/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb#L557 :)
[21:43:40] arup_r: matthewd: yes, I am copying Radar code. It is nice and seems it will tell me where
[21:44:45] asianMike: craysiii: scaffolding is great demonstration tool in my opinion. just like doing a hello world, i do it to make sure everything is working.
[21:45:16] pwnd_nsfw: It's definitely a good way to coax someone that rails is really good at producing applications quickly
[21:46:30] asianMike: yep. it got me interested in rails because of those youtube demos. never seen anything like it before. it's a good marketing tool for rails, not the best tool for your app...
[21:47:06] baweaver: has joined #RubyOnRails
[21:47:09] northfurr: has joined #RubyOnRails
[21:47:28] rhizome: scaffold is fine
[21:48:29] hansss: has joined #RubyOnRails
[21:48:30] phil6kites: has joined #RubyOnRails
[21:49:53] rgrmatt: has joined #RubyOnRails
[21:50:51] annlewis: has joined #RubyOnRails
[21:51:39] arup_r: matthewd: Got a huge backtrace .. :) https://gist.github.com/aruprakshit/621d37367f43a0c7c900#file-log-txt swimming into it.. but it is too deep :/
[21:53:43] willardg: has joined #RubyOnRails
[21:53:55] sankaber: has joined #RubyOnRails
[21:54:37] Cervajz: has joined #RubyOnRails
[21:55:25] Cervajz__: has joined #RubyOnRails
[21:55:44] matthewd: arup_r: save_through_record sounds relevant
[21:56:03] yogeshwar: has joined #RubyOnRails
[21:56:09] Maletor: has joined #RubyOnRails
[21:56:35] jessemcgilallen: has joined #RubyOnRails
[21:56:43] arup_r: https://gist.github.com/aruprakshit/621d37367f43a0c7c900#file-log-txt-L59 ok. Who is calling it.
[21:57:31] matthewd: Well from your code, it's assets_controller.rb:82:in `create'
[21:57:47] matthewd: But I assume that's the top of create
[21:58:07] arup_r: yes this line: https://gist.github.com/aruprakshit/621d37367f43a0c7c900#file-assetscontroller-rb-L28
[21:58:13] skinux: What does this mean: Missing :action key on routes definition ?
[21:58:31] arup_r: But now, need to find which code is doing this..
[21:58:43] craysiii: https://github.com/Instagram/instagram-ruby-gem#sample-application If i am using the instagram gem in my rails app, where do i have to 'require instagram', if at all?
[21:58:51] arup_r: permission object is getting created after the asset is created
[21:58:55] arup_r: as per the log
[21:58:55] tubbo: skinux: you need to route to a controller and action, you're missing the action
[21:59:27] skinux: root 'home@index' is this not right?
[21:59:50] arup_r: skinux: no
[21:59:53] skinux: Oh wait...that's only the action not a route so it's getting confused
[21:59:53] matthewd: arup_r: What's the assets association on User look like?
[21:59:56] arthurix: has joined #RubyOnRails
[22:00:11] skinux: root '/' 'home@index' ?
[22:00:12] yfeldblum: has joined #RubyOnRails
[22:00:21] arup_r: matthewd: in User model I have
[22:00:22] arup_r: has_many :assets, through: :permissions
[22:00:45] arup_r: is this line creating the Permission object ? because I have in the controller
[22:00:54] rhizome: do you have zero tests
[22:00:56] arup_r: @asset = current_user.assets.create(..)
[22:01:08] arup_r: so tricky.
[22:01:20] tubbo: skinux: that is not right.
[22:01:22] tubbo: skinux: !routing
[22:01:22] helpa: skinux: http://guides.rubyonrails.org/routing.html - Rails Routing From the Outside In - Rails Guide - by Mike Gunderloy
[22:01:32] arup_r: skinux: it is not @ ,, it is #
[22:02:03] arup_r: matthewd: and Radar is "Guru" of the day.
[22:02:16] arup_r: it is now 3:26 AM
[22:02:24] arup_r: Should I sleep now ?
[22:02:42] rhizome: 3pm here. are you in one of those half-timezones?
[22:02:44] tubbo: arup_r: yes. tomorrow you should write tests.
[22:03:09] arup_r: tubbo: I have been told, lets add features.. then we will write tests :D
[22:03:33] arup_r: rhizome: I am from India
[22:03:35] tubbo: arup_r: whoever told you that is the worst developer ever.
[22:03:41] tubbo: arup_r: yeah we know, we can see your name :P
[22:03:59] tubbo: i've never met anyone named arup who wasn't indian :D
[22:04:07] arup_r: Ssshh.... he also sometimes here.. He is a good guy really.. But..
[22:04:26] rhizome: MYSTERY TIME
[22:04:47] willardg: has joined #RubyOnRails
[22:04:59] arup_r: we are in pressure, so skipping it for now. We have a QA guy, he raises a bug which takes my whole working day to fix.
[22:05:11] yfeldblum: has joined #RubyOnRails
[22:05:12] rgrmatt: has joined #RubyOnRails
[22:05:25] matthewd: .. because you don't have tests :|
[22:05:30] arup_r: the QA guy is super helpful to the product owner
[22:05:39] arup_r: matthewd: I know.. we will write it soon
[22:07:13] pwnd_nsfw: has joined #RubyOnRails
[22:07:38] northfurr: has joined #RubyOnRails
[22:08:41] rhizome: it's always later than it should be
[22:09:20] rgrmatt: has joined #RubyOnRails
[22:09:49] WillAmes: has joined #RubyOnRails
[22:10:00] matthewd: ACTION should really make a decision about going to rubyconfau :/
[22:10:35] Radar: arup_r: Looks like it's happening in a callback. Those are always the hardest to debug.
[22:10:59] arup_r: Radar: figured out from your Notification code.
[22:11:11] arup_r: with the help of matthewd
[22:11:19] rubyonrails583: has joined #RubyOnRails
[22:11:48] arup_r: Radar: it is happening has_many :through call
[22:12:03] matthewd: arup_r: Australia.
[22:12:16] arup_r: records got created 1 level deeper than I expected
[22:13:16] EminenceHC: has joined #RubyOnRails
[22:13:28] Aeyrix: >"We're skipping tests for now."
[22:13:33] Aeyrix: [ Two years later ]
[22:14:51] Radar: Aeyrix: I have a blog post about this
[22:14:52] Radar: http://ryanbigg.com/2010/02/congratulations/
[22:15:40] Icey: has joined #RubyOnRails
[22:15:40] Icey: has joined #RubyOnRails
[22:15:44] rubyonrailed: has joined #RubyOnRails
[22:16:52] Aeyrix: Radar: Reading this makes me uncomfortable.
[22:17:10] Aeyrix: I'm torn between "please don't write things like this again" and "you could branch into a niche version of developer horror fiction"
[22:18:40] kerunaru: has joined #RubyOnRails
[22:19:16] pydave6367: has joined #RubyOnRails
[22:21:18] Aeyrix: good article tbh
[22:21:25] rickmasta: has joined #RubyOnRails
[22:21:34] gaussblurinc1: has joined #RubyOnRails
[22:22:37] jessemcgilallen: has joined #RubyOnRails
[22:23:47] Ropeney: has joined #RubyOnRails
[22:25:15] rromanchuk: has joined #RubyOnRails
[22:26:59] rubyonrailed: Does anyone know why faraday is throwing this error for my webmock? https://gist.github.com/JasonMannon/efde708462580fbe670c
[22:27:26] s2013: has joined #RubyOnRails
[22:28:15] northfurr: has joined #RubyOnRails
[22:29:08] MartinElvar: has joined #RubyOnRails
[22:30:54] arBmind: has joined #RubyOnRails
[22:31:25] rgrmatt: has joined #RubyOnRails
[22:35:04] Radar: Aeyrix: thank you :)
[22:35:12] bricker: rubyonrailed: all of those spaces and newlines can't be parsed
[22:35:42] Radar: rubyonrailed: What is the deal with topic and purpose?
[22:35:48] Radar: https://gist.github.com/JasonMannon/efde708462580fbe670c#file-error-log-L16-L17
[22:35:56] Radar: These are hashes, but they contain strings
[22:35:58] Radar: That is invalid JSON
[22:36:04] Radar: I found out by chucking it into http://jsonlint.com/
[22:36:16] bricker: rubyonrailed: disregard my comment it's incorrect
[22:36:55] Radar: I am so on the ball this morning that I think I am actually the ball
[22:37:19] rubyonrailed: Thanks for checking though
[22:37:25] craysiii: "be the ball."
[22:37:42] rhizome: fa-la-la-la-la-la-la
[22:38:06] wethu: has joined #RubyOnRails
[22:40:15] Ergo: has joined #RubyOnRails
[22:40:39] baweaver: Radar: dangit, not cool
[22:40:51] baweaver: I'm going to have nightmares now :(
[22:46:06] bendangelo: has joined #RubyOnRails
[22:48:01] m3_del: has joined #RubyOnRails
[22:48:48] northfurr: has joined #RubyOnRails
[22:50:19] htmldrum: has joined #RubyOnRails
[22:53:16] Or1on: has joined #RubyOnRails
[22:53:16] Or1on: has joined #RubyOnRails
[22:53:52] quazimodo: has joined #RubyOnRails
[22:55:32] Radar: hahaha :)
[22:55:46] Radar: I haven't worked in a place like that since 2008 and I'm very thankful for it.
[22:56:14] Radar: Nowadays I can pull the "I am an experienced developer, what we're doing here will _probably_ fail. How about we have a good productive discussion about how to make things better?"
[22:56:23] Radar: Rather than rattling the bars of my cage and screaming :)
[22:56:33] mary5030: has joined #RubyOnRails
[22:56:51] bax: has joined #RubyOnRails
[22:57:36] Radar: Speaking of: we have a super-great process here at Marketplacer which uses a Kanban like system that _never_ goes down.
[22:57:54] Radar: (because it's a physical card wall)
[22:58:12] Radar: We care more about quality than we care about pushing out the new shinies.
[22:59:47] dmarr: what is the first object in question here: http://apidock.com/rails/ActionView/Helpers/FormOptionsHelper/collection_select
[23:00:21] Papierkorb: Radar: No no no. You're doing it wrong. Better do this: <Radar> We at HipCorp aim at creating amazing, bug-free software, and value a hassle-free user experience in existing parts over pushing out new unfinished features every week. We're also hiring if you're interested.
[23:00:36] dmarr: i guess an instance variable in the controller (@post) would map to that :post symbol passed into the first arg?
[23:01:04] Radar: Papierkorb: hah, bug free? bullshit :)
[23:01:10] GeissT: has joined #RubyOnRails
[23:01:12] rgrmatt: has joined #RubyOnRails
[23:01:13] Radar: There are always bugs.
[23:01:39] Radar: dmarr: Usually used like f.collection_select :method
[23:02:07] Radar: dmarr: But if not, then it would be collection_select :post, :method
[23:02:10] Radar: But that's old-school
[23:02:20] Radar: And yes, iirc it does match up with @post
[23:02:27] Papierkorb: I don't get it. doing db:migrate on the test environment always tries to redo all migrations from the start, usually going up in flames because 'relations already exist'. Is there a common gotcha?
[23:02:32] dmarr: what is f in that example Radar?
[23:02:40] Radar: dmarr: the object yielded from form_for
[23:02:41] workmad3: Radar: you fail at marketing... they're not bugs, they're less-desirable, incomplete features!
[23:02:56] Radar: workmad3: Brutal honesty is one of our specialties :)
[23:03:28] Radar: dmarr: like this: https://gist.github.com/radar/3f4640d62bbdd68eeb75
[23:03:42] workmad3: Radar: hehe :) brutal honesty is why there aren't programmers in most marketing depts. (it's also why there should be programmers in marketing depts)
[23:04:14] SteenJobs: has joined #RubyOnRails
[23:04:22] VeryBewitching: workmad3: I would agree with that.
[23:07:32] bonhoeffer: has joined #RubyOnRails
[23:07:47] ritic: has joined #RubyOnRails
[23:08:55] ritic: has joined #RubyOnRails
[23:09:15] northfurr: has joined #RubyOnRails
[23:10:09] Pupeno: has joined #RubyOnRails
[23:10:19] bruno-: has joined #RubyOnRails
[23:10:59] K3VA: Say that I'm making a new graphic (table: graphic)
[23:11:01] moty66_: has joined #RubyOnRails
[23:11:12] K3VA: oopse. not done w/ that question.
[23:11:15] mag42c: has joined #RubyOnRails
[23:12:19] shilon: has joined #RubyOnRails
[23:13:27] rgrmatt: has joined #RubyOnRails
[23:15:31] sarink: has joined #RubyOnRails
[23:16:25] K3VA: Say that I have a Graphic, User, and Region table. User table has a foreign key from the region table. Graphic has a foreign key from User. Each user is assigned a single region. Upon creation of a graphic, I want to create to have the region that's associated with the user to automatically create a new string to store in the database. Ex: [User Region: NE]; [Graphic Number to be created upon submission: 1] => Goal => 'NE-000
[23:16:25] K3VA: 1' to be stored in DB
[23:16:37] K3VA: I have no idea how to do that.
[23:16:42] riotjones: has joined #RubyOnRails
[23:17:20] northfurr: has joined #RubyOnRails
[23:17:35] CJKinni_: has joined #RubyOnRails
[23:18:04] shpoont: has joined #RubyOnRails
[23:18:39] arthurix_: has joined #RubyOnRails
[23:19:19] rickmasta: has joined #RubyOnRails
[23:20:21] johnflux: What does "can't dup Fixnum" mean?
[23:20:30] Radar: johnflux: It can't duplicate a Fixnum
[23:20:32] Radar: johnflux: !ncnh
[23:20:32] helpa: johnflux: If you don't provide any code, it becomes really difficult for us to help you. Providing code to reproduce the problem increases your chances of getting great, accurate help immensely.
[23:21:04] havenwood: johnflux: 0.dup #!> TypeError: can't dup Fixnum
[23:21:15] johnflux: what's a fixnum?
[23:21:28] havenwood: johnflux: 0.class #=> Fixnum
[23:21:39] johnflux: what does duplicating an integer mean?
[23:21:45] havenwood: johnflux: 0.dup
[23:22:08] havenwood: johnflux: 0.is_a? Integer #=> true
[23:24:08] VeryBewitching: johnflux: http://ruby-doc.org/core-2.2.0/Fixnum.html Read the description of the class.
[23:26:53] northfurr: has joined #RubyOnRails
[23:28:29] xtagon: has left #RubyOnRails: ()
[23:28:48] wldcordeiro: has joined #RubyOnRails
[23:30:38] Scriptonaut_: has joined #RubyOnRails
[23:30:39] rgrmatt: has joined #RubyOnRails
[23:30:40] northfurr: has joined #RubyOnRails
[23:31:22] Radar: johnflux: I still think you should show us some code :)
[23:31:45] s2013: has joined #RubyOnRails
[23:33:21] Maletor: has joined #RubyOnRails
[23:34:13] m3_del: has joined #RubyOnRails
[23:34:52] CanTonic: has joined #RubyOnRails
[23:35:25] K3VA: Can anyone see my comment?
[23:36:04] sarink: has joined #RubyOnRails
[23:36:59] K3VA: has left #RubyOnRails: ()
[23:37:01] K3VA: has joined #RubyOnRails
[23:38:10] darrencauthon: has joined #RubyOnRails
[23:38:16] nettoweb: has joined #RubyOnRails
[23:38:28] rhizome: K3VA: it doesn't make sense to me
[23:38:50] K3VA: The entire thing or a select part of it?
[23:39:19] baweaver: has joined #RubyOnRails
[23:39:25] rhizome: users belong to regions and have graphics
[23:39:44] startupality: has joined #RubyOnRails
[23:40:57] Sigma00: K3VA: you want that 'NE-001' string to be the primary ID, or just another attribute?
[23:41:10] K3VA: Another attribute
[23:41:11] Wolfram74: has joined #RubyOnRails
[23:41:28] Wolfram74: I'm getting really cheesed off about this form_for helper
[23:41:28] chipotle: has joined #RubyOnRails
[23:41:35] K3VA: created at the time of new graphic submission and submitted to the DB
[23:41:37] mices: is application.css not an scss file by default i dunno if it generated like that or i renamed it by accident
[23:42:08] Wolfram74: how do i get something in the vein of class_name[class_attribute][] as the name for a form item?
[23:43:07] alex88: has joined #RubyOnRails
[23:43:43] mices: is bootstrap included in scss
[23:43:54] RegulationD: has joined #RubyOnRails
[23:44:27] bricker: mices: that's normal (default), and no.
[23:44:44] Sigma00: K3VA: then use an after_save callback on Graphic (so it already has an ID) and then in that callback create your string and save again.
[23:45:58] K3VA: ASigma00, thank you.
[23:46:49] gambl0re: has joined #RubyOnRails
[23:48:11] Wolfram74: as described in the last example of 7.1 http://edgeguides.rubyonrails.org/form_helpers.html#basic-structures
[23:49:38] sunya7a: has joined #RubyOnRails
[23:53:43] sunya7a_: has joined #RubyOnRails
[23:53:53] shilon: has joined #RubyOnRails
[23:54:20] startupality: has joined #RubyOnRails
[23:55:45] shilon: has left #RubyOnRails: ()
[23:59:53] Lightsword: has joined #RubyOnRails