« Back to channel list

#RubyOnRails - 02 June 2015

« Back 1 day Forward 1 day »
[00:00:13] nonparfumee: has joined #RubyOnRails
[00:00:35] artto: has joined #RubyOnRails
[00:01:45] lethjakman: has joined #RubyOnRails
[00:02:07] Radar: ARGH this fucking API is designed by muppets
[00:02:20] Radar: I make a request to /Item.json?itemID=1 where itemID is their primary key
[00:02:35] Radar: If that item doesn't exist, it returns a 200 (A TWO HUNDRED!!) response with an empty data set.
[00:02:38] jfarmer: has joined #RubyOnRails
[00:02:52] DoctorMonocular: has joined #RubyOnRails
[00:03:24] edgarjs: has joined #RubyOnRails
[00:03:27] rhizome: 200 == didn't return an exception
[00:03:34] Radar: It _should_ be a 404
[00:03:34] cornerma1: has joined #RubyOnRails
[00:03:44] rhizome: but the db is still running
[00:03:48] rushed: gabeodess: you might try wrapping your image calls in a float block
[00:03:51] yaw: has left #RubyOnRails: ("Textual IRC Client: www.textualapp.com")
[00:03:57] mustmodify: rhizome: makes sense.
[00:04:19] gabeodess: rushed: hmmm, okay, I???ll read up on float blocks
[00:04:41] mustmodify: Radar: I had a guy tell me he wanted me to build an API with a "top layer that included a status number" ... and I was like "can the top layer be HTTP?"
[00:04:59] AnoHito: has joined #RubyOnRails
[00:05:03] mustmodify: And then he told me he wanted it to be "service oriented"
[00:05:07] sevenseacat: has joined #RubyOnRails
[00:05:18] balr0g: has joined #RubyOnRails
[00:05:20] Radar: g0rx: !rule12
[00:05:20] helpa: g0rx: Do not PM members of the channel without first asking if that is OK.
[00:05:24] DoctorMonocular: has joined #RubyOnRails
[00:05:29] mustmodify: and I said, "Well, I'm sure there are other people who would be fascinated to work with you."
[00:05:53] scottmatheina: has joined #RubyOnRails
[00:06:14] kenndel_: has left #RubyOnRails: ()
[00:06:38] kenndel: has joined #RubyOnRails
[00:06:55] mustmodify: g0rx claims he wants a developer who is interested in "coding a black market". He pays in bitcoin and also wants to know if I like like (sic) english ladies.
[00:07:07] rhizome: sounds legit
[00:07:25] mustmodify: And English is his native language.
[00:07:30] mustmodify: for snizzle.
[00:07:35] dpg: has joined #RubyOnRails
[00:09:13] gabeodess: rushed: float did the trick, thanks :)
[00:09:51] elia: has joined #RubyOnRails
[00:09:58] mheld: has joined #RubyOnRails
[00:11:41] compeman: has joined #RubyOnRails
[00:11:47] ur5us: has joined #RubyOnRails
[00:12:15] scottmatheina: has joined #RubyOnRails
[00:13:08] compeman: has left #RubyOnRails: ()
[00:13:24] bricker: For a second it looked like rails devs were talking about floating point numbers
[00:13:33] mustmodify: bricker: lol
[00:13:45] mustmodify: 1 != 1 for some values of 1.
[00:13:56] DoctorMonocular: has joined #RubyOnRails
[00:14:13] mustmodify: has left #RubyOnRails: ()
[00:19:00] iliketurtles: has joined #RubyOnRails
[00:21:30] shyshy: has joined #RubyOnRails
[00:21:34] jab84: has joined #RubyOnRails
[00:27:30] pjammer: has joined #RubyOnRails
[00:27:32] bricker: has joined #RubyOnRails
[00:28:01] rickmasta: has joined #RubyOnRails
[00:29:23] bruno-: has joined #RubyOnRails
[00:29:28] duderonomy: has joined #RubyOnRails
[00:30:37] volkk: has joined #RubyOnRails
[00:31:43] charleystran: has joined #RubyOnRails
[00:34:21] volkk: has joined #RubyOnRails
[00:36:21] GriffinHeart: has joined #RubyOnRails
[00:37:04] bmurt: has joined #RubyOnRails
[00:38:31] DoctorMonocular: has joined #RubyOnRails
[00:40:18] ramfjord: has joined #RubyOnRails
[00:41:02] DoctorMonocular: has joined #RubyOnRails
[00:41:58] baweaver: has joined #RubyOnRails
[00:43:45] mello: has joined #RubyOnRails
[00:43:45] mello: has joined #RubyOnRails
[00:45:02] jgpawletko: has joined #RubyOnRails
[00:48:49] rushed: has joined #RubyOnRails
[00:49:22] robustus: has joined #RubyOnRails
[00:49:25] mfitton: has joined #RubyOnRails
[00:49:59] stardiviner: has joined #RubyOnRails
[00:51:19] dseitz: has joined #RubyOnRails
[00:51:44] GriffinHeart: has joined #RubyOnRails
[00:53:38] DoctorMonocular: has joined #RubyOnRails
[00:55:11] DoctorMo_: has joined #RubyOnRails
[00:57:01] dopie: has joined #RubyOnRails
[00:59:12] choke: has joined #RubyOnRails
[00:59:12] fgo: has joined #RubyOnRails
[00:59:13] joaomdmoura: has joined #RubyOnRails
[00:59:27] charliesome: has joined #RubyOnRails
[01:00:55] djbkd: has joined #RubyOnRails
[01:01:48] artto: has joined #RubyOnRails
[01:01:50] DoctorMonocular: has joined #RubyOnRails
[01:04:23] ramfjord: What's up guys?
[01:04:58] ramfjord: I've been kind of bashing my brains in on a weird activerecord error I'm getting in a test I'm writing
[01:05:03] ramfjord: https://gist.github.com/ramfjord/6dc9f0185a1894fe9076
[01:05:22] sevenseacat: I hope the guys can help you then
[01:05:27] ramfjord: basically, unless I have an id primary key, I'm getting this TypeError: nil is not a symbol nor a string
[01:05:58] ramfjord: actually, it may work if there is any kind of primary key column in the database
[01:05:58] rushed: has joined #RubyOnRails
[01:06:09] ramfjord: full confession, I'm using activerecord but not rails
[01:06:17] DoctorMonocular: has joined #RubyOnRails
[01:06:27] ramfjord: and this is for a test - I may be able to just ensure that there is a single primary key
[01:06:34] ramfjord: for all of the examples this will be running on
[01:06:52] rkofman: has joined #RubyOnRails
[01:09:06] rickmasta: has joined #RubyOnRails
[01:09:52] scottmatheina: has joined #RubyOnRails
[01:12:02] edwinrozario: has joined #RubyOnRails
[01:14:07] philcris_: has joined #RubyOnRails
[01:14:44] DoctorMonocular: has joined #RubyOnRails
[01:15:32] existensil: ramfjord: does activerecord even support not having a primary key?
[01:18:56] existensil: though it should clearly throw a more descriptive error
[01:19:47] thebatu1: has joined #RubyOnRails
[01:20:15] DoctorMonocular: has joined #RubyOnRails
[01:22:30] rhizome: "key" may be a bad column name to use in a ruby context
[01:23:44] ramfjord: yeah, I guess it might not
[01:24:02] ramfjord: it does work if I use key INTEGER PRIMARY KEY
[01:24:41] DoctorMonocular: has joined #RubyOnRails
[01:26:26] ramfjord: in the actual code I think almost all of the primary keys will be timestamps of other names, since it's for a general monitoring script. Originally I wanted to allow compound primary keys, which active record clearly doesn't support out of the box, so I was trying to avoid messing with any kind of primary key logic. For now I'll specify in the docs that all tables using this must have a single primary key
[01:26:29] rhizome: are you sure it's `primary_key "foo"` and not self.primary_key?
[01:26:56] rhizome: to be sure, it's called a primary key because there is only one
[01:27:12] DoctorMonocular: has joined #RubyOnRails
[01:27:12] rhizome: not sure what monstrosity you'd create that could have multiples
[01:27:16] ramfjord: that's not even true, at least in postgres
[01:27:40] ramfjord: an example would be if you have daily data someone - you'd want to primary key it on date and person
[01:27:46] ramfjord: daily data for someone*
[01:28:00] ramfjord: suppose I was making an app to record my meals
[01:28:15] rhizome: http://dba.stackexchange.com/a/65290
[01:28:19] existensil: I would recommend not mucking with the primary key concept. It can be useful to have a single internally maintained identifier for every record. You can add additional keys and use those keys for most of your access patterns. Your "primary" key doesn't have to be your only one, or even your "main" one.
[01:28:42] DoctorMonocular: has joined #RubyOnRails
[01:30:34] kinduff: has joined #RubyOnRails
[01:30:48] existensil: if you don't like activerecord's restrictions, I recommend using the sequel gem
[01:31:11] existensil: but you should still probably have a standard auto-incrementing primary key for most tables
[01:31:59] alexmr: has joined #RubyOnRails
[01:33:01] yfeldblum: has joined #RubyOnRails
[01:33:04] one_zero: has joined #RubyOnRails
[01:33:29] ramfjord: Interesting stack overflow article - it seems to work without error when I copy paste the code in my local database
[01:33:37] maz-dev: has joined #RubyOnRails
[01:34:04] DigitallyBorn: has joined #RubyOnRails
[01:34:20] ramfjord: ahh, they even mentioned that in the comments. I actually do try to avoid activerecord for the most part, but sometimes it's too convenient to pass up
[01:35:12] DoctorMonocular: has joined #RubyOnRails
[01:35:36] ramfjord: anyway, if you already have a unique identifier through 2 columns, isn't it easy to add a SERIAL unique identifier in a single migration?
[01:35:48] ramfjord: I don't really understand the emphasis on single column pkeys in active record
[01:36:11] rushed: ramfjord: so don't use it then
[01:36:37] Lytol: has joined #RubyOnRails
[01:36:40] ramfjord: rushed: if only I could write all of my code from scratch
[01:36:41] DoctorMonocular: has joined #RubyOnRails
[01:36:42] Rubie: has joined #RubyOnRails
[01:37:05] rushed: ramfjord: so stick to the conventions which allow you to leverage existing code then :P
[01:38:06] crevax: has joined #RubyOnRails
[01:38:11] DoctorMonocular: has joined #RubyOnRails
[01:39:35] crankharder: has joined #RubyOnRails
[01:40:23] jlpeters: has joined #RubyOnRails
[01:40:24] amitchellbullard: has joined #RubyOnRails
[01:40:25] Hosh: has joined #RubyOnRails
[01:40:25] ebryn: has joined #RubyOnRails
[01:40:25] culturelabs: has joined #RubyOnRails
[01:40:26] rakm: has joined #RubyOnRails
[01:40:34] kumavis: has joined #RubyOnRails
[01:41:15] prereflect: has joined #RubyOnRails
[01:42:18] Iacobus: has joined #RubyOnRails
[01:42:51] zrl: has joined #RubyOnRails
[01:42:56] cardoni: has joined #RubyOnRails
[01:43:10] poikon: has joined #RubyOnRails
[01:43:39] DoctorMonocular: has joined #RubyOnRails
[01:45:04] jlyndon: has joined #RubyOnRails
[01:45:09] DoctorMo_: has joined #RubyOnRails
[01:45:19] jxf: has joined #RubyOnRails
[01:46:51] hahuang65: has joined #RubyOnRails
[01:47:21] eggoez: has joined #RubyOnRails
[01:47:56] merqlove: has joined #RubyOnRails
[01:47:56] AckZ: has joined #RubyOnRails
[01:48:35] Killerkeksdose: has joined #RubyOnRails
[01:48:53] paulcsmith: has joined #RubyOnRails
[01:50:22] grandy: has joined #RubyOnRails
[01:50:39] kapowaz: has joined #RubyOnRails
[01:50:58] lxkm_: has joined #RubyOnRails
[01:51:48] DoctorMonocular: has joined #RubyOnRails
[01:52:53] lacrosse__: has joined #RubyOnRails
[01:53:16] DoctorMonocular: has joined #RubyOnRails
[01:55:33] mois3x: has joined #RubyOnRails
[01:55:55] chintanparikh: has joined #RubyOnRails
[01:57:19] codeurge: has joined #RubyOnRails
[01:58:58] fgo: has joined #RubyOnRails
[01:59:16] merryfett: has joined #RubyOnRails
[01:59:33] sarink: has joined #RubyOnRails
[01:59:54] DoctorMonocular: has joined #RubyOnRails
[02:00:27] sye: has left #RubyOnRails: ("undefined")
[02:00:31] sye: has joined #RubyOnRails
[02:02:31] artto: has joined #RubyOnRails
[02:03:18] rubyonrailed: has joined #RubyOnRails
[02:05:26] DoctorMonocular: has joined #RubyOnRails
[02:05:57] jaequery: has joined #RubyOnRails
[02:07:01] DoctorMonocular: has joined #RubyOnRails
[02:08:35] DoctorMonocular: has joined #RubyOnRails
[02:11:51] Glyphik: has joined #RubyOnRails
[02:13:08] commondream: has joined #RubyOnRails
[02:18:16] Limix: has joined #RubyOnRails
[02:19:07] DoctorMonocular: has joined #RubyOnRails
[02:19:08] bruno-: has joined #RubyOnRails
[02:20:37] DoctorMonocular: has joined #RubyOnRails
[02:21:04] BaNzounet: has joined #RubyOnRails
[02:22:59] quazimodo: has joined #RubyOnRails
[02:23:58] pontiki: has joined #RubyOnRails
[02:28:04] DoctorMonocular: has joined #RubyOnRails
[02:28:49] sevenseacat: mornin' pontiki
[02:29:06] pontiki: hi sevenseacat :)
[02:29:12] Scient: gaaaah I hate these watirs and cucumbers and things
[02:29:23] Scient: seems like any method related to blocking until an element appears is fucked
[02:29:43] DoctorMonocular: has joined #RubyOnRails
[02:30:21] pontiki: ACTION hands Scient a glass of cucumber watir with a gherkin in it
[02:30:29] charleystran: has joined #RubyOnRails
[02:31:13] DoctorMonocular: has joined #RubyOnRails
[02:31:57] towski_: has joined #RubyOnRails
[02:32:29] mello: has joined #RubyOnRails
[02:32:44] DoctorMonocular: has joined #RubyOnRails
[02:33:34] jaequery: has joined #RubyOnRails
[02:33:57] pwnz0r_: has joined #RubyOnRails
[02:34:14] DoctorMonocular: has joined #RubyOnRails
[02:35:11] djbkd: has joined #RubyOnRails
[02:35:17] drale2k: has joined #RubyOnRails
[02:37:02] SeanLazer: has joined #RubyOnRails
[02:38:15] IFrank00: has joined #RubyOnRails
[02:39:39] maz-dev: has joined #RubyOnRails
[02:39:43] DoctorMonocular: has joined #RubyOnRails
[02:39:59] zzing: has joined #RubyOnRails
[02:41:50] zzing: In a template, I have an array of values (a multiple of some known x) that I must turn into a table of rows and columns. What would be the easiest way to split the array or otherwise go through it?
[02:42:30] sevenseacat: use in_groups_of to chunk the array into groups, then use a nested loop?
[02:43:07] zzing: That will fit perfectly thank you.
[02:43:44] zzing: I am converting some old code that was written in sinatra with a nosql database and a different model. This will fit almost like a glove to the existing erb.
[02:45:38] codeurge: has joined #RubyOnRails
[02:46:12] DoctorMonocular: has joined #RubyOnRails
[02:47:50] Nuck: has joined #RubyOnRails
[02:48:44] zzing: It worked :-)
[02:48:50] DoctorMonocular: has joined #RubyOnRails
[02:49:56] zzing: My first thing outside of the railstutorial book. I look forward to doing more.
[02:52:15] merqlove: has joined #RubyOnRails
[02:52:27] DoctorMonocular: has joined #RubyOnRails
[02:54:58] DoctorMonocular: has joined #RubyOnRails
[02:56:25] Anakat: has joined #RubyOnRails
[02:56:36] DoctorMonocular: has joined #RubyOnRails
[02:57:12] sarink: has joined #RubyOnRails
[02:57:15] FCser: Hmm I setup bootstrap3-datetime-picker and changed a rails standard date time input to a text field (same field name journal_entry[date]) but now the date parameter is empty when saving the record...
[02:57:21] edwinrozario: has joined #RubyOnRails
[02:57:41] zzing: has joined #RubyOnRails
[02:58:11] DoctorMonocular: has joined #RubyOnRails
[02:58:21] FCser: what's up with that?
[02:58:52] barnex: I'm trying to use SQL binds in .execute, and I can't find the correct syntax???
[02:58:52] barnex: Here's what I'm trying: result = @connection.execute("select distinct mfin.FLAGS from mfin where mfin.SATEM_ID = ?", [outlet])
[02:59:13] barnex: and it gets turned into: LINE 1: select distinct mfin.FLAGS from mfin where mfin.SATEM_ID = ?
[02:59:33] mois3x: has joined #RubyOnRails
[03:00:01] scottmatheina: has joined #RubyOnRails
[03:02:26] Anakat: has joined #RubyOnRails
[03:03:00] dmz: has joined #RubyOnRails
[03:03:34] artto: has joined #RubyOnRails
[03:04:21] ivanskie: has joined #RubyOnRails
[03:04:36] rushed: barnex: an option for sanatize... query_text = ActiveRecord::Base.__send__(:sanitize_sql_array, [sql_string, *criteria_array])
[03:04:40] rushed: barnex: then to execute... self.class.connection.execute(query_text)
[03:07:29] barnex: rushed: thanks, that works, but??? seems to be a lot of typing. And __send__??? Is that the best way?
[03:08:07] dopie: has joined #RubyOnRails
[03:08:08] existensil: barnex: the low level SQL driver isn't what implements parameterization. its a feature of ActiveRecord... or its underlying Arel library
[03:08:43] thebatu1: has joined #RubyOnRails
[03:09:09] rushed: barnex: the "best" way would be to setup an AR model for tables you want to interact with :P
[03:09:32] barnex: well, the exec_query method takes the binds argument???
[03:09:38] DoctorMonocular: has joined #RubyOnRails
[03:09:58] barnex: http://apidock.com/rails/ActiveRecord/ConnectionAdapters/PostgreSQLAdapter/exec_query
[03:10:41] barnex: I guess those are just different binds then? Low level ones?
[03:13:23] braincrash: has joined #RubyOnRails
[03:16:23] Limix: has joined #RubyOnRails
[03:16:49] rickmasta: has joined #RubyOnRails
[03:19:31] barnex: will adding AR model for a table without id column work?
[03:20:15] delianides: has joined #RubyOnRails
[03:20:36] existensil: possibly not, but you can still Arel::Table.new(:table_without_id) and use arel to build queries
[03:21:03] existensil: or use the sequel gem
[03:21:14] DoctorMonocular: has joined #RubyOnRails
[03:22:23] Duckily: has joined #RubyOnRails
[03:22:38] ghr: has joined #RubyOnRails
[03:23:08] rushed: barnex: AR w/out a key will end up uglier then the two lines I already gave you :P
[03:24:07] existensil: arel syntax is also not beautiful to look at, but is powerful and flexible
[03:25:54] michael_mbp: has joined #RubyOnRails
[03:26:27] justintv90: has joined #RubyOnRails
[03:26:36] barnex: Isn't there a method in Arel that'd just let me execute SQL and bind to it?
[03:26:56] duderonomy: has joined #RubyOnRails
[03:27:40] Oog: has joined #RubyOnRails
[03:27:53] Oog: i have a model Credit with belongs_to :order
[03:28:03] Oog: the Credit is used when order is present
[03:28:14] Oog: should I make a separate boolean used or just test order.nil?
[03:30:41] barnex: If you want to go the 'order.nil?' route, I'd make a method Credit.used that tests for that.
[03:30:52] barnex: So when you need the boolean at some point you can switch easily
[03:31:13] Oog: good idea
[03:31:34] barnex: what if order gets deleted?
[03:31:38] barnex: Is it possible?
[03:32:04] Radar: order.present? if you want to go the other way
[03:32:09] Oog: assuming the system isnt broken
[03:32:22] rubyonra_: has joined #RubyOnRails
[03:32:24] Oog: yeah ill do present?
[03:33:06] fedexo: has joined #RubyOnRails
[03:35:45] workmad3: has joined #RubyOnRails
[03:35:54] shyshy: has joined #RubyOnRails
[03:36:33] iliketurtles: has joined #RubyOnRails
[03:43:57] Rubie: has joined #RubyOnRails
[03:44:02] crankharder: has joined #RubyOnRails
[03:46:43] Lightsword: has joined #RubyOnRails
[03:48:12] Lytol: has joined #RubyOnRails
[03:49:22] chagel: has joined #RubyOnRails
[03:49:28] towski_: has joined #RubyOnRails
[03:52:16] choke: has joined #RubyOnRails
[03:56:47] charliesome: has joined #RubyOnRails
[03:58:16] Killerkeksdose: has joined #RubyOnRails
[03:59:02] Lightsword: has joined #RubyOnRails
[03:59:03] jenrzzz: has joined #RubyOnRails
[03:59:03] iliketur_: has joined #RubyOnRails
[03:59:32] rkofman: has joined #RubyOnRails
[04:01:28] Lightsword: has joined #RubyOnRails
[04:01:42] Spami: has joined #RubyOnRails
[04:02:18] Lightsword: has joined #RubyOnRails
[04:03:12] jaequery: has joined #RubyOnRails
[04:04:08] artto: has joined #RubyOnRails
[04:04:22] acti0nman: has joined #RubyOnRails
[04:05:15] merryfett: has joined #RubyOnRails
[04:05:34] Brozo: has joined #RubyOnRails
[04:06:58] The_Phoenix: has joined #RubyOnRails
[04:07:03] lorn: has joined #RubyOnRails
[04:07:31] erichu: has joined #RubyOnRails
[04:07:47] momomomomo: has joined #RubyOnRails
[04:07:57] nahtnam: has joined #RubyOnRails
[04:11:10] ramfjord: has joined #RubyOnRails
[04:13:41] watchtheblur: has joined #RubyOnRails
[04:15:31] sarink: has joined #RubyOnRails
[04:16:41] iliketurtles: has joined #RubyOnRails
[04:17:03] rickmasta: has joined #RubyOnRails
[04:17:04] DoctorMonocular: has joined #RubyOnRails
[04:17:04] ur5us: has joined #RubyOnRails
[04:19:30] DoctorMonocular: has joined #RubyOnRails
[04:20:50] barnex: Hmm, can I use rails.js to get javascript response from a controller and execute it?
[04:21:00] barnex: like I do with remote links_to?
[04:21:18] mello: has joined #RubyOnRails
[04:21:32] djbkd: has joined #RubyOnRails
[04:22:04] tvle83: has joined #RubyOnRails
[04:22:19] simplyianm: has joined #RubyOnRails
[04:22:41] simplyianm: What is the naming convention for nested controllers?
[04:22:58] barnex: simplyianm: like what?
[04:23:00] tejasmanohar: has joined #RubyOnRails
[04:23:13] simplyianm: barnex: eg /posts/:id/comments/:cid
[04:23:19] simplyianm: PostsCommentsController?
[04:23:21] ghr: has joined #RubyOnRails
[04:23:44] sevenseacat: whats wrong with CommentsController
[04:23:58] sevenseacat: if you want to namespace it, thats a different story
[04:25:03] Radar: simplyianm: !gettingstarted
[04:25:04] helpa: simplyianm: http://guides.rubyonrails.org/getting_started.html - Getting started with Ruby on Rails guide written by Mike Gunderloy and Ryan Bigg
[04:27:08] dideler: has joined #RubyOnRails
[04:28:22] maz-dev: has joined #RubyOnRails
[04:31:37] baweaver: has joined #RubyOnRails
[04:34:28] lessless: has joined #RubyOnRails
[04:36:43] sarink: has joined #RubyOnRails
[04:36:53] lessless: is it possible to dynamically set foreign key for the join table in has_many through association?
[04:38:37] Radar: dynamically?
[04:45:27] rubyonrailed: has joined #RubyOnRails
[04:46:47] baweaver: lessless: Look into polymorphic associations
[04:46:49] choke: has joined #RubyOnRails
[04:47:28] ur5us: has joined #RubyOnRails
[04:51:29] rkofman: has joined #RubyOnRails
[04:52:38] lessless: Radar, there is a Deal model, which has many Presets. All Presets are different. Than Deal has many Products through Presets. When User change Preset Deal Products must change also
[04:52:41] dopie: has joined #RubyOnRails
[04:52:50] Radar: Sounds hard.
[04:56:11] baweaver: lessless: http://guides.rubyonrails.org/association_basics.html#polymorphic-associations
[04:57:35] thebatu1: has joined #RubyOnRails
[04:57:57] annlewis: has joined #RubyOnRails
[04:58:01] lessless: baweaver, you want to say that preset is polymorphic?
[04:58:30] baweaver: I think you're overcomplicating the relationship
[04:58:47] baweaver: A Deal has_many Products
[04:58:53] baweaver: Why are presents even needed?
[04:59:03] baweaver: and if they really are, can there be a better name for them?
[04:59:09] baweaver: because as is it's vague.
[05:01:47] dionysus69: has joined #RubyOnRails
[05:04:13] btrick: has joined #RubyOnRails
[05:04:21] rocknrollMarc: has joined #RubyOnRails
[05:04:50] artto: has joined #RubyOnRails
[05:05:47] lessless: baweaver, they really are. another possible name can be 'scenarios'
[05:06:14] baweaver: Explain what a Scenario or Preset is
[05:07:50] nonparfumee: has joined #RubyOnRails
[05:08:44] lessless: baweaver, it's a predefined set of products for the deal
[05:09:12] baweaver: So it'd be more of a ProductGroup or ProductSet or Bundle then?
[05:10:08] baweaver: As is there's not a reasonable way to infer that given the current name
[05:10:14] baweaver: unless there's more data on there.
[05:10:41] chrissonar: has joined #RubyOnRails
[05:12:45] lessless: baweaver, there is a little bit: Deal is a loan, so preset also has a term, a rate and many insurance policies
[05:13:05] lessless: it bundles insurance policies and products and carries own term and rate
[05:13:56] baweaver: Ok, so that helps a bit more as well
[05:14:12] baweaver: Present and Deal and Scenario would not have told me any of that.
[05:15:09] baweaver: What I would do is set out a piece of paper and map this out, make sure to name things as clearly as possible
[05:15:21] baweaver: database modeling is a pesky thing and requires a good deal of thought
[05:15:23] btrick: has left #RubyOnRails: ()
[05:15:35] lessless: baweaver, there is no book for it ;)
[05:15:50] baweaver: ACTION tries to find the dang thing again
[05:16:15] choke: has joined #RubyOnRails
[05:16:17] baweaver: http://agiledata.org/essays/dataNormalization.html
[05:16:22] baweaver: That'll get you started at least
[05:16:48] baweaver: Relational databases follow what are called the Normal Forms
[05:17:00] baweaver: or at least should to reduce complexity, duplication, and later pain.
[05:18:36] daneo: has joined #RubyOnRails
[05:18:43] baweaver: Database design especially requires a significant amount of forethought, charting, and gathering of requirements
[05:18:53] baweaver: naming is an especially critical part of it
[05:19:35] GnuYawk: has joined #RubyOnRails
[05:21:54] sinkensabe: has joined #RubyOnRails
[05:23:28] justintv90: has joined #RubyOnRails
[05:23:37] baweaver: Radar: You have a recommended Data Modeling book / tutorial? Still hunting down a good one here.
[05:23:53] daneo: Imagine a resource :users on a website being available on '/users'. I'd like to reuse that for a register section on the website, so only the GET on users/new and POST on users. To which path should I point the form? I don't want to reach the users namespace when entering from the /signup path, but I'd like to reuse the logic in the controller.
[05:24:03] ghr: has joined #RubyOnRails
[05:24:23] Radar: baweaver: negatory.
[05:24:25] daneo: If I missed something on the tutorial feel free to point me to it, but I don't really know how to accomplish this (yet)
[05:24:40] baweaver: Yeah, it's kinda a learned feat it seems in most cases :/
[05:24:42] Radar: daneo: I don't understand the question.
[05:24:44] workmad3: has joined #RubyOnRails
[05:24:44] Radar: baweaver: Absolutely.
[05:25:02] Radar: daneo: Show us in code perhaps?
[05:25:49] daneo: Radar: resources :users
[05:25:49] daneo: get 'sign_up' => 'users#new'
[05:25:50] daneo: post 'sign_up' => 'users#create'
[05:25:53] Radar: daneo: !gist
[05:25:53] helpa: daneo: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[05:25:54] daneo: Oops, sorry
[05:26:06] daneo: Yes, of course. My bad.
[05:26:20] daneo: Radar: https://gist.github.com/daneov/4a21d473e449d7a67276
[05:26:29] baweaver: lessless: http://www.amazon.com/Data-Modeling-Made-Simple-Professionals/dp/0977140067/ - This one looks good
[05:26:37] Radar: Which form?
[05:26:39] baweaver: covers UML, normalization, scorecards, and some other tools
[05:27:19] DoctorMonocular: has joined #RubyOnRails
[05:27:33] Radar: daneo: Which form?
[05:27:36] baweaver: UML referring to cardinality and charting your models, such as has_many and friends.
[05:27:46] daneo: Radar: Gist updated
[05:27:49] baweaver: (Unified Modeling language)
[05:28:02] SalexW: has joined #RubyOnRails
[05:28:06] aganov: has joined #RubyOnRails
[05:28:22] Radar: daneo: I still am not understand what the question is. The code looks fine to me save for that you're defining two routes to both new+create
[05:28:30] Radar: that can be fixed by doing resources :users, except: [:new, :create]
[05:29:03] User458764: has joined #RubyOnRails
[05:29:05] DoctorMonocular: has joined #RubyOnRails
[05:29:54] baweaver: Radar: Think it'd be a worthwhile writeup to go over database design in a Rails context?
[05:30:02] daneo: Radar: The routes and functionality do work perfectly fine. But when the registration is done, I want the path to remain as it is.
[05:30:11] fgo: has joined #RubyOnRails
[05:30:21] Radar: daneo: I think we're getting closer to a question but still not sure.
[05:30:45] daneo: Currently it goes to /users/ after entering the form, but I want it to remain in the path when the flow was entered
[05:31:17] Radar: form_for @user, url: sign_up_path
[05:31:37] lessless: baweaver, thank you very much! that bite me very hard on this project. data layer is not to so big but very tangled
[05:31:48] daneo: Radar: Ok, but that form is exactly the same in the /users/new
[05:32:12] daneo: I mean, I reuse that.
[05:32:16] baweaver: lessless: It's one of the big mistakes people make in Rails to get excited and jump creating a data layer.
[05:32:47] daneo: Wouldn't that mean that when the form is entered through /users/new that it'd be redirected to /signup
[05:32:48] rushed: lessless: untangle it~
[05:32:51] Radar: daneo: Why is /users/new important? Why not just have it as a sign up form?
[05:32:53] sinkensabe: has joined #RubyOnRails
[05:33:04] daneo: For user management later on ?
[05:34:07] daneo: Radar: Fair enough, when does an admin even need to create an account for a new user.
[05:34:19] daneo: No need in my application anyway.
[05:34:24] daneo: Radar: except: [:new, :create] it is then
[05:34:26] jenrzzz: has joined #RubyOnRails
[05:34:40] Radar: daneo: If an admin creates a user, it should be done in an admin namespace.
[05:34:48] Radar: As outlined in Chapter 7 of Rails 4 in Action </plug>
[05:34:49] DoctorMonocular: has joined #RubyOnRails
[05:35:01] givanse: has joined #RubyOnRails
[05:35:05] gokulnath: has joined #RubyOnRails
[05:35:30] daneo: Alright, I'll read that.
[05:35:35] daneo: Thank Radar.
[05:36:12] sarink: has joined #RubyOnRails
[05:36:43] gokulnath: Is there a working way to mount a rack app under a namespace?
[05:36:56] Radar: path or module namespace?
[05:37:05] drale2k: has joined #RubyOnRails
[05:37:43] sarink: has joined #RubyOnRails
[05:37:44] Radar: That doesn't make sense to me.
[05:37:56] Radar: can you show us an example of what you're trying to do?
[05:38:22] Lightsword: has joined #RubyOnRails
[05:38:32] tagrudev: has joined #RubyOnRails
[05:39:06] Olipro_: has joined #RubyOnRails
[05:41:09] gokulnath: Radar, https://gist.github.com/gokulnath/254689b045803524a984
[05:41:36] Radar: With the idea that it would be viewable at /admin/logs?
[05:41:47] Radar: scope path: "admin" is probably what you want, instead of namespace :admin
[05:44:52] duncannz: has joined #RubyOnRails
[05:44:53] tsujp: has joined #RubyOnRails
[05:45:01] gokulnath: Radar, I am getting 404 from the rack app when doing it. I guess it's getting the whole sub uri or something like that.
[05:45:03] GriffinHeart: has joined #RubyOnRails
[05:45:15] Radar: gokulnath: Maybe. I am not sure.
[05:46:03] lxsameer: has joined #RubyOnRails
[05:46:31] ChoiKyuSang_: has joined #RubyOnRails
[05:46:56] hmnhf: has joined #RubyOnRails
[05:47:38] metus_violarium: has joined #RubyOnRails
[05:48:13] jaequery: has joined #RubyOnRails
[05:50:33] dionysus69: has joined #RubyOnRails
[05:50:55] rvanlieshout: has joined #RubyOnRails
[05:52:24] eddie_v3: has joined #RubyOnRails
[05:54:00] dseitz: has joined #RubyOnRails
[05:55:23] ur5us: has joined #RubyOnRails
[05:56:05] bruno-: has joined #RubyOnRails
[05:59:12] annlewis: has joined #RubyOnRails
[05:59:46] simplyianm: has joined #RubyOnRails
[06:01:17] yfeldblum: has joined #RubyOnRails
[06:01:27] Rubie: has joined #RubyOnRails
[06:04:07] Aeyrix: has joined #RubyOnRails
[06:04:09] Macaveli: has joined #RubyOnRails
[06:04:12] Aeyrix: paging australians
[06:04:18] Aeyrix: and / or nz'ers
[06:04:45] arBmind: has joined #RubyOnRails
[06:04:50] Aeyrix: https://view-source-radboats.herokuapp.com is shittalk central for anz web dev, it seems - https://twitter.com/benschwarz/status/605590675837435904
[06:05:13] Aeyrix: Ben demanded I invite cool people but as I don't know any you guys will have to do. :^)
[06:05:27] baweaver: #shotsfired
[06:05:37] artto: has joined #RubyOnRails
[06:05:57] Aeyrix: APAC, not just ANZ.
[06:06:11] coin3d: has joined #RubyOnRails
[06:06:57] comrad: has joined #RubyOnRails
[06:08:05] sandstrom: has joined #RubyOnRails
[06:09:59] mello: has joined #RubyOnRails
[06:10:45] Limix: has joined #RubyOnRails
[06:11:16] roolo: has joined #RubyOnRails
[06:12:15] kerunaru: has joined #RubyOnRails
[06:12:44] tvle83: i was hired to work on an existing ruby on rails project to fix it up for the next build. THey are using cropper for an avatar upload and crop feature. when i choose the image and crop it, the end result seems to be cropped by 1/4th of the area that I chose... it seems like it is just automatically being recropped. i am trying to pin down where the error might lie but i am wondering if
[06:12:44] tvle83: someone has hear of this happening before
[06:19:48] ndrei: has joined #RubyOnRails
[06:19:58] choke: has joined #RubyOnRails
[06:22:26] chinmay_dd: has joined #RubyOnRails
[06:24:47] ghr: has joined #RubyOnRails
[06:25:20] jenrzzz: has joined #RubyOnRails
[06:28:44] squiercaster: has joined #RubyOnRails
[06:29:02] Geffy: has joined #RubyOnRails
[06:31:47] sevenseacat: sup rvanlieshout
[06:31:56] arup_r: has joined #RubyOnRails
[06:32:22] rvanlieshout: sleepy. busy at work, busy in getting the new house done
[06:32:27] rvanlieshout: so might be a bit slow in responding :)
[06:33:02] ChoiKyuSang: has joined #RubyOnRails
[06:33:16] sevenseacat: not bad. chillin' and workin' away.
[06:33:31] rvanlieshout: still happy at / with the 'new' job?
[06:33:32] lxsameer: has joined #RubyOnRails
[06:33:42] lxsameer: has joined #RubyOnRails
[06:35:25] tvle83: i am currently using Cropper for avatar cropping, is there a better solution ? this one is not working for me at all, it is cropping twice, it seems, i have a selection of the picture to crop and it gets approx the top left 1/4th of the area i selected
[06:35:44] rvanlieshout: tvle83: mini_magick
[06:36:48] tvle83: ok thanks ill check it out
[06:38:54] Aeyrix: sevenseacat: You got a new job?
[06:39:06] sevenseacat: well not new new, i've been there for a couple months now
[06:39:41] DoctorMonocular: has joined #RubyOnRails
[06:40:58] Hates__: has joined #RubyOnRails
[06:41:44] eddie_v3: has joined #RubyOnRails
[06:42:11] futilegames: has joined #RubyOnRails
[06:43:54] aufi: has joined #RubyOnRails
[06:43:57] pwnz0r: has joined #RubyOnRails
[06:45:13] simplyianm: has joined #RubyOnRails
[06:46:27] thebatu1: has joined #RubyOnRails
[06:48:03] patie: has joined #RubyOnRails
[06:49:50] maz-dev: has joined #RubyOnRails
[06:51:44] lxsameer: has joined #RubyOnRails
[06:54:31] Etriaph: https://gist.github.com/anonymous/9d59e3e78810b7b57c79 A little confused on this, expecting all preferences to be preloaded when a model uses this concern
[06:54:47] mikecmpbll: has joined #RubyOnRails
[06:55:40] gokulnath: has joined #RubyOnRails
[06:56:48] bruno-: has joined #RubyOnRails
[06:57:44] rkofman: has joined #RubyOnRails
[06:58:09] BlissOfBeing: has joined #RubyOnRails
[06:58:31] marr: has joined #RubyOnRails
[06:58:40] DoctorMonocular: has joined #RubyOnRails
[06:59:01] abuzze_: has joined #RubyOnRails
[07:00:00] annlewis: has joined #RubyOnRails
[07:00:50] artto: has joined #RubyOnRails
[07:01:51] User458764: has joined #RubyOnRails
[07:01:53] michael_mbp: has joined #RubyOnRails
[07:03:40] HayesHimself: has joined #RubyOnRails
[07:03:56] daneo: has joined #RubyOnRails
[07:04:44] iliketurtles: has joined #RubyOnRails
[07:05:09] mbuf: has joined #RubyOnRails
[07:05:10] krz: has joined #RubyOnRails
[07:05:38] Geffy: has joined #RubyOnRails
[07:07:18] ur5us: has joined #RubyOnRails
[07:08:48] tbuehlmann: Etriaph, are you mixing things up? in that gist you define a has_many relationship that has a default scope on it. when calling your_model.preferences, that scope is applied to the relation
[07:09:11] tbuehlmann: do you want to always load the preferences when loading a model? that's a different thing
[07:10:02] benhuda: has joined #RubyOnRails
[07:10:32] mrbubbles: has joined #RubyOnRails
[07:10:52] Etriaph: tbuehlmann: I have a couple of models that I want to set preferences on, but through Account; the preferences are scoped to the models that include the concern based on the entity_name of preference
[07:11:19] Etriaph: So Identity.find(1) should preload :preferences through :account
[07:11:33] rvanlieshout: not if you use .find
[07:11:44] tbuehlmann: that's a default scope you describe, different thing
[07:12:42] rvanlieshout: and less queries isn't always better
[07:13:14] Etriaph: Let me gist all the code involved so you have a better idea of what this is doing.
[07:13:49] sp1rs: has joined #RubyOnRails
[07:14:04] Etriaph: https://gist.github.com/anonymous/d34ef241305e1a4ba9f6
[07:14:50] Etriaph: (I had changed the code a bit since the last gist wrt scope)
[07:17:24] Etriaph: So if I have: i = Gleam::Identity.find(1); i.get_pref :name_is_visible; my hope is that the preferences are preloaded and multiple checks won't result in unnecessary queries.
[07:18:07] dhjondoh: has joined #RubyOnRails
[07:19:23] Geffy: has joined #RubyOnRails
[07:21:09] thebatu1: has joined #RubyOnRails
[07:22:39] futilegames: has joined #RubyOnRails
[07:24:00] gokulnath: has joined #RubyOnRails
[07:24:48] sandstrom: has joined #RubyOnRails
[07:25:15] User458764: has joined #RubyOnRails
[07:25:19] sevenseacat: it shouldnt, afaik.
[07:25:32] ghr: has joined #RubyOnRails
[07:25:56] sevenseacat: though actually, you're applying another where scope which might break the preloading.
[07:25:57] krz: has joined #RubyOnRails
[07:26:07] thatkid_: has joined #RubyOnRails
[07:26:55] Hates_: has joined #RubyOnRails
[07:28:14] simmerz: has joined #RubyOnRails
[07:28:30] chinmay_dd: has joined #RubyOnRails
[07:28:31] edwinvdgraaf: has joined #RubyOnRails
[07:29:54] Etriaph: So changed the where in get_pref to find_by_key
[07:30:19] oleg: has joined #RubyOnRails
[07:30:53] thatkid_: Hello, I want to sort `Users` by a method. the value of that method is not available on the users table, how can I do that?
[07:31:59] Etriaph: sevenseacat: After the change, still running a query each time.
[07:32:07] raj___: has joined #RubyOnRails
[07:32:16] jottr: has joined #RubyOnRails
[07:32:46] sevenseacat: Etriaph: each time what?
[07:34:00] universa1: thatkid_: Enumerable#sort | Enumerable#sort_by
[07:34:19] Etriaph: sevenseacat: If I call: i = Gleam::Identity.find(1); i.get_pref :name_is_visible; i.preferences.loaded? is false. Maybe I'm dense, but I expect it to be true.
[07:34:56] Etriaph: sevenseacat: And I expect to not have a query run when get_pref is called a second time
[07:35:37] sevenseacat: please gist what you're seeing because i am not psychic
[07:35:39] Doddlin: has joined #RubyOnRails
[07:36:01] maz-dev: has joined #RubyOnRails
[07:36:28] universa1: Etriaph: you're running a single record loading query, therefore the has many association si not loaded.
[07:36:32] ur5us: has joined #RubyOnRails
[07:36:37] maz-dev_: has joined #RubyOnRails
[07:37:36] mbuf: I am trying to print errors.full_messages and it gets printed like "{0=\u003E[\"Name has already been taken\"], 1=\u003E[\"Name has already been taken\"]". What can cause this unicode text to be printed?
[07:37:40] olegtc: has joined #RubyOnRails
[07:37:48] mrbubbles: hey guys, i???ve a project running on my local machine and also on a server that I deployed to with capistrano. i notice that varchars have a length of 255 locally, but a length of 0 on the server (though it doesnt??? seem to affect anything). any reason why this might be? should I just explicitally set the length of the field?
[07:38:01] universa1: mbuf: color codes.
[07:38:07] universa1: mbuf: are you on windows?
[07:38:34] mbuf: universa1, it prints fine inside the server log, on gnome-terminal
[07:38:53] mbuf: universa1, okay
[07:39:12] universa1: or probably not color codes, most likely was too quick
[07:39:52] thebatu1_: has joined #RubyOnRails
[07:40:00] universa1: mbuf: no clue why your terminal does not print the chars but the escaped sequence...
[07:40:27] universa1: mbuf: it's just 0 => ; 1 => the \u0003E is the > sign
[07:40:45] mbuf: universa1, I see
[07:40:55] mbuf: universa1, not a problem though, just asked
[07:41:07] Forgetful_Lion: has joined #RubyOnRails
[07:41:20] livathinos: has joined #RubyOnRails
[07:43:43] skroon: has joined #RubyOnRails
[07:46:04] krz: has joined #RubyOnRails
[07:46:43] dps: has joined #RubyOnRails
[07:47:15] tvle83: i am using the paperclip gem for an avatar up load. i found http://railscasts.com/episodes/182-cropping-images-revised that uses carrierwave, instead of recoding to use carrier wave instead (i came into an already existing project so it wouldnt be a simple process to switch them i dont think) this tutorial shows a fix for the exact problem i am experiencing but because it is using a method
[07:47:15] tvle83: of carrier wave i dont know how to fix it in paperclip. it uses 'resize_to_limit()' to tell the crop method to use the coordinates of the already cropped image instead of the full size image
[07:47:23] tvle83: does anyone know of an equiv method in paperclip ?
[07:48:13] universa1: tvle83: you need to look up whatever options imagemagick / minimagick wants, since paperclip just passes it on.
[07:49:30] ethicalhack3r: has left #RubyOnRails: ()
[07:53:49] professor_soap: has joined #RubyOnRails
[07:54:16] Ergo: has joined #RubyOnRails
[07:56:29] tvle83: universa1: ok thanks, ill look into the underlying commands then
[07:57:03] universa1: tvle83: the paperclip docs / wiki should also have examples... ...it's been a long time since i tried, but it's something like >150x150
[07:57:59] Anakat: has joined #RubyOnRails
[07:58:25] mikecmpbll: has joined #RubyOnRails
[07:58:50] mello: has joined #RubyOnRails
[07:59:24] bruno-: has joined #RubyOnRails
[08:00:27] srinidhi: has joined #RubyOnRails
[08:00:46] annlewis: has joined #RubyOnRails
[08:00:55] wethu: has joined #RubyOnRails
[08:01:04] x-light: has joined #RubyOnRails
[08:01:22] circ-user-gqbmz: has joined #RubyOnRails
[08:02:10] ghr: has joined #RubyOnRails
[08:07:25] michael_mbp: has joined #RubyOnRails
[08:09:13] nhhagen: has joined #RubyOnRails
[08:09:51] darutoko: has joined #RubyOnRails
[08:10:45] Elboerea: has joined #RubyOnRails
[08:11:07] karimb: has joined #RubyOnRails
[08:11:37] JDeen: has joined #RubyOnRails
[08:12:41] tvle83: universa1: i am really on a time crunch would switching to carrier wave be pretty simple, you think?
[08:13:34] universa1: tvle83: it's simpler to just figure out the correct format speecification for paperclip...
[08:13:36] jsrn_: has joined #RubyOnRails
[08:13:47] universa1: because both just pass options to whatever image processing library you use.
[08:14:37] universa1: http://stackoverflow.com/questions/3051041/rails-paperclip-plugin-style-options-for-resizing
[08:14:46] marr123: has joined #RubyOnRails
[08:14:50] JDeen: Hi there. I am having a resource controller that doesn't actually deal with AR. How ever I have some thing that is kind of a modal. I would like to have a cusotm JSON response when accessed like `/routes/to/resource/[:id].json`. I noticed that having instance variables add the values. But is there kinda to_json way that uses the same setup (not needing to any respond_to or similar but have an instance variable in the action) but return custom json structu
[08:15:31] universa1: jdeen: render json: your_json ?!; or just render a json view like you render a html view?
[08:16:06] MrMaynes: has joined #RubyOnRails
[08:16:46] marr: has joined #RubyOnRails
[08:17:10] srinidhi: has joined #RubyOnRails
[08:18:22] JDeen: universa1: json views, just cecked up. Could do that too.
[08:18:47] JDeen: Is there a specific gem/lib that does JSON rendering /resource/[:id].json
[08:18:49] simmerz_: has joined #RubyOnRails
[08:19:05] JDeen: the one that is used by Rails... so I can see how it does
[08:19:27] JDeen: I checked the gemfile and there were nothing jsonish
[08:19:38] abuzze: has joined #RubyOnRails
[08:20:47] simmerz: the ruby version you use is the one you determine, not determined by Rails
[08:20:50] universa1: jdeen: jbuilder and rabl are the most common ones iirc
[08:21:16] universa1: jdeen: you can also do a plain json view with erb
[08:21:33] BlissOfBeing: has joined #RubyOnRails
[08:22:24] michael_mbp: has joined #RubyOnRails
[08:22:35] JDeen: universa1: Cool! Thanks for the info. Will do some reading!
[08:22:55] dici: has joined #RubyOnRails
[08:23:48] barnex: I'm experiencing the weirdes issue with my javascripts/coffeescripts
[08:23:59] barnex: they seem to only get executed on ctrl-r refresh
[08:24:15] barnex: normal refresh or page navigation does nothing ;o
[08:24:46] abuzze: has joined #RubyOnRails
[08:25:44] jenrzzz: has joined #RubyOnRails
[08:25:52] barnex: Well, I would, but I have no idea what would be relevant here
[08:26:15] sevenseacat: the code that isnt executing, might be a good place to start.
[08:26:22] barnex: alert("I'm here")
[08:26:32] barnex: that;s the code :P
[08:26:36] sevenseacat: thats the whole file?
[08:26:53] sevenseacat: ok, you're using turbolinks arent you
[08:27:01] sevenseacat: which only loads up the js once when you load the site
[08:27:12] kjs3: has joined #RubyOnRails
[08:27:21] gokulnath: $(document).on "page:change"
[08:27:22] barnex: I need to disable that, thanks
[08:27:31] gokulnath: Don't disable it
[08:27:39] sevenseacat: or you need to learn about it and then write code that works with it
[08:27:50] DoctorMonocular: has joined #RubyOnRails
[08:27:58] sevenseacat: writing alerts in a plain js file isnt good practice, turbolinks or no
[08:28:35] barnex: I removed complex stuff to pin down the issue :P
[08:28:49] solars: has joined #RubyOnRails
[08:29:48] Pathfinder: has joined #RubyOnRails
[08:31:32] barnex: just to be clear, on "page:change" means I don't have to wait for document.ready?
[08:31:44] barnex: it gets called after the page has actually changed and got loaded?
[08:31:53] kjs3: Guys I want to run sql query in controller ... how to do this
[08:31:58] sevenseacat: barnex: but it wont run on a first load.
[08:32:32] mike___1234: has joined #RubyOnRails
[08:32:32] barnex: ok, so I need my stuff on document.ready and on page:change, but I don't need to nest one in the other
[08:32:36] barnex: is that right?
[08:32:52] sevenseacat: you dont nest them inside each other, no.
[08:33:12] barnex: thanks a lot
[08:33:50] barnex: kj__: like any query?
[08:34:16] barnex: ActiveRecord::Base.connection.execute(...) should work
[08:34:19] kjs3: well this is my query select exists (select * from cities where name = "hyderabad");
[08:34:33] kjs3: in sql it's response is in 1/0
[08:34:35] sevenseacat: why are you doing that as raw sql, and not as an activerecord query
[08:34:37] arBmind: has joined #RubyOnRails
[08:34:44] kjs3: same kinda response I am looking for in controller.
[08:34:48] barnex: buuut if you need to parametrize it, you'll need some dumb hacks
[08:34:52] mrbubbles: has joined #RubyOnRails
[08:34:59] sevenseacat: err, 1/0? what?
[08:35:12] barnex: he means true/false
[08:35:12] kjs3: <tableName>.find_by_sql() is giving me this output #<Cities id: nil>
[08:35:24] kjs3: in sql it's giving 1/0
[08:35:46] kjs3: in controller I am looking for either 1/0 response or true/false
[08:35:47] sevenseacat: kj__: what are you actually trying to find out
[08:35:59] sevenseacat: just City.find_by_name("Hyderabad") or something?
[08:36:15] sevenseacat: which will either return you nil, or a City instance
[08:36:16] barnex: here's the stupid hack if you need it: https://gist.github.com/barnaba/95e4e99d93fc2c4249a0
[08:36:36] barnex: but sevenseacat is probably right
[08:37:10] Trefex: has joined #RubyOnRails
[08:38:40] SalexW: has joined #RubyOnRails
[08:39:15] sevenseacat: i like when that happens.
[08:40:24] abuzze: has joined #RubyOnRails
[08:41:31] adre: has joined #RubyOnRails
[08:41:33] jhass: kj__: perhaps you want City.exists?(name: "Hyderabad") ?
[08:42:32] kjs3: yeah jhass_ this is what I was looking for response either true/false..... you saved my day
[08:42:59] kjs3: Thanks alot jhass_ and sevenseacat_ and others too :)
[08:43:25] sevenseacat: jhass: I always forget about that one
[08:43:48] ndrei: has joined #RubyOnRails
[08:45:20] arBmind: has joined #RubyOnRails
[08:45:54] tvle83: if i append .erb to a js file i can use embedded ruby just like in an .html.erb right ?
[08:47:39] gloscombe: has joined #RubyOnRails
[08:48:58] Geffy: has joined #RubyOnRails
[08:49:28] iliketurtles: has joined #RubyOnRails
[08:49:59] barnex: this is one of those questions that could be answered by just trying in 30 seconds :P
[08:51:20] DEA7TH: has joined #RubyOnRails
[08:51:41] quazimodo: sevenseacat: hi cat
[08:51:46] quazimodo: how are you tonight
[08:51:48] sevenseacat: quazimodo: sup
[08:52:02] tvle83: yes i know, my next question is about any references to the .js file, will those be broken ? i am asking before trying to save any problems i might encounter.. i really do appreciate the help :)
[08:52:19] rvanlieshout: references from where?
[08:52:20] quazimodo: sevenseacat: you know it's funny
[08:52:25] quazimodo: remember how you used to teach me somuch
[08:52:55] jhass: tvle83: you know, most people you ask this stuff learned it by just trying
[08:53:14] barnex: if you are using sprockets then all files are compiiled to one big file by default, so there are no references excepts in js files
[08:53:18] barnex: and those will be fine
[08:53:31] sevenseacat: quazimodo: i did?
[08:55:24] tvle83: rvanlieshout: anywhere,
[08:55:25] gokulnath: has joined #RubyOnRails
[08:55:37] quazimodo: sevenseacat: you don't remember?
[08:55:44] quazimodo: for like 3 years i've been coming in here asking stuff
[08:55:45] rvanlieshout: tvle83: awesome
[08:55:48] tvle83: barnex: i am not using sprockets right now... i have to use rake assets:precompile to get the new files
[08:55:52] quazimodo: you answered *heaps* of my qusetions
[08:55:54] quazimodo: so did rvanlieshout
[08:55:57] sevenseacat: quazimodo: i knew that, didnt know if you were learning anything
[08:56:09] quazimodo: yeah well it got me a job
[08:56:18] quazimodo: and funnily enough, i'm the opinionated person here
[08:56:27] quazimodo: making others do stuff properly
[08:56:47] tvle83: jhass: yes i know, and i do lots trial and error myself too
[08:57:27] MrBeardy: has joined #RubyOnRails
[08:57:43] quazimodo: it made me lol i guess
[08:57:43] jhass: tvle83: showing that in your question (opposed to showing the opposite) will make people want to help you a lot more ;)
[08:58:58] chagel: has joined #RubyOnRails
[08:59:31] mello: has joined #RubyOnRails
[08:59:34] dionysus69: has joined #RubyOnRails
[09:00:30] Pathfinder: has joined #RubyOnRails
[09:01:30] annlewis: has joined #RubyOnRails
[09:04:03] rushed: tvle83: you almost never want to run rake assets:precompile in dev, and if you do you probably want to remove public/assets and maybe clear tmp/cache
[09:04:37] jenrzzz: has joined #RubyOnRails
[09:07:19] alexwhitman: has joined #RubyOnRails
[09:07:52] tvle83: rushed: ok
[09:07:53] abuzze: has joined #RubyOnRails
[09:12:46] jhass: bin/rake assets:clobber tmp:cache:clear ;)
[09:13:19] porkqpain: has joined #RubyOnRails
[09:15:24] abuzze: has joined #RubyOnRails
[09:16:02] fgo: has joined #RubyOnRails
[09:20:57] workmad3: has joined #RubyOnRails
[09:21:50] abuzze: has joined #RubyOnRails
[09:21:52] mrbubbles: has joined #RubyOnRails
[09:22:17] n008f4g_: has joined #RubyOnRails
[09:24:44] elia: has joined #RubyOnRails
[09:28:59] acti0nman: has joined #RubyOnRails
[09:31:09] tvw: has joined #RubyOnRails
[09:31:46] Anakat_: has joined #RubyOnRails
[09:34:13] granthatcher: has joined #RubyOnRails
[09:34:13] daneo: has joined #RubyOnRails
[09:34:33] tercenya: has joined #RubyOnRails
[09:36:43] creature: has joined #RubyOnRails
[09:37:00] ArchRogem: has joined #RubyOnRails
[09:40:11] zorak8: has joined #RubyOnRails
[09:42:27] abuzze: has joined #RubyOnRails
[09:43:03] elia: has joined #RubyOnRails
[09:45:03] dionysus69: has joined #RubyOnRails
[09:45:59] shortCircuit__: has joined #RubyOnRails
[09:46:02] dhjondoh: has joined #RubyOnRails
[09:46:12] annlewis: has joined #RubyOnRails
[09:46:47] gokulnath: has joined #RubyOnRails
[09:50:25] daneo: has joined #RubyOnRails
[09:51:03] daneo: I have a generic question, being relatively new to the whole Rails & testing story, what do you guys generally test in your models? Just that it doesn't save given a validation fails, or do you go further & test the specific errors, .. ?
[09:51:50] shortCircuit__: how does devise handle remember-me .. I know about a few (2) persistant login strategies, one of which is a modified Miller's persistant login where user has a series and a token identifier ...
[09:52:48] dhjondoh: has left #RubyOnRails: ()
[09:52:57] dhjondoh: has joined #RubyOnRails
[09:52:59] Pathfinder: has joined #RubyOnRails
[09:54:48] dhjondoh: has left #RubyOnRails: ()
[09:55:06] dhjondoh: has joined #RubyOnRails
[09:59:04] blobolobob: has joined #RubyOnRails
[10:00:21] mello: has joined #RubyOnRails
[10:00:21] mello: has joined #RubyOnRails
[10:01:22] bruno-: has joined #RubyOnRails
[10:01:25] Juanchito: has joined #RubyOnRails
[10:01:27] MrBeardy: shortCircuit__: Check the source: https://github.com/plataformatec/devise/blob/master/lib/devise/models/rememberable.rb
[10:02:19] DoctorMonocular: has joined #RubyOnRails
[10:03:15] justintv90: has joined #RubyOnRails
[10:03:21] nfk: has joined #RubyOnRails
[10:04:45] JDeen: has joined #RubyOnRails
[10:06:02] b0nn1e|2: has joined #RubyOnRails
[10:07:32] cheeti: has joined #RubyOnRails
[10:08:40] livathinos: has joined #RubyOnRails
[10:11:35] chipotle: has joined #RubyOnRails
[10:12:21] Pathfinder: has joined #RubyOnRails
[10:13:26] toretore: has joined #RubyOnRails
[10:14:44] srinidhi: has joined #RubyOnRails
[10:14:46] quazimodo: i'm confused
[10:14:58] quazimodo: i thought that all non css/js assets in vendor/assets are precompiled by default
[10:14:59] dhjondoh: Hi guys. I'm trying to make local unicorn served rails app (on ubuntu) accessible on a local windows network.
[10:14:59] dhjondoh: I've added the port to ufw firewall, but it's still inacessible. What am I missing?
[10:16:13] dhjondoh: nope, you need to run rake precompile assets on your RAILS_ENV
[10:17:03] ekem: huh i didnt know that either
[10:17:14] ekem: its always found them when i place them in there as well
[10:17:16] ekem: but newb here
[10:17:56] thomasjachmann: has joined #RubyOnRails
[10:18:16] srinidhi: has joined #RubyOnRails
[10:20:24] rickmasta: has joined #RubyOnRails
[10:20:36] b0nn1e: has joined #RubyOnRails
[10:21:08] MrMaynes: has joined #RubyOnRails
[10:21:15] aditya432: has joined #RubyOnRails
[10:22:48] aditya432: https://gist.github.com/anonymous/38e6db2c6daf80dd5b73 I have this javascript file. I am rendering the form only when a button is clicked. But, right now the form is being rendered on page load itself. I don't understand why click event is firing on page load. Please check.
[10:24:46] b0nn1e|2: has joined #RubyOnRails
[10:26:28] aditya432: https://gist.github.com/anonymous/38e6db2c6daf80dd5b73 I have this javascript file. I am rendering the form only when a button is clicked. But, right now the form is being rendered on page load itself. I don't understand why click event is firing on page load. Please check.
[10:26:59] universa1: not enough information.
[10:27:13] aditya432: What else do you need? :-o
[10:28:01] aditya432: What else do you need? :-o
[10:28:23] MrBeardy: You know, messages persist longer than 60 seconds in IRC, you don't need to send it again
[10:29:13] universa1: aditya432: you supplied basically no context... where is the code sending the request for the js file? ...
[10:29:40] universa1: where is the file you're clicking next in? ...
[10:29:41] aditya432: Problem is in js because when I remove it - it works fine.
[10:30:03] centrx: has joined #RubyOnRails
[10:30:12] aditya432: This is where it is defined. <div id="submitForm">
[10:30:12] aditya432: <div id="next">Next</div>
[10:30:26] User458764: has joined #RubyOnRails
[10:30:27] universa1: so we have to imagine some html you might have which might cause some problem you're describing... ...nice... ...i'm out.
[10:30:42] aditya432: universa1 I just pasted above
[10:30:46] aditya432: it is one line of code
[10:30:53] scottmatheina: has joined #RubyOnRails
[10:31:41] doodlehaus: has joined #RubyOnRails
[10:31:56] universa1: aditya432: still no context when and how the request.js file is loaded...
[10:32:30] aditya432: My controller is request - so request.js is loaded!
[10:32:38] Pathfinder_: has joined #RubyOnRails
[10:32:44] universa1: aditya432: o0
[10:32:58] universa1: back to work for me...
[10:33:46] CheckYourSix: has joined #RubyOnRails
[10:33:49] aditya432: i will ask in javascript forum man. it is a js error. Thank you anyways
[10:34:00] aditya432: has left #RubyOnRails: ()
[10:35:36] MrBeardy: "I removed this line of code, so this line of code is the problem, not whatever this line of code is interacting with."
[10:35:43] MrBeardy: Good luck, javascript forum.
[10:36:04] medk: has joined #RubyOnRails
[10:36:21] ur5us: has joined #RubyOnRails
[10:38:25] daneo: has joined #RubyOnRails
[10:39:32] acti0nman: has joined #RubyOnRails
[10:39:55] TinkerTyper: has joined #RubyOnRails
[10:40:38] mathie: has joined #RubyOnRails
[10:42:37] rodfersou: has joined #RubyOnRails
[10:46:38] ggander: has joined #RubyOnRails
[10:46:45] chipotle: has joined #RubyOnRails
[10:48:07] darrencauthon: has joined #RubyOnRails
[10:48:17] LiquidInsect: has joined #RubyOnRails
[10:49:06] ChargedLight: has joined #RubyOnRails
[10:52:51] sandstrom: has joined #RubyOnRails
[10:56:57] gauke: has joined #RubyOnRails
[10:56:57] solars: has joined #RubyOnRails
[10:57:52] mrbubbles: has joined #RubyOnRails
[10:58:34] stamina: has joined #RubyOnRails
[10:59:46] porkqpain: has joined #RubyOnRails
[11:00:14] ChargedLight: Hello. I'm parsing a web store with Mechanize. Problem - if i have &amp in the title, it creates new line cell in output csv file. I tried to delete it with .gsub, but it did't help. Here is my parser script - https://gist.github.com/andrei-sheina/2c50e5ffa31a3f1b9e80 And this is a part of my my output.csv - http://goo.gl/6bVOX7
[11:00:40] rickmasta: has joined #RubyOnRails
[11:03:22] maz-dev: has joined #RubyOnRails
[11:04:02] SalexW: has joined #RubyOnRails
[11:04:52] universa1: ChargedLight: did you replace &amp; ?
[11:04:57] universa1: or just &amp ?
[11:05:10] universa1: ChargedLight: add raw csv to the gist please.
[11:05:28] ndrei: has joined #RubyOnRails
[11:08:21] ChargedLight: universa1, wow, &amp; made it
[11:08:25] ChargedLight: thank you very much
[11:08:54] universa1: ChargedLight: the root problem is that whatever you use for viewing the csv file is treating the ; as a separator, which it shouldn't...
[11:09:07] sinkensabe: has joined #RubyOnRails
[11:09:14] FastJack: has joined #RubyOnRails
[11:09:51] ChargedLight: universa1, i will know it know, thanks once again
[11:10:56] thebatu1: has joined #RubyOnRails
[11:11:12] gokulnath: has joined #RubyOnRails
[11:11:52] simplyianm: has joined #RubyOnRails
[11:11:58] thebatu1_: has joined #RubyOnRails
[11:12:53] thebatu1: has joined #RubyOnRails
[11:13:57] thebatu1_: has joined #RubyOnRails
[11:14:17] crankharder: has joined #RubyOnRails
[11:16:07] workmad3: has joined #RubyOnRails
[11:16:18] thebatu1: has joined #RubyOnRails
[11:18:46] daneo: has joined #RubyOnRails
[11:19:53] crankharder: has joined #RubyOnRails
[11:27:17] b0nn1e: has joined #RubyOnRails
[11:27:36] crankharder: has joined #RubyOnRails
[11:27:40] centrx: has joined #RubyOnRails
[11:28:52] jarr0dsz: has joined #RubyOnRails
[11:31:16] rustymyers: has joined #RubyOnRails
[11:31:39] futilegames: has joined #RubyOnRails
[11:31:50] chipotle: has joined #RubyOnRails
[11:33:07] crankharder: has joined #RubyOnRails
[11:33:51] jarr0dsz: has left #RubyOnRails: ()
[11:35:26] hook: has joined #RubyOnRails
[11:36:06] mrbubbles_: has joined #RubyOnRails
[11:37:03] Rhadax: has joined #RubyOnRails
[11:37:43] hook: has left #RubyOnRails: ()
[11:38:01] FotoHooK: has joined #RubyOnRails
[11:38:16] gauke: has joined #RubyOnRails
[11:39:28] Scripore: has joined #RubyOnRails
[11:41:09] FotoHooK: anyone got time for a noob question or two?
[11:41:09] srinidhi: has joined #RubyOnRails
[11:41:26] helpa: Don't ask to ask. Just ask your question, and if anybody can help, they will likely try to do so.
[11:42:32] FotoHooK: I got a form_tag, that needs to be connected to another controller
[11:42:36] FotoHooK: i got: <%= form_tag({controller: "X", action: "Y"}) do %>
[11:42:58] barnex: !fake or something
[11:43:04] FotoHooK: but that does not work, i think i need to add a route
[11:43:19] universa1: FotoHooK: use the url/path helpers
[11:43:20] helpa: Please do not use fake values, as they can be confusing or misleading. Sometimes both.
[11:43:29] TinkerTyper: has joined #RubyOnRails
[11:43:33] FotoHooK: <%= form_tag({controller: "VertretungController", action: "eintrag"}) do %>
[11:43:59] mase-chatter: has joined #RubyOnRails
[11:44:00] barnex: do you have a route for that controller?
[11:44:33] FotoHooK: i have no routes
[11:44:40] barnex: no routes whatsoever?
[11:44:45] barnex: your routes.rb is empty?
[11:44:49] barnex: then you need routes, yes
[11:44:51] quazimodo: has joined #RubyOnRails
[11:45:15] barnex: type 'rake routes' to get info about routes, maybe you have some and just don't know
[11:45:32] lapide_viridi: has joined #RubyOnRails
[11:45:37] FotoHooK: my routes.rb is empty, i just created the controller
[11:45:45] FotoHooK: how do i route this?
[11:45:55] barnex: well, depends
[11:45:55] rvanlieshout: what rails version is this?
[11:45:59] universa1: FotoHooK: !getting_started
[11:45:59] helpa: FotoHooK: http://guides.rubyonrails.org/getting_started.html - Getting started with Ruby on Rails guide written by Mike Gunderloy
[11:46:09] Duckily: has joined #RubyOnRails
[11:47:21] barnex: if you haven't done a lot of work on your controller, maybe try rails generate controller
[11:47:23] FotoHooK: And yes, I can find out by myself, have been doing that for all the other things, too..
[11:47:28] barnex: and it should make routes
[11:47:45] barnex: or even rails generate scaffold
[11:47:51] rvanlieshout: i would start with some new tutorials or something. it's not that common to need a form_tag
[11:47:57] rvanlieshout: in almost all cases a form_for is better
[11:47:59] FotoHooK: i generated the controller with another generator for redmine plugins, it didn't create any routes
[11:48:01] c355E3B: has joined #RubyOnRails
[11:48:19] barnex: rvanlieshout: unless you want a login form which is first thing everyone does :P
[11:48:41] barnex: or a search box
[11:48:52] rickmasta: has joined #RubyOnRails
[11:48:52] rvanlieshout: got a point there
[11:48:59] rvanlieshout: are we talking about one of those two?
[11:49:00] mello: has joined #RubyOnRails
[11:49:31] FotoHooK: i got a select thingie where you can select something. that selection needs to be saved somewhere.
[11:49:50] ldnunes: has joined #RubyOnRails
[11:50:32] barnex: FotoHooK: also please don't name stuff in German, assuming that is German
[11:50:42] universa1: barnex: you're right ;)
[11:50:46] barnex: I'm maintaining code written half in German and half in Polish
[11:50:54] barnex: and the longest variable name is 6 letters
[11:50:58] barnex: with hungarian notation
[11:51:00] barnex: special kind of hell
[11:51:18] universa1: barnex: poor you :p
[11:51:30] FotoHooK: Will keep that in mind. I'ts only my second day working here :D
[11:52:00] bricker: has joined #RubyOnRails
[11:55:23] jenrzzz: has joined #RubyOnRails
[11:55:56] FotoHooK: No route matches {:action=>"eintrag", :controller=>"VertretungController"}
[11:56:08] FotoHooK: how should that missing route look?
[11:56:16] shyshy: has joined #RubyOnRails
[11:56:29] universa1: FotoHooK: !routing -- you should read that guide, since it looks like you're new to rails.
[11:56:29] helpa: FotoHooK: http://guides.rubyonrails.org/routing.html - Rails Routing From the Outside In - Rails Guide - by Mike Gunderloy
[11:56:29] barnex: on the method you want
[11:57:00] FotoHooK: thanks, will read that
[11:57:01] charliesome: has joined #RubyOnRails
[11:59:03] Trefex: has joined #RubyOnRails
[11:59:17] tomkadwill: has joined #RubyOnRails
[11:59:43] squierca1ter: has joined #RubyOnRails
[12:02:04] mconnolly: has joined #RubyOnRails
[12:02:38] aditya432: has joined #RubyOnRails
[12:03:00] TinkerTyper: has joined #RubyOnRails
[12:04:00] adre: has joined #RubyOnRails
[12:05:07] aditya432: I have a request form which takes in user's query. I have ensured that the user is signed in. Now, I also want that some user details like email id, phone number, address should be filled before submitting the request form. What is the best way to do it?
[12:05:08] Hobogrammer_: has joined #RubyOnRails
[12:05:33] aditya432: Should I use ajax?
[12:06:18] ekem: no matter what, form data can be forged and set in a POST
[12:06:31] sankaber: has joined #RubyOnRails
[12:06:35] ekem: so you need server side checking, and ajax can allow you to do this, but so can in page js
[12:06:44] ekem: then do error checking on the server, no matter what
[12:07:00] ekem: no matter what
[12:07:08] Scripore: has joined #RubyOnRails
[12:07:57] ekem: it makes most sense to do checking with js, there are libs out there for this to validate forms of phone numbers etc
[12:08:04] aditya432: So actually request is a different model and User is a different model. So before opening request creation form I need to ensure user fills his details. How to do it?
[12:08:15] ekem: javascript
[12:08:23] ekem: just make sure you check it after the submission as well
[12:08:23] goodcodeguy: has joined #RubyOnRails
[12:08:23] k4nd4lf: has joined #RubyOnRails
[12:08:28] Mia: has joined #RubyOnRails
[12:08:29] Mia: has joined #RubyOnRails
[12:08:35] ekem: as someone can just send a url at your server
[12:08:51] ekem: one can post with curl and wget, so in page stuff is only have the battle
[12:09:32] DoctorMonocular: has joined #RubyOnRails
[12:09:44] ekem: by request i mean a request from the server
[12:09:47] ekem: as in POST and GET
[12:11:00] eoy: has joined #RubyOnRails
[12:11:26] skroon: has joined #RubyOnRails
[12:12:44] meat147: has joined #RubyOnRails
[12:14:18] thebatu1: has joined #RubyOnRails
[12:15:06] Doddlin: has joined #RubyOnRails
[12:15:21] leafac: has joined #RubyOnRails
[12:15:34] centrx: has joined #RubyOnRails
[12:16:22] Doddlin: hi all! This migration passed in 0.000 sec and changed nothing, I want to change the typ of the column to text instead of string, this is the correct way, right?
[12:16:23] Doddlin: hange_column :featuredcities, :body, :text
[12:16:31] Doddlin: change_column* obv
[12:16:37] Doddlin: (bad copy paste)
[12:17:01] squiercaster: has joined #RubyOnRails
[12:18:58] centrx: Doddlin, Yes that looks right
[12:21:35] Doddlin: has joined #RubyOnRails
[12:21:58] tenet: has joined #RubyOnRails
[12:22:21] Doddlin: my internet seems a bit unstable??? sorry if I missed an answer
[12:23:01] ArchRogem: has joined #RubyOnRails
[12:23:15] kain: has joined #RubyOnRails
[12:25:14] arta82: has joined #RubyOnRails
[12:25:30] DoubleMalt: has joined #RubyOnRails
[12:25:44] Hates__: has joined #RubyOnRails
[12:25:54] darrencauthon: has joined #RubyOnRails
[12:26:21] commondream: has joined #RubyOnRails
[12:26:53] DoctorMonocular: has joined #RubyOnRails
[12:28:30] cryptocronus: has joined #RubyOnRails
[12:30:04] cornerma1: has joined #RubyOnRails
[12:30:24] apeiros: say I have `class X < AR::Base; scope :foo, -> { ??? }; def self.bar; ???HERE???; end; end` - is there a way to detect within self.bar whether it was called with X.foo.bar vs. X.bar?
[12:30:39] apeiros: i.e. can I somehow introspect which scopes have been called already?
[12:30:52] jamiely: has joined #RubyOnRails
[12:31:28] centrx: I don't think you can determine which scopes were called already, but you can determine which where's, joins, etc. are on the existing Relation/query object
[12:31:57] Nigel_: has joined #RubyOnRails
[12:33:16] AugustoCesar: has joined #RubyOnRails
[12:33:43] tsujp: has joined #RubyOnRails
[12:34:19] bmurt: has joined #RubyOnRails
[12:34:23] cryptocronus: when sending marketing mails using something like mandrill, anyone have opinions on saving metadata about each mail sent on your server (opens/clicks/etc)? Is this commonly done? Seems like it might be useful data to have
[12:34:46] apeiros: it seems AR uses Thread.current to store data about the scope
[12:34:52] apeiros: not quite sure yet???
[12:35:42] IFrank00: has joined #RubyOnRails
[12:36:34] tbuehlmann: wouldn't surprise me, db connections are also on a per thread basis
[12:37:19] IFrank00: has left #RubyOnRails: ()
[12:37:25] IFrank00: has joined #RubyOnRails
[12:38:10] apeiros: tbuehlmann: db connection is even per model. which makes IMO more sense.
[12:38:16] IFrank00: good morning to all
[12:39:18] tbuehlmann: apeiros, what do you mean "per model"?
[12:39:57] apeiros: Model.connection # a connection per model
[12:40:11] apeiros: you can establish a different connection for each model
[12:40:21] universa1: that is inherited from ar::base, isn't it? ;)
[12:40:56] jkamenik: has joined #RubyOnRails
[12:40:59] tbuehlmann: sure, but they are the same per thread
[12:41:15] apeiros: wait??? do you think because connection is inherited from AR::Base you can't establish a different connection per model? you'd be wrong???
[12:41:37] apeiros: tbuehlmann: depends on the connection pool
[12:41:52] universa1: apeiros: no, even though you can establish different connections, it doesn't necessairly mean that they're actually different
[12:41:58] livathinos: has joined #RubyOnRails
[12:42:19] apeiros: I'll let that stand. no point in going down that discussion.
[12:42:19] tbuehlmann: my understanding of active record's db pool is one connection per thread, no matter what models are used
[12:42:35] apeiros: tbuehlmann: one connection with the same settings
[12:43:18] tbuehlmann: the exact same connection
[12:43:28] universa1: apeiros: https://gist.github.com/universal/7a2226a4091107a8d756
[12:43:45] tbuehlmann: don't want to be picky, just not understanding what you mean
[12:43:46] apeiros: universa1: yes. unrelated.
[12:44:23] universa1: apeiros: than i didn't get what you mean.
[12:44:48] apeiros: it doesn't really matter. my issue is with relations, not with connections.
[12:45:13] bhorn1: has joined #RubyOnRails
[12:45:23] apeiros: and relations don't have anything in common with the connection pool mechanics. so that reference was IMO pointless to begin with.
[12:46:00] apeiros: centrx: how'd you determine where's/join's?
[12:46:13] jhass: apeiros: I'll try the obvious, why do you need to know? .unscoped. and re-applying is not an option?
[12:47:01] apeiros: jhass: no, I need to know in which scope I am. trying to see whether clever code can be used in a meaningful way.
[12:48:11] apeiros: I ponder to elaborate on the use case. it's not too complex but not trivial either.
[12:48:46] marr: has joined #RubyOnRails
[12:49:34] Peteykun: has joined #RubyOnRails
[12:49:41] centrx: apeiros, Look in relation/query_methods, you'll see it adds constraints, etc. to variables like where_values
[12:49:42] apeiros: I have a model which is partitioned by ID. it's the mirror to an external soap API. and e.g. ID 0-100k is Service1, 100k-200k is Service2 etc. Right now I use 3 models all backed by the same table and inheriting from a common model.
[12:49:42] workmad3: universa1: apeiros's point was that you *can* establish separate connections per model, not that they are by default
[12:50:11] workmad3: (and that this was unrelated to what he was trying to achieve :) )
[12:50:15] prereflect: has joined #RubyOnRails
[12:50:23] Tashi: has joined #RubyOnRails
[12:50:38] universa1: workmad3: yeah, i was probably too interested in the discussion that followed ;) not the original point.
[12:50:40] apeiros: and I have e.g. Service::Service1.find_or_create. and I pondered replacing the 3 models with the base model and use Service.service1.find_or_create
[12:50:51] nonparfumee: has joined #RubyOnRails
[12:50:51] centrx: apeiros, It is only later, when a query is issued (like #first) that build_arel is called, which uses these stored components to build the query
[12:51:12] apeiros: centrx: yeah, and the stored components are in Thread.current as far as I can see
[12:51:37] centrx: apeiros, Where do you see this?
[12:51:42] workmad3: apeiros: hmm... the stored components should be carried on the ActiveRecord::Relation object
[12:52:17] apeiros: workmad3: I expected that. then I did a binding.pry in the class method - I was not in the context of a Relation. it's evaluated in the class itself.
[12:52:24] apeiros: that's quite surprising
[12:52:34] apeiros: i.e., Model.scope.class # => Relation
[12:52:43] ddv: rails has all kinds of magic
[12:52:59] apeiros: Model.scope.class_method_on_model # do binding.pry in class_method_on_model and self is not Relation but Model instead
[12:53:36] apeiros: and the current relation seems to be stored in Thread.current[:"ActiveRecord::Scoping::ScopeRegistry"]
[12:53:49] apeiros: due to the discussion here I didn't really have time to investigate, though
[12:53:50] ekain: has joined #RubyOnRails
[12:55:35] apeiros: looking at the code of method_missing triggered by the Relation explains some things too
[12:57:18] apeiros: the amounts of "magic" is quite staggering OO
[12:58:03] apeiros: yeah, I guess any "clever" solution would be way too brittle.
[12:58:03] centrx: it's advanced technology, aka wizardry
[12:58:07] workmad3: apeiros: that does not surprise me :)
[12:59:30] lessless: has joined #RubyOnRails
[12:59:33] aclapinpepin: has joined #RubyOnRails
[13:00:02] quazimodo: anyone using bowerify?
[13:00:04] sdwrage: has joined #RubyOnRails
[13:00:33] charliesome: has joined #RubyOnRails
[13:02:17] leafac: has joined #RubyOnRails
[13:03:20] SeanLazer: has joined #RubyOnRails
[13:03:46] allcentury: has joined #RubyOnRails
[13:03:55] acti0nman: has joined #RubyOnRails
[13:03:57] aclapinpepin: Anyone could help with the exercises in chapter 5 of railstutorial.org?
[13:04:11] apeiros: centrx: btw., did my elaboration answer your "where do you see this"?
[13:04:14] darrik: has joined #RubyOnRails
[13:04:27] pedrosnk: has joined #RubyOnRails
[13:04:32] porkqpain: has joined #RubyOnRails
[13:04:50] SalexW: has joined #RubyOnRails
[13:05:05] DoctorMonocular: has joined #RubyOnRails
[13:05:35] crankharder: was the 'secure' option dropped from the cookie_store config sometime < 4.2?
[13:06:47] centrx: apeiros, Yeah I just don't see that in the rails codebase. The threading around ActiveRecord is mainly for handling the database connections, in the adapter. Everything in the query construction should just be part of the current process/thread, but not specially in a Thread key
[13:07:34] DoctorMonocular: has joined #RubyOnRails
[13:07:40] sevenseacat: has joined #RubyOnRails
[13:09:23] bhorn1: has joined #RubyOnRails
[13:10:21] centrx: crankharder, I don't know, but this link implies it was Rails 3.1 - http://guides.rubyonrails.org/security.html#session-hijacking
[13:10:51] asmodlol: has joined #RubyOnRails
[13:14:56] Duckily: has joined #RubyOnRails
[13:17:06] mary5030: has joined #RubyOnRails
[13:18:55] funnel: has joined #RubyOnRails
[13:20:45] mary5030: has joined #RubyOnRails
[13:21:58] garrypolley: has joined #RubyOnRails
[13:24:09] thiagovsk: has joined #RubyOnRails
[13:26:51] apeiros: centrx: the chain is like this: ActiveRecord::Delegation::ClassSpecificRelation#method_missing -> ActiveRecord::Delegation::ClassSpecificRelation::ClassMethods#delegate_to_scoped_klass -> ActiveRecord::Relation#scoping -> ActiveRecord::Scoping::ClassMethods#current_scope= -> ActiveRecord::Scoping::ScopeRegistry.set_value_for
[13:26:59] apeiros: centrx: and ScopeRegistry has extend ActiveSupport::PerThreadRegistry
[13:27:32] centrx: good lord
[13:27:37] apeiros: any sufficiently analyzed magic is indistinguishable from science.
[13:27:46] centrx: It's Science!
[13:27:49] Zadrel: has joined #RubyOnRails
[13:27:55] apeiros: and yes, good lord.
[13:27:58] dark_otaku: has joined #RubyOnRails
[13:28:08] centrx: ok yeah scoping.rb
[13:28:30] apeiros: and that's good lord to the summary.
[13:28:52] apeiros: praise pry. makes figuring such chains a lot easier.
[13:29:17] centrx: It seems to be saying that scopes are attached to models
[13:29:35] centrx: if you chain multiple scopes, where do they go? couldn't be current_scope ?
[13:29:36] codeurge: has joined #RubyOnRails
[13:29:43] mostlybadfly: has joined #RubyOnRails
[13:30:18] apeiros: since delegate_to_scoped_klass essentially strips execution from the current scope, I assume the scope is "stashed away" for cases where AR needs to know the scope
[13:30:26] apeiros: e.g. if you execute a .find in that class
[13:30:38] apeiros: errr, *first. though same with .find
[13:31:23] apeiros: sadly it indeed doesn't seem to register names of named scopes. only the relational data. and that's tucked away in .arel.
[13:31:25] doodlehaus: has joined #RubyOnRails
[13:31:45] apeiros: so yeah, big nono IMO to use introspection on that to figure "where" we are.
[13:31:51] tianyi: has joined #RubyOnRails
[13:31:56] sarink: has joined #RubyOnRails
[13:32:28] sarink_: has joined #RubyOnRails
[13:32:30] centrx: gah what is the point of this ScopeRegistry anyway
[13:32:56] apeiros: as said, probably to tuck away the current scope.
[13:33:55] devdazed: has joined #RubyOnRails
[13:35:07] Joshmfrankel: has joined #RubyOnRails
[13:35:08] adre: has joined #RubyOnRails
[13:35:11] DigitallyBorn: has joined #RubyOnRails
[13:36:17] centrx: I see, sorry
[13:37:51] mello: has joined #RubyOnRails
[13:38:30] barnex: Hmm, I need to render some pdf data in tables. I currently have two of those pdfs done using a webkit solution, but it sucks serious balls.
[13:38:46] barnex: Pagebreaking doesn't work, tables spanning multiple pages aren't working etc
[13:39:05] Scripore: has joined #RubyOnRails
[13:39:15] barnex: So I thikning about maybe migrating to prawn? But I'd like to hear from you guys before I do that.
[13:39:31] barnex: Because I obviously wouldn't want to port those two pdfs only to get worse results
[13:39:58] momomomomo: has joined #RubyOnRails
[13:40:14] centrx: prawn has a good reputation
[13:40:29] centrx: Seems like it would surely be better than "a webkit solution" that "sucks serious balls"
[13:40:48] rvanlieshout: i mostly use wkhtmltopdf
[13:40:54] barnex: that's the one :P
[13:41:09] barnex: well, if it doesn't do multi-page tables properly it's not that much better
[13:41:20] barnex: and I don't see anything about that in prawn-table manual
[13:41:32] delianides: has joined #RubyOnRails
[13:42:43] barnex: well, I guess I'll just make a huge test table with random stuff
[13:44:54] jenrzzz: has joined #RubyOnRails
[13:46:05] leafac: has joined #RubyOnRails
[13:46:44] bmurt: has joined #RubyOnRails
[13:47:16] Geffy: has joined #RubyOnRails
[13:50:24] ivanskie: has joined #RubyOnRails
[13:50:24] fuzzyhorns: has joined #RubyOnRails
[13:50:53] darrencauthon: has joined #RubyOnRails
[13:51:44] darrencauthon: has joined #RubyOnRails
[13:51:48] momomomomo_: has joined #RubyOnRails
[13:53:21] g0rx: is there any coder ?
[13:53:47] barnex: ok, it works great with tables
[13:54:15] Papierkorb: has joined #RubyOnRails
[13:54:57] annlewis: has joined #RubyOnRails
[13:56:13] maz-dev: has joined #RubyOnRails
[13:56:26] _russell1: has joined #RubyOnRails
[13:59:35] naftilos76: has joined #RubyOnRails
[14:00:00] workmad3: has joined #RubyOnRails
[14:00:20] Scripore: has joined #RubyOnRails
[14:00:40] dllama: has joined #RubyOnRails
[14:00:44] nettoweb: has joined #RubyOnRails
[14:01:47] catcher: has joined #RubyOnRails
[14:01:53] intuxicated: has joined #RubyOnRails
[14:01:53] intuxicated: has joined #RubyOnRails
[14:02:08] nettoweb: guys, after some hours running my task I got a 'rake aborted. execution expired'. Is it possible to stay running my taks, or rescue this exception and try a next command? he are the gist with the error: https://gist.github.com/osnysantos/70000b94e1c5587561d5
[14:02:10] Duckily: has joined #RubyOnRails
[14:02:23] quazimodo: i need a yellow duck
[14:03:32] rubyonrailed: has joined #RubyOnRails
[14:04:41] syzygy__: has joined #RubyOnRails
[14:04:59] mwlang: has joined #RubyOnRails
[14:05:17] a346: has joined #RubyOnRails
[14:08:13] momomomomo_: has joined #RubyOnRails
[14:09:33] DoubleMalt: has joined #RubyOnRails
[14:09:48] asmodlol: has joined #RubyOnRails
[14:11:17] Axilla: has joined #RubyOnRails
[14:11:25] codepete: has joined #RubyOnRails
[14:12:36] DoctorMonocular: has joined #RubyOnRails
[14:13:41] nateberkopec: has joined #RubyOnRails
[14:14:11] fmcgeough: has joined #RubyOnRails
[14:17:33] IFrank00: Hi I like to add another session I got one with devise current_user. I want to add a current_company.
[14:17:45] fgo: has joined #RubyOnRails
[14:18:27] Anakat: has joined #RubyOnRails
[14:18:30] IFrank00: where do I add this logic and what is the correct syntax
[14:18:55] IFrank00: session[:current_company] = current_user.service_user.service_company
[14:19:46] jaequery: has joined #RubyOnRails
[14:20:30] voker57: has joined #RubyOnRails
[14:21:06] mase-chatter: has joined #RubyOnRails
[14:24:19] mikecmpbll: what makes a rails app cpu intensive? big AR queries?
[14:24:33] Rylee: lots of things can
[14:24:45] mikecmpbll: i suspect that's true, wondering what the most likely culprits are
[14:24:57] centrx: big queries can make the DB CPU intensive, not quite the Rails app
[14:25:13] mikecmpbll: centrx: i was thinking in loading all those AR objects might use a bunch of CPU
[14:25:27] centrx: mikecmpbll, memory usage is more of a concern with that
[14:25:43] centrx: mikecmpbll, but profile your app with require 'profile' or New Relic or whatever
[14:25:49] barnex: Could someone give me an example how this renderer is supposed to be used: https://github.com/cortiz/prawn-rails/blob/master/lib/prawn-rails/renderer.rb ?
[14:26:06] mikecmpbll: i use new relic, can't find anything useful for figuring out what makes it CPU intensive though
[14:26:12] mikecmpbll: above that of say .. our rails api
[14:26:30] mikecmpbll: maybe view compilation, hm
[14:26:45] commondream: has joined #RubyOnRails
[14:27:00] watchtheblur: has joined #RubyOnRails
[14:27:20] mikecmpbll: ruby deploy 10 24.8% 1.25 GB # process user # cpu ram
[14:27:50] watchtheblur: has joined #RubyOnRails
[14:28:09] jokke: i'm having a problem with cancancan
[14:28:35] jokke: i'm trying to define that a user can read everything _except_ for a particular model
[14:28:48] jokke: so i defined can :read, :all
[14:28:52] kies: has joined #RubyOnRails
[14:28:52] jokke: and underneath
[14:29:02] jokke: cannot :read, MyModel
[14:29:15] jokke: it still indexes the model though
[14:29:59] jokke: MyModel is User
[14:30:08] asmodlol: has joined #RubyOnRails
[14:30:12] jokke: and every user is able to edit itself
[14:30:41] gambl0re: has joined #RubyOnRails
[14:30:41] jokke: so there's also can [:edit, :update], user
[14:31:09] TinkerTyper: has joined #RubyOnRails
[14:31:41] jokke: and can :index User, id: user.id
[14:33:39] jokke: if i remove the can :read, :all from the top everything is fine, except i can't read any of the other models which i want to be able to read
[14:33:52] joaomdmoura: has joined #RubyOnRails
[14:34:24] dopie: has joined #RubyOnRails
[14:35:14] jokke: cannot :index, User doesn't work either
[14:35:35] mikecmpbll: jokke: can you gist your exact rules pls ty
[14:35:39] sevenseacat: jokke: define 'it still indexes the model'
[14:35:53] symbol: has joined #RubyOnRails
[14:36:00] jokke: sevenseacat: it still shows all items in the index
[14:36:08] sevenseacat: ok, so let's see the code for the index
[14:36:33] mikecmpbll: ACTION suspects sevenseacat knows more about cancan(can) than me :d
[14:36:49] sevenseacat: i've spent many a day wrangling it. however, in this case i suspect its just not being used.
[14:37:03] symbol: has joined #RubyOnRails
[14:37:13] mikecmpbll: sounds plausible!
[14:37:19] arBmind1: has joined #RubyOnRails
[14:37:34] jokke: ok here are the abilities: http://p.jreinert.com/Izp/ruby
[14:38:09] tbuehlmann: suspicious paste page is suspicious
[14:38:36] jokke: nothing about it is suspicios!
[14:38:38] mikecmpbll: at least it's not bit.ly
[14:38:49] jokke: it's the most awesome pastebin ever!
[14:39:06] jokke: ok i'm biased for having contributed to it
[14:39:40] helpa: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[14:39:55] puppeh: has joined #RubyOnRails
[14:40:08] puppeh: is there anyway I can limit the StackProf::Middleware to a specific unicorn worker?
[14:40:32] Trefex: has joined #RubyOnRails
[14:40:49] jokke: and i've got load_and_authorize_resource in my controller
[14:41:00] jokke: which also works if read :all is left out
[14:41:48] jokke: sevenseacat: any clues? i know order is pretty crucial in defining abilities
[14:41:56] sevenseacat: jokke: please gist your code.
[14:42:50] jokke: https://gist.github.com/anonymous/6f2156e0e4877f16c641
[14:43:13] sevenseacat: thats great, but i asked to see the controller code.
[14:43:24] paulcsmith: has joined #RubyOnRails
[14:44:08] jokke: https://gist.github.com/anonymous/ab730dcf173c3819c377
[14:44:08] BaNzounet: Hey guys, I've added some fonts in /app/assets/fonts/ but when bootstrap try to load them if fails 404 example.com/fonts/glyphicons-halflings-regular.woff :/ Any idea what's going on ?
[14:44:31] sevenseacat: jokke: there's no index action there.
[14:44:59] shinnya: has joined #RubyOnRails
[14:45:01] sevenseacat: BaNzounet: did you restart your rails server after creating the fonts folder?
[14:45:14] jokke: https://gist.github.com/anonymous/fa61dcfe70da9cdadb12
[14:45:29] umgrosscol: has joined #RubyOnRails
[14:45:30] mikecmpbll: jokke: !gist-usage also
[14:45:30] helpa: jokke: How to use Gist properly: https://github.com/radar/guides/blob/master/using-gist.markdown
[14:45:34] Anakat: has joined #RubyOnRails
[14:45:48] sevenseacat: your controller is a concern? nice
[14:46:01] rushed: has joined #RubyOnRails
[14:46:27] jokke: sevenseacat: yeah i thought that way it's easier to customize in the app that mounts the engine. It's not
[14:46:35] jokke: now i'm using decorators for that
[14:46:44] sevenseacat: I have yet to see a use for controller concerns
[14:46:51] BaNzounet: sevenseacat: just did nothing has changed ;( Btw it returns 406 Not Acceptable (not 404)
[14:47:00] sevenseacat: BaNzounet: gist the logs plz
[14:47:31] BaNzounet: sevenseacat: https://gist.github.com/AlexGaspar/b65c9ec2ce1571de4c41
[14:47:36] jokke: sevenseacat: are you assured, that the resource is loaded and authorized? :)
[14:47:42] sevenseacat: jokke: so wheres the controller that actually loads this concern
[14:48:17] jokke: sevenseacat: it's empty except for the include
[14:48:26] sevenseacat: BaNzounet: how are you loading these assets
[14:48:27] jokke: but i can gist it if you want
[14:48:41] mikecmpbll: jokke: also which roles does the user have
[14:48:42] sevenseacat: jokke: please do, because if it doesnt have more than one include, that sounds like a problem.
[14:48:42] srinidhi: has joined #RubyOnRails
[14:48:43] srinidhi: has joined #RubyOnRails
[14:48:53] jokke: mikecmpbll: professor
[14:49:23] jokke: sevenseacat: https://gist.github.com/anonymous/253152b4340f498ce55f
[14:49:58] sevenseacat: this is what we call overengineered code
[14:50:07] jokke: that is clear
[14:50:56] Limix: has joined #RubyOnRails
[14:51:08] sevenseacat: jokke: i cant make heads or tails of it. i have no idea if you're actually loading or authorizing anything.
[14:51:28] sevenseacat: the dots still arent connected between the concern that does the loading, and the controller you're accessing.
[14:51:48] sevenseacat: after five gists
[14:51:51] simplyianm: has joined #RubyOnRails
[14:51:52] centrx: has joined #RubyOnRails
[14:52:00] sevenseacat: sorry, only four of the gists were yours.
[14:52:01] jokke: i told you, if i leave out the can :read, :all then i'm able to see only the user itself in the index action
[14:52:31] jokke: i think that's clear evidence that the resource is authorized
[14:52:43] mikecmpbll: jokke: can you move the cannot :read, UserAdministration::User rule to the bottom of your initialize method
[14:52:54] disgrntld: has joined #RubyOnRails
[14:53:25] sevenseacat: i dont even know what resource is getting authorized, given you've got the authorization happening in a concern that presumably gets included into the inheritance chain somewhere
[14:53:42] sevenseacat: but anyway. i suggest some strong refactoring to detangle the mess.
[14:53:44] jokke: mikecmpbll: you mean over the can [:index, :modify]... ?
[14:53:52] mikecmpbll: i mean to the bottom of the initialize method
[14:53:54] mikecmpbll: the last line.
[14:54:00] mikecmpbll: not replacing anything, just moving it
[14:54:04] mordocai: has joined #RubyOnRails
[14:54:11] BaNzounet: sevenseacat: What do you mean? I've config.assets.enabled set to true, I don't know much about the asset pipeline, I was expecting him to move stuff in app/assets/fonts to /public/fonts somehow
[14:54:28] jokke: mikecmpbll: unauthorized, as expected
[14:54:31] sevenseacat: BaNzounet: where are you referencing the assets from?
[14:54:36] mikecmpbll: jokke: so it's working?
[14:54:55] jokke: umm. that's what i've kept saying
[14:55:01] jottr: has joined #RubyOnRails
[14:55:05] jokke: the _exclusion_ isn't working
[14:55:32] jokke: as in "Can read everything _except_ for Users"
[14:55:44] BaNzounet: the one from the logs? It's from bootstrap.min.css
[14:56:00] jokke: i'm starting to believe this is a bug in cancancan
[14:56:00] mikecmpbll: uh, yeah and i'd expect you to test what isn't working
[14:56:13] mikecmpbll: you've thoroughly confused me now.
[14:56:29] sevenseacat: mikecmpbll: welcome to my world.
[14:56:30] mikecmpbll: no idea what you meant by [15:54:28] <jokke> mikecmpbll: unauthorized, as expected
[14:56:51] jokke: mikecmpbll: well, i get an unauthorized error
[14:57:06] jokke: (i'm trying to access the index action of users after all)
[14:57:21] sevenseacat: something is very wrong in your code.
[14:57:43] sevenseacat: and i'm 99.9% sure its your code, not cancancan.
[14:57:55] jokke: sevenseacat: alright, i'll prove you wrong
[14:58:09] sevenseacat: please do. refactor your code to sanity, and see if its still broken.
[14:58:27] quazimodo: sevenseacat:
[14:58:31] quazimodo: cant believe youre awake
[14:58:36] sevenseacat: its only 11pm
[14:58:44] quazimodo: it's 1 here
[14:58:49] quazimodo: i'm so dumb
[15:00:17] pjammer: has joined #RubyOnRails
[15:01:01] Spami: has joined #RubyOnRails
[15:02:30] garrypolley: has joined #RubyOnRails
[15:02:32] nhhagen: has joined #RubyOnRails
[15:04:44] mikecmpbll: [15:29:14] <jokke> it still indexes the model though [15:56:51] <jokke> mikecmpbll: well, i get an unauthorized error [15:57:06] <jokke> (i'm trying to access the index action of users after all)
[15:05:27] mikecmpbll: that's the basis of my utter confusion
[15:05:48] jokke: mikecmpbll: maybe i'm bad at communicating this, english is not my native tounge.
[15:05:51] SalexW: has joined #RubyOnRails
[15:05:58] mikecmpbll: jokke: there's no maybe about that.
[15:06:08] jokke: i'm trying again:
[15:06:13] centrx: your native tongs
[15:06:48] porkqpain: has joined #RubyOnRails
[15:07:22] jokke: 1. if i have can :read, :all at the top, _every_ user is fetched in the index action, _despite_ the fact that just below that i have cannot :read, User
[15:08:18] mikecmpbll: jokke: because i'm not terribly familiar with cancan, can you tell me what is meant to happen also
[15:08:23] jokke: 2. if i move the cannot :read, User to the bottom (below can :index, User, id: user.id) i get an unauthorized error (makes sense, because i cannot read)
[15:08:32] jokke: mikecmpbll: okay
[15:08:45] jokke: so cancan lets you override stuff
[15:08:55] mikecmpbll: jokke: no, don't tell me about cancan, i can find that out myself
[15:09:03] bhorn1: has joined #RubyOnRails
[15:09:06] mikecmpbll: tell me what is meant to happen when you to to the index
[15:09:34] jokke: what's meant to happen is, that a only the current_user is fetched in the index action
[15:10:34] batasrki: has joined #RubyOnRails
[15:11:01] batasrki: anyone know why sidekiq would not pick up a job invoked with #perform_in?
[15:11:16] batasrki: I can't even debug the problem, it's just a black hole
[15:11:57] mrbubbles: Hey guys, I???m using CanCanCan to check abilities. I have a User model with an account_id and a Meter model with an account_id, so that???s easy: can :crud, Meter, :account_id => user.account_id. However, I have a Parameter model which has a meter ID, and that meter then has an account_id so how would I be able to check for that?
[15:13:07] allcentury: has joined #RubyOnRails
[15:14:09] SeriousMatters: has joined #RubyOnRails
[15:14:22] bzb: has joined #RubyOnRails
[15:14:38] sonofdirt: has joined #RubyOnRails
[15:15:30] Lightsword: has joined #RubyOnRails
[15:15:52] Peteykun: has joined #RubyOnRails
[15:16:07] rustymyers: has joined #RubyOnRails
[15:17:39] nfk|laptop: has joined #RubyOnRails
[15:17:55] spyderman4g63: has joined #RubyOnRails
[15:18:25] jokke: hm now sevenseacat is gone
[15:18:40] hnanon: How can I compare one array of arrays against another array of arrays?
[15:18:56] jokke: anyhow, i refactored the code. There's no more concern anywhere and the behavior is unchanged
[15:19:17] mikecmpbll: jokke: it's to do with the ability precedence
[15:19:19] zeknox: has joined #RubyOnRails
[15:19:29] jokke: mikecmpbll: yes i guess so
[15:20:41] DoctorMonocular: has joined #RubyOnRails
[15:23:27] Cache_Money: has joined #RubyOnRails
[15:24:04] Geffy: has joined #RubyOnRails
[15:26:36] mello: has joined #RubyOnRails
[15:26:49] fgo: has joined #RubyOnRails
[15:27:25] towski_: has joined #RubyOnRails
[15:28:42] momomomomo: has joined #RubyOnRails
[15:29:25] sarink: has joined #RubyOnRails
[15:29:46] mikecmpbll: jokke: eh, i don't really get it. what happens if you comment out line 36?
[15:30:10] mikecmpbll: and 35 (cus i don't really know what that does)
[15:34:15] DoctorMonocular: has joined #RubyOnRails
[15:35:06] jokke: mikecmpbll: line 36 where?
[15:35:17] mikecmpbll: jokke: http://p.jreinert.com/Izp/ruby
[15:36:20] rushed: has joined #RubyOnRails
[15:36:30] livathinos: has joined #RubyOnRails
[15:36:43] mikecmpbll: need to isolate which 'rule' isn't working so at the very least you can file a bug report. either the cannot :read, User line isn't working or the can [:read, :modify], User, id: user.id isn't working, right? if you comment the latter out and you can still access the index then that'll tell you..
[15:37:18] simplyianm: has joined #RubyOnRails
[15:37:19] jokke: mikecmpbll: then i get an unauthorized error
[15:38:12] mikecmpbll: so the `can [:read, :modify], User, id: user.id` line is allowing you to see all users rather than just with id: user.id, is that correct?
[15:38:51] snockerton: has joined #RubyOnRails
[15:39:21] moretti: has joined #RubyOnRails
[15:39:25] sandstrom: has joined #RubyOnRails
[15:39:36] Joshmfrankel: has left #RubyOnRails: ()
[15:39:50] moretti: has joined #RubyOnRails
[15:40:23] baweaver: has joined #RubyOnRails
[15:41:15] jokke: mikecmpbll: no that lets me see _only_ users with id: user.id
[15:41:35] jokke: the hash part of the args is basically what you'd write in a where()
[15:41:54] mikecmpbll: no, i'm talking now about what is actually happening
[15:41:55] Tempesta: has joined #RubyOnRails
[15:41:57] mikecmpbll: not the desired behaviour
[15:42:09] mikecmpbll: when you add that line in, does it allow you to see all users?
[15:42:09] jokke: that's what's happening
[15:42:31] asmodlol: has joined #RubyOnRails
[15:42:35] jokke: mikecmpbll: it does
[15:43:12] toretore: has joined #RubyOnRails
[15:44:31] barnex: hmm, is there a way to reload! stuff I've required in rails console?
[15:44:48] Trefex: has joined #RubyOnRails
[15:45:12] mikecmpbll: barnex: you can try use `load` instead of require.
[15:45:41] mikecmpbll: (including the file extension)
[15:45:49] Rubie: has joined #RubyOnRails
[15:45:55] simplyianm: has joined #RubyOnRails
[15:46:14] barnex: it doesn't work :P
[15:46:27] mikecmpbll: !didntwork :'(
[15:46:27] helpa: What "didn't work"? Did your server not start? Did your computer explode? Did your webpage turn bright pink? Did your client not pay your bill on time? You may have to be more specific. A Gist (http://gist.github.com) of the code that doesn't work (and the error you are getting) will be helpful.
[15:46:55] barnex: well, I entered random, syntax agnostic bullshit in my file and reloaded it, created a new object without problems
[15:47:06] barnex: it shouldn't run
[15:47:21] barnex: so the class hasn't reloaded
[15:47:46] toertore: has joined #RubyOnRails
[15:48:02] bzb: has joined #RubyOnRails
[15:48:39] Verrelia: has joined #RubyOnRails
[15:51:24] Scripore: has joined #RubyOnRails
[15:52:16] mikecmpbll: barnex: works for me in irb /shrugs
[15:52:21] mikecmpbll: i guess rails is interferring.
[15:52:34] asmodlol: has joined #RubyOnRails
[15:52:41] SeanLazer: has joined #RubyOnRails
[15:53:10] mikecmpbll: barnex: fwiw: https://gist.github.com/mikecmpbll/a6831dec309eeec34656
[15:54:52] Limix: has joined #RubyOnRails
[15:55:00] batasrki: has left #RubyOnRails: ()
[15:55:03] ndrei: has joined #RubyOnRails
[15:56:40] drale2k: has joined #RubyOnRails
[15:56:49] commondream: has joined #RubyOnRails
[15:57:49] Fire-Dragon-DoL: has joined #RubyOnRails
[15:59:48] zorak8: has joined #RubyOnRails
[16:01:21] towski_: has joined #RubyOnRails
[16:02:17] toretore: has joined #RubyOnRails
[16:03:46] krz: has joined #RubyOnRails
[16:03:52] garrypolley: has joined #RubyOnRails
[16:04:51] kinduff: has joined #RubyOnRails
[16:05:04] momomomomo: has joined #RubyOnRails
[16:05:05] kinduff: Good morning RoR Devs
[16:05:21] artto: has joined #RubyOnRails
[16:05:22] kinduff: Got this heavy app that needs to have a pretty decent cache system
[16:05:37] sonofdirt: has joined #RubyOnRails
[16:05:43] kinduff: is there any tool out there that help me out to archive this in an easy and configurable way?
[16:05:49] barnex: mikecmpbll: ok, thanks for that, I misunderstood you
[16:05:57] barnex: I tried load instead of require and then 'reload!'
[16:06:01] barnex: and expected results
[16:06:04] barnex: this works, thanks
[16:06:21] mikecmpbll: barnex: my apologies, reading it back i wasn't particularly clear ;)
[16:06:54] mikecmpbll: kinduff: depends on what type of cache
[16:06:57] barnex: well, my description of how it wasn't working also could be clearer on the important part of reloading
[16:07:30] SeriousMatters: Can I add where clause to filter associated has_many models?
[16:07:43] pjammer: has joined #RubyOnRails
[16:08:01] SeriousMatters: something like, class Blog has_many :comments
[16:08:01] SeriousMatters: @new_comments = @blog.comments.where(:unread => true)
[16:08:29] tbuehlmann: SeriousMatters, exactly like that, yes
[16:08:35] hnanon: I have this code in my model: https://gist.github.com/anonymous/e97658df7bbadf6057ae
[16:08:38] kinduff: mikecmpbll: it's a 3.2 app with postgresql, looking for asset cachin and db caching
[16:08:51] soahccc: Which method is being called on a model to get the attribute value by the form builder? I overwrote the getter method which doesn't seem to affect the form :(
[16:08:58] hnanon: I get this error: undefined method `update' for ["qwert", "spring promo"]:Array
[16:09:02] mikecmpbll: kinduff: !caching
[16:09:02] helpa: kinduff: Caching with Rails Guide - http://guides.rubyonrails.org/caching_with_rails.html - by Aditya Chadha
[16:09:46] mikecmpbll: hnanon: array doesn't have an update method?
[16:09:48] soahccc: hnanon: pluck gives you an array of the specified attributes, it's a string (or whatever) and not a model hence it cannot be saved like this
[16:09:55] kinduff: mikecmpbll: thanks!
[16:11:14] __butch__: has joined #RubyOnRails
[16:11:23] hnanon: soahccc: But I see the arrays I want in the logs (from the subtraction, ie. unpaid_phones)
[16:13:36] __butch__1: has joined #RubyOnRails
[16:13:43] SeriousMatters: hnanon: it's returning empty list tho
[16:13:55] RegulationD: has joined #RubyOnRails
[16:14:10] hnanon: SeriousMatters: No, I see the new array returned.
[16:14:36] mikecmpbll: hnanon: like you said, it's an array, what are you expecting .update to do to an array?
[16:14:40] hnanon: I guess the question is, then, how do I update the records that are associated with the elements in that array?
[16:14:53] SeriousMatters: hnanon: my apology, I was talking to tbuehlmann.
[16:15:36] tbuehlmann: the blog doesn't have any unread comments then
[16:16:23] jaequery: has joined #RubyOnRails
[16:16:39] SeriousMatters: tbuehlmann: where(:unread => true) didn't work. but where("unread = 'true'") does. wrong syntax?
[16:16:46] RegulationD: has joined #RubyOnRails
[16:17:31] tbuehlmann: is the unread column of type boolean?
[16:18:30] tbuehlmann: .where(unread: true) should work
[16:18:46] mikecmpbll: hnanon: why are you using pluck?
[16:19:30] edwinvdgraaf: has joined #RubyOnRails
[16:19:57] dionysus69: has joined #RubyOnRails
[16:21:35] treehug88: has joined #RubyOnRails
[16:21:40] SeriousMatters: tbuehlmann: suppose to be boolean. but it's sqlite.
[16:21:59] hnanon: mikecmpbll: Long story, short: I have a dealer commissions table and a carrier commissions table. I want to collect all dealer commissions not in carrier commissions and update their status.
[16:22:03] bricker: has joined #RubyOnRails
[16:22:04] tbuehlmann: SeriousMatters, should work just as we'd expect
[16:22:19] tbuehlmann: SeriousMatters, can you check whether there really are associated unread comments?
[16:22:20] lindii_: has joined #RubyOnRails
[16:22:23] hnanon: A uniqe record is defined by a pair of attributes: phone id and name.
[16:23:16] n008f4g_: has joined #RubyOnRails
[16:24:58] edwinvdg_: has joined #RubyOnRails
[16:25:01] porkqpain: has joined #RubyOnRails
[16:25:32] railsForDaiz: has joined #RubyOnRails
[16:26:48] ramfjord: has joined #RubyOnRails
[16:27:24] mello: has joined #RubyOnRails
[16:27:43] devdazed_: has joined #RubyOnRails
[16:28:38] railsForDaiz: rails is trying to use assets from projects/assets/ instead of public/assets. How can i stop this behaviour
[16:29:48] Synthead: where is the best place to put global model helpers?
[16:29:56] syzygy__: has joined #RubyOnRails
[16:30:50] garrypolley_: has joined #RubyOnRails
[16:33:30] SeriousMatters: tbuehlmann: oooh, sqlite doesn't have boolean.
[16:33:51] tbuehlmann: SeriousMatters, but rails should translate it correctly, right?
[16:33:52] sandstrom: has joined #RubyOnRails
[16:34:39] paulcsmith: has joined #RubyOnRails
[16:35:07] AzaToth: has joined #RubyOnRails
[16:35:15] bricker: Synthead: app/models/concerns, app/services/ lib/ are three reasonable places, depending on how you'll be using them one may be the best choice
[16:37:18] railsForDaiz: Hi. How where can i put the assets from a admin dashboard i have obtained from themeforest? (css and js)
[16:38:40] allcentury: has joined #RubyOnRails
[16:38:50] SeriousMatters: tbuehlmann: the problem is I inserted test data into sqlite manually, not via rails
[16:39:15] mello: has joined #RubyOnRails
[16:39:15] mello: has joined #RubyOnRails
[16:40:28] dmz: has joined #RubyOnRails
[16:40:29] dmz: has joined #RubyOnRails
[16:40:44] hnanon: This problem has held me up for a few days now.
[16:40:45] tbuehlmann: SeriousMatters, you can use 't' and 'f' for true/false and rails should understand them
[16:41:07] DoctorMonocular: has joined #RubyOnRails
[16:43:29] krzkrz: has joined #RubyOnRails
[16:43:32] bricker: railsForDaiz: vendor/assets is a good place
[16:44:00] bricker: tbuehlmann: or 0/1, less bits
[16:44:35] tbuehlmann: not sure what sqlite supports, but yeah, give that a try
[16:46:15] Yoda: has joined #RubyOnRails
[16:46:15] Yoda: has joined #RubyOnRails
[16:47:35] meoblast001: has joined #RubyOnRails
[16:47:42] __butch__: has joined #RubyOnRails
[16:49:04] iliketurtles: has joined #RubyOnRails
[16:49:30] leafac: has joined #RubyOnRails
[16:50:36] hnanon: Can someone explain this scope to me: https://gist.github.com/anonymous/cfcaf3ad0f4f27f0d4ff
[16:51:09] dllama: has left #RubyOnRails: ()
[16:52:38] Zadrel: has joined #RubyOnRails
[16:53:37] Lytol: has joined #RubyOnRails
[16:54:03] railsForDaiz: bricker thanks will try it out. Having a problem where if i go to localhost/projects/1 the assets wont load because they are pointing to projects/assets/asset.css which is not what i want. I had used a theme from themeforest and just put the files in public/assets.
[16:55:06] seank_: has joined #RubyOnRails
[16:57:28] chipotle: FIFA head is resigning!!
[16:57:29] JohnBat26: has joined #RubyOnRails
[16:58:08] daveomcd: I'm trying to figure out how to solve a n+1 query... I have to include an association of an association to solve it. Is there a way to do this in the active record query or do i need to setup an additional association? Here are my current models... https://gist.github.com/daveomcd/18863ccf2eb87251dffe
[16:58:22] daveomcd: chipotle, good, i didn't think it was going to happen ;-/
[16:58:47] moeabdol: has joined #RubyOnRails
[16:58:54] chipotle: it's quite frankly unbeliavable
[16:58:55] meoblast001: has joined #RubyOnRails
[16:59:31] daveomcd: chipotle, yup -- but its great to see that corruption such as that is being handled (hopefully)
[16:59:55] aclapinpepin: has joined #RubyOnRails
[17:00:04] Zadrel: hello there, any one could help me with an embedded googlemaps that is showin a gray bg instead of the map(drawed or satellite)?
[17:00:22] djbkd: has joined #RubyOnRails
[17:00:31] chipotle: we will see
[17:01:18] sinkensabe: has joined #RubyOnRails
[17:01:42] tbuehlmann: daveomcd, I think you want something like this: @interviews = Interview.includes(player: :college_play_histories)
[17:04:38] SeriousMatters: tbuehlmann: thanks for the tip. sqlite docs suggest boolean is represented by int 1 and 0. so I manually inserted 1 and 0. but rails is expecting 't' and 'f'. therefore rails can't find anything for where(:boolean_field => true)
[17:04:43] ghr: has joined #RubyOnRails
[17:04:43] jottr: has joined #RubyOnRails
[17:05:18] tbuehlmann: why don't you use 't' and 'f' then? :)
[17:06:30] rubyonrailed: has joined #RubyOnRails
[17:06:48] SalexW: has joined #RubyOnRails
[17:07:52] mconnolly: has joined #RubyOnRails
[17:07:54] mustmodify: has joined #RubyOnRails
[17:08:10] mustmodify: has left #RubyOnRails: ()
[17:08:36] spyderman4g63: has joined #RubyOnRails
[17:09:15] m0r0n: has joined #RubyOnRails
[17:09:27] garrypolley: has joined #RubyOnRails
[17:09:34] momomomomo_: has joined #RubyOnRails
[17:09:59] daveomcd: tbuehlmann, thanks i'll try it!
[17:10:15] moeabdol: has joined #RubyOnRails
[17:10:25] rushed: has joined #RubyOnRails
[17:10:35] sinkensabe: has joined #RubyOnRails
[17:13:19] ghr: has joined #RubyOnRails
[17:13:41] choke: has joined #RubyOnRails
[17:13:56] Detch: has joined #RubyOnRails
[17:14:45] centrx: Hey, what do you think, should I submit a PR or make a gem, for this project - https://github.com/lostisland/faraday
[17:15:05] centrx: Inactive for four months, but the dude seems to still exist
[17:15:59] jenrzzz: has joined #RubyOnRails
[17:16:41] mconnolly: Faraday is a dependency for a lot of projects I see, so I think a PR might be good depending on what changes you want to make
[17:16:53] vickleton: has joined #RubyOnRails
[17:17:34] centrx: Okay good point
[17:17:47] centrx: I just hope it becomes more active again
[17:17:48] tbuehlmann: is mislav still maintaining it?
[17:17:52] centrx: apparently
[17:17:58] tbuehlmann: seems a bit abandoned
[17:18:01] centrx: but he's not, you know
[17:18:29] mconnolly: It is always possible that it "just works", that happens on certain low level projects
[17:18:32] jhass: well, some things just don't need much feature development anymore to be maintained
[17:19:00] centrx: yeah, but he should get all the Issues and PRs closed or something
[17:19:09] tbuehlmann: jhass, absolutely
[17:19:13] centrx: Maybe I'll contact him
[17:19:32] tbuehlmann: yeah, my impression comes from the issue and PR count
[17:19:47] tbuehlmann: might be wrong about it, I'm not into the project
[17:20:22] choke: All very true, but you could do some refactoring to speed things up or clean it up a bit ( not that it's messy by any means )... always something you could do... Any idea on his average response time in a PR? If you do, I'd submit a PR and after that time -- re-package it as a new gem... Get the best of both worlds.
[17:21:15] chintanparikh: has joined #RubyOnRails
[17:21:32] Scripore: has joined #RubyOnRails
[17:21:55] centrx: That's what I was thinking, but I didn't want it to go to waste. I don't know how that works if someone forks it or abandons a project
[17:22:16] coin3d: has joined #RubyOnRails
[17:22:16] edgarjs: has joined #RubyOnRails
[17:22:17] centrx: Thanks. Good work team!
[17:22:33] moretti: has joined #RubyOnRails
[17:22:41] leafac1: has joined #RubyOnRails
[17:23:14] chintanparikh1: has joined #RubyOnRails
[17:24:16] slug99: has joined #RubyOnRails
[17:24:28] slug99: has left #RubyOnRails: ()
[17:24:51] joaomdmoura: has joined #RubyOnRails
[17:25:01] choke: Plenty of people do it really. Look at all the other libraries out there that have some sort of disclaimer stating things like "newproject is a continuation of <link_to_old_project>old_project</link_to_old_project>" as long as the license for it permits redistribution in part or in whole 'legally' speaking you should be good to go
[17:25:03] hamster88: has joined #RubyOnRails
[17:25:11] hamster88: Hello people :)
[17:25:16] codepete: has joined #RubyOnRails
[17:25:51] benanne: has joined #RubyOnRails
[17:26:02] moretti: has joined #RubyOnRails
[17:26:11] hamster88: I have a question related to devise alerts i am trying to configure. I am using twitter-bootstrap-rails gem. Everything is working fine but the two of the alerts bar are showing up at top of every page.
[17:26:42] Spami: has joined #RubyOnRails
[17:27:22] IFrank00: has joined #RubyOnRails
[17:27:23] centrx: choke, Yes, but I don't really use faraday enough to make it worth maintaining it, so I was concerned someone else would fork, and ignore all the work I did (potentially) on the faraday issues
[17:27:43] centrx: *use faraday enough to be able to properly maintain it
[17:28:01] rushed: has joined #RubyOnRails
[17:29:20] Altonymous: has joined #RubyOnRails
[17:29:23] Altonymous: Anyone know how I can serve a friendly error message when the database goes down? We are using postgresql
[17:29:30] sinkensabe: has joined #RubyOnRails
[17:30:05] choke: ahh... it's quite possible someone will fork the original and it probably will happen, at least initially. But I get where you are coming from, I did a php library a while back and in my entire life ( even the parent library) i used it a total of 2 times -- almost seems like wasted work...
[17:30:06] centrx: choke, hmm, so this thing I wanted to add (SOCKS support) requires a new dependency (socksify), is there a clever way to do optional dependencies for the PR, or would this warrant making a separate gem instead?
[17:30:15] Synthead: can I add a custom model method to models? Like MyModel.find(1).my_custom_method?
[17:30:25] hamster88: please have a look at this gist https://gist.github.com/thedesignable/5dfaaf695be3a7e06d6d
[17:30:26] centrx: Synthead, yes of course
[17:30:43] Synthead: centrx: how is that done? I am familiar with scopes, but they only seem to work with the base class
[17:30:43] mikecmpbll: has joined #RubyOnRails
[17:30:59] choke: I'm the wrong person to ask that type of stuff, i come from a 20 year php background... still noobish when it comes to ruby centrx
[17:31:11] centrx: Synthead, just create an instance method in the model's class
[17:31:14] centrx: model class
[17:31:17] mordocai: Last time I heard, rails 5.0 was going to come out this summer. Anyone know if we have a more solid timeline? We are working on moving to rails 4.x now from rails 3.2.x and rails 5 releasing is considered our hard deadline for it to management.
[17:31:33] mordocai: I can push upgrading faster depending on when it will release.
[17:31:51] kies: has joined #RubyOnRails
[17:31:56] Synthead: centrx: like "def self.whatever(foo) ... end" ?
[17:32:23] centrx: Synthead, yes, but that would be a class method. Remember if you have X.find(1).my_method, find(1) returns an instance
[17:32:28] mikecmpbll: mordocai: !raills5
[17:32:32] mikecmpbll: mordocai: !rails5
[17:32:32] helpa: mordocai: lol
[17:33:18] mikecmpbll: also don't base a deadline on something that has no deadline ;)
[17:33:23] sinkensabe: has joined #RubyOnRails
[17:33:42] Synthead: centrx: oh I see, yeah. if I wanted to access the instance's model attributes, how would that be done in the method?
[17:34:35] Synthead: centrx: oooh, you just call them :) nevermind!
[17:34:42] Synthead: centrx: this is great. thanks for the help!
[17:34:44] mordocai: mikecmpbll: It's because 3.2 loses security support with 5.0 comes out
[17:34:52] centrx: Synthead, :)
[17:35:02] baweaver_: has joined #RubyOnRails
[17:35:08] workmad3: mordocai: there's not even a beta release of rails 5 yet... rails 3 and rails 4 both took several months from first beta to final release, and I don't see any reason rails 5 will be much different
[17:35:43] mordocai: workmad3: Cool, I wasn't around for rails 3 or 4 release so I didn't have any historical perspective to call upon.
[17:35:56] workmad3: mordocai: there's always release dates in rubygems too ;)
[17:36:08] pixelhandler: has joined #RubyOnRails
[17:37:43] baweaver_: has joined #RubyOnRails
[17:38:05] hamster88: umm.. anyone?
[17:38:37] centrx: I don't know about devise
[17:38:44] rubyonrailed: has joined #RubyOnRails
[17:38:50] Altonymous: Anyone know how I can serve a friendly error message when the database goes down? We are using postgresql
[17:38:56] choke: release dates are for people who like deadlines.... ive been working on a php lib for years, v1 isnt released yet ( or even in beta ) release date is ( and always has been ): it'll be released when its released...
[17:38:57] DoctorMonocular: has joined #RubyOnRails
[17:39:23] workmad3: hamster88: you're not making the display of the alert bars conditional on there actually being alerts
[17:39:58] hamster88: workmad3, can you please explain it a bit more ..
[17:40:18] centrx: mordocai, If it helps any, 3.2 already lacks "regular" security support
[17:40:25] Peteykun: has joined #RubyOnRails
[17:40:34] centrx: mordocai, "As per our maintenance policy, the release of Rails 4.2 will mean that bug fixes will only apply to 4-2-stable, regular security issues to 4.2.x, 4.1.x, and severe security issues to 4.2.x, 4.1.x, and 3.2.x."
[17:41:14] centrx: mordocai, In other words, it's always best to be proactive/early, and in this case, non-severe security support for 3.2 is already over.
[17:41:14] workmad3: hamster88: in your layout, you're always putting the elements in place to have notices and alerts displayed, even if there's no text in the notice or alert to warrent them being present
[17:41:25] SeriousMatters: has left #RubyOnRails: ()
[17:41:34] Fire-Dragon-DoL: does rails auto connects to database on first query or does it connects automatically once loaded?
[17:41:46] choke: hamster88 he means something like if notice { } if error { } ( obviously not haml and will not function but basic gist of what he means )
[17:42:31] DoctorMonocular: has joined #RubyOnRails
[17:43:06] hamster88: so what i need to do, they always display shows up on my page. I am not sure if i can put the screenshot on gist to tell the exact problem
[17:43:34] centrx: Fire-Dragon-DoL, As I recall, it connects on load in order to get the columns from the information_schema
[17:43:53] hahuang65: has joined #RubyOnRails
[17:44:00] Fire-Dragon-DoL: centrx: mhhh... crap, that's a big problem for me
[17:44:34] workmad3: Fire-Dragon-DoL: what are you trying to do that the exact time of connection is important? :)
[17:44:36] thebatu1: has joined #RubyOnRails
[17:44:55] mordocai: centrx: Just talked to my boss about it and got it made a priority. We already knew about the lack of "regular" support but I harped on that some more. Thanks for the info!
[17:45:27] erich: has joined #RubyOnRails
[17:46:48] Fire-Dragon-DoL: workmad3: I'm creating a worker based on an SQS queue which must NOT hit the database (we might have 50+ of these processes), so I'm serializing the models and sending them to the process and then consume them. The problem is that I want to access the code for the model, which is in rails, so I'm loading rails, which in turns connect when loaded. I suppose I have to decouple this stuff, making it longer than I initially th
[17:47:39] ndrei_: has joined #RubyOnRails
[17:48:29] baweaver_: has joined #RubyOnRails
[17:48:41] edwinvdgraaf: has joined #RubyOnRails
[17:48:51] joaomdmoura: has joined #RubyOnRails
[17:48:53] sinkensabe: has joined #RubyOnRails
[17:48:56] workmad3: Fire-Dragon-DoL: alternatively, you could do something like have pgbouncer or some other connection-pooling middleware in place for connections between your SQS processes and the database to remove that as a constraint
[17:49:53] Fire-Dragon-DoL: workmad3: let me google pgbouncer
[17:50:03] Altonymous: Anyone know how I can serve a friendly error message when the database goes down? We are using postgresql
[17:50:10] workmad3: Fire-Dragon-DoL: or you could take a look at when the connection count increases in the database :)
[17:50:22] hamster88: here is the screenshot to my problem http://tinypic.com/r/2958i02/8
[17:50:44] workmad3: Fire-Dragon-DoL: as I think rails will pre-initialize the column information based on db/schema.rb nowadays and has a lazy connection pool
[17:51:21] workmad3: hamster88: yeah... the problem is exactly as we knew and we told you what you need to do to solve it
[17:51:49] Fire-Dragon-DoL: workmad3: OH that's very important
[17:52:00] Fire-Dragon-DoL: workmad3: means rails load stuff from schema, but doesn't connect to database
[17:52:01] DoctorMonocular: has joined #RubyOnRails
[17:52:05] erich: has joined #RubyOnRails
[17:52:15] workmad3: Fire-Dragon-DoL: you should do some testing to establish which one is the case though
[17:52:16] Scripore: has joined #RubyOnRails
[17:52:18] hamster88: workmad3, what i need to do? it's first time i am using HAML :/ (is a tutorial i tried working on)
[17:52:31] Fire-Dragon-DoL: workmad3: how to check connection count? that's the only thing I need right now
[17:52:39] workmad3: Fire-Dragon-DoL: what db are you using?
[17:53:07] Fire-Dragon-DoL: workmad3: sorry forgot to mention, postgresql
[17:53:08] mconnolly: has joined #RubyOnRails
[17:53:17] workmad3: Fire-Dragon-DoL: run select count(*) from pg_stat_activity; in a pg console then ;)
[17:53:34] DoctorMonocular: has joined #RubyOnRails
[17:54:33] RegulationD: has joined #RubyOnRails
[17:54:43] edwinvdgraaf: has joined #RubyOnRails
[17:55:03] Fire-Dragon-DoL: workmad3: mh damn, it hits database when I initialize any activerecord object
[17:55:04] DoctorMonocular: has joined #RubyOnRails
[17:55:43] Lytol: has joined #RubyOnRails
[17:55:45] maz-dev: has joined #RubyOnRails
[17:56:01] sinkensabe: has joined #RubyOnRails
[17:56:39] DoctorMonocular: has joined #RubyOnRails
[17:56:41] workmad3: Fire-Dragon-DoL: take a look at PgBouncer then ;) setting that up with transaction pooling should work... that mode will mean that your processes will create a connection to pgbouncer (very lightweight), and pgbouncer will allocate a connection from its own pool of pg connections when a client starts a transaction
[17:57:26] workmad3: Fire-Dragon-DoL: which means you can maintain a fixed connection pool size across process boundaries
[17:58:27] choke: hamster88 http://stackoverflow.com/questions/8026619/how-to-write-if-condition-in-haml
[17:58:34] Fire-Dragon-DoL: workmad3: mhhhhh I'll think about it, considering we might have 1 process per customer, this is (hopefully) a problem if we have a lot of customers
[17:58:49] diegobiavati: has joined #RubyOnRails
[17:59:02] Xiti: has joined #RubyOnRails
[17:59:05] yfeldblum: has joined #RubyOnRails
[18:00:07] Fire-Dragon-DoL: workmad3: ok a new limitation has arrived: sqs doesn't handle all unicode characters, which automatically makes hitting the database required
[18:01:25] hamster88: choke, the only place i have used conditional statement is in my navbar partial, which seems to be correct as per that link
[18:01:56] jottr: has joined #RubyOnRails
[18:02:01] rkofman: has joined #RubyOnRails
[18:02:45] pjammer: has joined #RubyOnRails
[18:03:48] jaequery: has joined #RubyOnRails
[18:04:56] moretti: has joined #RubyOnRails
[18:05:36] chadwtaylor: has joined #RubyOnRails
[18:05:58] sleungcy: Is there a way to convert rails3 ActiveRecord objects to rails4 AR objects?
[18:06:13] DoctorMonocular: has joined #RubyOnRails
[18:06:15] rushed: sleungcy: what are you trying to do?
[18:06:59] sleungcy: I have some rails 3 marshalled test AR objects in my test suite, but I am trying to upgrade to rails4 now.
[18:07:32] sleungcy: The tests will break if i dont upgrade the marshal data to rails4 as well
[18:07:35] ramfjord: has joined #RubyOnRails
[18:07:41] DoctorMonocular: has joined #RubyOnRails
[18:08:12] rushed: sleungcy: might be a good time to resave them as yaml or something less version dependent
[18:08:23] speakingcode: has joined #RubyOnRails
[18:08:34] workmad3: sleungcy: welcome to the reason to not marshal objects :D
[18:09:11] DoctorMonocular: has joined #RubyOnRails
[18:09:20] nonparfumee: has joined #RubyOnRails
[18:09:32] rubyonrailed: has joined #RubyOnRails
[18:09:37] chouhoul_: has joined #RubyOnRails
[18:10:59] x1337807x: has joined #RubyOnRails
[18:11:46] chouhoul_: has joined #RubyOnRails
[18:11:48] DoctorMonocular: has joined #RubyOnRails
[18:11:53] baweaver_: has joined #RubyOnRails
[18:12:40] mikecmpbll: has joined #RubyOnRails
[18:13:21] jaequery: has joined #RubyOnRails
[18:14:02] dopie: has joined #RubyOnRails
[18:14:41] edwinvdgraaf: has joined #RubyOnRails
[18:14:49] DoubleMalt: has joined #RubyOnRails
[18:16:51] baweaver_: has joined #RubyOnRails
[18:17:26] DoctorMonocular: has joined #RubyOnRails
[18:18:44] edwinvdgraaf: has joined #RubyOnRails
[18:19:52] TommyTheKid: has joined #RubyOnRails
[18:20:23] doodlehaus: has joined #RubyOnRails
[18:20:34] ekain: has joined #RubyOnRails
[18:21:13] TommyTheKid: I have an issue where if I run "rake assets:precompile" it only takes ~4 seconds, but if it runs as part of a "cap production deploy" it takes a very long time.
[18:21:43] jaequery: has joined #RubyOnRails
[18:22:17] bricker: TommyTheKid: rails version?
[18:22:24] hamster88: okay got my prob resolved
[18:22:25] tbuehlmann: TommyTheKid, do you symlink the public directory with capistrano and reuse previously compiled assets? if not chances are the asset compilation won't catch up on earlier compilations and have to run the full thing
[18:22:33] hamster88: one more question though
[18:23:06] DoctorMonocular: has joined #RubyOnRails
[18:23:14] TommyTheKid: I am using the capistrano/rails default setting ..https://github.com/capistrano/rails/#symlinks
[18:23:26] michael_mbp: has joined #RubyOnRails
[18:23:38] aclapinpepin: has joined #RubyOnRails
[18:23:40] jaequery_: has joined #RubyOnRails
[18:23:44] hamster88: when i click on log off it gives me this error " No route matches [GET] "/users/sign_out "
[18:23:52] TommyTheKid: bricker: 4.2.0 (I expect the devs to move to 4.2.1, but I am just managing the server side)
[18:24:01] hamster88: for logoff button i have this " = link_to "Log Off", destroy_user_session_path, method: :delete, class: "btn btn-danger", type: "button""
[18:24:13] bricker: TommyTheKid: Does it take a long time even if you didn't make any changes to your assets?
[18:24:26] TommyTheKid: right,, it seems to actually hang "forever" today
[18:24:36] DoctorMonocular: has joined #RubyOnRails
[18:24:40] TommyTheKid: as in, the process isn't running on the server, but cap is still waiting?
[18:24:50] srinidhi: has joined #RubyOnRails
[18:25:01] jottr_: has joined #RubyOnRails
[18:25:19] bricker: hamster88: sounds like you don't have Rails UJS installed
[18:25:42] hamster88: rails ujs :/
[18:25:51] hamster88: bricker, how should i do that
[18:26:19] rkofman: has joined #RubyOnRails
[18:26:22] bricker: hamster88: read the instructions here: https://github.com/rails/jquery-ujs
[18:26:32] bricker: it should be included in your application.js by default, perhaps you removed it or something
[18:26:36] edwinvdgraaf: has joined #RubyOnRails
[18:26:44] bricker: it's what makes it possible to do POST/DELETE from "links"
[18:26:56] tbuehlmann: TommyTheKid, I'd try adding public/assets to the symlinked dirs
[18:27:36] hamster88: bricker, jquery-rails is already in my gems file.. as mentioned at that link
[18:27:50] bricker: hamster88: is jquery-ujs in your application.js ?
[18:28:08] bricker: TommyTheKid: could the SSH connection just be slow or timed out?
[18:28:31] choke: has joined #RubyOnRails
[18:28:38] momomomomo: has joined #RubyOnRails
[18:28:51] kaneda^: has joined #RubyOnRails
[18:28:59] tlarevo: has joined #RubyOnRails
[18:29:00] TommyTheKid: I think it is tbuehlmann ... I see that its not in the list, but it is indeed linked public/assets -> /web/railsapp/staging/shared/public/assets
[18:29:10] TommyTheKid: perhaps capistrano/rails/assets adds it?
[18:29:13] n0f3: has joined #RubyOnRails
[18:29:13] hamster88: bricker, https://gist.github.com/thedesignable/5dfaaf695be3a7e06d6d it has both gemfile and application.js have alook
[18:29:17] kaneda^: hey all, i'm having a really, really weird issue with passenger right now, where the rails log is telling me that it's redirected successfully, but passenger is hung, eating up memory, and eventually implodes (running out of memory)
[18:29:23] x1337807x: has joined #RubyOnRails
[18:29:46] lapide_viridi: has joined #RubyOnRails
[18:29:47] Malgorath: has joined #RubyOnRails
[18:29:48] kaneda^: has anyone seen anything like this before? forums / posts seem to indicate activerecord/actionpack as the suspect and passenger forking, but i haven't actually changed anything in code recently
[18:30:02] madebymarkca: has joined #RubyOnRails
[18:30:11] tbuehlmann: TommyTheKid, looks like it: https://github.com/capistrano/rails/blob/b5f41b6482a0f481077f351d058307b9b29c9fac/lib/capistrano/tasks/assets.rake#L113
[18:31:01] Papierkorb: I have a photo gallery, where the user can click on previous/next buttons. Upon click, I load the prev/next photo through JS. Now, I want to update the location (History) of the document. Do I need to do something special in regards to turbolinks?
[18:31:40] Aswebb_: has joined #RubyOnRails
[18:32:10] DoctorMonocular: has joined #RubyOnRails
[18:32:59] pixelhan_: has joined #RubyOnRails
[18:33:49] tbuehlmann: TommyTheKid, no idea then. slow server? :)
[18:33:55] TommyTheKid: ok, so, on a whim, I copied the "exact" (very verbose) command that capistrano is running, and its hanging
[18:34:02] annlewis: has joined #RubyOnRails
[18:34:14] TommyTheKid: but if I cd into the "current" directory and run rake assets:precompile it seems OK
[18:34:26] TommyTheKid: must be something screwed up on the initializer I changed :)
[18:34:27] baweaver: has joined #RubyOnRails
[18:34:47] TommyTheKid: does the app really have to startup to compile assets?
[18:34:58] edwinvdgraaf: has joined #RubyOnRails
[18:35:39] rkofman: has joined #RubyOnRails
[18:36:06] ekain: has joined #RubyOnRails
[18:36:10] TommyTheKid: HAHF ... OK so after I interrupted it, it showed me that it was in therubyracer ...
[18:36:30] allcentury: has joined #RubyOnRails
[18:36:34] TommyTheKid: which I removed from the gem file and the "super long" command took 0.9 seconds
[18:37:00] moretti: has joined #RubyOnRails
[18:37:05] TommyTheKid: I had v8 installed on the system, but apparently never removed that from the Gemfile?
[18:37:08] dseitz: has joined #RubyOnRails
[18:37:12] a346: has joined #RubyOnRails
[18:37:45] DoctorMonocular: has joined #RubyOnRails
[18:37:50] diegobiavati: has joined #RubyOnRails
[18:39:14] DoctorMonocular: has joined #RubyOnRails
[18:39:35] surrealanalysis: has joined #RubyOnRails
[18:39:59] givanse: has joined #RubyOnRails
[18:39:59] hazelux: has joined #RubyOnRails
[18:40:44] DoctorMonocular: has joined #RubyOnRails
[18:41:04] momomomomo: has joined #RubyOnRails
[18:42:02] soahccc: Any idea how to reproduce this error? I tried to send the data as latin-1 but I still can't provoke an error with this kind of input. The IP is chinese so I guess it's not only a weird encoding but also a malicious requests. Anyway, how can I handle this? We have like 9 thousand of these exceptions
[18:42:04] soahccc: https://gist.github.com/2called-chaos/75e241a4aced8373b0c5
[18:42:15] DoctorMonocular: has joined #RubyOnRails
[18:42:21] sarink: has joined #RubyOnRails
[18:42:29] TommyTheKid: sorry I meant "node" (nodejs) not v8
[18:42:40] jottr: has joined #RubyOnRails
[18:42:50] Altonymous: has joined #RubyOnRails
[18:44:15] Altonymous: Anyone know how I can serve a friendly error message when the database goes down? We are using postgresql
[18:44:19] jottr: has joined #RubyOnRails
[18:44:22] maz-dev: has joined #RubyOnRails
[18:44:55] centrx: Altonymous, You can catch an Exception in the controller and render a 404 page or whatever
[18:45:06] givanse_: has joined #RubyOnRails
[18:45:07] Altonymous: It???s failing before it gets to the controller
[18:45:10] centrx: Altonymous, You can put that in the Application Controller as a before_filter ?
[18:45:27] Altonymous: It???s not getting to the controller at all
[18:45:46] choke: has joined #RubyOnRails
[18:47:02] sdwrage: has joined #RubyOnRails
[18:47:31] centrx: You're a winner!
[18:47:47] centrx: Altonymous, Yeah where is it failing? Why is this happening?
[18:47:54] baweaver|work: It was trying to tell me I was banned for a bit.
[18:48:02] centrx: oh sorry you're right
[18:48:06] centrx: ACTION sets mode +b baweaver|work 
[18:48:21] baweaver|work: ACTION shrugs
[18:48:30] Altonymous: centrx: it???s failing in the postgresql_adapter.rb class on the connect method `@connection = PGconn.connect(@connection_parameters)`
[18:48:39] baweaver|work: Tried to hunt down where that happened, comcast has been flapping connections a lot over the last few days.
[18:48:52] commondream: has joined #RubyOnRails
[18:48:57] kaneda^: i think it could be related to our sessions...
[18:49:54] duderonomy: has joined #RubyOnRails
[18:50:47] tbuehlmann: Altonymous, is this happening in a middleware?
[18:51:14] Hates_: has joined #RubyOnRails
[18:51:29] Altonymous: tbuehlmann: yes it appears to be happening in the middleware. I???m trying to figure out the first place I can catch it right now
[18:51:32] joaomdmoura: has joined #RubyOnRails
[18:51:36] spyderman4g63: has joined #RubyOnRails
[18:51:53] Altonymous: Once I figure that out I won???t know what to do to handle it, but hopefully I???ll be able to work from there to figure it out
[18:52:19] sarink: has joined #RubyOnRails
[18:52:37] tbuehlmann: well, you could write a custom middleware that snaps in before the middleware that calls the db. not sure if you make it til the controller then, but at least you can return something custom
[18:52:53] disgrntld: hey gang, after I've rolled back from a migration, can I delete the migration and recreate it?
[18:52:57] DoctorMonocular: has joined #RubyOnRails
[18:53:14] arBmind: has joined #RubyOnRails
[18:53:14] edwinvdgraaf: has joined #RubyOnRails
[18:53:21] tbuehlmann: disgrntld, yup
[18:53:25] disgrntld: cool, thanks!
[18:54:14] commondream: has joined #RubyOnRails
[18:57:22] rubyonrailed: has joined #RubyOnRails
[18:57:35] nunayerBeezwax: has joined #RubyOnRails
[18:57:58] n008f4g_: has joined #RubyOnRails
[18:58:17] jenrzzz: has joined #RubyOnRails
[19:00:59] kadoppe: has joined #RubyOnRails
[19:01:36] codeurge: has joined #RubyOnRails
[19:03:06] edwinvdgraaf: has joined #RubyOnRails
[19:03:50] jfarmer: has joined #RubyOnRails
[19:04:10] Altonymous: tbuehlmann & centrx: For whatever reason this is one of the errors I???m getting from the middleware when the database is unreachable.. ???PG::Error - invalid encoding name: unicode:???
[19:04:43] duhhhsty: has joined #RubyOnRails
[19:04:49] Malgorath: machuga: I been installing RoR again ... think I'll give it another whirl :D
[19:04:52] Altonymous: Still haven???t figured out how to catch it in the middleware.. not something I???m used to doing.
[19:04:52] centrx: Altonymous, okay that sounds like not a temporary error to workaround, but a configuration/installation error that should be fixed
[19:05:08] Altonymous: I can start the DB back up and it goes away
[19:05:24] Altonymous: I am manually taking the DB offline after authenticating and verifying the request..
[19:05:30] podman: has joined #RubyOnRails
[19:05:33] Altonymous: I then shut down the DB and get that error
[19:05:46] rustymyers: has joined #RubyOnRails
[19:06:02] centrx: Altonymous, #postgresql might know better about this
[19:06:03] machuga: malgorath haha nice. cheers!
[19:06:26] Malgorath: machuga: I basically have to go through all the tuts again since its been 1.5 years since I last touched this.
[19:06:54] machuga: Most of it will be the same at least
[19:06:58] machuga: 3/4 are pretty close
[19:07:05] machuga: watch out for Spring though
[19:07:15] duderonomy: has joined #RubyOnRails
[19:07:20] Malgorath: machuga: its mostly ain't used it, wont remember much till I get the 'tingle' in my spidy sense again
[19:07:27] DoctorMonocular: has joined #RubyOnRails
[19:07:30] victortyau: has joined #RubyOnRails
[19:07:40] SalexW: has joined #RubyOnRails
[19:10:56] DoctorMonocular: has joined #RubyOnRails
[19:11:52] SegFaultAX: has joined #RubyOnRails
[19:12:49] skiz: has joined #RubyOnRails
[19:13:45] alexmr: has joined #RubyOnRails
[19:14:45] qejk: has joined #RubyOnRails
[19:15:53] pulgolino: has joined #RubyOnRails
[19:17:34] cryptocronus: has joined #RubyOnRails
[19:18:18] cryptocronus: Is there a way to get STI-like subclasses when the type is actually an id into a separate table?
[19:18:58] cryptocronus: so for example, you had Campaign and CampaignType models where most campaigns share the same functionality and data but are of different types specified by CampaignType?
[19:19:07] iamjarvo: has joined #RubyOnRails
[19:19:26] marr: has joined #RubyOnRails
[19:19:41] yaymukund: has joined #RubyOnRails
[19:19:52] edwinvdg_: has joined #RubyOnRails
[19:20:30] Lightsword: has joined #RubyOnRails
[19:23:18] cryptocronus: oh apparently it???s called Class Table Inheritance and not supported by AR?
[19:23:30] maz-dev: has joined #RubyOnRails
[19:23:55] Etriaph: has joined #RubyOnRails
[19:24:27] DoctorMonocular: has joined #RubyOnRails
[19:25:37] jfarmer: cryptocronus Correct,
[19:25:51] jfarmer: Re: class table inheritance and ActiveRecord's ability to support it out of the box
[19:26:05] jottr_: has joined #RubyOnRails
[19:26:15] jfarmer: It's sometimes also called multi-table inheritance
[19:26:23] choke: has joined #RubyOnRails
[19:27:04] cryptocronus: so is there a better way around having massive switch / if else in each method that needs custom functionality based on the type?
[19:27:06] runnyard: has joined #RubyOnRails
[19:27:21] DoctorMonocular: has joined #RubyOnRails
[19:27:21] Mession: has joined #RubyOnRails
[19:27:41] sandstrom: has joined #RubyOnRails
[19:27:47] tbuehlmann: Altonymous, sounds like an invalid encoding from config/database.yml
[19:27:59] jfarmer: cryptocronus Give a scenario
[19:28:11] Altonymous: tbuehlmann: it works fine when I bring the database online
[19:28:21] Altonymous: tbuehlmann: I am manually taking the db offline.
[19:28:22] commondream: has joined #RubyOnRails
[19:28:33] runnyard: Hello guys, good day... anyone familiar with this issue? https://github.com/rails/rails/issues/18660
[19:28:50] cryptocronus: so say each campaign has a starts_at attribute that gets set at creation.. and the calculation depends on what type of campaign it is
[19:29:14] towski__: has joined #RubyOnRails
[19:29:18] jfarmer: cryptocronus Each subclass has its own logic
[19:29:41] cryptocronus: right, that???s what I want but how do I define a subclass without STI
[19:29:44] blackmesa: has joined #RubyOnRails
[19:29:58] jfarmer: STI is out because the schema already exists?
[19:30:09] cryptocronus: well it doesn???t really fit
[19:30:20] cryptocronus: i also need to be able to maintain a list of available campaign types
[19:30:23] Scripore: has joined #RubyOnRails
[19:30:23] cryptocronus: to choose from
[19:30:29] cryptocronus: which is why that???s its own table
[19:30:35] cryptocronus: and each campaign belongs_to a campaign_type
[19:31:29] sarink_: has joined #RubyOnRails
[19:31:32] jfarmer: It's hard to say given how non-specific this info is, but if you control the schema (or are designing it afresh), why can't you use STI?
[19:32:31] cryptocronus: i can, say you are creating a new campaign and you want to pick what kind of campaign it is going to be, so I have a CampaignType collection for you to pick from
[19:32:35] jfarmer: Generally STI is "bad" when there's little mutual overlap between the attributes of each subtype. In that scenario, STI results in very sparse tables (i.e., tables where the values of most fields is NULL)
[19:32:39] cryptocronus: with STI I wouldn???t be able to popular such a list
[19:32:42] elia: has joined #RubyOnRails
[19:32:48] jfarmer: cryptocronus Why not? I don't follow.
[19:33:00] jfarmer: STI doesn't really have an impact on that one way or another.
[19:33:14] jfarmer: Are you saying you're imagining "populating the list of campaign types" by looking at the list of database tables?
[19:33:17] thebatu1: has joined #RubyOnRails
[19:33:42] jfarmer: If you're already doing that kind of introspection, why can't you look at the subclasses of the base class?
[19:34:52] towski_: has joined #RubyOnRails
[19:35:00] rushed: has joined #RubyOnRails
[19:35:07] jfarmer: Or something less dynamic, each subclass explicitly registers itself with the parent class
[19:35:21] jglover: has joined #RubyOnRails
[19:35:29] Lightsword: has joined #RubyOnRails
[19:36:06] diegoviola: has joined #RubyOnRails
[19:36:10] jglover: When we send emails out, we include a set of identical params in each link for tracking purposes. Is there some way I could define that once in the mailer, and then each link would automatically have those params?
[19:36:14] jfarmer: (explicitly registering would allow you to have subclasses which aren't exposed via the UI)
[19:36:21] jglover: oh, maybe write a new helper instead of using link_to?
[19:36:27] haz111: has joined #RubyOnRails
[19:36:29] x-light: has joined #RubyOnRails
[19:36:33] jfarmer: jglover http://en.wikipedia.org/wiki/Rubber_duck_debugging
[19:36:38] jfarmer: (Was about to suggest just that)
[19:36:48] jfarmer: Have a wrapper around link_to
[19:37:22] jglover: jfarmer: eh unforuntately the links are not all the same for each email
[19:37:32] jglover: so i'd need to define a new helper per email, thats not that nice
[19:37:43] jglover: i need my helper to hold some values across an entire email
[19:37:44] jfarmer: jglover What do you mean?
[19:38:02] jglover: lets say i made something called tracking_link_to
[19:38:11] jglover: i want to define the params once
[19:38:25] jglover: rather than have to keep passing in the params for every link
[19:38:38] jfarmer: If you want something stateful like that, well, that's why we have objects. :)
[19:38:46] jfarmer: Define a TrackingLink class or something
[19:38:54] jfarmer: TrackingLink.new(tracking_id)
[19:39:10] jfarmer: I'm sure link_to calls to_s
[19:39:15] jglover: hm, that's a cool idea.
[19:39:30] jfarmer: OOP! It's real! :D
[19:39:50] momomomomo_: has joined #RubyOnRails
[19:40:34] Coldblackice: has joined #RubyOnRails
[19:40:55] rubyonrailed: has joined #RubyOnRails
[19:41:17] Rubie: has joined #RubyOnRails
[19:41:32] commondream: has joined #RubyOnRails
[19:41:55] jfarmer: Define an instance method like tracking_link.url(path)
[19:41:58] xploshioon: has joined #RubyOnRails
[19:42:02] jfarmer: Or whatever you want the interface to be
[19:42:12] annlewis: has joined #RubyOnRails
[19:42:34] jfarmer: link_to(body, tracking_link.url(path))
[19:43:00] nfk|laptop: has joined #RubyOnRails
[19:43:02] jfarmer: It's clear what's happening in that code and it's clear to anyone familiar with Ruby that they should go look and see what tracking_link is all about.
[19:43:34] jfarmer: You can use the URI module or the Addressable gem (https://github.com/sporkmonger/addressable) to manipulate the query params.
[19:43:38] jfarmer: (in a generic way)
[19:44:26] jglover: sweet, im going to do that
[19:45:49] jfarmer: uri = Addressable::URI.parse("http://somesite.com/users/20"); uri.query_values.merge(:tracking_id => tracking_id)
[19:46:13] jfarmer: uri.to_s # => "http://somesite.com/users/20?tracking_id=abc123omgwtf"
[19:46:46] ramfjord: has joined #RubyOnRails
[19:47:13] atmosx: has joined #RubyOnRails
[19:47:15] xploshioon: hi guys, i am having a problem in my app i renamed the application.css to app.css.scss, added the "Rails.application.config.assets.precompile += %w( app.css.scss )" in the assets inicializer, but when i put the stylesheet link tag in my layout, it always add .css to the final of the url and the css dont work
[19:47:28] codepete: has joined #RubyOnRails
[19:47:34] xploshioon: in development i have no problem, but in production it don't load
[19:48:01] neanderslob: has joined #RubyOnRails
[19:48:29] jfarmer: I'm sure there's a way to make it work, but, honestly, application.css is meant to be a kind of manifest file and renaming it seems like a Very Bad Idea???.
[19:48:31] rushed: xploshioon: just app.css in the precompile, also maybe don't rename things for giggles?
[19:48:46] vedu: Hello. I want to make a rails app for my operations team to manage deliveries and delivery people
[19:49:06] ur5us: has joined #RubyOnRails
[19:49:25] rushed: vedu: step one, check to see if someone already did that :)
[19:49:29] xploshioon: @rushed, in that way works in development but not in production for some reason
[19:49:35] vedu: How should I go about it? any gems I could use. Cannot figure what to google
[19:49:51] xploshioon: I renamed it because was having conflicts with active admin css
[19:49:52] jfarmer: xploshioon He's saying don't include the ".scss"
[19:49:55] atmosx: Guys, would you add a university which you attended but dropped out in your CV? It's a totally different field which could add some variation, but I'm not sure if I should add this. I dropped out due to health issues (back in 2004).
[19:49:57] vedu: rushed: yeah I do that always :)
[19:50:00] jfarmer: xploshioon That seems like the real problem, then
[19:50:18] vedu: But 'ruby on rails delivery gem' is not giving proper results
[19:50:43] xploshioon: Rails.application.config.assets.precompile += %w( app.css )
[19:50:55] jfarmer: That really seems like the wrong solution to this problem.
[19:51:03] rushed: vedu: ............lol
[19:51:06] jfarmer: But syntactically, yes
[19:51:08] Rhadax: has joined #RubyOnRails
[19:51:20] iliketurtles: has joined #RubyOnRails
[19:51:40] vedu: rushed: :D can't understand what to google
[19:51:57] xploshioon: <%= stylesheet_link_tag "app" %>
[19:52:02] xploshioon: in my layout
[19:52:32] Zadrel: anyone can help me with will-paginate? my 2nd page link generates the queries to pull the rows from DB but it doesn't show in my view. it's outside and right after an .each loop
[19:53:54] pjammer: has joined #RubyOnRails
[19:54:01] symbol: has joined #RubyOnRails
[19:54:07] rkofman: has joined #RubyOnRails
[19:54:13] leeky: has joined #RubyOnRails
[19:54:57] xploshioon: for some reason in production the html looks like "<link rel="stylesheet" media="screen" href="/stylesheets/app.css" />"
[19:55:06] xploshioon: <%= stylesheet_link_tag "app" %>
[19:55:26] Etriaph: Zadrel: Post your code on https://gist.github.com/
[19:55:37] Etriaph: Models, views and controller
[19:55:56] Rhadax: has left #RubyOnRails: ()
[19:55:57] jaequery: has joined #RubyOnRails
[19:57:20] x1337807x: has joined #RubyOnRails
[19:57:20] Lightsword: has joined #RubyOnRails
[19:57:39] jfarmer: xploshioon That's what it should look like.
[19:57:52] baweaver|work: has joined #RubyOnRails
[19:57:53] jfarmer: What do you expect it to look like?
[19:57:58] workmad3: has joined #RubyOnRails
[19:58:31] simplyianm: has joined #RubyOnRails
[19:58:45] nonparfumee: has joined #RubyOnRails
[19:59:07] garrypolley: has joined #RubyOnRails
[19:59:49] yfeldblum: has joined #RubyOnRails
[20:00:14] xploshioon: well, it doesn't load the file
[20:00:30] asmodlol: has joined #RubyOnRails
[20:00:37] xploshioon: when i click in the link, it says The page you were looking for doesn't exist
[20:00:53] tjbiddle: has joined #RubyOnRails
[20:01:12] moeabdol1: has joined #RubyOnRails
[20:02:00] naftilos76: has joined #RubyOnRails
[20:03:16] Zadrel: Etriaph: https://gist.github.com/rmatuoka/156c17a8df5d10190555
[20:03:26] Zadrel: Etriaph: please tell me if there's something missing
[20:03:41] slash_nick: Any of you familiar with this rspec error? https://gist.github.com/rthbound/d381145ca743e7f192cf
[20:04:15] cleopatra: has joined #RubyOnRails
[20:04:47] leafac: has joined #RubyOnRails
[20:04:59] cleopatra: hello friends
[20:05:07] slash_nick: rspec fails to run with that output for one of our developers... https://gist.github.com/rthbound/d381145ca743e7f192cf
[20:06:46] towski__: has joined #RubyOnRails
[20:07:07] Etriaph: Zadrel: Nothing jumps out at me, you're implementing it properly as far as I can tell.
[20:07:47] baweaver|work: has joined #RubyOnRails
[20:07:54] Etriaph: Zadrel: I've never used will-paginate, but according to their docs you've implemented it properly.
[20:08:18] zorak8: has joined #RubyOnRails
[20:08:30] Etriaph: Zadrel: I used Kaminari and have never had an issue with it.
[20:08:32] Ratler_: has joined #RubyOnRails
[20:08:38] spectra-: has joined #RubyOnRails
[20:09:05] FLeiXiuS: has joined #RubyOnRails
[20:09:59] Zadrel: Etriaph: thx for your attention, you're awesome :)
[20:10:02] FLeiXiuS: I have a habtm SessionUsers and another model reports which belongs to sessions. How can I get the number of reports from each session grouped by the user?
[20:10:39] Ratler: has joined #RubyOnRails
[20:10:43] Etriaph: Zadrel: Try it out with Kaminari and if that ends up working as you desire, you're good to go.
[20:11:41] cryptocronus: jfarmer: with STI, since my type model is gone I essentially have to move what were column attributes to subclass methods, is that normal?
[20:12:11] jfarmer: cryptocronus This is more about how you're organizing your code, which is hard to say without having more context.
[20:12:18] jfarmer: What is an example?
[20:12:22] commondream: has joined #RubyOnRails
[20:12:47] ramfjord: has joined #RubyOnRails
[20:13:04] hazelux: has joined #RubyOnRails
[20:13:15] Frem: has joined #RubyOnRails
[20:13:17] cryptocronus: so before in my Campaign and CampaignType setup.. CampaignType had things like ???description???, ???avatar??? , and other attributes that are different for each type of campaign
[20:13:50] tvw: has joined #RubyOnRails
[20:13:52] cryptocronus: if I still want my users to be able to select from the different campaign types those attributes now need to be accessible on the campaign subclasses
[20:13:55] cryptocronus: so that I can show them in the ui
[20:14:15] IFrank00: has joined #RubyOnRails
[20:14:35] bendangelo: has joined #RubyOnRails
[20:15:09] simplyianm: has joined #RubyOnRails
[20:15:21] jfarmer: cryptocronus Why can't those just be fields on the campaigns table?
[20:15:38] jfarmer: Oh, I see, never mind.
[20:15:38] joaomdmoura: has joined #RubyOnRails
[20:15:44] cryptocronus: just seems redundant to save the same thing over and over again
[20:16:03] cryptocronus: and plus how would it get set, would have to be set from the subclass methods
[20:16:08] jfarmer: cryptocronus So, yes, one way is to define it in Ruby.
[20:16:20] cryptocronus: yeah that was my gut reaction, but still feels a bit janky
[20:16:23] jfarmer: Alternatively, you could keep a separate table
[20:16:28] cryptocronus: which is what I had :(
[20:16:33] jfarmer: well hold on
[20:17:06] jfarmer: that contains _only_ the class-level attributes for each type
[20:17:29] jfarmer: the primary key would be the name of the class (which is what AR uses as the field value in STI)
[20:17:32] g0rx: is there any coder ?
[20:17:33] allcentury: has joined #RubyOnRails
[20:17:38] jfarmer: which admittedly is a little unorthodox
[20:18:04] x-light: has joined #RubyOnRails
[20:18:26] cryptocronus: so it???s what I had but instead of campaign_type_id in campaign it was still just type as a foreign key
[20:18:32] cryptocronus: and it???d act as both
[20:18:51] cryptocronus: this just seems like a common pattern, not sure why it feels so weird to do
[20:19:03] cryptocronus: i have 3 examples of it in my project so far
[20:19:50] IFrank00: has left #RubyOnRails: ()
[20:19:54] IFrank00: has joined #RubyOnRails
[20:19:55] jfarmer: Well, hold on, even in the MTI model you would have this issue
[20:20:00] jfarmer: because you're talking about class-level data
[20:20:16] jfarmer: if you want that in a relational database there has to be a table where each row corresponds to a class
[20:20:25] ratmav: has joined #RubyOnRails
[20:20:34] jfarmer: MTI means "one table per subtype"
[20:21:01] jfarmer: STI means "one table for all instances with a field to distinguish between subtypes"
[20:21:13] cryptocronus: yeah its much closer to STI
[20:21:16] jfarmer: Neither has a "solution" for storing class-level data
[20:21:26] cryptocronus: other than these few attributes the functionality is nearly identical across types
[20:21:54] Radar: GOOD MORNING!
[20:22:09] spyderman4g63: has joined #RubyOnRails
[20:22:26] diggitydane: has joined #RubyOnRails
[20:22:29] ratmav: what does sidekiq give me over using the Thread class?
[20:22:34] ratmav: syntactic sugar?
[20:23:05] garrypolley: has joined #RubyOnRails
[20:23:06] nonparfumee: has joined #RubyOnRails
[20:23:14] weldon: has joined #RubyOnRails
[20:23:22] asmodlol: has joined #RubyOnRails
[20:23:34] ratmav: cryptocronus, diegoviola: ok, so it saves me the time of having to implement that myself
[20:23:48] ratmav: and it uses redis to provide scheduling, queue, etc.
[20:23:54] ratmav: that sounds worthwhile
[20:23:58] IFrank00: LLevo varios dias tratando de resolver varios errores y vulnerabilidades del sistema. Busque varia informaci?n sobre como trabajar el asunto de filtrar los regirtros de un hijo de un padre. Mi routes de padre a hijo estan de la siguente manera
[20:24:04] centrx: ratmav, yeah you can also use delayed_job, resque, etc.
[20:24:04] IFrank00: resources :projects, shallow: true do resources :employees do end end
[20:24:17] ratmav: new question: does redis use all avaiable memory, similar to mongo?
[20:24:28] ratmav: or should i go ask in #redis, or whatever the channel for it is?
[20:24:43] IFrank00: ops sorry I took several days trying to resolve several errors and system vulnerabilities. Look various information on how to work the issue of filtering regirtros a child of a parent. My routes from father to son are as follows
[20:24:49] Zadrel: Etriaph: still there? kaminari outputs me the same thing: nothing in 2nd page T-T/
[20:24:57] ratmav: nm, heading to #redis
[20:25:00] ratmav: thanks for the info!
[20:25:01] Zadrel: Etriaph: can't figure out where my mistake is
[20:25:52] Etriaph: Zadrel: Does the method all_active return the correct results in a rails console?
[20:26:10] FLeiXiuS: I have a habtm SessionsUsers and another model reports which belongs to sessions. How can I get the number of reports from each session grouped by the user?
[20:26:19] djbkd: has joined #RubyOnRails
[20:26:23] ldnunes: has joined #RubyOnRails
[20:26:36] Etriaph: Zadrel: Gist that model method if you can.
[20:26:57] IFrank00: as I'm using shallow resources on my show action I dont have de parent ID. I'm trying to find a way to do this on the show action @project.employee.find(id)
[20:28:12] cleopatra: any idea how to use rails helper methods in js.erb file?
[20:28:28] jfarmer: cleopatra You almost never want to do that.
[20:28:47] jfarmer: In fact, I can't think of a situation where that's a good idea.
[20:29:12] jfarmer: What's happening in your code that's nudging you in that direction?
[20:29:13] mbug: has joined #RubyOnRails
[20:29:19] Zadrel: Etriaph: gist updated with the method and the console log with the 7 remaining queries
[20:29:38] momomomomo: has joined #RubyOnRails
[20:30:00] cleopatra: jfarmer, i see
[20:30:41] x1337807x: has joined #RubyOnRails
[20:31:11] cleopatra: jfarmer, I want to make a client-side validation
[20:32:10] cleopatra: I create a helper method for that
[20:32:39] atmosx: has joined #RubyOnRails
[20:32:47] Ziioynx: has joined #RubyOnRails
[20:33:49] pharserror: has joined #RubyOnRails
[20:33:50] ivanskie: has joined #RubyOnRails
[20:34:03] Ziioynx: Any idea why variable scopes would work differently in development versus production?
[20:34:40] centrx: Ziioynx, maybe class caching?
[20:35:22] Ziioynx: hmm, not sure where i would start chasing that down.
[20:35:34] dopie: has joined #RubyOnRails
[20:35:51] Etriaph: Zadrel: The only thing I can suggest is spit out an inspection of @products; @products.inspect
[20:36:02] Etriaph: Zadrel: See what the contents of the object are.
[20:36:21] Ziioynx: centrx: I am going to turn it off and try again.
[20:37:43] roolo: has joined #RubyOnRails
[20:40:17] rubyonrailed: has joined #RubyOnRails
[20:41:46] choke: has joined #RubyOnRails
[20:42:44] umgrosscol: has joined #RubyOnRails
[20:42:52] iamjarvo: has joined #RubyOnRails
[20:42:53] codepete: stupid question. I need to append a hashtag when something hits my controller. such that the url is blah.com/path#blah
[20:42:56] codepete: Is this possible
[20:42:59] diggitydane: I have a parent/child, but when I delete the child, the parent.child_id is not set to null. I've tried dependent: :destroy. what am I missing?
[20:43:09] jfarmer: cleopatra What do you mean?
[20:43:13] codepete: i call a render before the end of my controller
[20:43:13] pharserror: has left #RubyOnRails: ()
[20:43:16] jfarmer: I mean, I get what a client-side validation is
[20:43:17] Anakat: has joined #RubyOnRails
[20:43:29] jfarmer: I don't get why that leads to you feeling the need to use view helpers in a .js.erb file
[20:44:11] jfarmer: cleopatra Ultimately, people feel the need to do what you're doing because there's some request-specific / server-side data that you want your JavaScript to have access to.
[20:44:15] jfarmer: For whatever reason
[20:44:30] jfarmer: cleopatra A better alternative is to embed that data outside of the functional logic of your JavaScript
[20:45:10] jfarmer: The two most common ways are to dynamically generate some kind of configuration object in a HTML (inside a <script>...</script>) tag and pass that into your JS.
[20:45:57] jfarmer: Or to embed the info in the DOM via attributes on HTML tags (the data-* attributes in HTML5 make this easy to do without adding a bazillion new CSS classes or whatever)
[20:46:08] sandstrom: has joined #RubyOnRails
[20:47:03] Ratler: has joined #RubyOnRails
[20:48:33] pharserror: has joined #RubyOnRails
[20:48:42] pharserror: has left #RubyOnRails: ()
[20:48:46] Sylario: has joined #RubyOnRails
[20:49:05] pharserror: has joined #RubyOnRails
[20:49:33] Sigma00: you're a pharse
[20:50:38] cleopatra: jfarmer, I found a solution
[20:52:00] x1337807x: has joined #RubyOnRails
[20:52:08] sleungcy: has joined #RubyOnRails
[20:52:20] jfarmer: cleopatra It's possible to do what you want, but it's a bad idea to do it. I'll leave it at that. :)
[20:52:41] leafac: has joined #RubyOnRails
[20:54:46] choke: has joined #RubyOnRails
[20:55:21] chouhoulis: has joined #RubyOnRails
[20:55:34] baweaver|work: has joined #RubyOnRails
[20:59:38] hnanon: Does the following SQL compare the phone id and names in the dealer commissions table with the same in the carrier commissions table and if the pair doesn't exist there, returns those records?
[20:59:40] hnanon: https://gist.github.com/anonymous/cfcaf3ad0f4f27f0d4ff
[21:00:44] leeky: has joined #RubyOnRails
[21:00:52] annlewis: has joined #RubyOnRails
[21:02:04] baweaver|work: has joined #RubyOnRails
[21:04:10] baweaver|work: has joined #RubyOnRails
[21:04:33] Zadrel: has joined #RubyOnRails
[21:04:43] bluish: has joined #RubyOnRails
[21:05:25] DLSteve: has joined #RubyOnRails
[21:05:26] Zadrel: Etriaph: hello, my internet went down for a while
[21:05:33] BlissOfBeing: has joined #RubyOnRails
[21:05:40] Etriaph: Zadrel: Ah
[21:05:50] Zadrel: Etriaph: found the issue, my HAML code is fallin' in the elses
[21:05:58] Etriaph: Zadrel: Oh, lol
[21:06:57] edwinrozario: has joined #RubyOnRails
[21:06:59] scottmatheina: has joined #RubyOnRails
[21:08:30] SalexW: has joined #RubyOnRails
[21:08:41] volkk: has joined #RubyOnRails
[21:09:16] rubyonrailed: has joined #RubyOnRails
[21:10:29] IrishGringo: has joined #RubyOnRails
[21:10:33] diggitydane: has left #RubyOnRails: ("Leaving")
[21:12:16] momomomomo_: has joined #RubyOnRails
[21:13:26] pixelhandler: has joined #RubyOnRails
[21:13:59] hnanon: I get this error: SQLite3::SQLException: near "as": syntax error: SELECT "dealer_commissions".* FROM "dealer_commissions" LEFT OUTER JOIN ...
[21:14:24] hnanon: when I do...
[21:14:40] hnanon: dealer_commissions.unpaid.each do |unpaid|
[21:14:46] hnanon: unpaid.update(status: "Unpaid")
[21:15:07] sdwrage: has joined #RubyOnRails
[21:15:44] Etriaph: hnanon: LEFT OUTER JOIN as CarrierCommission
[21:15:56] TommyTheKid: if "any" asset changes, does precompile re-compile ALL assets? It seems like a change to one file causes a *lot* of work :)
[21:17:49] hnanon: Etriaph: That's what I have, I think.
[21:18:08] Etriaph: hnanon: I know, your syntax is incorrect.
[21:19:00] weaksauce: hnanon as indicates a table alias.
[21:19:41] Etriaph: LEFT OUTER JOIN table1 on table 2 where <conditions>
[21:19:41] Etriaph: s/table 2/table2
[21:21:32] atmosx: has joined #RubyOnRails
[21:21:53] dopie: has joined #RubyOnRails
[21:22:10] thebatu1: has joined #RubyOnRails
[21:22:41] hnanon: I see...let me try that.
[21:23:12] coffeeju1: has joined #RubyOnRails
[21:24:10] hnanon: SQLite3::SQLException: no such table: CarrierCommission
[21:24:19] hnanon: I'm working from the DealerCommissions model.
[21:25:43] weaksauce: table names are plural
[21:26:07] jenrzzz: has joined #RubyOnRails
[21:27:31] cryptocronus: struggling with a pattern I run into often. Say I have a model Campaign and it has a boolean attribute `active` defaulted to false. There???s an `activate` button a user can click which updates `active` attribute to true. I want to trigger the `activate` method on the model when the attribute is set to true. I normally solve this by adding an after_update callback and check if active_is_changed? and active is true. Is that okay? Is there a
[21:27:32] cryptocronus: better approach?
[21:28:56] ur5us: has joined #RubyOnRails
[21:29:11] dopie: has joined #RubyOnRails
[21:29:17] victorkohl: has joined #RubyOnRails
[21:29:45] hnanon: Etriaph, weaksauce: Thank you. It worked.
[21:29:49] bruno-: has joined #RubyOnRails
[21:30:10] mike___1234: has joined #RubyOnRails
[21:30:13] Zadrel: Etriaph: solved the error, i was stubborn and treated everything in the view, therefore my controller, when called again by page 2, wasn't bringing what i needed;
[21:30:27] Etriaph: Zadrel: Good to hear.
[21:30:56] Zadrel: Etriaph: ty for your effort to help me, really, may Odin bless you
[21:31:14] hazelux: has joined #RubyOnRails
[21:31:24] Etriaph: Zadrel: May Odin give me unlimited cups of coffee. :D
[21:31:47] maz-dev: has joined #RubyOnRails
[21:31:51] Zadrel: Etriaph: it's more liekly he give you unlimited ale lol
[21:31:51] zorak8: has joined #RubyOnRails
[21:31:55] porkqpain: has joined #RubyOnRails
[21:33:55] chouhoulis: has joined #RubyOnRails
[21:34:09] doublemalt_: has joined #RubyOnRails
[21:34:26] BlissOfBeing: has joined #RubyOnRails
[21:34:32] jenrzzz_: has joined #RubyOnRails
[21:35:16] joaomdmoura: has joined #RubyOnRails
[21:35:56] dopieee: has joined #RubyOnRails
[21:36:03] choke: has joined #RubyOnRails
[21:37:39] benlieb: what's the highest level Exception that is reasonable to rescue_from?
[21:38:17] edwinrozario: has joined #RubyOnRails
[21:38:25] benlieb: I was using RuntimeError as a catch-all, but today I saw that an accidental JSON parse error didn't get caught here?
[21:39:31] Trynemjoel: has joined #RubyOnRails
[21:40:01] momomomomo_: has joined #RubyOnRails
[21:47:59] blackmesa: has joined #RubyOnRails
[21:48:59] IFrank00: I got User, Project and Employee. how can I access projects.employees which he owns with cancan
[21:49:21] bricker: benlieb: StandardError unless you intend to do signal handling via exceptions
[21:49:37] jenrzzz: has joined #RubyOnRails
[21:50:41] x1337807x: has joined #RubyOnRails
[21:50:51] wethu: has joined #RubyOnRails
[21:51:09] bricker: benlieb: best to just do StandardError as a catch-all if you must
[21:51:29] x1337807x: has joined #RubyOnRails
[21:52:08] Zadrel: hello there! here i am again, i have a 1-to-n relationship and i need to check id 1.id is in n.any_column, anyone knows how?
[21:52:36] Spami: has joined #RubyOnRails
[21:52:41] Zadrel: *in rails
[21:54:22] meoblast001: has joined #RubyOnRails
[21:54:29] nettoweb: has joined #RubyOnRails
[21:54:31] rhizome: "any column?"
[21:57:29] meoblast001: has joined #RubyOnRails
[21:58:25] Anakat: has joined #RubyOnRails
[21:59:26] Pumukel: has joined #RubyOnRails
[22:00:04] workmad3: has joined #RubyOnRails
[22:00:17] zzing: has joined #RubyOnRails
[22:00:33] bricker: rhizome: it's like the "any key" on your computer
[22:00:48] ramfjord: has joined #RubyOnRails
[22:01:11] dici: has left #RubyOnRails: ()
[22:03:26] spyderman4g63: has joined #RubyOnRails
[22:03:35] gambl0re: has joined #RubyOnRails
[22:04:37] Altonymous: has joined #RubyOnRails
[22:05:08] moretti: has joined #RubyOnRails
[22:08:01] blackmesa: has joined #RubyOnRails
[22:09:32] duderonomy: has joined #RubyOnRails
[22:13:15] crevax: has joined #RubyOnRails
[22:13:15] sarink: has joined #RubyOnRails
[22:13:46] hnanon: I have: .where('carrier_commissions.id IS NULL')
[22:14:01] Anakat_: has joined #RubyOnRails
[22:14:05] hnanon: Can I simply say .where('carrier_commissions.id IS NULL OR 0')
[22:14:18] hnanon: If I want to include 0 as part of the condition?
[22:16:03] weaksauce: hnanon no, but you can add another full condition to it
[22:16:25] FernandoBasso: has joined #RubyOnRails
[22:17:39] baweaver|work: has joined #RubyOnRails
[22:20:36] yaymukund: has joined #RubyOnRails
[22:20:42] tjbiddle: has joined #RubyOnRails
[22:20:55] Scripore: has joined #RubyOnRails
[22:27:47] borodin: has joined #RubyOnRails
[22:28:04] ramfjord: has joined #RubyOnRails
[22:28:29] fgo: has joined #RubyOnRails
[22:29:12] joaomdmoura: has joined #RubyOnRails
[22:29:23] m0r0n: has joined #RubyOnRails
[22:30:04] borodin: anybody know why @svn_repo_engine = SvnRepoEngine.new gives uninitialized constant EscrowSessionsController::SvnRepoEngine when app/services/svn_repo_engine.rb defines class SvnRepoEngine
[22:30:15] borodin: it worked fine in Rails 3, but in rails 4, no go
[22:30:23] baweaver|work: has joined #RubyOnRails
[22:30:29] borodin: as if app/services is not seen by rails unless I add it somewhere?
[22:30:39] rhizome: do we already know what all of that is referring to?
[22:30:57] pjammer: has joined #RubyOnRails
[22:31:00] borodin: it's only about rails visibilty to a service layer class
[22:31:03] jfarmer: has joined #RubyOnRails
[22:31:35] rhizome: what is EscrowEtc in relation to that?
[22:32:16] borodin: EscrowSessionsController is a controller in app/controllers
[22:32:43] borodin: does rails require that I put the service layer in app/models/concerns?
[22:33:00] rhizome: no, it should autoload everything under app
[22:33:49] moretti: has joined #RubyOnRails
[22:34:07] borodin: ok spelling or something - thanks rhizome!
[22:35:44] rhizome: hard to say
[22:37:15] Iacobus: has joined #RubyOnRails
[22:39:46] dopieee: has joined #RubyOnRails
[22:39:56] blackhuey: has joined #RubyOnRails
[22:40:45] sandstrom: has joined #RubyOnRails
[22:42:08] culturelabs: has joined #RubyOnRails
[22:42:31] codeurge: has joined #RubyOnRails
[22:42:37] borodin: rhizome: the issue was, after you add files in app/services, you gotta restart rails. durrrr I'm dumb today
[22:42:58] Rager: long shot: I'm getting errors like "uninitialized constant User::user" all over my app, and I'm not sure what the error even means
[22:43:21] Rager: there are exactly 0 uses of the actual string of characters "User::user" in my app
[22:43:22] bricker: Rager: show the full stack trace please
[22:43:32] nixter1029: has joined #RubyOnRails
[22:43:44] Rager: http://hastebin.com/ocamigageh.vbshttp://hastebin.com/ocamigageh.vbs
[22:43:47] Rager: http://hastebin.com/ocamigageh.vbs
[22:43:50] ebryn: has joined #RubyOnRails
[22:43:58] DukeDave: has joined #RubyOnRails
[22:44:00] chouhoul_: has joined #RubyOnRails
[22:44:23] bricker: Rager: it looks like User::user is in your database somewhere in a "type" column
[22:44:47] bricker: Rager: ActiveRecord is pulling the record and trying to cast to "User::user" class, which of course doesn't exist
[22:44:51] cryptocronus: has joined #RubyOnRails
[22:45:07] amitchellbullard: has joined #RubyOnRails
[22:45:08] Rager: the class they *should* be is User
[22:45:09] rakm: has joined #RubyOnRails
[22:45:42] maz-dev: has joined #RubyOnRails
[22:45:43] devdazed: has joined #RubyOnRails
[22:46:26] balr0g: has joined #RubyOnRails
[22:47:56] kaneda^: hey all, has anyone encountered an issue with rails in which a request is said to have redirected (i see 302 redirect complete in the logs) but it hangs, eating up memory, until it eventually throws up with out of memory?
[22:48:52] arBmind: has joined #RubyOnRails
[22:48:55] Rager: I'll look for type fields
[22:49:55] Rager: bricker: how about improper association declarations?
[22:50:08] rickmasta: has joined #RubyOnRails
[22:50:26] chancancode: has joined #RubyOnRails
[22:50:36] pedrosnk: has joined #RubyOnRails
[22:50:50] kaneda^: i have this feeling like it's related to improper redirects or something, but i'm short on ideas after many hours of trying different approaches to discover the root issue
[22:50:57] bricker: Rager: could be
[22:51:33] bricker: kaneda^: infinite redirect?
[22:51:46] mary5030: has joined #RubyOnRails
[22:52:12] kaneda^: bricker: it certainly seems that way, since the stack traces i CAN get seem to indicate a loop, often coming from actionpack or activerecord
[22:52:22] kaneda^: but i cant highlight anything in my code
[22:52:23] Rager: bricker: I think that's what ended up being it
[22:52:31] nonparfumee: has joined #RubyOnRails
[22:52:40] jpstokes: has joined #RubyOnRails
[22:52:53] jpstokes: I've been asked to do the following for a test: The app should scale to support high traffic (assume thousands of concurrent GET and POST requests)
[22:52:53] kaneda^: i've never encountered anything like this
[22:53:00] jpstokes: How do I meet this requirement
[22:53:17] jpstokes: I haven't worked on large apps so my knowledge is limited when it comes to scability
[22:53:38] kaneda^: bricker: i'm working in someone else's code base and i've done extensive research through it to see if maybe it's session or route related, and i can find nothing that would indicate this
[22:53:39] commondream: has joined #RubyOnRails
[22:53:42] Scriptonaut: has joined #RubyOnRails
[22:54:30] kaneda^: the weirdest thing is that my code finishes running, completely
[22:54:49] kaneda^: i can verify this because the last thing my code does is push another user into the session, which is done once it bombs out due to the memory issue
[22:55:00] weaksauce: Rager can you gist the spec?
[22:55:15] Rager: it wasn't so much the spec that was wrong
[22:55:29] weaksauce: I just saw that you fixed it
[22:55:31] Rager: I had been refactoring out hash rockets for aesthetic reasons
[22:55:43] Rager: I had an association with `class_name => "User"`
[22:55:51] Rager: and I'd changed it to `class_name: :user`
[22:55:53] Rager: this was not good
[22:55:58] Rager: has to be capitalized
[22:56:11] Rager: just went with User.name, in the end
[22:57:28] jlpeters: has joined #RubyOnRails
[22:57:37] kumavis: has joined #RubyOnRails
[22:58:47] zrl: has joined #RubyOnRails
[22:58:52] Anakat: has joined #RubyOnRails
[22:59:57] _seanc_: has joined #RubyOnRails
[23:00:03] Guest12375: has joined #RubyOnRails
[23:00:15] g0rx: is there any coder ?
[23:00:22] mary5030: has joined #RubyOnRails
[23:00:58] shwoodard: has joined #RubyOnRails
[23:01:12] baweaver|work: has joined #RubyOnRails
[23:01:41] spastorino: has joined #RubyOnRails
[23:02:28] d5sx43: has joined #RubyOnRails
[23:03:49] Hosh: has joined #RubyOnRails
[23:04:10] eddie_v8: hi.. im having a hard time trying to get this warning out. I alredy update my rubygems. Warning: You're using Rubygems 2.0.14 with Spring.
[23:04:33] DoctorMonocular: has joined #RubyOnRails
[23:04:54] SalexW: has joined #RubyOnRails
[23:05:49] one_zero: has joined #RubyOnRails
[23:06:52] bricker: jpstokes: lots of ways
[23:06:56] nomadicoder: has joined #RubyOnRails
[23:06:59] bricker: jpstokes: use a good threaded web server
[23:07:12] bricker: jpstokes: don't perform long-running operations on the main thread
[23:07:21] jpstokes: ok...well, for my assign I've built a basic web api using rails
[23:07:35] jpstokes: assign = assignment
[23:07:52] jpstokes: I think they want to know what can I do in my application to scale things
[23:08:34] kaneda^: so in short, my application continues to eat memory, crap itself, despite finishing my code successfully and supposedly redirecting appropriately
[23:08:38] kaneda^: any ideas why this might happen?
[23:08:39] bricker: jpstokes: scaling means preventing race conditions and collisions as well, so being sure to synchronize any shared resource like your database or cache
[23:08:48] kaneda^: any ideas how i could track down where this is happening?
[23:09:06] Ropeney: has joined #RubyOnRails
[23:09:08] eddie_v8: any idea how to fix that?
[23:09:33] bricker: jpstokes: keep indexes in your database for faster lookups, use cache for even faster lookups. Keep your queries simple; denormalize when possible
[23:10:14] markalanevans: has joined #RubyOnRails
[23:10:20] mark[oz]: has joined #RubyOnRails
[23:10:31] jpstokes: hmmm...so I'm looking up my queries based on the name of the user so I'll definitely put an index on that
[23:10:38] jfarmer: jpstokes That specification ("The app should scale to support high traffic") is almost meaningless
[23:10:42] jmif: has joined #RubyOnRails
[23:11:02] thebatu1: has joined #RubyOnRails
[23:11:03] bricker: jpstokes: also use your database's EXPLAIN function to see which index is actually getting used, so you're sure your indexes are effective
[23:11:10] jfarmer: All of this is premature.
[23:11:21] jfarmer: jpstokes You need to find a way to simulate the conditions specified
[23:11:29] bricker: jfarmer: ab
[23:11:30] ivanskie: k im not getting anywhere in the #emberjs channel... so i have my rails app with carrier wave to handle files and images.. lets say to start with.. i just want to figure out the images part.. this is going to be easier: https://gist.github.com/i5okie/bb543b56fb26a1751374 so rails spits out item object.. and then spits out the image object.. in rails.. image isn't another model actually.. and I can't figure out how to get that out for ember
[23:11:37] jfarmer: bricker I know the tools.
[23:11:47] bricker: jfarmer: okay so we found the way
[23:11:52] bricker: *high five*
[23:12:11] jpstokes: hmmm...well I'm a novice at this stuff but so far I think indexing is the way to go
[23:12:19] jfarmer: I'm saying before he runs off and starts flipping switches, he needs to be able to test the consequences of flipping those switches
[23:12:26] krz: has joined #RubyOnRails
[23:12:32] jfarmer: bricker See? You just convinced him the answer is "database indexes."
[23:12:35] jfarmer: Good job. *high five*
[23:12:41] jpstokes: I read something about caching and using backend jobs...is that something I would do for a simple rest api
[23:12:42] bricker: jfarmer: indeed, maybe his app can already handle thousands of concurrent requests without any additional work
[23:13:17] jfarmer: Or maybe the database isn't the bottleneck. Or maybe...a million other things.
[23:13:27] ivanskie: so anyone have experience with rails api with embedded objects.. and an ember client?
[23:13:59] ProLoser: has joined #RubyOnRails
[23:14:01] ivanskie: im not building a rails api just for the api.. i already have the full app. im just trying to get some side functionality.. with ember
[23:14:03] bricker: jpstokes: caching is always useful, background jobs are useful if you need to perform a long-running operation
[23:14:11] jfarmer: jpstokes First thing's first, be able to (1) simulate the traffic patterns and (2) measure your application's performance at a level fine-grained enough to isolate where the time is being spent.
[23:14:11] darrencauthon: has joined #RubyOnRails
[23:14:15] jpstokes: jfarmer: this is just a test assignment...I'm using postgres right now just trying to come up with ways to make it faster
[23:14:25] ProLoser: how do i do wildcard route definitions?
[23:14:30] ProLoser: can i just do 'whatever/*'?
[23:14:42] jfarmer: jpstokes Do you have an actual application, or is it purely hypothetical?
[23:14:59] bricker: ProLoser: http://guides.rubyonrails.org/routing.html#route-globbing-and-wildcard-segments
[23:15:08] jfarmer: Like, "Imagine an application that does XYZ. How could you make it handle thousands of concurrent GET and POST requests?"
[23:15:10] ProLoser: all of them do *pages
[23:15:12] ProLoser: or something
[23:15:18] jpstokes: I do have an application but they are just using this assignment so they can measure my coding level
[23:15:21] ProLoser: i don't care what comes after a path or how deep it is
[23:15:25] ProLoser: it's a client-side app i want to server
[23:15:28] jpstokes: and see whether or not i follow best practices
[23:15:38] jfarmer: jpstokes What I'm describing is a best practice.
[23:15:45] bricker: ProLoser: http://guides.rubyonrails.org/routing.html#route-globbing-and-wildcard-segments
[23:15:55] spastorino: has joined #RubyOnRails
[23:15:59] jpstokes: cool...I'm listening
[23:16:11] jfarmer: I would slap the wrist of anyone working for me who went about optimizing performance without first having the tools in place to measure the impact of their changes.
[23:16:22] mpowers: has joined #RubyOnRails
[23:16:26] jpstokes: ok...caching for api...how???
[23:16:31] ProLoser: do i HAVE to have a word after the star?
[23:16:46] jpstokes: jfarmer: makes sense
[23:16:55] jfarmer: jpstokes What is this a test for? School? A job application?
[23:16:59] bricker: ProLoser: yes... be careful not to strain your wrist while you're typing it
[23:17:43] jfarmer: jpstokes I've interviewed hundreds of developers and managed teams of a few dozen.
[23:18:07] jfarmer: So, I have _some_ insight into the kinds of things they'd be looking for.
[23:18:24] ProLoser: can i make route params optional?
[23:18:28] ProLoser: or do i have to define 2 routes?
[23:18:50] goodcodeguy: has joined #RubyOnRails
[23:18:58] jpstokes: well I'm pushing my code once I finish it to github but I don't think they'll be able to see any "tools" but I do hear you on that...what your saying makes sense
[23:19:01] jfarmer: jpstokes I can also guarantee that if you submit your application w/ an actual performance TEST HARNESS (even if it is simple) they'll be blown away
[23:19:05] rkofman: has joined #RubyOnRails
[23:19:14] TheNet: has joined #RubyOnRails
[23:19:19] jfarmer: That's the kind of 1-in-a-1000 thing you look for an interviewee to do.
[23:19:40] TheNet: anyone know if the phone_number gem works in rails 4? https://github.com/midas/phone_number
[23:20:01] jfarmer: the tool bricker was suggesting was Apache Bench (aka "ab"): http://en.wikipedia.org/wiki/ApacheBench
[23:20:33] jfarmer: bricker Load your database up with 100,000 rows of dummy data
[23:20:35] bricker: ProLoser: you can have optional parameters by wrapping the optional param in parentheses
[23:20:42] jfarmer: Set ab off to hit the homepage 1000 times
[23:20:46] jfarmer: See where the bottlenecks are
[23:21:11] Olipro: has joined #RubyOnRails
[23:21:31] jpstokes: cool...I'm on it
[23:21:36] mpowers: have a bit of an odd question for you guys. I'm running some background workers using Resque. I want some of my workers to do work without maintaining a connection to my database. I can do ActiveRecord::Base.connection.disconnect! At the start of a job, but if anything uses activerecord later, it will "helpfully" establish a connection automatically. Is there a way to actually forbid ActiveRecord from connectin
[23:21:36] mpowers: g at all, to raise an exception if anything tries?
[23:23:07] mpowers: I;ve googled around for this but the only thing that seems to apply is this monkey patch, which is a bit of a last resort https://gist.github.com/jrochkind/59b6330e3f52710cc49e
[23:24:41] annlewis: has joined #RubyOnRails
[23:24:51] kaneda^: bricker: any ideas?
[23:25:05] leafac: has joined #RubyOnRails
[23:25:18] Anakat_: has joined #RubyOnRails
[23:25:32] x1337807x: has joined #RubyOnRails
[23:26:29] chouhoulis: has joined #RubyOnRails
[23:26:42] kaneda^: i have a full stack trace if that's helpful, but it isn't to me
[23:26:57] kaneda^: "[BUG] object allocation during garbage collection phase"
[23:27:04] kaneda^: in ruby-prof
[23:27:06] iliketurtles: has joined #RubyOnRails
[23:27:21] kaneda^: but i believe this to be a red herring, something happening as a result of some kind of infinite loop
[23:27:34] j_mcnally: has joined #RubyOnRails
[23:28:23] j_mcnally: has joined #RubyOnRails
[23:31:21] fgo: has joined #RubyOnRails
[23:31:50] Obfuscate: How can I generate the authenticity_token used when creating forms, without using form_for?
[23:32:41] kaneda^: Obfuscate: <%= tag(:input, :type => "hidden", :name => request_forgery_protection_token.to_s, :value => form_authenticity_token) %>
[23:33:21] Obfuscate: That looks perfect: testing...
[23:34:03] pharserror: Obfuscate, = content_tag(:input, type: 'hidden', name: request_forgery_protection_token.to_s, value: form_authenticity_token)
[23:34:37] pharserror: forgot the content, = content_tag(:input, '', type: 'hidden', name: request_forgery_protection_token.to_s, value: form_authenticity_token)
[23:35:19] Obfuscate: Yeah, content_tag seems to be the right one.
[23:35:21] RegulationD: has joined #RubyOnRails
[23:35:43] Obfuscate: Either way, that had what I was looking for.
[23:35:50] Obfuscate: Thank you both.
[23:36:05] pharserror: Obfuscate, no problem
[23:36:36] pharserror: are you using haml and rails 4?
[23:36:50] j_mcnally: has joined #RubyOnRails
[23:38:05] Obfuscate: No. I'm incrementally converting a rails frontend to a static site using a json backend (still in rails).
[23:39:35] IFrank00: has joined #RubyOnRails
[23:40:29] pharserror: Obfuscate: interesting. ok well good luck. you can ignore my syntax then :P
[23:41:31] Obfuscate: I have no complaints. :)
[23:42:31] sandstrom: has joined #RubyOnRails
[23:44:22] commondream: has joined #RubyOnRails
[23:46:47] x1337807x: has joined #RubyOnRails
[23:47:01] Zadrel: hello there! i need to extract this format from my system's clock ---2015-06-02 23:10:16 --- using rails but i'm failin to do this using --Time-- and --DateTime-- anyone have any sugestions?
[23:47:51] neanderslob: Zadrel: I forget, what's the default format?
[23:47:58] skiz: Zadrel, take a step back and what are you trying to do exactly?
[23:48:19] creature: has joined #RubyOnRails
[23:48:58] Zadrel: neanderslob: Tue Jun 02 20:48:15 -0300 2015
[23:49:04] mike___1234: has joined #RubyOnRails
[23:50:27] Zadrel: skiz: i'm trying to compare, in a WHERE SQL clause, the date and hour at this ---2015-06-02 23:10:16 --- format becouse this is the way my 'date_select' saves it in my DB :)
[23:50:29] cryptocronus: how to handle rails loading models in wrong order, for subclasses that don???t know the parent class?
[23:51:20] twilling: has joined #RubyOnRails
[23:51:26] neanderslob: Zadrel: you could do the formatting piece-by-piece by using strftime: http://apidock.com/ruby/DateTime/strftime
[23:51:29] pharserror: Zadrel: use strftime
[23:51:42] skiz: Zadrel, it depends on the column type in your db. it should be stored in GMT, and your query should allow you to extract the time adjusted to the TZ you want.
[23:51:50] Zadrel: neanderslob: strftime doesn't fit becouse the date saved isn't a string
[23:52:59] sarink: has joined #RubyOnRails
[23:53:26] Lightsword: has joined #RubyOnRails
[23:53:31] neanderslob: Zadrel: so you want the output to just be a string?
[23:54:18] skiz: Zadrel, check out https://www.reinteractive.net/posts/168-dealing-with-timezones-effectively-in-rails
[23:54:26] pharserror: Zadrel: I just did this. confirmed. Time.now.strftime('%Y-%m-%d %H:%M:%S')
[23:55:56] michael_mbp: has joined #RubyOnRails
[23:56:45] skiz: Zadrel, perhaps taking us back up a level we can point you in a better direction. What feature are you trying to accomplish? (Not your implementation details)
[23:57:03] TheNet: has joined #RubyOnRails
[23:57:12] mark[oz]: has joined #RubyOnRails