« Back to channel list

#RubyOnRails - 18 April 2016

« Back 1 day Forward 1 day »
[00:06:22] rubyonrailed: has joined #RubyOnRails
[00:14:32] jetpack_joe: has joined #RubyOnRails
[00:20:57] SteenJobs: has joined #RubyOnRails
[00:22:02] zpe: has joined #RubyOnRails
[00:23:37] aloneintheworld: has joined #RubyOnRails
[00:24:47] Psy-Q: has joined #RubyOnRails
[00:26:44] DZj091231kld: has joined #RubyOnRails
[00:33:45] ishamo: has joined #RubyOnRails
[00:34:05] drim: has joined #RubyOnRails
[00:36:10] newjersey: has joined #RubyOnRails
[00:36:56] macsteps: has joined #RubyOnRails
[00:37:33] malcolmva: has joined #RubyOnRails
[00:40:56] newjersey: has joined #RubyOnRails
[00:41:34] drim: why everytimes Iam running Devise::Encryptor.digest(User, 'password'), I'm getting a different hash?
[00:44:31] adavia: has joined #RubyOnRails
[00:47:47] hxegon: has joined #RubyOnRails
[00:49:11] tildes: has joined #RubyOnRails
[00:54:45] ur5us: has joined #RubyOnRails
[01:00:15] beilabs: has joined #RubyOnRails
[01:00:33] zrl_: has joined #RubyOnRails
[01:02:24] triptec: has joined #RubyOnRails
[01:02:27] jpterry: has joined #RubyOnRails
[01:03:15] csmb: has joined #RubyOnRails
[01:03:29] matthew0: has joined #RubyOnRails
[01:07:00] quazimod1: devise 3.5.1 sends the original confirmation_token in the email for confirmation, and stores it's digest. So if someone reads the db, they can't confirm that user via the digested token they see. I upgraded to 3.5.6 today and my specs broke. Now they're storing the original token that they send in the email, so my code breaks.
[01:07:52] quazimod1: their logic: we don't sign users in after confirmation any more so it's fine to send the same token we store. But ffs i have some gradual engagement shit gonig on where they password *after* confirmation
[01:07:57] quazimod1: son of a bitch
[01:08:21] quazimod1: i guess i'll have to ask for a psasword on the front page now
[01:08:27] SteenJobs: has joined #RubyOnRails
[01:09:26] ensyde: has joined #RubyOnRails
[01:10:46] sevenseacat: has joined #RubyOnRails
[01:16:30] Cohedrin_: has joined #RubyOnRails
[01:17:47] IrishGringo_: has joined #RubyOnRails
[01:22:35] hxegon: has joined #RubyOnRails
[01:24:59] ekinmur: has joined #RubyOnRails
[01:30:57] spastorino: has joined #RubyOnRails
[01:32:55] chocoelho: has joined #RubyOnRails
[01:39:48] aurum_infide_: has joined #RubyOnRails
[01:41:02] FailBit: https://i.imgur.com/5Hl6xZx.png
[01:41:25] Radar: Should've used Pundit.
[01:41:44] FailBit: I did the stupid thing
[01:41:46] FailBit: forked cancancan
[01:41:48] FailBit: gutted the thing
[01:41:50] FailBit: made it performant
[01:42:03] helpa: http://i.imgur.com/m9m3wr9.gif
[01:42:15] FailBit: I love that GIF.
[01:42:23] sevenseacat: its very applicable.\
[01:42:48] FailBit: I wish I would not have to keep writing code outside my application scope, it's so demoralizing :V
[01:46:11] DarkBushido: has joined #RubyOnRails
[01:46:11] DarkBushido: has joined #RubyOnRails
[01:52:26] IrishGringo: has joined #RubyOnRails
[01:54:00] SteenJobs: pundit is the way to go? i’m about to start building authorization, final step for our MVP
[01:54:13] Radar: SteenJobs: Chapter 7 (or is it 8?) of Rails 4 in Action says so
[01:54:13] SteenJobs: and was planning on using cancancan
[01:54:20] baweaver: has joined #RubyOnRails
[01:54:22] Radar: You did read Chapter 7 (or 8?) didn't you?
[01:55:07] FailBit: pundit is fast
[01:55:11] FailBit: cancancan is slow
[01:55:27] FailBit: I don't like pundit for different reasons though
[01:55:46] SteenJobs: read the whole thing, but this was over a year ago and before I really picked up the pace. time to review it with newfound perspective.
[01:55:49] FailBit: wait that came out wrong
[01:55:52] sevenseacat: the speed isnt why I would recommend pundit over cancan
[01:55:58] sevenseacat: it's just a nice bonus :)
[01:56:05] Radar: Ease of use is why I would recommend Pundit.
[01:56:23] SteenJobs: why would someone in theory/why do people use cancan over pundit?
[01:56:34] FailBit: ACLs can be convenient
[01:56:36] SteenJobs: is it just lack of knowing, or is there something cancan offers
[01:56:52] SteenJobs: bec i’ve used cancan a bunch in the past, but haven’t used pundit
[01:57:25] SteenJobs: FailBit: so pundit doesn’t use ACLs?
[01:58:12] FailBit: with the scope/feature creep of our application I am not fond of the idea writing a shitton of policies to match our ability file
[01:58:19] FailBit: that's why I don't want pundit
[01:58:36] FailBit: (the ability file is 200 lines long.)
[01:59:11] SteenJobs: writing policies for each doesn’t sound fun (as i read thru pundits docs)
[01:59:43] FailBit: AND I JUST DISCOVERED
[01:59:47] FailBit: it turns out that cancan has some bugs I mean features
[02:00:28] quazimodo: has joined #RubyOnRails
[02:00:28] quazimod1: has joined #RubyOnRails
[02:00:33] FailBit: ACTION cries softly into a blanket
[02:01:01] SteenJobs: can’t catch a break. what’s the worst one?
[02:01:09] FailBit: https://github.com/CanCanCommunity/cancancan/blob/develop/lib/cancan/ability.rb#L413
[02:01:13] FailBit: this is a useful feature
[02:01:27] FailBit: but I think it might have resulted in some extremely broken code in my app somewhere
[02:02:41] FailBit: the way I gutted it for my stupid little acl gem means that these aliases are no longer a thing and I have to rewrite app code
[02:03:52] drim: hey guys, I have a weird issue with devise. In fixture, im setting encrypted_password like this encrypted_password: <%= User.new.send(:password_digest, 'password') %>. If I do users(:one).valid_password?('password') its returning false...
[02:03:59] sevenseacat: *hey everyone
[02:04:14] drim: hello sevenseacat
[02:04:15] sevenseacat: why are you setting the encrypted password?
[02:04:26] drim: why not?
[02:04:36] drim: I cannot use password: 'abc'
[02:04:39] sevenseacat: because any password you pass in isn't going to encrupt to that value
[02:04:58] sevenseacat: just set the normal password and let devise handle the encryption
[02:05:02] drim: table "users" has no column named "password".
[02:05:19] Arcaire: 12:04 PM <drim> why not?
[02:05:22] sevenseacat: thats correct
[02:05:23] Arcaire: Because that's the entire point
[02:05:25] drim: if I try to set user password field in users.yml (fixture)
[02:05:44] Arcaire: You shouldn't be setting encrypted_password
[02:05:47] Arcaire: you should be setting password
[02:05:54] drim: in the fixture?
[02:05:59] Arcaire: and Devise handles setting enc_pass
[02:06:18] drim: okay but If I do that in my users.yml file, I'm getting the previous error (table "users" has no column named "password")
[02:06:27] Cohedrin: has joined #RubyOnRails
[02:06:39] drim: (its working if I do User.new.password = 'abc')
[02:06:49] sevenseacat: sigh, fixtures
[02:06:55] Arcaire: Fuck fixtures
[02:06:58] Arcaire: Use FactoryGirl.
[02:07:12] Arcaire: Seriously, fixtures are utter trash.
[02:07:22] Arcaire: They're like Turbolinks but worse.
[02:07:38] drim: do u prefer rspec+factorygirl?
[02:07:47] sevenseacat: i use them very sparingly, but they're way too tied to your database structure to be of much use
[02:08:08] Arcaire: Yeah rspec+fg is the way I go.
[02:08:51] FailBit: Brazilian President just officially impeached
[02:09:00] Arcaire: Why are they putting him in a peach?
[02:09:06] Arcaire: Is it for a convention?
[02:09:15] sevenseacat: whats that got to do with rails?
[02:09:15] drim: do you have any idea how can I fix my error with fixtures?
[02:09:45] flashpoint9: has joined #RubyOnRails
[02:10:22] Arcaire: drim: If you're doing it with fixtures you need to generate the password hash with Devise and use that output in your fixture.
[02:10:48] drim: this is what I tried to do
[02:10:55] Arcaire: The reason that's the case is because devise exposes an attribute called "password" but it's actually working with the db column "encrypted_password", and performing what I'll simply describe as "hash magic".
[02:11:04] Arcaire: In your test you need to use password.
[02:11:06] drim: encrypted_password: <%= User.new.send(:password_digest, 'password') %>
[02:11:18] Arcaire: wait, what?
[02:11:57] drim: I tried also Devise::Encryptor.digest(User, 'password')
[02:12:00] drim: but same issue
[02:12:02] Arcaire: Yeah that's what I'd do.
[02:12:08] Radar: No, please don't do that.
[02:12:17] Radar: Setting password should be fine. You don't need to set encrypted_password yourself.
[02:12:22] Arcaire: Radar: in fix
[02:12:25] Radar: password: 'password'
[02:12:29] Arcaire: >no db column
[02:12:32] drim: not working in fixture Radar
[02:12:36] Radar: drim: !didntwork
[02:12:36] helpa: drim: What "didn't work"? Did your server not start? Did your computer explode? Did your webpage turn bright pink? Did your client not pay your bill on time? You may have to be more specific. A Gist (http://gist.github.com) of the code that doesn't work (and the error you are getting) will be helpful.
[02:12:41] Radar: Oh because it'll try to insert it
[02:12:42] Arcaire: They already provided the error.
[02:12:42] drim: table "users" has no column named "password".
[02:12:45] Radar: stop using fixtures.
[02:12:50] helpa: Next question, please!
[02:12:58] Arcaire: drim: I apologise on behalf of the channel.
[02:13:09] drim: why is that coming by default with Rails so..
[02:13:21] Arcaire: We don't get to choose that, unfortunately.
[02:13:32] Arcaire: There's a lot of things I seriously dislike that are default in Rails.
[02:13:34] stannard: has joined #RubyOnRails
[02:13:46] Arcaire: Turbolinks, Spring (often), Fixtures, sometimes ActiveRecord.
[02:14:18] Arcaire: The one downside of having a single head of development, really.
[02:14:29] Arcaire: Works well for Python because Guido listens.
[02:14:47] drim: is there a way still to fix that with fixtures?
[02:14:48] FailBit: don't use fixtures
[02:14:48] Arcaire: Doesn't work well for Rails because Hansson just wants Rails to work for him, everyone else using it is a positive side-effect.
[02:14:52] Arcaire: Not really.
[02:15:01] Arcaire: It's too much of a pain to warrant continuing to use fixtures, tbh.
[02:15:12] FailBit: just don't use fixtures
[02:15:43] drim: you all recommend rspec + fg so?
[02:16:14] FailBit: I do not recommend rspec
[02:16:20] FailBit: but use it if you want
[02:16:25] FailBit: everyone else does
[02:16:29] drim: minitest + fg?
[02:16:38] FailBit: that's what I use
[02:16:40] Arcaire: FailBit is an outlier. RSpec is pretty good.
[02:16:46] Arcaire: Simple and easy to use.
[02:16:49] Arcaire: Also comfy and easy to wear.
[02:17:04] FailBit: once you memorize its crazy syntax rules
[02:17:11] bklane: has joined #RubyOnRails
[02:17:26] Arcaire: You mean all of "it 'puts the lotion' do"
[02:18:52] FailBit: my gripe is that the DSL is so complete that even if ruby is running the code underneath you're hardly able to write any ruby
[02:19:23] FailBit: I distinctly remember having to call eval in a loop to get the output I wanted
[02:19:28] sevenseacat: you have a lot of weird gripes about things that dont make sense.
[02:19:31] Radar: further what
[02:19:46] Radar: You could say that my whattage is high.
[02:20:00] tjbiddle: has joined #RubyOnRails
[02:20:08] FailBit: nested contexts
[02:20:20] Radar: got some code as an example?
[02:20:36] FailBit: and at that time I did not know about instance_exec which I think may have worked insteaf
[02:20:40] FailBit: let me check
[02:20:47] FailBit: I think I saved that one
[02:22:08] FailBit: ah yes it's in ~/.snips/what_the_fuck.rb
[02:22:20] FailBit: ACTION pastebins
[02:24:41] FailBit: the first version I did was eval
[02:24:47] FailBit: the second one was not
[02:24:48] FailBit: http://paste.ubuntu.com/15906927/
[02:25:18] sevenseacat: its like shared example groups, but with helpings of wtfs
[02:26:16] FailBit: that's most of my code
[02:26:24] FailBit: and also why I don't use rspec
[02:26:41] sevenseacat: because you write wtfs...?
[02:27:25] ishamo: has joined #RubyOnRails
[02:27:26] sp1rs: has joined #RubyOnRails
[02:27:31] gmci: has joined #RubyOnRails
[02:28:21] FailBit: I can't stand dsls like that
[02:28:42] FailBit: and by extension I write wtfs in them
[02:30:33] sevenseacat: if you don't like them, don't use them. but don't use that as an excuse for poor code.
[02:30:58] sevenseacat: and don't use that poor code to convince others that 'this is why it sucks'
[02:31:23] sevenseacat: because that says a lot about you as a developer, but not much about rspec
[02:31:30] jglover: has joined #RubyOnRails
[02:31:42] FailBit: and that's why I don't have a job in programming
[02:31:51] jglover: do you guys trust the devise_token_auth gem for token auth with devise?
[02:31:56] jglover: if not, what alternative do you use?
[02:32:21] jglover: FailBit: responding to me?
[02:32:30] FailBit: jglover: yes
[02:32:48] jglover: ah good to know. It only has about 1800 stars on gh
[02:32:54] jglover: so im not sure if it's ok to use
[02:32:58] FailBit: sevenseacat: I consider myself an absolutely horrid programmer
[02:33:10] sevenseacat: that makes two of us.
[02:33:12] FailBit: jglover: >only 1800 >not okay to use
[02:33:13] aurum_infide___: has joined #RubyOnRails
[02:36:19] altair118: has joined #RubyOnRails
[02:36:32] smoitra: has joined #RubyOnRails
[02:40:19] braincra-: has joined #RubyOnRails
[02:41:43] mices: has joined #RubyOnRails
[02:42:00] SteenJobs: sevenseacat: that’s scary to hear..
[02:42:35] macsteps: has joined #RubyOnRails
[02:43:47] duncannz: has joined #RubyOnRails
[02:44:22] duncannz: has left #RubyOnRails: ()
[02:45:09] Ropeney: has joined #RubyOnRails
[02:45:31] SteenJobs: that you consider yourself a horrid programmer haha
[02:45:50] sevenseacat: no, I consider FailBit to be one.
[02:46:12] SteenJobs: oh haha i totally misread that
[02:46:12] FailBit: I am a programmer masochist
[02:46:28] FailBit: apparently
[02:46:29] SteenJobs: oo i want to hear what was horrid about his code
[02:46:35] FailBit: just look at it
[02:46:59] SteenJobs: haha dying at the first comment
[02:47:31] SteenJobs: yea but i feel like everyone has those moments where you’re being a bit lazy
[02:47:47] FailBit: that wasn't laziness
[02:47:59] FailBit: that was me telling rspec to get off my lawn
[02:48:28] FailBit: im one of those old timers who just likes writing ruby
[02:48:54] SteenJobs: heh, not a terrible title
[02:51:10] altair118: has joined #RubyOnRails
[02:52:14] creature: has joined #RubyOnRails
[02:52:14] creature: has joined #RubyOnRails
[02:53:10] nettoweb: has joined #RubyOnRails
[02:54:05] flashpoint9: has joined #RubyOnRails
[02:56:19] duncannz: has joined #RubyOnRails
[03:00:33] hxegon: has joined #RubyOnRails
[03:06:16] draig: has joined #RubyOnRails
[03:09:15] macsteps: has joined #RubyOnRails
[03:13:14] braincras: has joined #RubyOnRails
[03:13:52] arBmind1: has joined #RubyOnRails
[03:19:32] SteenJobs: has joined #RubyOnRails
[03:21:55] diegoviola: has joined #RubyOnRails
[03:26:19] pwnd_nsfw: has joined #RubyOnRails
[03:27:11] Radar: Yeah this would totally be solved by shared example groups
[03:28:09] pawnbox: has joined #RubyOnRails
[03:28:15] Trynemjoel: has joined #RubyOnRails
[03:31:28] jetpack_joe: has joined #RubyOnRails
[03:35:55] nettoweb: has joined #RubyOnRails
[03:38:59] M-shine: has joined #RubyOnRails
[03:40:58] diego1: has joined #RubyOnRails
[03:40:59] Coldblackice_: has joined #RubyOnRails
[03:41:38] diego1: has joined #RubyOnRails
[03:42:18] eduardodeoh: has joined #RubyOnRails
[03:47:15] baweaver: has joined #RubyOnRails
[03:48:19] bklane: has joined #RubyOnRails
[03:53:57] ur5us: has joined #RubyOnRails
[04:05:33] ur5us_: has joined #RubyOnRails
[04:07:57] DoctorMonocular: has joined #RubyOnRails
[04:12:48] lxsameer: has joined #RubyOnRails
[04:13:59] sypheren: has joined #RubyOnRails
[04:15:32] yfeldblum: has joined #RubyOnRails
[04:16:13] stannard: has joined #RubyOnRails
[04:17:48] benlieb: has joined #RubyOnRails
[04:19:32] rew: has joined #RubyOnRails
[04:20:29] Olipro_: has joined #RubyOnRails
[04:21:22] bronson: has joined #RubyOnRails
[04:22:01] jhill: has joined #RubyOnRails
[04:23:39] sarink: has joined #RubyOnRails
[04:23:44] PedramT: has joined #RubyOnRails
[04:29:03] ur5us: has joined #RubyOnRails
[04:30:29] sp1rs: has joined #RubyOnRails
[04:31:31] beilabs: has joined #RubyOnRails
[04:33:59] hxegon: has joined #RubyOnRails
[04:37:30] PedramT: has joined #RubyOnRails
[04:40:36] jetpack_joe: has joined #RubyOnRails
[04:42:26] bklane: has joined #RubyOnRails
[04:43:07] aloneintheworld: has joined #RubyOnRails
[04:43:15] marcdel: has joined #RubyOnRails
[04:43:54] one_zero: has joined #RubyOnRails
[04:44:36] sp1rs: has joined #RubyOnRails
[04:48:35] srinidhi: has joined #RubyOnRails
[04:48:39] srinidhi: has joined #RubyOnRails
[05:05:30] tildes: has joined #RubyOnRails
[05:09:57] sp1rs: has joined #RubyOnRails
[05:14:18] Devalo: has joined #RubyOnRails
[05:14:34] one_zero: has joined #RubyOnRails
[05:14:52] yfeldblum: has joined #RubyOnRails
[05:15:05] smathy: has joined #RubyOnRails
[05:16:40] smathy: has joined #RubyOnRails
[05:18:10] sp1rs: has joined #RubyOnRails
[05:19:37] markelite: has joined #RubyOnRails
[05:21:23] altair118: has joined #RubyOnRails
[05:22:28] zpe: has joined #RubyOnRails
[05:30:45] aurum_infide: has joined #RubyOnRails
[05:32:38] sarink: has joined #RubyOnRails
[05:36:39] wenchenx_: has joined #RubyOnRails
[05:37:21] agent_white: has joined #RubyOnRails
[05:38:32] tvw: has joined #RubyOnRails
[05:41:55] triptec: has joined #RubyOnRails
[05:42:22] sp1rs: has joined #RubyOnRails
[05:44:47] sp1rs: has joined #RubyOnRails
[05:45:40] Ratler: has joined #RubyOnRails
[05:45:44] lacrosse: has joined #RubyOnRails
[05:46:50] yfeldblum: has joined #RubyOnRails
[05:49:15] rvanlieshout: has joined #RubyOnRails
[05:59:54] mark2: has joined #RubyOnRails
[06:00:50] mark_66: has joined #RubyOnRails
[06:01:19] dionysus69: has joined #RubyOnRails
[06:03:25] Cohedrin_: has joined #RubyOnRails
[06:11:56] fedexo: has joined #RubyOnRails
[06:13:24] edwinvdgraaf: has joined #RubyOnRails
[06:15:58] aganov: has joined #RubyOnRails
[06:17:22] marcdel: has joined #RubyOnRails
[06:17:40] stannard: has joined #RubyOnRails
[06:19:11] ss_much: has joined #RubyOnRails
[06:20:27] bklane: has joined #RubyOnRails
[06:23:15] zpe: has joined #RubyOnRails
[06:24:09] PedramT: has joined #RubyOnRails
[06:25:46] dede: has joined #RubyOnRails
[06:27:06] pawnbox: has joined #RubyOnRails
[06:27:26] solars: has joined #RubyOnRails
[06:27:33] sarink: has joined #RubyOnRails
[06:29:50] pawnbox: has joined #RubyOnRails
[06:33:17] aurum_infide_: has joined #RubyOnRails
[06:39:30] krzkrz: has joined #RubyOnRails
[06:42:58] triptec_: has joined #RubyOnRails
[06:44:16] ur5us: has joined #RubyOnRails
[06:44:51] diegoaguilar: has joined #RubyOnRails
[06:45:40] edward_: can I find out what happened between two commits
[06:45:49] edward_: My tests are failing after a specific commit but I can't tell what went wrong
[06:47:38] matt_d: Edward_: quite the broad question :) perhaps start looking at the diff of the two commits and see what has changed
[06:49:16] diegoaguilar: has joined #RubyOnRails
[06:51:48] edward_: matt_d, I think github is glitched
[06:51:51] edward_: doesnt show exactly what changed
[06:51:55] edward_: trying commandline
[06:53:38] diegoaguilar: has joined #RubyOnRails
[06:54:59] sarink: has joined #RubyOnRails
[06:56:02] rubyonrailed: has joined #RubyOnRails
[06:56:11] matt_d: Edward_: do you know what file you want to look at?
[06:56:21] matt_d: Edward_: or, investigate?
[06:56:40] edward_: well I have a master branch that isn't failing
[06:56:49] edward_: and a branch that is failing
[06:56:59] edward_: I want to merge master into the other branch locally
[06:57:06] edward_: how would I find the commit repsonsible?
[06:58:54] matt_d: Edward_: you want to compare a feature branch with master branch?
[06:59:16] edward_: master branch is passing, feature branch is not
[06:59:31] edward_: I already merged the master and feature locally
[06:59:49] matt_d: Edward_: so, for exmaple. right now i'm working on a branch called matt-allowed-networks. if i want to compare current changes to master i can: git diff master matt-allowed-networks
[07:01:27] AimlessRAven: has joined #RubyOnRails
[07:01:55] AimlessRAven: hi all i have https://gist.github.com/anonymous/a4b83baed270bb2c82a177ee63826541
[07:01:59] AimlessRAven: how my form would be like
[07:02:02] PedramT_: has joined #RubyOnRails
[07:02:42] AzaToth: has joined #RubyOnRails
[07:05:20] matt_d: AimlessRaven: you can use the form_tag helper and map it to your contact_send route.
[07:06:44] AimlessRAven: matt_d: its would look like = form_tag url: contact_send
[07:09:18] matt_d: AimlessRaven: form_tag(your_route_path, method: "POST")
[07:10:37] pawnbox: has joined #RubyOnRails
[07:11:55] brunto: has joined #RubyOnRails
[07:12:52] artto: has joined #RubyOnRails
[07:16:26] sp1rs: has joined #RubyOnRails
[07:20:19] AimlessRAven: matt_d: ok but my submit tag .. is need to have any parameters
[07:20:59] aurum_infide: has joined #RubyOnRails
[07:28:15] Palsson: has joined #RubyOnRails
[07:28:17] antgel: has joined #RubyOnRails
[07:28:32] artto: has joined #RubyOnRails
[07:29:05] tenzan: has joined #RubyOnRails
[07:30:01] jhass: AimlessRaven: http://guides.rubyonrails.org/form_helpers.html
[07:34:08] ferr: has joined #RubyOnRails
[07:37:06] dgncn: has joined #RubyOnRails
[07:38:51] mentero: has joined #RubyOnRails
[07:42:07] sp1rs: has joined #RubyOnRails
[07:42:25] bruno-: has joined #RubyOnRails
[07:45:24] moep: has joined #RubyOnRails
[07:48:27] yfeldblum: has joined #RubyOnRails
[07:51:15] Linuus: has joined #RubyOnRails
[07:52:11] krzkrz: has joined #RubyOnRails
[07:54:31] DoubleMalt: has joined #RubyOnRails
[07:55:14] artto: has joined #RubyOnRails
[07:55:15] SanguineAnomaly: has joined #RubyOnRails
[07:56:47] arathald: has joined #RubyOnRails
[07:59:45] AimlessRAven: how to define attrute for form in my controller, i mean not params.require but just attribute in my mailer action
[07:59:51] AimlessRAven: to define whitch field i wanna use
[07:59:58] universa1: AimlessRaven: whaaat?
[08:00:29] AimlessRAven: universa1: i have welcome controller and then i wanna send mail via form_tag, but how to define fields name, email, message in my controller action
[08:00:46] universa1: AimlessRaven: you don't. you specify fields in the form.
[08:01:06] universa1: AimlessRaven: and then you submit the form and look in the log what ended up in the params.
[08:01:46] artto: has joined #RubyOnRails
[08:02:31] marr: has joined #RubyOnRails
[08:02:34] rbr: has joined #RubyOnRails
[08:03:09] kareeoleez: has joined #RubyOnRails
[08:03:13] pawnbox: has joined #RubyOnRails
[08:03:17] tagaulap: has joined #RubyOnRails
[08:03:53] beilabs: has joined #RubyOnRails
[08:05:51] rbr: has joined #RubyOnRails
[08:06:12] mikecmpbll: has joined #RubyOnRails
[08:06:19] andrew9184: has joined #RubyOnRails
[08:12:16] nobitanobi: has joined #RubyOnRails
[08:13:18] darutoko: has joined #RubyOnRails
[08:19:17] stannard: has joined #RubyOnRails
[08:19:29] Sylario: has joined #RubyOnRails
[08:19:31] kareeoleez: has anyone setup semantic ui manually in Rails ?
[08:19:58] kareeoleez: I am struggling to find how to connect css/js/fonts & themes together with the asset pipeline
[08:20:12] Sylario: has joined #RubyOnRails
[08:20:13] AimlessRAven: https://gist.github.com/anonymous/3d7bcb4b722f7e116c1d08cc8b13dada
[08:20:23] AimlessRAven: how to set in controller my form params
[08:20:50] rbr: has joined #RubyOnRails
[08:21:00] tbuehlmann: has joined #RubyOnRails
[08:21:25] _3by8: has joined #RubyOnRails
[08:24:06] _3by8: I'm looking at some code in an old example app that I followed along with and the edit method of a controller is completely empty but when I go there, everything works as expected. It's like something is creating an instance variable without my knowledge of it... I've checked the helper files and I don't see any references to the rogue instance variable there either... any ideas?
[08:24:25] quazimodo: has joined #RubyOnRails
[08:25:29] universa1: AimlessRaven: !gist-usage ....
[08:25:29] helpa: AimlessRaven: How to use Gist properly: https://github.com/radar/guides/blob/master/using-gist.markdown
[08:25:41] _3by8: Never mind, found it...
[08:26:40] Psy-Q: has joined #RubyOnRails
[08:26:55] pawnbox: has joined #RubyOnRails
[08:27:20] drptbl: has joined #RubyOnRails
[08:31:45] Ergo: has joined #RubyOnRails
[08:32:23] Pumukel: has joined #RubyOnRails
[08:34:58] quazimod1: has joined #RubyOnRails
[08:36:39] pawnbox: has joined #RubyOnRails
[08:39:16] markelite: has joined #RubyOnRails
[08:40:44] Eliogabalus: has joined #RubyOnRails
[08:42:49] Eliogabalus: Hello. I have in a controller defined a callback before_action :set_license_detail, only: [:show, :edit, :update, :destroy]. I have a function called modify for the same controller and a view modify.html.erb. Whenever I access the route license_detail_modify, the set_license_detail callback gets called.
[08:43:08] bruno-: has joined #RubyOnRails
[08:43:22] blackhuey: has joined #RubyOnRails
[08:43:23] universa1: Eliogabalus: !code + log trace => gist
[08:43:23] helpa: Eliogabalus: We cannot help you with your problem if you don't show us your code. Please put it on http://gist.github.com and give us the URL so we can see it.
[08:44:17] Eliogabalus: https://gist.github.com/anonymous/60c434e0958a7be4a4d25baf3fea7093
[08:45:58] srinidhi: has joined #RubyOnRails
[08:46:01] Eliogabalus: I intend that the set_license_detail controller does not get called whenever the route license_detail/modify is used.
[08:46:08] universa1: Eliogabalus: error trace?
[08:47:38] Eliogabalus: https://gist.github.com/anonymous/5bda6b734035ab47ed9cb178e8f4c7c1
[08:47:53] universa1: Eliogabalus: https://gist.github.com/anonymous/5bda6b734035ab47ed9cb178e8f4c7c1#file-gistfile1-txt-L1
[08:48:12] universa1: you can also add multiple files to one gist, makes it easier.
[08:51:54] Eliogabalus: I presume I have something wrong with my routes, but no idea what it is.
[08:52:03] AimlessRAven: has joined #RubyOnRails
[08:52:47] AimlessRAven: how to set attributes in my action controller for my form, i dont have model and controller.. just have form and need to pass him attributes in my controller go get their value
[08:53:43] mdw: has joined #RubyOnRails
[08:56:05] universa1: Eliogabalus: we can't tell, unless we see the code generating the url and routes.rb
[08:56:19] universa1: AimlessRaven: did you look in the log?!
[08:56:39] njero: has joined #RubyOnRails
[09:00:18] universa1: the request log prints you the params hash... ...maybe you can find your submitted values in there
[09:00:49] zpe: has joined #RubyOnRails
[09:02:17] WhereIsMySpoon_: has joined #RubyOnRails
[09:03:22] srinidhi: has joined #RubyOnRails
[09:04:54] AimlessRAven: https://gist.github.com/anonymous/c82f84d0a0c424df96818a2deada737e
[09:04:56] artto: has joined #RubyOnRails
[09:05:02] AimlessRAven: how to set theese form attribute in my mailer action
[09:06:18] universa1: AimlessRaven: !gist-usage --- syntax highlighting is a wonderful thing!
[09:06:18] helpa: AimlessRaven: How to use Gist properly: https://github.com/radar/guides/blob/master/using-gist.markdown
[09:06:34] universa1: AimlessRaven: did you look in the log?!
[09:08:14] drptbl_: has joined #RubyOnRails
[09:11:34] bollullera: has joined #RubyOnRails
[09:12:59] moei: has joined #RubyOnRails
[09:13:50] ravionrails: has joined #RubyOnRails
[09:13:53] bmf: has joined #RubyOnRails
[09:13:55] sp1rs: has joined #RubyOnRails
[09:17:17] SteenJobs: has joined #RubyOnRails
[09:17:41] quazimodo: has joined #RubyOnRails
[09:17:42] quazimod1: has joined #RubyOnRails
[09:18:53] skislak: has joined #RubyOnRails
[09:22:08] mbreedlove: has joined #RubyOnRails
[09:22:22] chagel: has joined #RubyOnRails
[09:22:42] watersoul: has joined #RubyOnRails
[09:25:14] jsrn: has joined #RubyOnRails
[09:25:34] artto: has joined #RubyOnRails
[09:26:41] solars: hi, quick question: if I wrap a class definition into a module, do I always have to refer to it as Module::Class in rails? e.g.: https://gist.github.com/solars/465c5fd488ae6733f2d76e2c400b6a44
[09:27:05] Dbugger: has joined #RubyOnRails
[09:27:11] Dbugger: Hello everyone
[09:27:25] DefV: solars: jup, unless the place you're using it includes Module itself
[09:27:26] Dbugger: I have a template like this (http://hastebin.com/qibamaqeze.erb), that I want to use often, since it is bootstraped code from a CSS framework I am using. But I do not know how to use it. I tried to do it like this (http://hastebin.com/jigeqiziya.erb) but it gives me an error. What am I doing wrong?
[09:27:56] sevenseacat: dbugger: not showing the error, for starters
[09:28:13] Dbugger: The error is this: 'nil' is not an ActiveModel-compatible object. It must implement :to_partial_path.
[09:28:16] solars: DefV, how do you mean includes Module itself?
[09:28:28] sevenseacat: dbugger: !debug
[09:28:28] helpa: dbugger: You have not provided enough information to debug your problem. Please provide this information: https://gist.github.com/radar/5384431
[09:28:29] Dbugger: sevenseacat, I was going to put it. i was just slow :)
[09:30:32] rbr: has joined #RubyOnRails
[09:31:41] neanderslob: has joined #RubyOnRails
[09:32:45] solars: don't mess with sevenseacat if you've got an incomplete problem definition
[09:33:45] kszarlej: has joined #RubyOnRails
[09:33:50] Dbugger: Indeed, I am guilty
[09:34:50] sevenseacat: how slow is slow?
[09:36:40] kszarlej: hey guys! Is there any possibility to make Rails ActiveRecord log in pure json so I can forward its logs to logstash? I have config.logger = LogStashLogger.new and most of the logs are in json but activerecord debug SQL are in plaintext
[09:37:05] kszarlej: I assume activerecord has its own logger
[09:37:22] Linuus: has joined #RubyOnRails
[09:37:33] sevenseacat: *hey everyone
[09:38:34] kszarlej: yeah, hey everyone! :D
[09:38:40] hervie: has joined #RubyOnRails
[09:40:00] fox_muld1r_cp: hi. a have a set of properties in jsonb field, and i need to post it to server after update. what is the best way to do it? compose it by js into one hidden field and post it, or make allowed_params list and compose it on server side
[09:42:16] solars: guys is not gender specific, right
[09:44:09] pawnbox: has joined #RubyOnRails
[09:44:20] bruno-: has joined #RubyOnRails
[09:46:27] krzkrz: has joined #RubyOnRails
[09:47:23] workmad3: has joined #RubyOnRails
[09:49:13] fox_muld1r_cp: solars: I see fol(k)s as greeting message in some channels in fronode
[09:50:09] solars: I mean just in general, I'm no native english speaker but from my experience people use it referring to folks in general
[09:51:08] workmad3: solars: guys is frequently used in both gender-specific and non-gender-specific ways, making it rather ambiguous and potentially exclusionary
[09:51:10] fox_muld1r_cp: i'm from Ukraine, and we use some (s)lang in cyrillic itc networks for greetings
[09:51:16] nettoweb: has joined #RubyOnRails
[09:52:01] fox_muld1r_cp: ad what about my question for jsonb field and it's hash? now it posts .. "options"=>"sssasas"..)...
[09:52:29] aaronr: has joined #RubyOnRails
[09:53:39] baweaver: has joined #RubyOnRails
[09:53:52] Chagel_: has joined #RubyOnRails
[09:54:29] solars: workmad3, that's what I meant, yeah
[09:57:50] Seich: has joined #RubyOnRails
[09:58:05] yfeldblum: has joined #RubyOnRails
[09:59:48] lightheaded: has joined #RubyOnRails
[10:01:27] aaronr: has joined #RubyOnRails
[10:02:27] artto: has joined #RubyOnRails
[10:09:00] njero: has joined #RubyOnRails
[10:10:20] delgiudices: has joined #RubyOnRails
[10:12:30] petor: has joined #RubyOnRails
[10:12:36] ZerGabriel: has joined #RubyOnRails
[10:13:05] bollullera: has joined #RubyOnRails
[10:13:57] srinidhi: has joined #RubyOnRails
[10:15:29] fox_muld1r_cp: how to change this example ' match '/new?:type' => 'client#create', via: [:get], :as => :type ' for create action create in resource with ?type=some argument?
[10:16:32] fox_muld1r_cp: i need render some, based on /resource/new?type=something
[10:17:19] bollullera: has left #RubyOnRails: ()
[10:17:24] fox_muld1r_cp: now it type_client_path GET /clients/:id/new?:type(.:format)
[10:17:39] fox_muld1r_cp: in routes list
[10:20:20] arBmind: has joined #RubyOnRails
[10:20:55] stannard: has joined #RubyOnRails
[10:23:47] bronson: has joined #RubyOnRails
[10:23:56] artto: has joined #RubyOnRails
[10:27:49] wethu: has joined #RubyOnRails
[10:29:04] ql6wlld: has joined #RubyOnRails
[10:32:49] sp1rs: has joined #RubyOnRails
[10:33:35] pawnbox: has joined #RubyOnRails
[10:42:18] mbreedlove: has joined #RubyOnRails
[10:42:23] pawnbox: has joined #RubyOnRails
[10:42:57] Detch: has joined #RubyOnRails
[10:43:33] rodfersou: has joined #RubyOnRails
[10:45:24] bruno-: has joined #RubyOnRails
[10:46:50] mikeiniowa: has joined #RubyOnRails
[10:47:47] mbreedlove: has joined #RubyOnRails
[10:52:49] PedramT: has joined #RubyOnRails
[10:52:49] SeductiveError: has joined #RubyOnRails
[10:54:56] Andr3as: morning everyone.. i've been following this railscast http://railscasts.com/episodes/399-autocomplete-search-terms in order to create a simple search with autocomplete... however, it seems that the indexing does not work, even though i've doublechecked everything numerous times.. when i do the indexing manually, this is what i get and what i have: https://gist.github.com/awunder/b76aa31bde58909fe024210da9439c84
[10:55:13] Andr3as: it does not store the terms into the database
[10:55:30] Andr3as: and i am stuck.. anyone could take a look at it?
[10:56:44] Andr3as: where there is NULL in the search suggestion db - ther should be test and qeq
[10:57:02] pawnbox: has joined #RubyOnRails
[10:58:38] krzkrz: has joined #RubyOnRails
[10:59:59] daveomcd_: has joined #RubyOnRails
[11:00:44] maxx88_: has joined #RubyOnRails
[11:01:33] mozzarel1: has joined #RubyOnRails
[11:01:34] diprotic: has joined #RubyOnRails
[11:01:34] diprotic: has joined #RubyOnRails
[11:02:05] Obi_obi_: has joined #RubyOnRails
[11:02:07] shwoodard__: has joined #RubyOnRails
[11:02:24] deeprave_: has joined #RubyOnRails
[11:02:28] SuppliedRelic___: has joined #RubyOnRails
[11:02:46] jutah_: has joined #RubyOnRails
[11:03:05] Arcaire_: has joined #RubyOnRails
[11:03:15] fn2187_: has joined #RubyOnRails
[11:03:23] hjdivad_: has joined #RubyOnRails
[11:03:49] jtd_: has joined #RubyOnRails
[11:04:08] deavidsedice: has joined #RubyOnRails
[11:04:11] codelahoma_: has joined #RubyOnRails
[11:04:12] ltd: has joined #RubyOnRails
[11:04:12] bitemyap1: has joined #RubyOnRails
[11:04:18] philtr_: has joined #RubyOnRails
[11:04:19] Sigma01: has joined #RubyOnRails
[11:04:30] eyck: has joined #RubyOnRails
[11:04:32] bakingbread: has joined #RubyOnRails
[11:04:33] euphoriaa: has joined #RubyOnRails
[11:04:35] BaNzounet: has joined #RubyOnRails
[11:04:37] brunto: has joined #RubyOnRails
[11:04:37] rickmasta: has joined #RubyOnRails
[11:04:43] hinbody_: has joined #RubyOnRails
[11:04:44] thomasfedb_: has joined #RubyOnRails
[11:04:51] slash_ni1k: has joined #RubyOnRails
[11:04:52] trollface: has joined #RubyOnRails
[11:04:55] swistak35_: has joined #RubyOnRails
[11:04:57] kanzure_: has joined #RubyOnRails
[11:04:58] cwheeler: has joined #RubyOnRails
[11:04:58] fluxsour1e: has joined #RubyOnRails
[11:04:59] jarib_: has joined #RubyOnRails
[11:05:00] cfloare_: has joined #RubyOnRails
[11:05:07] djgraham|calypso: has joined #RubyOnRails
[11:05:16] rheddry: has joined #RubyOnRails
[11:05:21] Edward123: has joined #RubyOnRails
[11:05:29] spoon: has joined #RubyOnRails
[11:05:30] arthurnn_: has joined #RubyOnRails
[11:05:36] g3funk: has joined #RubyOnRails
[11:05:53] jalcine: has joined #RubyOnRails
[11:07:02] helpa-bot: has joined #RubyOnRails
[11:07:05] callumacrae: has joined #RubyOnRails
[11:07:19] Fernando-Basso: has joined #RubyOnRails
[11:07:23] deur-: has joined #RubyOnRails
[11:07:57] pipework: has joined #RubyOnRails
[11:08:30] cgfbee: has joined #RubyOnRails
[11:08:49] Fire-Dragon-DoL: has joined #RubyOnRails
[11:09:02] helpa: has joined #RubyOnRails
[11:10:38] AntiSpamMeta: has joined #RubyOnRails
[11:10:49] n008f4g_: has joined #RubyOnRails
[11:12:13] speakingcode: has joined #RubyOnRails
[11:12:18] G: has joined #RubyOnRails
[11:13:40] mbreedlo_: has joined #RubyOnRails
[11:14:51] GodFather: has joined #RubyOnRails
[11:14:53] sp1rs: has joined #RubyOnRails
[11:16:07] matthias_: has joined #RubyOnRails
[11:18:41] EasyCo: has joined #RubyOnRails
[11:19:31] spectra: has joined #RubyOnRails
[11:24:59] msyvich: has joined #RubyOnRails
[11:25:13] Papierkorb: has joined #RubyOnRails
[11:25:44] msyvich: When I run rake tasks using rbenv + rbenv-vars, the ENV variable is not populated with the contents of .rbenv-vars
[11:25:55] msyvich: Anyone seen this problem before?
[11:26:33] okdas: has joined #RubyOnRails
[11:26:33] okdas: has joined #RubyOnRails
[11:26:46] iamvery: has joined #RubyOnRails
[11:28:29] Shidash: has joined #RubyOnRails
[11:29:27] Thai_: has joined #RubyOnRails
[11:31:48] ldnunes: has joined #RubyOnRails
[11:32:09] nettoweb: has joined #RubyOnRails
[11:32:28] Raphal: has joined #RubyOnRails
[11:33:38] bruce_lee: has joined #RubyOnRails
[11:33:38] bruce_lee: has joined #RubyOnRails
[11:34:53] n008f4g_: has joined #RubyOnRails
[11:36:56] pawnbox: has joined #RubyOnRails
[11:39:26] beilabs: has joined #RubyOnRails
[11:42:59] rbr: has joined #RubyOnRails
[11:43:39] dionysus69: has joined #RubyOnRails
[11:44:21] iwada: has joined #RubyOnRails
[11:46:48] alextheger: has joined #RubyOnRails
[11:49:05] aep_: has joined #RubyOnRails
[11:49:16] Linuus: has joined #RubyOnRails
[11:49:48] JakFrist: has joined #RubyOnRails
[11:53:06] srinidhi: has joined #RubyOnRails
[11:54:59] baweaver: has joined #RubyOnRails
[12:00:09] stannard: has joined #RubyOnRails
[12:00:17] King_Rex: has joined #RubyOnRails
[12:01:02] scott_o: has joined #RubyOnRails
[12:04:11] tjvc: has joined #RubyOnRails
[12:04:11] tjvc: has joined #RubyOnRails
[12:06:54] szulak_: has joined #RubyOnRails
[12:06:59] artto: has joined #RubyOnRails
[12:07:11] King_Rex: has joined #RubyOnRails
[12:07:48] tjvc: has joined #RubyOnRails
[12:07:48] tjvc: has joined #RubyOnRails
[12:10:14] sevenseacat: has joined #RubyOnRails
[12:10:59] crameth: has joined #RubyOnRails
[12:13:09] n008f4g_: has joined #RubyOnRails
[12:13:12] siaW: unless my way of generating a rails 5 scaffold is wrong, this is not working. i don’t know why “rails generate scaffold Document filename:string content_type:string file_contents:binary”
[12:13:31] siaW: i’m expecting a file apps to be generated
[12:13:46] siaW: i get help text with know help for gerating scaffold
[12:14:04] siaW: i mean app files***
[12:15:04] sevenseacat: siaw: are you inside the folder of a rails app?
[12:15:19] siaW: no i’m on the desktop
[12:15:44] IrishGringo: has joined #RubyOnRails
[12:15:44] sevenseacat: you cant run rails app commands unless you're inside a rails app
[12:15:49] sevenseacat: otherwise what app are you running them for?
[12:18:09] siaW: yup right
[12:20:23] context: was that a "ahh ok" or a "i see, that works" or a ...... what was it !
[12:20:55] context: or were you just quizzing him? "good job sevenseacat, you get a gold star. you're on a roll this week"
[12:21:32] context: sevenseacat: http://www.smashthehsc.com/uploads/3/0/8/2/30822773/2407724_orig.png
[12:22:04] siaW: it works. thanks :)
[12:23:19] pawnbox: has joined #RubyOnRails
[12:23:47] Weavel: has joined #RubyOnRails
[12:33:30] vedu: has joined #RubyOnRails
[12:33:34] chagel: has joined #RubyOnRails
[12:34:40] eljimmy: has joined #RubyOnRails
[12:34:44] patrick_star: has joined #RubyOnRails
[12:36:59] myntcake: has joined #RubyOnRails
[12:41:48] newjersey: has joined #RubyOnRails
[12:41:59] rrawlins: has joined #RubyOnRails
[12:44:38] Eliogabalus: has joined #RubyOnRails
[12:46:21] bruno-: has joined #RubyOnRails
[12:52:00] constantinexvi: has joined #RubyOnRails
[12:57:34] ramortegui: has joined #RubyOnRails
[12:57:36] diegoaguilar: has joined #RubyOnRails
[12:59:47] aegis3121: has joined #RubyOnRails
[13:06:02] scrooloose: has joined #RubyOnRails
[13:06:48] artto: has joined #RubyOnRails
[13:10:49] sp1rs: has joined #RubyOnRails
[13:11:31] ekinmur: has joined #RubyOnRails
[13:13:42] smoitra_: has joined #RubyOnRails
[13:14:20] stannard: has joined #RubyOnRails
[13:14:26] norc: has joined #RubyOnRails
[13:16:46] quazimodo: has joined #RubyOnRails
[13:16:47] quazimod1: has joined #RubyOnRails
[13:16:48] flashpoint9: has joined #RubyOnRails
[13:18:20] snowy: has joined #RubyOnRails
[13:19:31] AlexJakeGreen: has joined #RubyOnRails
[13:19:38] drptbl: has joined #RubyOnRails
[13:20:05] krzkrz: has joined #RubyOnRails
[13:25:26] kanzure: has joined #RubyOnRails
[13:25:37] hxegon: has joined #RubyOnRails
[13:25:46] PedramT: has joined #RubyOnRails
[13:25:59] jtong: has joined #RubyOnRails
[13:26:08] someish: has joined #RubyOnRails
[13:26:25] aegis3121: has joined #RubyOnRails
[13:34:20] jtong: has joined #RubyOnRails
[13:34:48] siaW: has joined #RubyOnRails
[13:35:56] siaW: i have uploaded a binary file in my top app into the database. and from the console it looks like this “=> #<Document id: 1, name: "hello", file: "#<ActionDispatch::Http::UploadedFile:0x007fc4824b2...", created_at: "2016-04-18 13:28:37", updated_at: "2016-04-18 13:28:37”>”
[13:36:10] siaW: file is of type “binary”
[13:36:24] rvanlieshout: siaw: so .file.class ?
[13:36:31] siaW: with the help of image_tag, how can i display this image.
[13:36:36] siaW: file.class = String
[13:37:07] siaW: https://gist.github.com/siaw23/d3bf9c50886095981e0ca83caad8df90
[13:37:14] GodFather: has joined #RubyOnRails
[13:37:27] xMopxShell: has joined #RubyOnRails
[13:37:37] sevenseacat: you've stored a string of an object in your database
[13:37:42] sevenseacat: not an actual file
[13:38:24] elaptics: you could try passing it into StringIO and then you'll have a file again
[13:38:42] elaptics: e.g. file = StringIO.new(document.file)
[13:39:45] fox_muld1r_cp: siaw: open gem carrierwave :)
[13:39:48] elaptics: as for showing that on a page, you'd need to put the file somewhere that can be "read" e.g. write it to disk somewhere suitable, or you'd need a controller action to stream it
[13:40:43] siaW: elaptics: so what you’re saying is i HAVE to put the file somewhere on a disk? the file can’t be in the database?
[13:40:46] lancejordan: has joined #RubyOnRails
[13:41:13] elaptics: no, you could stream it out the db
[13:41:42] siaW: that’s what i want to do :p
[13:44:51] siaW: elaptics: how would i store the image in my db? i was thinking making a type of “binary” is enough
[13:45:07] siaW: looks like it’s storing a string instead of a file like sevenseacat said
[13:45:46] sevenseacat: I don't just make these things up
[13:47:06] siaW: sevenseacat: i know :)
[13:47:25] bruno-: has joined #RubyOnRails
[13:47:53] Dbugger: Do you guys and girls think, that a Rails project with a team of 20 people, is too much?
[13:49:18] norc: dbugger: If you have to ask the question it probably is.
[13:49:26] godzillaenlacasa: has joined #RubyOnRails
[13:50:25] Dbugger: norc, I think the app we are building in my new office is too big. I tried to convince the heads that we should break it down in several smaller apps, but they do not agree, and I am wondering what arguments I could use against the dreaded "There is not time for that"
[13:51:10] norc: dbugger: My point is that teams with 20 people is fine, but you need some methodology that can work with that.
[13:51:21] lancejordan: has joined #RubyOnRails
[13:52:01] Dbugger: norc, The migrations have gone really out of hand. A new member has to run a shitload of migrations that will be undone later on by older migrations.... the whole setup takes more than 5 hours
[13:52:59] norc: dbugger: Do not run migrations from scratch...
[13:53:10] Dbugger: norc, what do you mean?
[13:53:16] chagel: has joined #RubyOnRails
[13:53:24] Dbugger: what should we do?
[13:53:32] Macaveli: has joined #RubyOnRails
[13:53:34] jtong: has joined #RubyOnRails
[13:53:36] norc: dbugger: Migrations are for continuous work on production and perhaps staging environments. If you have the need to replicate the state, simply dump and load the schema as is.
[13:53:49] snowy: has joined #RubyOnRails
[13:53:59] Dbugger: Just doing that, seems to take its sweet time
[13:54:03] norc: That is what your db/schema.rb is for.
[13:54:14] norc: dbugger: But surely not 5 hours.
[13:54:38] Dbugger: actually was being nice. My first day was 10 hours running
[13:54:45] norc: dbugger: In fact your db/schema.rb should be automatically updated with each migration.
[13:54:54] norc: I seriously doubt that it takes 10 hours to load that file.
[13:55:23] Dbugger: I see... I am reading the comments on schema.rb
[13:55:34] Dbugger: That is something I did not know. That is something usefull that I have used...
[13:56:04] Dbugger: But you see, there is another problem... They are here working with "production data". That means a 5 GB database for production
[13:56:24] Dbugger: And what is worse, they use the migrations to move the data from the old database to the one on the developing app
[13:56:25] norc: dbugger: That is not a problem of team size.
[13:56:45] sevenseacat: sometimes I wonder if people realize this is a public channel where everyone can see people whinging about their employers and their projects
[13:57:08] Dbugger: well, Im not whinning. Im just trying to find out if there is a better approach or idea
[13:57:12] Dbugger: or maybe I am the one who is wrong
[13:57:14] Dbugger: and this is normal
[13:57:21] w0rd-driven: has joined #RubyOnRails
[13:57:24] Kallis: has joined #RubyOnRails
[13:57:25] sevenseacat: so far nothing you've said is related to having a team of 20 people
[13:57:26] norc: dbugger: You keep saying about mistakes and bad choices "they" make.
[13:57:27] Dbugger: I just want to know, what is the proper way to go forward, to improve the situation
[13:57:33] norc: I would call that whinging.
[13:57:50] arpegius: has joined #RubyOnRails
[13:57:51] EXCHGR: has joined #RubyOnRails
[13:58:02] norc: dbugger: You said it yourself. They are working with production data. The proper way is not to.
[13:58:06] Dbugger: well, just because I consider something "doubtful", it means not that I am right
[13:58:11] norc: They are working with migrations, the proper way is not to.
[13:58:23] njero: has joined #RubyOnRails
[13:58:38] Dbugger: Wait a minute there... you are telling me that in "development", is better not to work with migrations?
[13:59:08] norc: dbugger: migrations are useful for making changes.
[13:59:16] norc: But not for loading the state of an application.
[13:59:51] norc: dbugger: It is the equivalent of loading an entire git repository and doing a complete rebase for good measure.
[13:59:57] norc: Might as well skip the rebase.
[14:00:32] Dbugger: I got to admit, I didnt know about "db:schema:load". I never used it before, because all rails app I have built up to date, I was the only one of them
[14:01:01] Dbugger: Thank you for teaching me that
[14:01:13] norc: dbugger: next up, use db/seeds.rb
[14:01:22] centrx: has joined #RubyOnRails
[14:01:26] emachnic: has joined #RubyOnRails
[14:01:28] norc: That is a good place to define a minimum set of database data to work with.
[14:01:35] norc: Instead of having to load a 5gb dump.
[14:02:06] Dbugger: Yes, I would love to have some sort of seeding values, for development
[14:02:19] Dbugger: That is something else I would like to convince my team to change to
[14:02:23] loglaunch: has joined #RubyOnRails
[14:02:35] norc: dbugger: Do not convince your team, tell them to.
[14:02:39] webdestroya: has joined #RubyOnRails
[14:02:49] norc: If you are not in the position to tell them, convince whoever can to tell them.
[14:02:51] Dbugger: Well, I am the enw guy here, so it is hard to TELL THEM to do things :)
[14:03:11] Nuck: has joined #RubyOnRails
[14:03:20] \13k: has joined #RubyOnRails
[14:03:35] norc: dbugger: If you are so fresh and seeing so many problematic spots, have you perhaps considered that the team might not be a good fit for you?
[14:05:03] norc: dbugger: Either you are actually good (and recognise their mistakes) which means you should not have a real problem finding better job, or you have problems finding a better job, which might not exactly qualify to judge all their "mistakes".
[14:05:12] Dbugger: Well, they are clever people, and to be honest, they have heard my opinion and took it in many fields
[14:05:14] Dbugger: I like it here
[14:05:45] Dbugger: They just need to improve their methodology (in my opinion)
[14:06:01] Dbugger: Id like to help them on that
[14:06:07] Dbugger: But I also doubt myself many times
[14:06:08] akshat: has joined #RubyOnRails
[14:06:30] TheShaun: has joined #RubyOnRails
[14:06:35] Dbugger: that is why I asked your opinion, because I was thinking that MAYBE the amount of team members could be an argument
[14:06:54] Dbugger: But I am not sure if that is actually a factor, or an antipattern or whatever it can be called
[14:07:07] emachnic_: has joined #RubyOnRails
[14:11:11] mices: has joined #RubyOnRails
[14:11:14] SeductiveError: has joined #RubyOnRails
[14:11:36] mices: someone can look at this for me https://gist.github.com/mices/39bceabf15e945d527439cba0a7beeb1
[14:12:34] mices: nm i think i know what's wrong
[14:12:43] workmad3: has joined #RubyOnRails
[14:14:17] sar1nk: has joined #RubyOnRails
[14:15:20] SeductiveError: hi all, any one with experience in dateranges?
[14:16:20] helpa: Nope. No one. Ever. In the history of the world.
[14:18:41] srinidhi: has joined #RubyOnRails
[14:19:05] mices: actually no i don't know what's wrong https://gist.github.com/mices/39bceabf15e945d527439cba0a7beeb1
[14:19:21] akshat_: has joined #RubyOnRails
[14:20:15] norc: mices: Brilliant security hole. You basically give anyone with access to that function to move/rename/delete any files with the permission of the webserver on the entire Server your app runs on.
[14:20:20] norc: Are you sure you want that?
[14:20:54] mices: norc: it's not public it's a little utility app for my own record keeping here at home
[14:21:26] mices: it's just to run on localhost
[14:21:27] norc: mices: Of course home networks are more secure than any other network.
[14:21:31] beilabs: has joined #RubyOnRails
[14:21:47] elaptics: siaw: storing your image in the db as a string is possible but generally you'd be better storing it on the file system or in cloud storage like s3
[14:22:14] siaW: i don’t want to store it on s3 or anywhere in the cloud. i want it in db :)
[14:22:14] sadaf2605: has joined #RubyOnRails
[14:22:19] mices: it's not gonna be online
[14:22:28] elaptics: siaw: why not?
[14:22:38] siaW: because i was asked to do it in the db
[14:22:42] marr: has joined #RubyOnRails
[14:22:42] elaptics: siaw: if it's an image it needs to be accessible in some form in order to display it
[14:22:46] mices: so what's wrong with my FileUtils.move statement
[14:22:53] sevenseacat: after it was stored in public on heroku and then wiped
[14:23:27] siaW: sevenseacat: on heroku it wasn’t stored in the db, i tried to store it on their filesystem
[14:23:32] mices: to_path["queue/"]=""
[14:23:38] workmad3: siaw: being asked to do something isn't a requirement to actually do it... if I asked someone to do something stupid or insane, I'd expect them to question it to make sure my reasons behind it were sound or suggest alternatives
[14:23:39] sevenseacat: siaw: yes, thats what I just said
[14:23:47] RegulationD: has joined #RubyOnRails
[14:23:48] SeductiveError: just having an issue with datetimes, https://gist.github.com/anonymous/696280bd2a33d8f9e6f9f5d9008d5a9e
[14:23:52] mices: that should strip queue/ from to_path right?
[14:24:22] elaptics: siaw: heroku doesn't have a file-system per-se - they expect you to store anything permanent in some kind of cloud storage
[14:24:38] SeductiveError: dateranges* I'm just not getting why its incrementing by one when saved
[14:24:39] elaptics: siaw: that's just a misunderstanding as to how heroku works
[14:24:52] elaptics: sevenseacat: has this conversation already been had?
[14:24:54] shanson: has joined #RubyOnRails
[14:24:55] mices: norc: can you tell what's wrong with it?
[14:25:07] sevenseacat: elaptics: yes, I told siaw the exact same thing
[14:25:23] sevenseacat: then they got the db idea because they didnt want to use an external service
[14:25:52] drptbl: has joined #RubyOnRails
[14:26:03] artto_: has joined #RubyOnRails
[14:26:20] tvon: has joined #RubyOnRails
[14:27:30] elaptics: because that makes more sense... :(
[14:28:31] mices: FileUtils.move "#{from_path}", "#{to_path}"
[14:28:59] mices: it takes the whole thing with the , to be the first argument
[14:29:57] workmad3: mices: http://yourdomain.com/path?from_path=/etc/passwd&to_path=/dev/null
[14:30:26] siaW: sevenseacat: you can see my argument with him here https://gist.github.com/siaw23/f0e0e41beea88dd16d66191277f2ae1e
[14:31:06] siaW: elaptics: i want to know. is it POSSIBLE to save an image in the db? (though i know it’s bad practice).
[14:31:11] workmad3: siaw: ah, you're storing SVG images in the database
[14:31:17] workmad3: siaw: that is slightly less insane, yes :)
[14:31:38] sevenseacat: of course its possible
[14:31:48] SeductiveError: you can just store the hex representation of it
[14:31:52] SeductiveError: or the CSS code
[14:31:58] sevenseacat: you save the contents of the file, not the uploaded file object
[14:32:03] workmad3: siaw: and yes, it's possible to save an image in the db... you need a BLOB for the data, you need to be happy that the database isn't going to screw up the binary info, and you should store the mime type as well, then you can use rails` send_data to send the data and the mime type from the database
[14:32:33] siaW: workmad3: but SVG would be easier right?
[14:32:35] workmad3: (I've done it before, purely for a demo)
[14:32:43] siaW: i think that’s what he meant
[14:32:51] darkxploit: has joined #RubyOnRails
[14:32:54] siaW: like that’s what he wanted me to do
[14:33:01] workmad3: siaw: you'd want pretty much exactly the same db setup, but you could get away with a TEXT field rather than a BLOB
[14:33:33] SeductiveError: svg is just XML =]
[14:33:48] workmad3: but you'd probably still be safer doing BLOB just to avoid the possibility that you accidentally transcode some embedded binary data or character encodings
[14:34:22] siaW: workmad3: but if i use SVG+XML string type should do the job. or not?
[14:34:55] Coldblackice_: has joined #RubyOnRails
[14:35:05] workmad3: siaw: depends on how paranoid you want to be about the aforementioned edge cases :)
[14:35:20] siaW: i’m not at all
[14:36:05] workmad3: siaw: btw, it's still fairly insane to be doing this, just not quite as insane as arbitrary bitmap formats :)
[14:36:50] tfitts: has joined #RubyOnRails
[14:36:57] siaW: i’d like to take the “slightly less insane” path
[14:37:12] siaW: meaning storing the SVG in db
[14:37:40] workmad3: siaw: well, you've now got pretty much all the info you need, so feel free to go do that :)
[14:37:56] Ergo: has joined #RubyOnRails
[14:37:58] siaW: yes, i’m doing a dummy app aside to test this
[14:38:04] SeductiveError: is there a particular reasoning for him wanting to do that?
[14:38:22] siaW: well his reason was “the reasone we don't want s3 is because we don't need to overcomplicate this solution now”
[14:39:12] SeductiveError: its not that difficult to setup, I mean it has simple in its acronym
[14:40:31] siaW: i know haha. but i think he doesn’t want to pay for s3 or something? i know it’s cheap but he doesn’t want to have credit cards involved or stuff like that. that’s what he meant by “not keeping things complcated"
[14:40:41] siaW: maybe cause i don’t see any other sensible reason here
[14:40:56] SeductiveError: besides just having a folder to pull images from on the local disk?
[14:41:20] sevenseacat: meh, any more and we'd be doing your job for you
[14:42:15] siaW: sevenseacat: i’m a noob just learning. i have to also mention this is an opensource project i’m contributing to :)
[14:42:18] siaW: :D :D :D
[14:42:26] siaW: but i’m going through this just for the experience
[14:43:45] hxegon: has joined #RubyOnRails
[14:44:18] SeductiveError: you could do best of both worlds, store filepath in db
[14:44:34] yardenbar: has joined #RubyOnRails
[14:44:42] mdel: has joined #RubyOnRails
[14:44:55] pawnbox: has joined #RubyOnRails
[14:46:33] pawnbox: has joined #RubyOnRails
[14:47:10] arpegius: has joined #RubyOnRails
[14:50:42] adavia: has joined #RubyOnRails
[14:51:07] chagel: has joined #RubyOnRails
[14:54:15] polishdub: has joined #RubyOnRails
[14:56:27] pawnbox: has joined #RubyOnRails
[14:57:51] SteenJobs: has joined #RubyOnRails
[14:58:59] atrius: has joined #RubyOnRails
[15:01:15] rubyonrailed: has joined #RubyOnRails
[15:01:42] brent__: has joined #RubyOnRails
[15:05:43] jstransky: has joined #RubyOnRails
[15:05:50] jhack: has joined #RubyOnRails
[15:06:32] Devalo: has joined #RubyOnRails
[15:06:59] elaptics: which is what carrierwave et al actually do
[15:08:01] treehug88: has joined #RubyOnRails
[15:08:04] n008f4g_: has joined #RubyOnRails
[15:10:02] franzip: has joined #RubyOnRails
[15:10:09] godzillaenlacasa: is there a way to create a SecureRandom type of hash for 2 strings? I'm trying to make a 'fingerprint'... so if either of the two strings change, then a new 'fingerprint' is generated
[15:11:01] smathy: has joined #RubyOnRails
[15:11:10] workmad3: godzillaenlacasa: create a sha256 hash of the two strings concatenated
[15:11:11] elaptics: godzillaenlacasa: concat the strings and hash the resulting one
[15:11:13] lxsameer: has joined #RubyOnRails
[15:11:33] godzillaenlacasa: @workmad3 @elaptics haha, nice guys
[15:11:35] elaptics: I think that's a definitive solution :D
[15:12:10] smathy: godzillaenlacasa, hash the strings.
[15:12:41] smathy: (probably funnier to me than you guys)
[15:12:48] SteenJobs: haha i laughed
[15:12:55] zave: has joined #RubyOnRails
[15:13:13] SteenJobs: and was strongly debating making the same joke for added effect
[15:13:35] SteenJobs: smathy: oo clear indication your joke fell totally flat
[15:14:00] smathy: godzillaenlacasa, question really becomes which hashing algorithm to use, if it's for anything security-related then you might be better off using bcrypt - which is much harder to attack.
[15:14:08] smathy: SteenJobs, yep :)
[15:14:46] godzillaenlacasa: @smathy nah, not security related at all... just trying to create a unique fingerprint, but still tie it to a DB entry as long as it doesn't change.
[15:14:47] smathy: It was too easy to think I just missed the other replies (which I do quite a bit too actually ;)
[15:14:51] hobodave: has joined #RubyOnRails
[15:15:15] smathy: godzillaenlacasa, ok cool, so yeah, just go for a fast hash.
[15:15:35] Balzrael: has joined #RubyOnRails
[15:16:37] yellow5: has joined #RubyOnRails
[15:17:27] k13nox: has joined #RubyOnRails
[15:18:25] k13nox: Hi, anyone know how to use #run_periodic_timer(channel, callback) in Rails 5 ActionCable ?
[15:18:59] w0rd-driven: has joined #RubyOnRails
[15:19:49] epochwolf: How do I bypass the AR query cache for a single test: https://gist.github.com/epochwolf/bee7a3236136a074fa1733fb0d3a54de
[15:19:58] smathy: k13nox, !used
[15:19:58] helpa: k13nox: Don't ask "does anyone use <thing>?". It's better to just state your problem and if anyone has used <thing> they will most likely answer.
[15:19:58] epochwolf: I'm using Rails 3.2.22
[15:20:46] smathy: epochwolf, no idea if this works in 3.2, but in a real version of Rails you can use Foo.connection.uncached { }
[15:21:07] epochwolf: smathy: I'll see if it works.
[15:21:28] smathy: epochwolf, http://api.rubyonrails.org/v3.2.22/classes/ActiveRecord/ConnectionAdapters/QueryCache.html#method-i-uncached suggests it will.
[15:21:58] shanson: has joined #RubyOnRails
[15:22:17] k13nox: I would like to send a message every minute to a channel with ActionCable in Rails 5 ? I have try run_periodic_timer with no success :s
[15:22:57] epochwolf: smathy: didn't work... looks like my issue isn't the query cache.
[15:24:28] smathy: epochwolf, wait, didn't work to switch off caching? Or didn't solve your `y` problem?
[15:24:38] epochwolf: smathy: I've updated the gist with the model, I think I have another issue here. :)
[15:24:49] smathy: k13nox, !dw
[15:24:49] helpa: k13nox: What "didn't work"? Did your server not start? Did your computer explode? Did your webpage turn bright pink? Did your client not pay your bill on time? You may have to be more specific. A Gist (http://gist.github.com) of the code that doesn't work (and the error you are getting) will be helpful.
[15:25:21] epochwolf: smathy: didn't solve my problem, I commented out lines 3 and 4 in the test.
[15:25:42] workmad3: smathy: I added the line `* { color: pink; }` to my webpage and it turned pink, halp please
[15:26:21] epochwolf: workmad3: solution: find handgun, shoot self. Repeat until no longer able to communicate status back to IRC.
[15:26:23] triptec: has joined #RubyOnRails
[15:26:23] universa1_: has joined #RubyOnRails
[15:26:36] workmad3: epochwolf: I live in the UK... can u send handgun plz
[15:26:48] epochwolf: workmad3: yeah, I've got a spare one I'm not using.
[15:27:01] sevenseacat: we dont have guns over here. what now
[15:27:02] njero: epochwolf: will catch rust :P
[15:27:06] epochwolf: Will need to air drop since customs won't allow it.
[15:27:20] epochwolf: n_e_o: that's why you oil things properly.
[15:27:21] workmad3: epochwolf: u pay? :D
[15:27:42] njero: yeah.. oiling is great :D
[15:28:00] epochwolf: smathy: I'm adding some additional checks to the test. I may have a validation biting me in the tail.
[15:28:50] smathy: workmad3, I think there's a gem to fix that.
[15:29:01] yellow5: has joined #RubyOnRails
[15:29:14] smathy: Wait, what now? You live in the UK workmad3 ?
[15:29:23] epochwolf: smathy: he has for a long time.
[15:29:41] smathy: ACTION adjusts mental world map of #RoR regulars.
[15:29:45] epochwolf: smathy: Failure/Error: user.save.should be_true ... found the problem.
[15:30:02] smathy: epochwolf, validations? ;)
[15:30:17] sevenseacat: ACTION plants giant pineapple on smathy's mental map right over Australia
[15:30:22] epochwolf: smathy: adding additional assertion to read those out. :)
[15:30:34] workmad3: smathy: I can count the times I've left the UK on my fingers still
[15:30:45] workmad3: and not by resorting to binary or other counting methods :)
[15:30:47] epochwolf: workmad3: I've only left the US once.
[15:30:58] adaedra: workmad3: stay on your side of the channel, you're good here.
[15:31:05] sevenseacat: have never left australia :(
[15:31:11] SteenJobs: never ever?
[15:31:12] k13nox: smathy, i just don't know how to use #run_periodic_timer in ActionCable, No Docs, No sample code :s And i'm not sure if I should use it. To send a periodic message with ActionCable.server.broadcast
[15:31:32] SteenJobs: starting a kickstarter campaign
[15:31:35] adaedra: kangaroos don't swim?
[15:32:11] SteenJobs: they’re not terribly buoyant with them pockets and all
[15:33:11] sevenseacat: one day i'll go to one of the big confs in the US or something
[15:33:26] sevenseacat: when i save up many many dollars
[15:33:35] sarink: has joined #RubyOnRails
[15:33:41] smathy: k13nox, sorry, I know nothing about ActionCable or any of the Rails5 changes really, I was just advising you how of the best way to get traction in this channel.
[15:34:07] adaedra: Love only for the US.
[15:34:10] k13nox: smathy, np thx
[15:34:18] njero: I'm ready to do that even without saving.. Hope someone else will spent my TA :P
[15:34:23] smathy: I think that's the nicest thing you've ever said in reference to me sevenseacat
[15:34:25] smathy: ACTION tears up
[15:34:29] dici: has joined #RubyOnRails
[15:35:22] epochwolf: smathy: confirmed it's there's a failed validation somewhere in this mess, trying to get at which one.
[15:36:02] smathy: workmad3, I can count the number of times I've been to the UK on one finger.
[15:36:20] smathy: I've been to Ireland a bunch though.
[15:36:31] adaedra: Using articulations?
[15:36:35] epochwolf: Why is password confirmation being a bitch. :|
[15:37:04] disgrntld: has joined #RubyOnRails
[15:37:51] smathy: ACTION pats his Reform, there there validation-nightmare-rescuer, good gem, goooood gem.
[15:37:57] dionysus69: has joined #RubyOnRails
[15:38:37] epochwolf: smathy: confirmation is supposed to allow me to bypass it when it's never been called.
[15:38:39] triptec: has joined #RubyOnRails
[15:38:58] smathy: ACTION greps IRC logs for `supposed to` - OMG!
[15:40:06] noah256: has joined #RubyOnRails
[15:40:08] baweaver: has joined #RubyOnRails
[15:40:21] lxsameer: has joined #RubyOnRails
[15:40:29] epochwolf: smathy: It's documented not to check if password_confirmation is not nil.
[15:40:41] epochwolf: https://github.com/rails/rails/blob/3-2-stable/activemodel/lib/active_model/validations/confirmation.rb
[15:42:16] smathy: epochwolf, you remember the part of this saga where I advised to just write your own auth.
[15:43:03] smathy: epochwolf, I'm guessing it's not nil - or something.
[15:43:08] epochwolf: smathy: I already have. I'm not using has_secure_password anymore.
[15:44:43] greenhat: has joined #RubyOnRails
[15:44:45] yellow5: has joined #RubyOnRails
[15:45:30] epochwolf: smathy: you are correct, some idiot is adding confirmatoin on the factory. :|
[15:45:43] sevenseacat: git blame git blame git blame
[15:46:10] epochwolf: sevenseacat: not useful, there's been 8+ different contractors on this code.
[15:46:31] eljimador: has joined #RubyOnRails
[15:46:55] epochwolf: smathy: yay, everything is working again.
[15:47:13] [Butch]: has joined #RubyOnRails
[15:47:32] smathy: epochwolf, hah - factories :)
[15:47:48] melonstorm: has joined #RubyOnRails
[15:47:57] epochwolf: smathy: they are mocking me.
[15:48:13] smathy: I can't think of any role I've had where they had factories in place before I started where one of my earliest (self-assigned) tasks was to clean up their fucking factories!
[15:48:49] smathy: LOL, I see what you did there.
[15:49:04] tubbo: smathy: do you just use fixtures to set up test data?
[15:49:21] tubbo: > Importing 301/6790
[15:49:38] macsteps: has joined #RubyOnRails
[15:50:29] shanson: has joined #RubyOnRails
[15:51:07] jobewan: has joined #RubyOnRails
[15:51:52] AntiSpamMeta: has joined #RubyOnRails
[15:51:56] joshkovach: has joined #RubyOnRails
[15:53:06] jobewan: has joined #RubyOnRails
[15:53:08] baweaver: smathy: then cheat :D
[15:53:18] baweaver: Make migrations take care of factories for you.
[15:53:28] bradleyprice: has joined #RubyOnRails
[15:53:41] smathy: tubbo, when totally up to me I usually just `Foo.new` in my tests. And I'll just use a helper method to setup complex structures for integration tests (which I use very sparingly anyway), and for big models I'll just make my own YAML file that I'll use just to simplify that separation of data and logic.
[15:54:13] baweaver: If those break tests, well they're actually broken in any case.
[15:54:18] smathy: baweaver, yeah, doesn't help when people create factories with lots of callbacks creating all sorts of complicated associations.
[15:54:32] smathy: ...and they combine different methods of creating those associated objects.
[15:54:45] smathy: ...and their models also have callbacks which get triggered during the factory setup.
[15:54:52] baweaver: might I suggest a stiff slap in the face and a reprimanding look then?
[15:55:10] smathy: ...that's how I usually say good morning.
[15:55:24] AntiSpamMeta: has joined #RubyOnRails
[15:55:42] baweaver: that, and a pointed lecture on the nature of unit tests
[15:56:30] leeky: has joined #RubyOnRails
[15:56:34] tubbo: smathy: that makes sense. we wanted to be able to define that kind of stuff in ruby, rather than yaml, so we actually made our own means of injecting "factory methods" into the tests. they're really just methods called e.g. `create_order` or `create_user`, but some are really complex like `create_placed_order` which ends up defining over 8 objects (goes through an entire checkout process).
[15:58:03] Cohedrin: has joined #RubyOnRails
[15:58:44] sarink: has joined #RubyOnRails
[15:59:21] n008f4g_: has joined #RubyOnRails
[16:00:43] bronson: has joined #RubyOnRails
[16:01:05] flashpoint9: has joined #RubyOnRails
[16:01:16] hobodave_: has joined #RubyOnRails
[16:02:44] epochwolf: tubbo: only 8 objects?
[16:03:22] Cohedrin_: has joined #RubyOnRails
[16:06:09] bradleyprice: has joined #RubyOnRails
[16:07:34] PedramT: has joined #RubyOnRails
[16:09:12] yellow5: has joined #RubyOnRails
[16:09:12] JoshL: has joined #RubyOnRails
[16:09:25] cschneid: has joined #RubyOnRails
[16:09:56] cschneid: I'd like to use the pluralize helper, but it sticks the actual number on the front. How do I have it just give me the word, instead of "1 user", I just want "user".
[16:11:05] apeiros: has joined #RubyOnRails
[16:11:40] yellow5: has joined #RubyOnRails
[16:12:11] cschneid: nevermind, google answered me. Apparently pluralize(count, str) always spits out number, but the string monkey patch str.pluralize(count) doesn't. Makes sense..... :-/
[16:12:17] tubbo: epochwolf: haha maybe more
[16:12:22] hxegon: has joined #RubyOnRails
[16:12:36] epochwolf: tubbo: let me know when you get over 100 record for a single factory.
[16:13:54] tubbo: well that's just fucked :P
[16:14:03] tubbo: why would you ever want to repeat that? sounds like a 1-test situation
[16:14:29] IrishGringo: has joined #RubyOnRails
[16:14:33] yellow5: has joined #RubyOnRails
[16:15:23] epochwolf: tubbo: student loans... a single loan has hundreds of records it will reference. For example interest rate lookups.
[16:16:08] jenrzzz: has joined #RubyOnRails
[16:16:08] jenrzzz: has joined #RubyOnRails
[16:16:39] yellow5: has joined #RubyOnRails
[16:19:16] roqo: has joined #RubyOnRails
[16:21:04] SteenJobs: does anyone know how to handle belongs_to associations in cancancan? user belongs_to Brand/Brand has_many Users…i need to check for the show action of a Brand’s dashboard, if brand.users contains current_user.
[16:21:20] SteenJobs: i can create a block and check if brand.users.includes? but thought maybe there’s a cleaner way
[16:22:48] Maletor: has joined #RubyOnRails
[16:24:06] icedp: has joined #RubyOnRails
[16:25:43] smathy: tubbo, sounds similar to how I do things, yes.
[16:27:27] Yeomra_: has joined #RubyOnRails
[16:29:20] SteenJobs: well i guess the real question is, whenever checking auth the reverse way, can you do it without a block? (let’s say a user can view a bid, if the bid belongs_to a project which belongs_to that brand)
[16:29:25] arpegius: has joined #RubyOnRails
[16:32:53] baweaver: has joined #RubyOnRails
[16:34:27] shilon: has joined #RubyOnRails
[16:35:45] euandreh_: has joined #RubyOnRails
[16:35:48] tubbo: epochwolf: right, thankfully we don't have to deal with testing stuff like product recommendations in a lot of different places, thus we only need to create a bunch of products and sales for a single test
[16:36:10] tubbo: the stuff you're dealing with there sounds like a hard problem to test
[16:36:23] fmcgeough: has joined #RubyOnRails
[16:36:52] snowy: has joined #RubyOnRails
[16:37:02] diegoaguilar: has joined #RubyOnRails
[16:39:26] bePolite: has joined #RubyOnRails
[16:39:56] dionysus69: has joined #RubyOnRails
[16:40:04] epochwolf: tubbo: that was previous company, not my problem anymore.,
[16:43:12] yuujinlee: has joined #RubyOnRails
[16:43:49] bradleyprice: has joined #RubyOnRails
[16:43:51] lxsameer: has joined #RubyOnRails
[16:44:27] shanson: has joined #RubyOnRails
[16:47:57] sp1rs: has joined #RubyOnRails
[16:53:09] Cohedrin: has joined #RubyOnRails
[16:54:19] renegadeandy: has joined #RubyOnRails
[16:54:40] alexg101: has joined #RubyOnRails
[16:54:58] renegadeandy: Hey guys for this sitemap-generator gem, which file do i put the deploy:sitemap:refresh line into for capistrano? Is it in the deploy.rb file?
[16:55:04] renegadeandy: https://github.com/kjvarga/sitemap_generator#deployments--capistrano
[16:55:33] smathy: renegadeandy, yes, you will need to put it in some sort of event handler in there.
[16:56:42] renegadeandy: smathy: like this : https://gist.github.com/renegadeandy/d8b312e2767f369f201b624147e2ecf9
[16:59:18] manfrin: has joined #RubyOnRails
[16:59:56] smathy: renegadeandy, no, it's not ruby, it's the name of a task.
[17:01:04] smathy: renegadeandy, I'd think it'd be more likely something you want done after the deploy entirely, so out at the root level of your deploy.rb you'd have something like: after :deploy, "deploy:sitemap:refresh"
[17:02:00] renegadeandy: smathy: ah I see, going to give it a shot - thanks!@
[17:02:39] GodFather: has joined #RubyOnRails
[17:03:20] aegis3121: has joined #RubyOnRails
[17:03:31] sleungcy: has joined #RubyOnRails
[17:03:38] eljimmy: has joined #RubyOnRails
[17:03:42] deavid: has joined #RubyOnRails
[17:04:43] tamole: has joined #RubyOnRails
[17:07:20] jstransky: has joined #RubyOnRails
[17:07:29] jenrzzz: has joined #RubyOnRails
[17:07:29] jenrzzz: has joined #RubyOnRails
[17:10:51] EdwardIII: has joined #RubyOnRails
[17:12:51] cnk: has joined #RubyOnRails
[17:13:31] renegadeandy: smathy: exactly what you wrote worked first time - software superstar for the day goes to smathy!
[17:13:47] smathy: renegadeandy, happy to help.
[17:13:58] alexg101: how does rails compare to sails.js?
[17:17:30] triptec: has joined #RubyOnRails
[17:19:33] jstransky: has joined #RubyOnRails
[17:21:51] tildes: has joined #RubyOnRails
[17:22:49] nerium: has joined #RubyOnRails
[17:23:17] mbreedlove: has joined #RubyOnRails
[17:25:47] arpegius: has joined #RubyOnRails
[17:28:09] Paradox: has joined #RubyOnRails
[17:29:19] boontdustie: has joined #RubyOnRails
[17:29:26] Synthead: has joined #RubyOnRails
[17:29:41] jenrzzz: has joined #RubyOnRails
[17:29:41] jenrzzz: has joined #RubyOnRails
[17:30:36] solars: has joined #RubyOnRails
[17:34:40] baweaver: has joined #RubyOnRails
[17:36:03] SteenJobs: has joined #RubyOnRails
[17:37:27] arup_r: has joined #RubyOnRails
[17:41:01] mostlybadfly: has joined #RubyOnRails
[17:43:09] bradleyprice: has joined #RubyOnRails
[17:43:32] boontdus`: has joined #RubyOnRails
[17:44:11] flashpoint9: has joined #RubyOnRails
[17:44:13] netzfisch: has joined #RubyOnRails
[17:45:06] KensoDev: has joined #RubyOnRails
[17:45:27] n008f4g_: has joined #RubyOnRails
[17:45:55] jenrzzz: has joined #RubyOnRails
[17:47:48] artto: has joined #RubyOnRails
[17:53:55] shanson: has joined #RubyOnRails
[17:54:20] mices: has joined #RubyOnRails
[17:56:18] mices: to_path=params[:file_name]; from_path=params[:file_name]; to_path["foo","bar"] what just happened to from_path when i altered to_path and why
[17:57:11] baweaver: has joined #RubyOnRails
[17:57:14] beilabs: has joined #RubyOnRails
[17:57:45] mices: o never mind
[17:58:04] arup_r1: has joined #RubyOnRails
[18:01:03] B1n4r10: has joined #RubyOnRails
[18:03:03] bronson: has joined #RubyOnRails
[18:05:49] mices: i don't understand this
[18:05:51] SteenJobs: has joined #RubyOnRails
[18:06:08] mdw: has joined #RubyOnRails
[18:06:18] mices: it seem instead of making assignments i'm binding these object to each other
[18:12:03] gambl0re: has joined #RubyOnRails
[18:12:04] yfeldblum: has joined #RubyOnRails
[18:12:49] aegis3121: has joined #RubyOnRails
[18:15:19] cnk: mices: show more code. Sounds like you may be modifying the params hash but unsure
[18:16:27] pawnbox: has joined #RubyOnRails
[18:16:36] mbreedlove: has joined #RubyOnRails
[18:18:56] ekinmur: has joined #RubyOnRails
[18:23:23] tamole: has joined #RubyOnRails
[18:24:15] Technodrome: has joined #RubyOnRails
[18:24:40] arpegius: has joined #RubyOnRails
[18:25:41] IrishGringo: has joined #RubyOnRails
[18:28:34] MrPunkin: has joined #RubyOnRails
[18:29:30] flashpoint9: has joined #RubyOnRails
[18:30:18] szulak: has joined #RubyOnRails
[18:31:17] sypheren: has joined #RubyOnRails
[18:32:13] yellow5: has joined #RubyOnRails
[18:34:16] fox_muld1r_cp: smathy: i have some thinkinh about my polymorhic links. in guides we add to class imageable index for (id, imageable_type) in class image.
[18:35:03] arup_r: has joined #RubyOnRails
[18:37:38] fox_muld1r_cp: but in my relations i have one main class Client, and has_one (Personal) and (Company)
[18:37:48] centrx: has joined #RubyOnRails
[18:41:11] MrPunkin: has left #RubyOnRails: ()
[18:41:35] smathy: fox_muld1r_cp, a polymorphic association is from the belongs_to side, so that's no good.
[18:43:45] fox_muld1r_cp: smathy: i want add to Client class it's set of properties, but for personal user or company set's of properties is defferent - billing info
[18:44:02] emachnic: has joined #RubyOnRails
[18:44:03] Maletor: has joined #RubyOnRails
[18:44:11] fox_muld1r_cp: smathy: hm. may be add two association and make accessor?
[18:44:22] fox_muld1r_cp: to masquarade it
[18:44:55] noah256: has joined #RubyOnRails
[18:46:11] jstransky: has joined #RubyOnRails
[18:46:40] EXCHGR: has joined #RubyOnRails
[18:47:01] baweaver: has joined #RubyOnRails
[18:47:31] matthias_: has joined #RubyOnRails
[18:48:04] mices: cnk: https://gist.github.com/mices/39bceabf15e945d527439cba0a7beeb1
[18:48:36] meoblast001: has joined #RubyOnRails
[18:48:56] mikecmpbll: has joined #RubyOnRails
[18:49:19] smathy: fox_muld1r_cp, or, y'know, move your fkey over to client so you can do the polymorphic association properly.
[18:51:48] cnk: mices: I would bet you need to turn that relative file name into an absolute using rails root
[18:52:23] cnk: recordings/WCR-20160409.mp3 is just a fragment to the server
[18:52:43] mices: it's just a string
[18:52:46] conta: has joined #RubyOnRails
[18:52:56] fox_muld1r_cp: smathy: and what about my idea for masquerade two has_one option by accessor?
[18:53:10] x2drive: has joined #RubyOnRails
[18:53:12] havenwood: mices: Save your gist with a .rb extension for syntax highlighting and to make it nicer to folk cloning your gist.
[18:53:24] PedramT: has joined #RubyOnRails
[18:53:28] havenwood: mices: move_file.rb
[18:53:39] n008f4g_: has joined #RubyOnRails
[18:53:41] smathy: fox_muld1r_cp, I don't understand why you'd do that, don't fight convention.
[18:54:15] universa1_: has joined #RubyOnRails
[18:54:15] mices: havenwood: refresh
[18:54:39] conta: stupid question: let's say I have table animal and there is a column type, which will be only 'kitten' or 'puppy'. DO I need to put index there? I will query often for all 'kitten' and all 'puppy'
[18:55:06] siaW: is there a way for me to render svg directly in my views without having to go through controllers and routes. this is what i have. https://gist.github.com/siaw23/8011d271a743b4f3f60e8148376bed96
[18:55:26] siaW: i want to be able to render the svg+xml directly
[18:55:46] epochwolf: conta: it's a good idea to index frequently queried columns.
[18:56:01] cnk: siaw: you can put it in an assets directory
[18:56:28] cnk: or somewhere in public
[18:56:32] conta: epochwolf: that's what I was thinking, but not sure if it helps when I will have only 2 possible types.
[18:56:35] universa1_: siaw: so? what is wrong with what you got?
[18:56:35] epochwolf: conta: however, try to keep the number of indexes to a minimum. Each index you add makes inserts and updates slower.
[18:56:47] qejk: has joined #RubyOnRails
[18:56:54] epochwolf: conta: measure it with and with an index? :)
[18:57:06] siaW: cnk: i don’t want to put it in assets
[18:57:06] epochwolf: with and without*
[18:57:35] siaW: universa1_: that xml is an image. i want to see the image instead of the raw xml
[18:57:36] mices: havenwood: what's gonna be revealed by that
[18:57:38] conta: that's good idea
[18:57:42] epochwolf: conta: personally, I'd index it. But, there are trade offs.
[18:58:14] universa1_: siaw: so wrap it in the correct tags? or unwrap in your case i guess...
[18:58:26] conta: epochwolf: I was thinking about making 2 different tables: puppy, kitten.
[18:58:41] smathy: conta, as I always say re indexes, it depends on many things, number of rows, writes vs reads, what other fields you're searching on, etc..
[18:59:04] siaW: universa1_: you see what it generates already has the correct tags. <svg> unless i don’t know something
[18:59:11] siaW: universa1_: https://gist.github.com/siaw23/8011d271a743b4f3f60e8148376bed96
[18:59:17] havenwood: mices: What are you thinking here? Check that you understand what `to_path` is at this point with `p to_path` and `p to_path.class`: https://gist.github.com/mices/39bceabf15e945d527439cba0a7beeb1#file-move_file-rb-L3-L4
[18:59:21] smathy: conta, if you do thousands of writes per second and a read every hour then an index can bring your DB a grinding halt.
[18:59:21] universa1_: siaw: so an svg image starts with an xml tag?
[18:59:31] epochwolf: conta: They can both go in the chinese_food table :D
[19:00:17] universa1_: siaw: you might also want to NOT escape the inserted content, look for html_safe and friends.
[19:01:52] conta: smathy, epochwolf: I am doing sth realy simple. DB with images (kitten, puppy) and people can vote (kitten or puppy picture). I wanna then save the vote (with image_id)
[19:02:10] macsteps: has joined #RubyOnRails
[19:02:32] epochwolf: conta: images -> votes
[19:03:12] smathy: conta, doesn't explain your queries, anyway - premature optimization, and when you do optimize you'll know your bottlenecks.
[19:04:03] conta: my query is: pick random image with puppy, same with kitten. count votes for kitten, puppy
[19:04:13] conta: premature optimization sounds just right
[19:04:20] epochwolf: contest -> images, images -> votes, contest -> votes, user -> vote
[19:04:46] epochwolf: Assuming you have users.
[19:06:16] conta: Thanks ;]
[19:06:40] mices: havenwood: i can't print them until i write a page which i wasn't going to, i was using redirect instead, but it does seem no matter what i do to_path and from_path are ending up with the same value
[19:07:17] epochwolf: conta: you can easily cache that into [contest_id] => [image1, image2, vote_count_1, vote_count_2]
[19:07:43] mdw7: has joined #RubyOnRails
[19:08:25] havenwood: mices: Since you assign them to the same value in two subsequent lines that'd make sense.
[19:09:04] snowy: has joined #RubyOnRails
[19:09:20] mices: havenwood i'm assigning the right operand to the left
[19:10:15] mices: havenwood: i mean you're right but the substitution works and then changes both
[19:10:18] havenwood: mices: Look at these two lines carefully... Are `from_path` and `to_path` pointing at different things?: https://gist.github.com/mices/39bceabf15e945d527439cba0a7beeb1#file-move_file-rb-L2-L3
[19:10:32] havenwood: mices: Im confused about what you think is happening here.
[19:11:18] mices: i'm not trying to point them i'm trying to assign the value of params[:file_name] to to_path, not point to_path to the object params[:file_name]
[19:11:36] baweaver: has joined #RubyOnRails
[19:11:54] mices: iow i dunno what you mean by point
[19:12:09] shanson: has joined #RubyOnRails
[19:13:53] havenwood: mices: What do you expect `[x, y]` to return in this example?: params = {mices: 'cheese'}; x = params[:mices]; y = params[:mices]; x['che'] = ''; [x, y]
[19:14:04] havenwood: mices: Try it ^ in your REPL and compare with your expectation.
[19:14:59] bmf: has joined #RubyOnRails
[19:15:02] tildes: has joined #RubyOnRails
[19:15:23] mices: havenwood: i expect y to retain it's original value before the modification of x
[19:15:48] mices: y should still be params[:mices]
[19:16:09] havenwood: mices: So what happened to `params[:mices]` then?
[19:16:25] mices: it's still available to the controller
[19:16:27] lacuna: has joined #RubyOnRails
[19:16:30] mices: in it's original form
[19:16:47] mices: what happened to it lol
[19:16:59] mices: hey what ever happened to that parameter
[19:17:39] SteenJobs: has joined #RubyOnRails
[19:19:33] mices: havenwood: how do i make an assignment without affecting the other operands
[19:19:43] mices: since obviously i'm mistaken
[19:20:32] mices: the pointing to concept i don't understand
[19:21:41] havenwood: mices: What's the value of `b` in this example?: a = b = 'hi'; a.delete! 'hi'
[19:21:49] [Butch]: has joined #RubyOnRails
[19:21:55] solars: has joined #RubyOnRails
[19:22:12] havenwood: mices: Compare to the value of `b` in this example: a = b = 'hi'; a.delete 'hi'
[19:23:27] jhass: has joined #RubyOnRails
[19:23:32] triptec: has joined #RubyOnRails
[19:23:38] Takumo: has joined #RubyOnRails
[19:23:38] Takumo: has joined #RubyOnRails
[19:24:31] Darmani: has joined #RubyOnRails
[19:24:43] zpe: has joined #RubyOnRails
[19:27:00] dionysus69: has joined #RubyOnRails
[19:27:06] bmf: has joined #RubyOnRails
[19:30:13] netzfisch: has joined #RubyOnRails
[19:31:06] matthias_: has joined #RubyOnRails
[19:32:18] tubbo: a isn't a hash though?
[19:32:58] renegadeandy: has joined #RubyOnRails
[19:34:08] ornerymoose: has joined #RubyOnRails
[19:34:56] ornerymoose: what are some decent free data visualzation tools for use within a rails environment? I’ve been toying with FusionTables, but wanted to explore some other options/hear some recommendations
[19:40:22] PedramT: has joined #RubyOnRails
[19:40:53] arup_r: ornerymoose: I was seeing today this https://app.viurdata.com
[19:40:59] arup_r: for 1 app..
[19:42:13] phaza: has joined #RubyOnRails
[19:42:16] ornerymoose: nice, looks good. We use MSSQL too
[19:42:26] platzhirsch: has joined #RubyOnRails
[19:44:58] bmf: has joined #RubyOnRails
[19:45:15] triptec: has joined #RubyOnRails
[19:45:47] FailBit: can someone ban me?
[19:47:07] tubbo: FailBit: i've always wanted to
[19:48:34] FailBit: I just would like someone to ban me so I can't come back and shit up the channel again
[19:49:29] PedramT: has joined #RubyOnRails
[19:49:45] maxx88: ornerymoose: i’ve used chartkick, that worked well, free
[19:52:04] apotry: has joined #RubyOnRails
[19:52:04] tubbo: FailBit: i'm not your dad, ban yourself
[19:53:16] Oliphaunte: has joined #RubyOnRails
[19:54:17] ChanServ: +o baweaver
[19:54:43] FailBit: /mode +b $a:LiamW
[19:55:01] baweaver: we don't do assisted bannicide here
[19:55:02] ornerymoose: max88: nice, will take a look
[19:55:06] ChanServ: -o baweaver
[19:55:28] FailBit: just mute me then
[19:55:36] FailBit: +q $a:LiamW
[19:55:54] arup_r: ok.. bye.. feeling sleepyyy
[19:56:16] arup_r: has left #RubyOnRails: ()
[19:56:35] theod: has joined #RubyOnRails
[19:56:56] conta: has joined #RubyOnRails
[19:58:43] arpegius: has joined #RubyOnRails
[19:58:44] barajasfab: has joined #RubyOnRails
[19:59:51] jenrzzz: has joined #RubyOnRails
[20:01:57] srinidhi: has joined #RubyOnRails
[20:04:19] S1kx: has joined #RubyOnRails
[20:04:30] bronson: has joined #RubyOnRails
[20:04:53] ur5us: has joined #RubyOnRails
[20:05:22] Devalo: has joined #RubyOnRails
[20:08:57] benlieb: has joined #RubyOnRails
[20:09:24] platzhirsch: has left #RubyOnRails: ()
[20:11:16] baweaver: has joined #RubyOnRails
[20:14:15] MrPunkin: has joined #RubyOnRails
[20:16:49] eljimmy: has joined #RubyOnRails
[20:17:44] Thai_: has joined #RubyOnRails
[20:21:03] snowy: has joined #RubyOnRails
[20:22:57] Cohedrin_: has joined #RubyOnRails
[20:23:06] CodaBrink: has joined #RubyOnRails
[20:23:24] JakFrist: has joined #RubyOnRails
[20:24:11] Cohedrin_: has joined #RubyOnRails
[20:32:20] jhack_: has joined #RubyOnRails
[20:32:50] meoblast001: has joined #RubyOnRails
[20:34:06] centrx: has joined #RubyOnRails
[20:34:38] pawnbox: has joined #RubyOnRails
[20:36:23] srinidhi: has joined #RubyOnRails
[20:37:53] lemur: has joined #RubyOnRails
[20:40:45] Balzrael: has joined #RubyOnRails
[20:40:46] hyperdrive: has joined #RubyOnRails
[20:41:02] alexblom: has joined #RubyOnRails
[20:41:11] mhenrixon: has joined #RubyOnRails
[20:43:03] yfeldblum: has joined #RubyOnRails
[20:49:00] Paradox: has joined #RubyOnRails
[20:50:37] newjersey: has joined #RubyOnRails
[20:52:03] zpe: has joined #RubyOnRails
[20:53:16] istrasci1: has joined #RubyOnRails
[20:53:48] Cervajz: has joined #RubyOnRails
[20:56:21] Cervajz_: has joined #RubyOnRails
[20:57:56] SteenJobs: has joined #RubyOnRails
[20:58:15] shilon: has joined #RubyOnRails
[20:59:11] alevy: has joined #RubyOnRails
[21:00:37] bphogan: has joined #RubyOnRails
[21:05:26] constantinexvi: has joined #RubyOnRails
[21:06:26] istrasci1: When running `rails g model`, can you specify an irregular model name? I need to override the default and I want it to propagate to the file names that get created by the generator.
[21:06:49] context: uhh you tell it the name of the model to create
[21:07:23] context: if you mean irregular singular/plural word you probably want to add it to the inflector
[21:07:23] istrasci1: I run `rails g model nbrjobs`, but it automatically gets singularized.
[21:07:35] istrasci1: I need it to remain plural
[21:07:50] context: you can also just manually rename it..
[21:08:16] eljimmy: has joined #RubyOnRails
[21:10:36] istrasci1: So there's no way to specify that when you run the command? I'd rather not have to manually rename all the generated files.
[21:10:47] emachnic: has joined #RubyOnRails
[21:10:57] context: you can update the inflector
[21:11:33] smathy: istrasci1, add an `inflect.uncountable 'nbrjobs'` in your inflections.rb
[21:11:36] context: though im not sure why anything would NEED to be one way or the other, you could use it singular if you wanted, or use a name with actual meaning
[21:11:50] smathy: Feels like an xyproblem to me, but meh.
[21:12:25] context: i mean, dont get me wrong, naming models incomprehensibly makes total sense to me.
[21:13:06] istrasci1: It's a mode for a 3rd party database whose tables names are just all over the place.
[21:13:07] smathy: Well I'm sure you'd provide the necessary context.
[21:13:25] smathy: istrasci1, table names != model names.
[21:14:17] ZerGabriel: has joined #RubyOnRails
[21:14:23] context: yeah. model names do not have to be the exact same as the table, or anywhere in the same ballpark.
[21:14:39] context: to which i would recommend naming the model soemthing that makes sense.
[21:14:58] arBmind: has joined #RubyOnRails
[21:15:08] istrasci1: That's out of my control.
[21:15:18] istrasci1: Model name needs to match table name.
[21:15:22] pawnbox: has joined #RubyOnRails
[21:16:08] context: im assuming thats something inforced by work.... or something, for what sounds to be an awesome reasoning
[21:16:17] smathy: That's insane, the whole point of an ORM is to provide a layer of logic on top of the database, naming is probably the most important part of that.
[21:16:30] smathy: Tell them that smathy says they're insane.
[21:16:32] edwinvdgraaf: has joined #RubyOnRails
[21:16:44] context: smathy: nonsense. he can tell them himself
[21:16:56] context: istrasci1: if they want to restrict how you do your job, tell them to do it
[21:17:19] ZerGabriel: has left #RubyOnRails: ()
[21:17:45] dcope: has joined #RubyOnRails
[21:17:46] istrasci1: Yeah, the real world doesn't really work that way.
[21:18:32] nickenchuggets: has joined #RubyOnRails
[21:18:39] nickenchuggets: has joined #RubyOnRails
[21:18:59] smathy: context, I assume that if he can't pick the name of a model then probably telling them (from himself) that they're insane won't go down too well either.
[21:19:10] smathy: istrasci1, my life has.
[21:19:14] swav: has joined #RubyOnRails
[21:19:15] smathy: ...worked that way
[21:19:29] context: well, if he cant pick model names he will probably need to ask to touch the inflector also
[21:19:31] Cohedrin: has joined #RubyOnRails
[21:19:50] smathy: Probably ;)
[21:19:56] context: he probably had to put in a request to see if the generate command is allowed
[21:20:07] smathy: ...do they tell you which editor you're allowed to use too istrasci1 ?
[21:20:12] istrasci1: I'm lucky to have a terminal.
[21:20:16] epicwife: istrasci1: you can configure the table name
[21:20:48] smathy: epicwife, oh man, catch up woman!
[21:21:04] epicwife: i forgot i had this nick
[21:21:09] smathy: epochwolf, talk to your wife please!
[21:21:36] epicwife: relevant: https://www.youtube.com/watch?v=017N_IPiuxY
[21:22:27] smathy: Heh, great bit.
[21:23:11] beilabs: has joined #RubyOnRails
[21:24:07] context: hahahahaha
[21:26:02] flashpoint9: has joined #RubyOnRails
[21:28:38] dopie: has joined #RubyOnRails
[21:29:19] Devalo: has joined #RubyOnRails
[21:30:23] Oliphaunte: has joined #RubyOnRails
[21:34:41] P4Titan: has joined #RubyOnRails
[21:35:26] jobewan: has joined #RubyOnRails
[21:35:28] P4Titan: Hello all. I need a general recommendation: should I include an alert message field in the application html file
[21:35:41] P4Titan: and have it hidden when there is no error, but trigger it w/ JS when needed?
[21:36:52] cnk: seems kind of convoluted. What kind of errors are you anticipating?
[21:36:54] ensyde: has joined #RubyOnRails
[21:37:31] tubbo: P4Titan: no, you should render the element(s) containing your error when it's raised.
[21:37:35] tubbo: if and when*
[21:39:27] P4Titan: but should I have space in each view file that I could expect some sort of error?
[21:40:10] istrasci1: has left #RubyOnRails: ()
[21:40:30] smathy: Not sure if tubbo understood your question, he seems to be talking about form validation errors.
[21:41:01] smathy: P4Titan, if by "alert message" you mean your `flash[:alert]` etc. messages then yes, having that in your layout file is a good idea.
[21:41:14] P4Titan: ya, the popup html code
[21:42:52] tubbo: yeah i usually render that only when there are actually flash messages
[21:43:00] smathy: So hard to talk to you, "popup" has a generally accepted meaning in web context and no, this isn't really anything to do with popup code.
[21:43:16] smathy: tubbo, same, but that logic is in your layout right?
[21:43:17] tubbo: and some JS code is used to append new flash messages when the page doesn't refresh
[21:43:41] tubbo: right smathy i was agreeing with you and adding on that it doesn't get displayed if i have no flash messages
[21:43:47] tubbo: s/displayed/rendered into the markup
[21:43:55] smathy: Ok cool, yes.
[21:44:29] P4Titan: ai, so the alert container should be in the layout file
[21:44:33] P4Titan: and used when necessary
[21:45:32] P4Titan: And sorry, im still new to web terminology
[21:46:27] smathy: Fair enough.
[21:46:40] P4Titan: funny command
[21:47:49] SteenJobs: has joined #RubyOnRails
[21:50:57] baweaver: has joined #RubyOnRails
[21:53:18] siaW: i added a new column in to my table, run “db:migrate” on heroku but heroku erros says it can’t find the newly added column. can someone please help? https://gist.github.com/siaw23/e74c22d5e713b1ce961d049fe93344de
[21:53:23] wilsonc91: has joined #RubyOnRails
[21:53:56] yohle: has joined #RubyOnRails
[21:55:44] siaW: everything runs fine locally though
[21:56:29] triptec: has joined #RubyOnRails
[21:59:59] IrishGringo: has joined #RubyOnRails
[22:00:02] kies: has joined #RubyOnRails
[22:01:02] smathy: heroku restart ?
[22:01:19] siaW: let me try
[22:02:12] ornerymoose: has joined #RubyOnRails
[22:02:39] siaW: smathy: works, thanks :)
[22:03:48] yohle: has joined #RubyOnRails
[22:05:44] tfitts: has joined #RubyOnRails
[22:10:16] mrbubbles: has joined #RubyOnRails
[22:11:24] mrbubbles: Evening guys and girls. Apologies if this is super easy question - I'm just looking at the Shoppe gem and it says that it uses Carrierwave for attachments. http://tryshoppe.com/docs/attachments I configured it as suggested and it's uploading into my S3 bucket. However, I can't for life of me figure out how to retrieve the image URLs to output into templates. Can anyone offer any advice please?
[22:11:37] Radar: GOOD MORNING
[22:11:48] mrbubbles: Carrierwave and Fog is what I'm using
[22:12:18] mrbubbles: Hi Radar, you're very chirpy for a man with a pregnant wife :)
[22:12:32] zpe: has joined #RubyOnRails
[22:12:36] Radar: It is my default state of being in the mornings.
[22:13:05] Radar: mrbubbles: how do you attach a file in shoppe?
[22:13:08] Radar: Do you have a link to the code?
[22:13:54] mrbubbles: Sure - so you can see here: https://github.com/tryshoppe/shoppe/blob/master/app/models/shoppe/product.rb that there is a has_many attachment
[22:14:04] mrbubbles: and the uploader attachment is here: https://github.com/tryshoppe/shoppe/blob/master/app/uploaders/shoppe/attachment_uploader.rb
[22:14:23] mrbubbles: So I just used that along with the config that they provided and it seems to work - files that I add through the Shoppe dashbaord appear in my s3 bucket
[22:15:35] EasyCo: has joined #RubyOnRails
[22:15:44] Radar: attachment.file.url should give yout he path?
[22:16:58] mrbubbles: Would I use @product.attachment.file.url?
[22:17:43] mrbubbles: Strangely I get undefined method `attachment' for #<Shoppe::Product:0x007f01d2040170>
[22:18:23] triptec: has joined #RubyOnRails
[22:18:31] n008f4g_: has joined #RubyOnRails
[22:21:05] kies: has joined #RubyOnRails
[22:21:41] w1lson: Anyone here have experience creating a rest API in rails? Any thoughts on rails for it?
[22:21:46] w1lson: Debating between using rails and django rest framework
[22:22:30] mices: has joined #RubyOnRails
[22:22:31] mices: has joined #RubyOnRails
[22:22:48] mices: havenwood: are you sure the example is relevant cause that's new syntax for me
[22:23:53] smathy: mrbubbles, that code is showing it's a has_many :attachments - there won't be a (singular) attachment method.
[22:24:24] smathy: mrbubbles, @product.attachments.first.file.url
[22:26:09] delgiudices: has joined #RubyOnRails
[22:27:30] GodFather: has joined #RubyOnRails
[22:27:34] Oliphaunte: has joined #RubyOnRails
[22:27:39] FailBit: I saw the light, Radar
[22:27:45] FailBit: pundit is king
[22:28:13] Radar: mrbubbles: what smathy said
[22:28:23] mrbubbles: Yeh that worked thanks guys
[22:28:27] mrbubbles: Not sure what I had going on there :0
[22:30:01] FailBit: now I have to figure out how to get rolify to not do a separate query for every has_role
[22:30:47] FailBit: unless someone can recommend a better framework
[22:30:54] Devalo: has joined #RubyOnRails
[22:32:53] FailBit: found it, has_cached_role
[22:32:59] FailBit: implementation is weird though
[22:33:46] FailBit: I probably need to monkeypatch devise to get this to work...
[22:34:00] triptec: has joined #RubyOnRails
[22:34:39] polyidus: has joined #RubyOnRails
[22:35:28] gambl0re: has joined #RubyOnRails
[22:35:33] polyidus: has joined #RubyOnRails
[22:35:40] w1lson: has joined #RubyOnRails
[22:35:51] macsteps: has joined #RubyOnRails
[22:38:09] loglaunch: has joined #RubyOnRails
[22:38:37] lemur: has joined #RubyOnRails
[22:45:31] siaW: originally my rails app puts newly created models at the end of the list, but after running #update on them to update attributes, the order changes… how can i update models and still keep the orginal order? (Oldest first)
[22:45:39] FailBit: there isn't much documentation but I found this which will work https://github.com/plataformatec/devise/wiki/How-To:-Allow-users-to-sign-in-using-their-username-or-email-address
[22:46:00] FailBit: siaw: sort by created_at?
[22:46:30] siaW: meaning i have to bout sort by created_at in my index method?
[22:47:09] FailBit: Thing.where(...).order(:created_at => :asc)
[22:47:27] FailBit: make sure you index created_at
[22:47:34] mrbubbles: So... (and this may be the question that gets me killed!)... if I'm using an engine like Shoppe... that obviously provides a nice dashbaord etc. But if I then want to customise the dashboard... do I fork the gem?
[22:47:45] mrbubbles: Or do I need to try and override the engine classes somehow?
[22:47:49] FailBit: that or monkeypatch, mrbubbles
[22:47:52] siaW: FailBit: and if i don’t index created_at?
[22:48:00] FailBit: siaw: then sort performance will be poor
[22:51:14] Vlatiska: has joined #RubyOnRails
[22:52:08] Vlatiska: Hi folk, i have a question, i want add custom css and js to a specific view, can i just add helper tag stylesheet_link_tag inside the view itself? and if so, can i just add in the top of the view?
[22:54:35] siaW: FailBit: i could order by “id” instead to prevent the cost of an extra index
[22:55:00] FailBit: only if your ids are in order
[22:55:12] FailBit: (they might not be!)
[22:55:28] FailBit: also lol what
[22:55:37] FailBit: how limited are you on space that indexes are expensive
[22:55:38] Greg1: has joined #RubyOnRails
[22:55:43] FailBit: because they generally aren't.
[22:56:04] siaW: i am trying to think in cases where the db is VEEEEERY large
[22:56:16] FailBit: are you ever going to have that?
[22:56:36] FailBit: and fyi that doesn't mean you shouldn't index it
[22:57:14] Megamos: has joined #RubyOnRails
[22:57:28] triptec: has joined #RubyOnRails
[22:58:14] FailBit: if the db is "veeeery large" you can shard it across a couple of machines
[22:58:16] mices: FailBit: were you at keyboard for this? https://gist.github.com/mices/39bceabf15e945d527439cba0a7beeb1
[22:58:38] jschoolcraft: has joined #RubyOnRails
[22:58:40] yuujinlee: has joined #RubyOnRails
[22:59:03] FailBit: I was not but you'll probably end up with a pwned server from doing that
[22:59:11] FailBit: that's _incredibly_ unsafe
[22:59:39] mices: it's just a localhost thingy for my own media files
[23:00:05] Vlatiska: Hi folk, i have a question, i want add custom css and js to a specific view, can i just add helper tag stylesheet_link_tag inside the view itself? and if so, can i just add in the top of the view?
[23:00:24] mices: just need to automate my own household tasks with this stuff
[23:00:52] wethu: has joined #RubyOnRails
[23:01:21] FailBit: so to answer your question
[23:01:25] FailBit: make the path absolute
[23:01:26] smathy: Vlatiska, yes, but content_for is your friend here.
[23:02:36] Vlatiska: smathy: So its better to use yield inside the layout/application with js and css content_for?
[23:04:53] smathy: Vlatiska, yep.
[23:05:36] Vlatiska: smathy: Ok, so in a yield its more efficiency than just inside the view or its just a better programming habit?
[23:06:13] smathy: Vlatiska, both the latter, and better for page transitions assuming you have turbolinks.
[23:06:25] FailBit: content_for lets you position your scripts in a good spot
[23:06:41] smathy: (speaking of which, make sure you put that turbolinks option on the end)
[23:06:48] Vlatiska: ok, thx alot, i will use yield then
[23:07:07] ornerymoose: has joined #RubyOnRails
[23:07:24] FailBit: you sacrifice an extremely tiny amount of backend performance with content_for and gain frontend performance if you do it right
[23:08:34] Vlatiska: Ok, so before the turbolink i put my yield, and can i add the css and the js at the same yield, its also a good spot for js?
[23:10:19] smathy: Vlatiska, yes, in same content_for
[23:10:41] smathy: Vlatiska, and just copy what's in your layout - but change the filename, and put it in a content_for block in your view.
[23:12:10] Vlatiska: ok, gotcha, thx buddy
[23:12:18] Vlatiska: have a good night all
[23:13:01] triptec: has joined #RubyOnRails
[23:16:43] ss_much: has joined #RubyOnRails
[23:20:06] baweaver: has joined #RubyOnRails
[23:23:35] aloneintheworld: has joined #RubyOnRails
[23:23:57] twilling: has joined #RubyOnRails
[23:24:56] akshat: has joined #RubyOnRails
[23:25:22] superlou: has joined #RubyOnRails
[23:29:45] mrbubbles: Is there a clean way to do : <%= product.product_attributes.where(key: :size).value %>
[23:29:50] centrx: has joined #RubyOnRails
[23:30:01] mrbubbles: But there isn't always an attribute with that key... so then value fails with undefined method `value' for
[23:31:57] FailBit: what do you want it to say
[23:32:01] FailBit: (if it's nil)
[23:32:03] twilling: has joined #RubyOnRails
[23:32:09] mrbubbles: the number 2
[23:32:25] mrbubbles: Basically product.product_attributes.where(key: :size).value || 2
[23:32:41] FailBit: what ruby version are you using
[23:32:41] mrbubbles: But not breaking if the attribute with key: 'size' doesn't exist
[23:33:05] Megamos: Super stuck on strong parameters. Can't get a hash with arrays to pass.
[23:33:06] Megamos: Parameters: {"utf8"=>"✓", "authenticity_token"=>"...", "practice"=>{"occasions"=>{"o1"=>["mån", "11:00", "12:00"], "o2"=>["tor", "07:00", "08:30"]}, "commit"=>"Godkänn", "id"=>"31"}
[23:33:07] Megamos: params.require(:practice).permit(occasions: [o1: [],o2: [],o3: [],o4: [],o5: [],o6: [],o7: []])
[23:33:39] mrbubbles: FailBit ruby 2.3.0p0
[23:34:11] FailBit: product.product_attributes.where(key: :size).take&.value || 2
[23:34:42] FailBit: if it was before 2.3 you would use .try(:value)
[23:34:53] FailBit: (ActiveSupport)
[23:35:18] mrbubbles: I've been stuck on that for ages
[23:35:24] mrbubbles: I wasn't using .take though
[23:35:36] FailBit: it's the same as .first
[23:35:41] FailBit: or the equivalent find_by
[23:35:52] mrbubbles: Yep I knew I had to do something like .first to get from a collectionproxy to a single object
[23:36:05] mrbubbles: I was tryign to use pluck (gave me an array with a single item) or select (gave me something else crazy)
[23:36:08] mrbubbles: so .take is the key :0
[23:36:09] FailBit: product_attributes.find_by_key(:size)&.value || 2
[23:36:18] FailBit: ^^ what I would use
[23:37:30] mrbubbles: what does the & do?
[23:37:35] mwlang: has joined #RubyOnRails
[23:37:36] mrbubbles: supress exceptions?
[23:37:37] FailBit: safe access
[23:38:09] FailBit: if the value is nil it terminates the expression
[23:38:15] FailBit: and just makes its value nil
[23:38:22] triptec: has joined #RubyOnRails
[23:38:44] FailBit: it does not suppress exceptions
[23:38:48] mrbubbles: That's exactly what I was looking for
[23:38:49] mrbubbles: Something like that
[23:39:12] mrbubbles: I was thinking that ealirer how I basically want to evaluate each step of the expression and stop if it doesn't exist
[23:39:13] FailBit: I believe activesupport #try! does suppress exceptions
[23:39:15] mrbubbles: Wow that's super handy
[23:39:31] smathy: Megamos, and what's the error you get?
[23:40:23] mwlang: Suppose I want to run a smoke test against development or production rather than test environment and want it to be non-destructive as far as the database goes. In other words, the data in development db *is* the fixture and the database shouldn’t be scrubbed.
[23:40:57] Megamos: smathy, params[:occasions] shows as should in controller. But in the practice_params (permitted params) it is not.
[23:41:09] Arcaire: mwlang: what
[23:41:20] Arcaire: "suppose I want to run my testing against any database except the test database"
[23:41:39] mwlang: basically, I’m porting an app to Rails 4 and the pages and all the partials are database-driven rather than the typical file-based templates. I want to set up a smoke test that simply attempts to render every page after I’ve done some refactoring to see what I broke.
[23:41:40] smathy: Megamos, !gist what you're seeing and your controller code.
[23:41:40] helpa: Megamos: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[23:41:57] Megamos: smathy, shall do
[23:42:28] smathy: Megamos, also check your logs, if this is a strong params problem then you will have an "Unpermitted param" error/warning in there.
[23:42:38] mwlang: not trying to substitute for proper unit testing, just trying to find a simple way to smoke out broken pages so I can then add unit tests, fixtures etc. and fix it.
[23:43:39] mwlang: thought about just doing a rake task and use either curl or Faraday to hit each page…but kind of like the idea of getting an rspec documented output.
[23:44:13] mwlang: that is —format=html option for rspec.
[23:44:42] diegoaguilar: has joined #RubyOnRails
[23:46:14] snowy: has joined #RubyOnRails
[23:51:12] Megamos: smathy, I don't get the "Unpermitted param" error. Here is da code, https://gist.github.com/megamos/3b962d13b479f5bd902503927bfa321a
[23:52:58] mrbubbles: FailBit Sorry my good man, is the offical name for that ampersand trick "safe access"? I can't find anything abou tit in the docs
[23:53:49] Radar: https://gist.github.com/megamos/3b962d13b479f5bd902503927bfa321a#file-practice_controller-rb-L26 why the extra array wrapping here
[23:54:18] havenwood: mrbubbles: It's the lonely person operator.
[23:55:41] Megamos: Radar, I just tried something new... tried alot. Didn't work without either
[23:56:58] blindMoe: has joined #RubyOnRails
[23:57:31] mrbubbles: thanks havenwood, found it now. that's beauty
[23:58:58] blindMoe: is it possible for me to do something like: <%= fubar.test#{index} %>? Basically I have a loop where index is the index of the loop and I want to grab what is stored in fubar.test1, fubar.test2 ... Having a hard time finding ways to use dynamic variable names. instance_variable_get() doesn't seem to do it
[23:59:17] smathy: Megamos, the code you're showing is different than what you said you had in the channel, and I'm surprised the code you're showing in your gist didn't generate the unpermitted params error.