« Back to channel list

#RubyOnRails - 13 December 2013

« Back 1 day Forward 1 day »
[00:01:28] platzhirsch: debugging inside of action_dispatch/routing/polymorphic_routes.rb ... freaking crazy down here
[00:03:10] jalcine: the magic?
[00:03:16] jalcine: more like madness
[00:08:04] platzhirsch: I am trying to find out, which option/parameter is used to determine which key should be used from the model to create a url in link_to "...", [entity1, child_entity1]
[00:11:30] MrPunkin: What's the easiest way in rails to validate two columns, but not where a,b and b,a are both considered unique??? but rather if a,b exists then b,a can't exist. Just a custom validation?
[00:15:46] platzhirsch: oh there is the friendly_id gem for this
[00:16:36] MrPunkin: platzhirsch: you can simply set to_param in your model
[00:16:44] MrPunkin: def to_param; slug; end
[00:17:23] MrPunkin: platzhirsch: for which data should be used as the ID param for url building and such.
[00:18:16] platzhirsch: MrPunkin: oh, I was looking for that one :)
[00:18:46] platzhirsch: friendly_id gem seems to do a lot more, but probably I don't need that for now
[00:19:31] MrPunkin: platzhirsch: Yeah, it can do a lot but if your only looking to change a few model's url param I'd take the easy route
[00:21:39] platzhirsch: This is so good, now i can remove a bunch of code whenever I had to adjust this
[01:16:57] Radar: It's quiet in here. Too quiet.
[01:18:13] crucify_me: Radar you rule
[01:18:23] Radar: Thak you.
[01:18:27] Radar: Thank also.
[01:19:30] crucify_me: Radar how do I write a simple ruby class, Stack, for example, that is just an array ?
[01:19:52] crucify_me: like class Stack; []; end
[01:20:06] crucify_me: I'm just stumped on basic ruby.
[01:20:12] helpa: Learn Ruby by reading this book - http://manning.com/black2 - The Well-Grounded Rubyist by David A. Black
[01:20:41] crucify_me: I have it ddd !
[01:20:53] Radar: crucify_me: class Stack < Array
[01:21:00] ddd: having it != reading and practicing
[01:21:06] Radar: What does your Stack class do that Array does not?
[01:21:15] crucify_me: oh yeah duh Radar ddd
[01:21:49] crucify_me: Radar nothing I just forget the basics sometimes. I've been working on rails. finished that brutal hartl book now onto rails in action
[01:21:56] helpa: crucify_me: Please do not use fake values, as they can be confusing or misleading. Sometimes both.
[01:21:56] Radar: crucify_me: !fake
[01:22:03] Radar: crucify_me: c'mon mate you know the rules :()
[01:22:20] crucify_me: whaddya mean?
[01:23:18] crucify_me: sorry thanks Radar I knew the inheritance way I'm just tired.
[01:23:19] rhizome: ugh, nightmare workflow
[01:23:25] Radar: Then go to sleep!
[01:23:56] platzhirsch: My algorithms are stored in Metric classes, subclassing it. Now I want to make an active model out of them, but I still want to address them in a static way
[01:27:38] nobitanobi: Hi guys. I have a question... I have some background jobs running with Sidekiq. I am concerned about memory usage and I would like to know how do you "monitor" or "analyze" memory in Rails or in particular in this scenario of jobs with Sidekiq.
[01:28:27] Radar: nobitanobi: Probably with a tool like monit.
[01:28:44] nobitanobi: I will take a look
[01:29:01] nobitanobi: I have never had to worry about memory usage, but yeah, I've hit that point :)
[01:29:10] nobitanobi: thanks Radar
[01:43:26] Zesty: If i want to remove `null: true` from a column in a migration... would it be stupid to just delete `null: true` in my old migration, regenerate the schema locally.. then log into my production database and check the box 'allow null' in my sequel editor program?
[01:43:38] Zesty: i feel like adding a migration just for that is a pain.. im trying not to have 50000 migrations
[01:44:02] jrobeson: there's nothing wrong with having a ton of migrations
[01:44:17] jrobeson: some people merge them together later
[01:45:34] ddd: i know more than a few that doa ton of migrations, get it to a certain stage, export the schema and then delete the migrations. usually because the repo has the files of course. and then they tag the commit where they deleted the migration removal
[01:46:20] ddd: tag the commit they deleted the migrations in even
[01:46:21] sevenseacat: whats wrong with having a heap of migrations to show how your db has changed over time?
[01:46:34] sevenseacat: are you worried about the storage space?
[01:47:09] ddd: not a thing. just people some folks want their models to a certain point and not have to worry about applying them to get to a certain model stage or controller stage etc
[01:47:14] Zesty: lol not storage. i guess its part of my "ocd" coming out, it just really stands out, and drives me crazy i guess
[01:47:19] ddd: just a choice they make. nothing wrong with it
[01:47:44] Zesty: i like to have them kind of be cohesive, and well planne
[01:48:04] Zesty: well, what would you guys call a migration to allow null on a certain column?
[01:48:07] ddd: well that has nothing to do with the # of migration files
[01:48:21] Zesty: if i had 100 migrations that were very neat that wouldnt bother me
[01:48:22] ddd: a modification migration
[01:48:27] Zesty: having 10 with one crappy one would :S
[01:48:46] Zesty: I was thinking this: ChangeMixtapesFilename
[01:49:17] ddd: sevenseacat, is also right. keeping the migrations around to show the evolution is also a good thing
[01:49:24] lethjakman: actually seems like it could be a good idea in order to keep the migrations folder clean.
[01:49:46] ddd: some folks prefer to keep the directory smaller. both approaches work provided the models can be migrated back to a specific format
[01:50:56] ddd: the absolute golden rule is that regardless of which way you go, your models match exactly what is needed
[01:53:04] sbooth: Would anyone be able to help me with a server configuration issue?
[01:53:34] helpa: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[01:53:44] helpa: You have not provided enough information to debug your problem. Please provide this information: https://gist.github.com/radar/5384431
[01:54:18] ddd: read that gist then give the issue (especially needed when diagnosing server setups. depending on the issue it can get convoluted)
[01:55:02] sbooth: I think it's an nginx configuration issue. http://serverfault.com/questions/560547/nginx-configuration-for-rails-subdir-deployment
[02:23:57] rhizome: gngngngngh
[02:34:49] droptone: anyone have any idea how to uninstall rolify? I can't find any documentation on it.
[02:35:48] droptone: also, is Radar around? I did what he asked and deployed a test project, and the issue did not re-surface, meaning that it must be an additional gem we added. I have to assume it's rolify, since we only added a few gems, but I can't entirely eliminate it.
[02:35:56] Radar: Radar is never around.
[02:36:11] Radar: droptone: gem uninstall rolify
[02:36:15] ddd: radar is just a blip on the radar but he always hears the blip! :)
[02:37:24] droptone: Radar: nothing needs to be done to the code? gem uninstall rolify will remove the code added by rails g rolify:role Role User?
[02:37:57] Radar: droptone: You asked about uninstalling a gem. I gave you the command which will uninstall the gem.
[02:38:03] Radar: You did not ask about removing that gem's hooks from your codebas.e
[02:38:06] droptone: rolify generates a roles+users join table, a role model, etc.
[02:38:08] Radar: That is left as an exercise to the ready.
[02:38:13] droptone: right, ok, sorry.
[02:38:18] droptone: I should have been more specific.
[02:38:46] droptone: Ok, so the question remains, does anyone know how to back out the changes rolify makes to your code? I've scoured the rolify documentation and the web and can't find it.
[02:39:28] sevenseacat: do the inverse of whatever the installation is
[02:39:35] sevenseacat: doesnt seem too difficult
[02:39:56] droptone: sevenseacat: ok, so call rails d rolify:role Role User?
[02:40:02] droptone: instead of rails g?
[02:40:22] mordocai_: Hello, i've been googling for a few minutes and didn't find a straight answer. Since ruby on rails is popular for support the "rails way", is there a "rails way" for user authentication/management? There seems to be a bunch of different gems, but is there a more official one?
[02:40:31] mordocai_: for supporting*
[02:41:46] ddd: there is no rails way for that
[02:41:49] sevenseacat: there isnt an official one, no
[02:42:03] ddd: most folks use devise it seems but its not a Rails Way (Tm)
[02:43:29] droptone: :( guess it's not rolify, the change from Fan to Artist is still occurring.
[02:43:35] droptone: that worked though sevenseacat, thank you.
[02:43:44] droptone: christ, what could it be.
[02:43:53] sevenseacat: whatever you did to rename the model?
[02:44:34] droptone: Radar: I deployed the test application like you asked, with devise and identical User, Fan, and Artist models, and the type change from Fan to Artist didn't magically occur on logon in the test application.
[02:44:44] Radar: droptone: Then it's something else.
[02:45:11] Radar: droptone: If you can't reproduce the problem in a new application then what hope would we -- people WITHOUT access to the breaking application -- have of solving your problem?
[02:45:26] Radar: droptone: This is the part where I strongly advise you to hire a consultant who can come in and take a look at your application.
[02:45:28] droptone: I assume slim to none!
[02:45:45] droptone: ok, I'll figure it out, thanks for the help thus far, it is appreciated.
[02:46:28] Radar: All good :)
[02:55:30] j0llyr0tten: is it possible that turbolinks is messing with onload= attr on my img tags?
[02:55:43] Radar: j0llyr0tten: you tell us
[02:56:11] j0llyr0tten: Radar: i'm not sure, i feel that it could be
[02:56:24] helpa: j0llyr0tten: You have not provided enough information to debug your problem. Please provide this information: https://gist.github.com/radar/5384431
[02:56:24] Radar: j0llyr0tten: !debug
[02:58:15] j0llyr0tten: tell you what, i'll disable turbolinks and if it starts working then that's it
[02:59:13] Radar: j0llyr0tten: MAGIC
[03:00:46] bricker`LA: It's always turbolinks
[03:00:58] bricker`LA: every problem: turbolinks
[03:01:17] sevenseacat: i have decided that html->pdf printing is a fucking nightmare
[03:01:54] j0llyr0tten: Radar: yeah, well we can't all be geniuses like yourself
[03:02:22] sevenseacat: wkpdf is now being stupid
[03:02:28] Radar: j0llyr0tten: Thank you for at least acknowledging that.
[03:02:37] Radar: sevenseacat: Have you looked at phantomjs yet?
[03:02:39] j0llyr0tten: Radar: np, ;)
[03:02:47] sevenseacat: phantomjs does pdf rendering?
[03:03:20] sevenseacat: its all webkit so its going to have all the same issues
[03:03:47] sevenseacat: the margins dont work properly. the table has page breaks in the middle. the images look like shit.
[03:06:37] Radar: sevenseacat: yes
[03:06:47] Radar: sevenseacat: https://coderwall.com/p/5vmo1g
[03:06:51] Radar: sevenseacat: maybe worth a shot?
[03:07:02] sevenseacat: i'll give it a go
[03:09:04] innovativedir: Hello everyone, I am having a lot of trouble installing RVM on my iMac, could someone please help? I just started learning Ruby and nothing I am doing to install RVM is working. http://hastebin.com/titupupoqu.md
[03:09:32] innovativedir: I posted it there now
[03:09:49] Radar: innovativedir: https://github.com/sstephenson/rbenv I used this to set up Ruby on my Mac Mini just this week and it worked fine for me.
[03:09:57] Radar: innovativedir: I've also used rbenv on my mac book pro
[03:10:16] Radar: One bonus thing is that it's much much lighter than rvm
[03:11:12] innovativedir: my current version of ruby is 2.0.0p247, need to down ground it to 1.9.3 as stable version and all
[03:11:38] Radar: innovativedir: 2.0.0 should work just as well as 1.9.3... any particular reason you want to use the older version of Ruby?
[03:12:23] innovativedir: my trainer said so basically, he is saying that 2.0.0 only integrates with the beta version of rails
[03:12:41] innovativedir: me being a noob in ROR i have no clue if thats right or not
[03:14:02] innovativedir: I only have Ruby installed on this computer, not Rails, so trying to figure out how to setup a good working environment etc...
[03:14:14] sevenseacat: your trainer was completely wrong
[03:14:34] sevenseacat: utterly, completely wrong
[03:15:17] lethjakman: as far as I know 2.0.0 is very backwards compatible. is there anything that isn't backwards compatible?
[03:15:29] innovativedir: I'm thinking the same, I am a web designer the most amount of "coding" i know is "Html5/Css/JS" which is not even real programming in any way what so ever and he started first day trying to explain the inner workings of MVC which went completely over my head...
[03:15:53] sevenseacat: yeah js can be real programming
[03:15:54] Radar: innovativedir: You'll learn in time :)
[03:16:11] Radar: innovativedir: The latest version of Rails, Rails 4.0, is completely compatible with Ruby 2.
[03:16:30] innovativedir: well js sure but i mean only the visual aspect of JS I did not get into node or backbone or anything like that, I will soon :)
[03:16:45] asarch: Anyone using Semantic UI?
[03:16:48] innovativedir: Radar: Thanks, so you think i should just install Rails or still install rbenv?
[03:17:00] lethjakman: innovativedir: also if you're setting up an environment I'd highly recommend rbenv over rvm. rvm messed me up a lot when I first started.
[03:17:09] Radar: innovativedir: You can use rbenv to install Ruby and from there you can install Rails.
[03:17:11] helpa: asarch: Don't ask "does anyone use <thing>?". It's better to just state your problem and if anyone has used <thing> they will most likely answer.
[03:17:11] Radar: asarch: !used
[03:17:21] asarch: Thank you
[03:17:46] innovativedir: Radar: ok but i already have ruby installed and I don't know how to uninstall it, if i search google everyone just said oh don't uninstall Ruby just install RVM..
[03:17:48] asarch: Ok, can someone give me a small example using form (with just one field if you wish) validation?
[03:17:55] Radar: innovativedir: What does `which ruby` tell you?
[03:18:10] Radar: asarch: Assume nobody here knows what Semantic UI *is*
[03:18:13] Radar: asarch: Link us to it, perhaps?
[03:18:19] asarch: So far, I've been following this doc: http://www.philliphaydon.com/2013/10/semantic-ui-and-angularjs-basic-registration-form-with-validation/
[03:18:43] Radar: asarch: I am not quite seeing yet how it's a Rails thing :\
[03:18:46] asarch: Well, the way I understand is a collection of CSS styles with some JavaScripts programs based on jQuery modeled after the Bootstrap framework
[03:18:54] innovativedir: Radar: /usr/bin/ruby
[03:19:06] Radar: innovativedir: Ok, that's just the system Ruby... you may run into issues with that one.
[03:19:27] Radar: innovativedir: Follow the installation instructions for rbenv to install a new Ruby. That'll also give you the opportunity to use Ruby 1.9.3 easily if you have to.
[03:19:46] asarch: Radar: Just omit the part where the developer uses NancyFX
[03:19:50] innovativedir: Radar: ah ok gotcha let me try that
[03:20:31] Radar: asarch: This is the first time I've ever seen Semantic UI mentioned here
[03:20:47] bricker`LA: Never even heard of it
[03:21:31] Radar: There was one mention of it on the 29th of November... let me see if I can bring it up.
[03:21:33] asarch: Anyway, I will continue to look for some information
[03:21:36] asarch: Thank you guys
[03:21:42] asarch: Thank you very much :-)
[03:21:52] Radar: asarch: http://logs.ryanbigg.com/RubyOnRails?date=2013-11-29#1497415
[03:22:04] Radar: asarch: Before you came into the channel, this was the first mention of it EVER in the channel's history.
[03:22:58] Radar: Well, at least at the times the helpa bot has been in the channel. Could've been mentioned during this week's downtime.
[03:23:02] asarch: Too much coincidence...
[03:23:23] scyllinice: Sounds like another framework-of-the-week sort of thing
[03:23:33] slash_nick: What's the best way to include associations and nested associations, while limiting the columns selected? Inner joins are not what I want, and eager loading is kind of a must :/
[03:23:36] Radar: Looks similar to bootstrap/foundation/etc
[03:23:53] Radar: slash_nick: .select("joined_table.column")
[03:24:02] sevenseacat: i dont think the people at semantic ui know the meaning of the world 'semantic'
[03:24:02] asarch: Actually, they pretend to be a "replace" for Bootstrap
[03:24:19] slash_nick: Radar: and .select("joined_table.joined_table.column") ?
[03:24:19] innovativedir: good luck with that
[03:24:20] sevenseacat: <span class="right floated text item"> is not smeantic
[03:24:27] Radar: slash_nick: Nope
[03:24:35] slash_nick: get what i'm getting at, right?
[03:24:38] Radar: slash_nick: select("table_name.column")
[03:24:50] slash_nick: but i need to go two deep
[03:24:51] Radar: slash_nick: Select statements in SQL only need to reference the table as a top-level entity
[03:25:15] slash_nick: i want conditions.condition_type_id, but I want condition_types.description
[03:25:16] Radar: slash_nick: Please just try referencing the table name directly :) It will work.
[03:25:32] Radar: select("conditions.condition_type_id, condition_types.description")
[03:27:21] slash_nick: Radar: The generated query still includes other columns... "patient_manager_conditions"."cleared" AS t4_r4,
[03:27:27] sevenseacat: sigh.... bring on 5pm
[03:27:34] sevenseacat: bring on beer oclock!
[03:27:49] Radar: slash_nick: Then I don't know :(
[03:28:15] scyllinice: Lucky that it's almost the weekend for you
[03:28:22] slash_nick: It's like you have to choose ONE: eager load or select specific columns
[03:28:30] Radar: Probably.
[03:28:35] slash_nick: the includes by default selects all columns...
[03:28:38] Radar: Welcome to the wonderful world of ActiveRecord.
[03:28:53] sevenseacat: its almost holidays for meeeeeee
[03:29:17] slash_nick: yerp... :/ i'll have to benchmark eager load versus limited columns sometime...
[03:31:24] sevenseacat: i cant even get phantomjs's rasterize to work -_-
[03:32:45] slash_nick: sevenseacat: at least it's friday... i'm stuck over here on thursday
[03:32:47] scyllinice: Sounds like you do need a vacation
[03:33:03] sevenseacat: i very much needa vacation
[03:34:04] slash_nick: is it warm over there sevenseacat ? http://api.usno.navy.mil/imagery/earth.png?view=sun
[03:34:21] sevenseacat: slash_nick: 37C here today.
[03:34:39] slash_nick: that's plenty warm for me
[03:36:48] scyllinice: It's just above freezing here in St. Louis. Was 13F most of the day
[03:43:26] sevenseacat: i have no idea how to make this rasterize work, phantomjs cannot find the file
[03:45:59] j0llyr0tten: Radar: i found out what the problem was, i was being a moron
[03:46:34] sevenseacat: ACTION throws hands up in the air
[03:48:20] bricker`LA: ACTION waves them like he just don't care
[03:48:47] Radar: j0llyr0tten: How so?
[03:51:28] j0llyr0tten: Radar: meh, i had a src=data:... which was broken so obviously the image wasn't loading
[03:53:24] Radar: j0llyr0tten: sounds good
[04:03:19] cantonic: in migrations: is there any difference between adding using "add_index :terms, :position" and "t.integer :position, index: true"?
[04:04:42] helpa: cantonic: Why don't you try it and find out for yourself?
[04:04:42] Radar: cantonic: !try
[04:05:46] cantonic: Radar: because sometimes you don't see the difference by the result
[04:06:09] sevenseacat: then how can there be a difference?
[04:06:27] Radar: Surely inspecting the table should show you if there is an index or not.
[04:07:51] cantonic: sevenseacat: [1,2].length == 2 and [1,2].count == 2 --> same result, but they are not the same
[04:08:12] cantonic: i thought this could have been similar to this case
[04:08:19] cantonic: because i have a file here which uses both
[04:08:23] sevenseacat: but in terms of setting a database index, theres only two results - either its created or its not
[04:08:36] sevenseacat: its not like two created identical indexes will behave differently
[04:09:23] cantonic: yeah of course. just wondered :)
[04:10:33] cantonic: btw, there is an index ;) :P
[04:11:48] Radar: I'm so glad cantonic went through the trial of trying that out rather than me.
[04:12:03] Radar: and ftr length and count are aliased on array
[04:12:15] cantonic: really? :D oh damn
[04:13:15] Radar: Actually, I am wrong it appears :\ It's length and size which are aliased
[04:13:18] Radar: count can take a block
[04:13:30] Radar: and an argument
[04:13:31] cantonic: Radar: i wouldn't have asked if there wasn't a migration file containing both. But it turned out that one of them was added later. that confused me
[04:24:12] Blizzik: Hi, just a question.. Does something happened with the true.true? method or .. do I have messed up env? :D
[04:25:25] helpa: Blizzik: You have not provided enough information to debug your problem. Please provide this information: https://gist.github.com/radar/5384431
[04:25:26] Radar: Blizzik: !debug
[04:25:39] Radar: Blizzik: What .true? method?
[04:26:51] christo_m: auth = current_user.identity.find(:first, :conditions => { :provider => 'twitter' }) <- current_user is instance of user model, and has many identities,
[04:26:57] christo_m: should be able to run this query no?
[04:27:03] Radar: christo_m: Why are you using old syntax?
[04:27:08] christo_m: that may be why
[04:27:08] Radar: christo_m: What version of Rails are you using?
[04:27:08] Blizzik: Radar: Though I wrote it.. yes method .true?
[04:27:20] Radar: Blizzik: No. There is no .true? method.
[04:27:22] christo_m: Radar: 4.0.2
[04:27:27] Radar: Blizzik: There does not need to be a true? method.
[04:27:32] christo_m: what is the correct syntax now?
[04:27:38] Radar: christo_m: current_user.identity.where(:provider => 'twitter')
[04:27:43] Radar: christo_m: Oh, it's a first
[04:27:49] Radar: christo_m: current_user.identity.find_by(:provider => 'twitter')
[04:28:34] christo_m: Radar: hmm stil tells me undefined method
[04:28:43] helpa: christo_m: You have not provided enough information to debug your problem. Please provide this information: https://gist.github.com/radar/5384431
[04:28:43] Radar: christo_m: !debug
[04:28:52] christo_m: well i mean, its from that line..
[04:28:58] christo_m: and my relationships are set up properly
[04:29:20] helpa: christo_m: No code == no help
[04:29:20] Radar: christo_m: !ncnh
[04:29:30] Radar: christo_m: If we can't see your associations then we can't help you.
[04:29:33] christo_m: okay, the last line of code you jsut gave me, is what i put in, and thats where the error is
[04:29:40] Radar: christo_m: Yes, I understand that much.
[04:29:51] Radar: If you're getting an undefined method there is probably a deeper reason
[04:29:55] christo_m: user.rb has_many :identities .. identity.rb belongs_to :user
[04:30:06] Radar: so current_user.identity would've never worked then
[04:30:13] Radar: current_user.identities.find_by(:provider => 'twitter')
[04:30:20] Radar: because there is no identity method on current_user!
[04:30:22] helpa: http://guides.rubyonrails.org/association_basics.html - Active Record Association Basics by Mike Gunderloy
[04:30:22] Radar: !associations
[04:30:31] Radar: So many people just can't debug :(
[04:31:01] zrl: so in a railscast (#88), ryanb has some csv files in the root of his project. they're loaded into the database with seeds.rb. is the root of the project directory generally considered the right place for this kind of data? https://github.com/railscasts/088-dynamic-select-menus-revised
[04:31:16] Radar: zrl: I would put them at db/seeds
[04:31:29] Radar: zrl: I would not pollute the root of the app with more files than are necessary.
[04:31:34] zrl: alright, thanks.
[04:32:52] Blizzik: Radar: Ah sorry, it was misunderstanding. I was using be_true method in rspec and normally you could use almost anything with the be_ prefix and it translated the method to the suffix + ? so be_valid became valid? etc.. Thought it did same with true..
[04:33:01] Radar: Blizzik: Nope.
[04:34:34] platzhirsch: Is there a typical method to overide to use as a display function for the view?
[04:34:35] Radar: Blizzik: Let me find the method for you.
[04:35:05] Blizzik: Radar: No you don't have to. It seems rspec moved those method into a new gem https://github.com/rspec/rspec-expectations
[04:35:12] Radar: Blizzik: https://github.com/rspec/rspec-expectations/blob/v2.14.4/lib/rspec/matchers.rb#L187-L199
[04:35:22] Radar: Blizzik: no big deal
[04:35:27] helpa: platzhirsch: Please explain your problem better as we are having trouble understanding what you mean. A Gist (http://gist.github.com) is always helpful!
[04:35:27] Radar: platzhirsch: !explain
[04:35:54] Blizzik: Radar: Tahnk you anyway ;)
[04:36:08] Radar: Blizzik: in RSpec 3 it'll be be_truthy and be_falsey
[04:36:35] platzhirsch: err, I meant for displaying an entity, entity of the active model. Like a display name
[04:36:45] Blizzik: Radar: That's the version I use, just find that out in the gem doc. Thank you again
[04:37:29] Radar: platzhirsch: .to_s
[04:37:48] Blizzik: Works like a charm :0
[04:37:51] platzhirsch: Radar: alright, so nothing bound to ActiveModel::Naming
[04:38:48] Radar: platzhirsch: I think ActiveModel::Naming is for the class.
[04:40:41] Radar: Where did generate_password_reset_token? go in Devise?
[04:41:53] Radar: nm, this is what I'm after: https://github.com/plataformatec/devise/blob/master/lib/devise/models/recoverable.rb#L47-L56
[04:42:06] orolo: i'm wondering how to route a "DELETE example/17" and a "DELETE example" <-- no params on that 2nd one so i can delete all.
[04:42:50] orolo: both requests should go to "def destroy" so i can check for the param.
[04:43:34] christo_m: Radar: http://pastie.org/8549098 did syntax change in here too.. this doesnt seem to create a new identity link it to a user anymore
[04:43:40] christo_m: the user is created, but i dont see an identity record to go with it
[04:44:48] Radar: christo_m: I don't see where you're doing the linking.
[04:45:01] Radar: Oh, all the .user= calls...
[04:45:12] Radar: christo_m: Where are you checking for that identity record?
[04:45:40] christo_m: Radar: line 23 24
[04:46:00] christo_m: the first few lines, i have a method in the identity model
[04:46:28] christo_m: Radar: http://pastie.org/8549102
[04:46:53] Radar: I don't see where you're checking the identity record and determining if ti has a user or not
[04:47:35] christo_m: and 23 and 24 should link and save
[04:47:36] Radar: christo_m: Are you sure the identity was created through the SessionsController and not through some other code?
[04:47:49] Radar: I am only postulating because I cannot see the problem happening for myslef.
[04:48:14] christo_m: identity isnt being created
[04:48:16] christo_m: only user is.
[04:48:23] christo_m: well, being saved rather
[04:48:34] Radar: I don't think I can be of much more help without seeing a broken app on my own computer.
[04:48:59] christo_m: okay np, just wanted to make sure i wasnt using old syntax in that code or something
[04:49:05] christo_m: though i think id get some error, this is just failing silently.
[04:49:15] christo_m: because im doing something wrong
[04:51:43] christo_m: Radar: yes looking in the debugger i only see the insert for users
[04:52:58] christo_m: Do i have to explicitly save them separately, shouldnt ralis cascade save them?
[04:56:53] Radar: christo_m: Again, and for the final time: I would need to see this happening on my own computer to help you debug this.
[05:00:25] Radar: -q *!*@gateway/web/freenode/ip.71.202.42.173
[05:06:47] bricker`LA: https://github.com/rails/rails/issues/988#issuecomment-12653474 :(
[05:06:51] bricker`LA: I wish this fix was in rails 3
[05:14:50] NivenHuH: hey all.. on rails3, when i'm pre-compiling my assets, in the output file, i see sprockets comments instead of the compiled output. any clue what would cause this?
[05:15:15] helpa: NivenHuH: You have not provided enough information to debug your problem. Please provide this information: https://gist.github.com/radar/5384431
[05:15:15] Radar: NivenHuH: !debug
[05:15:24] Radar: NivenHuH: Would help if you could reproduce it within a new app?
[05:16:00] NivenHuH: Radar ok i'll attempt to reproduce elsewhere
[05:18:47] christo_m: Radar: hmm okay, one last thing then , does anything strike you as wrong in here: http://pastie.org/8549139
[05:19:10] Radar: christo_m: other than that you're attempting to BYO authentication engine, no nothing at all.
[05:19:16] Radar: p.s. down that path lies madness
[05:19:23] christo_m: Radar: what do you suggest then..
[05:19:38] Radar: christo_m: Using Devise.
[05:19:51] Radar: Devise would also integrate nicely with this Identity crap you've got yourself into as well.
[05:20:22] christo_m: i need to use identities if i plan to allow people to login with multiple social accounst
[05:20:26] christo_m: it isnt enough to just have a user
[05:21:25] christo_m: Radar: mind you i pretty much followed this: https://github.com/intridea/omniauth/wiki/Managing-Multiple-Providers
[05:22:15] christo_m: of course in the provider callback, i can finalize a proper registration through devise, and thus the user object, but whatever im doing here still needs to exist
[05:22:55] christo_m: specifically extracting the token and secret so i can make subsequent requests on the users behalf to a given provider
[05:24:06] Radar: I don't know sorry.
[05:24:23] Radar: This seems like a > 15 minute problem, which is probably better suited for a long-term pairing session which is what I charge money for
[05:24:37] Radar: If you have specific rails problems then I'm sure someone else in here could help you
[05:30:31] bricker`LA: huh... Is this expected behavior? https://github.com/bricker/after_commit_order ? These callbacks get run in the opposite order that they're defined. https://github.com/bricker/after_commit_order/blob/master/app/models/article.rb
[05:30:50] bricker`LA: You can see it by running the spec if you're interested
[05:32:23] bricker`LA: "Callbacks are generally run in the order they are defined, with the exception of callbacks defined as methods on the model, which are called last."
[05:32:36] bricker`LA: I don't get it, "callbacks defined as methods on the model"
[05:34:48] NivenHuH: Radar does not occur on new app
[05:35:00] Radar: NivenHuH: And now you have two problems :)
[05:35:11] Radar: NivenHuH: Are the versions of sprockets different between the apps?
[05:35:21] NivenHuH: no, i copied the gemfile over to see if that was a cause
[05:35:33] NivenHuH: i also copied the assets over to see if that was a cause
[05:35:35] Radar: NivenHuH: I mean in Gemfile.lock.
[05:35:43] Radar: NivenHuH: Please compare Gemfile.lock
[05:35:45] NivenHuH: correct, i used the same gemfile.lock
[05:35:55] Radar: Ok then, I have no idea how that could happen.
[05:36:13] NivenHuH: i'll share when i finally figure it out
[05:36:35] christo_m: Radar: i see.. its just weird that it worked in rails 3.2.16 and now that i updated to 4 its broken..
[05:36:41] christo_m: anyway, thanks for your help
[05:37:00] NivenHuH: christo_m lol that's not too weird .. major versions break things
[05:37:30] NivenHuH: * on legacy code
[05:37:31] sc00l: I have a model Links with attributes `url` and `url_hash`. When `url` is assigned I want to call a method to assign `url_hash`. Is it wrong to assign the `url_hash` attribute in a
[05:37:32] sc00l: could use `def url=` or I could use a `before_save`
[05:38:03] christo_m: NivenHuH: ya i suppose, except im not really relying on anything super crazy.. im doing a save
[05:38:18] christo_m: unless the syntax for save changed or something (which is why i was showing Radar the code to begin with)
[05:38:20] NivenHuH: it's what's behind the save that's complex
[05:38:37] christo_m: NivenHuH: really? according to the debugger its doing an INSERT, as i expected.
[05:38:47] christo_m: except its only inserting the user table row, not the identity one. which is what im trying to figure out
[05:38:58] NivenHuH: i don't know much about your problem, i haven't been following along.. i'm just speaking generically
[05:39:12] christo_m: it may have to do with the omniauth-identity gem
[05:39:33] NivenHuH: use a debugger like pry stack-explorer
[05:41:06] Radar: And that's my cue. HAVE FUN EVERYONE.
[05:41:12] NivenHuH: night radar
[05:41:21] ddd: Radar, o/
[05:47:01] pipecloud: As much as people think byebug isn't broken, it is.
[05:48:13] christo_m: NivenHuH: so i used save! instead of save to see if there were any validation errors, got this: Validation failed: Password can't be blank
[05:48:23] christo_m: here's the kicker, i have no such validation in user.rb or identity.rb or anywhere that i can see.
[05:49:03] sevenseacat: are you using devise?
[05:49:12] christo_m: it may be left over
[05:50:06] christo_m: i thought i purged it but i guess not
[05:50:11] pipecloud: sevenseacat: Some asshole at Dropbox's offices caused my laptop to drop extremely hard and they just walked away. :(
[05:50:26] sevenseacat: pipecloud: those fuckers.
[05:50:33] pipecloud: I even called out, "Hey! What the fuck. You're walking away?"
[05:51:02] christo_m: sevenseacat: is there a way i can temporarily bypass this validation?
[05:51:38] christo_m: because im just trying to test this real quick
[05:52:07] christo_m: also i feel like creating an account on my app would be redundant, as they authenticate through social media.
[05:52:48] christo_m: i did a grep for devise in the project, only the views remain.. why is it still validating?
[05:52:56] sevenseacat: no idea. i cant see your project.
[05:53:16] sevenseacat: that was a hint, btw.
[05:54:16] christo_m: sevenseacat: a hint that you charge money for consulting?
[05:54:33] sevenseacat: no, a hint that we cant fix problems without seeing code.
[05:54:40] pipecloud: I only consult on closed source code.
[05:54:42] christo_m: i wouldnt know what to show you , i guess i have to purge devise
[05:54:44] sevenseacat: i'll take money if you're offering it though.
[05:54:53] pipecloud: I occasionally contribute to open source though.
[05:54:53] sevenseacat: you dont even know if devise is the problem
[05:54:53] christo_m: apparently uninstall gems is hard or something though
[05:55:00] sevenseacat: you're just guessing
[05:55:12] christo_m: sevenseacat: well you mentioned it, and i dont have any validation rules of my own for a non existent field called password so
[05:56:09] pipecloud: christo_m: Open source your app!
[05:56:27] sevenseacat: so see previous hint
[05:56:38] pipecloud: Trust us, your idea isn't remotely unique or worth stealing.
[05:56:38] sevenseacat: this isnt rocket science
[05:56:45] pipecloud: s/science/surgery/
[05:57:05] christo_m: pipecloud: no i know
[05:57:17] christo_m: its just the amount of work for me to do that is not worth it , yet
[05:58:06] innovativedir: Radar: hey thanks for help earlier, I just installed rbenv it installed perfectly :) however even so if I type in ruby -version it is saying that its 2.0.0 but if I type in rbenv versions its giving me the 1.9 version
[05:58:26] pipecloud: christo_m: git remote add github git@github.com/$USER/$PROJECT.git; git push github
[05:58:28] Radar: innovativedir: Maybe you missed a part of the installation.
[05:58:31] Radar: innovativedir: Check `which ruby` again
[05:58:41] Radar: innovativedir: Should show something like /Users/ryanbigg/.rbenv/shims/ruby
[05:59:03] innovativedir: still says /usr/bin/ruby, I installed using brew
[05:59:05] helpa: Sir or Madam, as the case may be, I humbly implore you to make hasty egress from this fine establishment, at your earliest leisure.
[05:59:12] pipecloud: ACTION loves helpa again
[05:59:28] Radar: pipecloud: c'mon.
[05:59:30] Radar: pipecloud: not cool
[05:59:42] pipecloud: That wasn't directed at anyone, that's just my favorite factoid!
[05:59:53] Radar: innovativedir: Why did you install using brew? rbenv is your Ruby manager!
[06:00:03] innovativedir: Radar: however I tried to install 1.9.3 version using rbenv and it did install in "* system (set by /Users/frozzenfire/.rbenv/version)"
[06:00:31] Radar: innovativedir: You missed this step: https://github.com/sstephenson/rbenv#basic-github-checkout
[06:00:33] Radar: innovativedir: I think.
[06:00:47] innovativedir: on the rbenv it said that I can install using brew or something to make it easier
[06:01:03] Radar: I don't have time to help you right now.
[06:01:08] Radar: My instructions where to follow the README.
[06:01:20] Radar: Mainly, this part: https://github.com/sstephenson/rbenv#basic-github-checkout
[06:01:27] Radar: If you're not going to follow them then you're probably going to have a bad time.
[06:01:31] Radar: I need to go home now. ttyl.
[06:01:35] pipecloud: You can tell Radar is tired because he's an aspie about his spelling.
[06:01:41] pipecloud: Radar: dun die.
[06:10:22] sevenseacat: i would have so many happies if i could get this pdf rendering from html, working right
[06:11:19] pipecloud: sevenseacat: Too late to do it the nice way?
[06:11:24] sevenseacat: the nice way?
[06:11:27] bobbobbins: so I'm still having some issues with submitting ajax to my create method, but I've made some progress...i have the values coming over now, but they're escaped all weird so I can't use them, any ideas how to fix that? https://gist.github.com/bobbobbins/1699a93c60a6743efa7a
[06:11:51] bobbobbins: the .json file gets submitted to annotations/create, but you can see from the log that the params are all escaped
[06:11:52] pipecloud: sevenseacat: Phantomjs, it's webkit. So if you can get it working in chrome, you can almost directly turn it into a PDF.
[06:12:06] sevenseacat: pipecloud: still has the same issues.
[06:12:19] sevenseacat: theyre all just webkit and its webkit that has problems.
[06:12:26] pipecloud: It's super easy to get almost there, you just have to fix pagination and not having <table>'s splitting (it's still broken)
[06:12:35] sevenseacat: pipecloud: and those are my two problems.
[06:12:41] pipecloud: ACTION is a bit of a knowledgable fucker on phantomjs
[06:13:08] pipecloud: sevenseacat: Oh. Lul. You're fucked then.
[06:13:08] sevenseacat: tables splitting over multiple pages, and also margins
[06:13:35] pipecloud: It's a regression they haven't fixed in months and months.
[06:13:58] pipecloud: The fix I came up with was to make a table fit on a page and put a full pagebreak in so the table won't be split
[06:15:35] sevenseacat: all my content is variable height and its quite long, including some cells with rowspans
[06:18:33] pipecloud: mmph. Have you tried writing a pdf-specific stylesheet?
[06:18:43] sevenseacat: i have one, yes
[06:19:28] pipecloud: These are such a pain right now. Because you have to actually end the table on the end of the page and then make a new table element for the next one, which is like "HOW THE FUCK DO I KNOW WHICH ROW?!", right?
[06:27:29] ravionrails: sevenseacat, are you using wickedpdf?
[06:28:54] sevenseacat: i've tried wkhtmltopdf, ive tried wkpdf, ive tried pandoc
[06:29:18] sevenseacat: oh also phantomjs.
[06:44:23] ravionrails: i don't think any solution exist for this problem, we are using css for page-break according to A4 page size https://gist.github.com/ravionrails/7940637
[06:44:48] sevenseacat: but how do you do that in a table that spans multiple pages? :)
[06:45:36] ravionrails: tr shifted to next page due to page-break
[06:45:53] sevenseacat: so where do you decide where to insert the page break? and how?
[06:54:20] ravionrails: it's not possible to calculate where to insert page break, due to css if anything comes on bottom border line it would push it to next page
[07:02:12] bobbobbins: anyone have a chance to look at this? when I try to access the params here, they're all screwed up... https://gist.github.com/bobbobbins/1699a93c60a6743efa7a
[07:02:44] bobbobbins: if i do params.to_json, i can get quote and text, but ranges is still messed up
[07:03:39] tagrudev: paste the model too
[07:03:44] tagrudev: what is ranges
[07:04:18] bobbobbins: tagrudev, ranges is just a json array
[07:04:23] bobbobbins: one sec, i'll post the model
[07:05:14] bobbobbins: its up there now
[07:06:34] tagrudev: I still don't see where the start, end, startOffset, endOffset come from
[07:07:08] bobbobbins: they're inside ranges
[07:07:52] bobbobbins: i don't think i need to specify them in the model, since I'm using mongo
[07:09:03] tagrudev: hmm as I see in your development.log you post the ranges like this
[07:09:25] tagrudev: care to add the view too
[07:09:43] bobbobbins: there is no view, it just returns annotations as json
[07:10:17] bobbobbins: see, the log shows ranges all messed up, but if you look at data.json, thats how it should come over
[07:11:41] bobbobbins: (and thats how its actually being posted)
[07:12:32] tagrudev: it escapes the params
[07:12:42] tagrudev: removing the quotes
[07:13:08] bobbobbins: yeah, but its adding in a few => too, not just escaping it
[07:14:18] bobbobbins: i guess because div[3], its seeing that as a new array, but its just part of the string...do i need to escape the [] as well i guess?
[07:15:15] tagrudev: try it maybe
[07:18:04] tagrudev: bobbobbins, is that it ?
[07:18:24] bobbobbins: haven't tried yet, i had to go grab a drink...
[07:19:51] tagrudev: heh how awesome is that https://rails-assets.org/
[07:23:16] pipecloud: It's neat for sure. Go ruby-weekly.
[07:39:49] Rama25: i am uploading images in amazon dynamically and i need to get it after upload what is the url for getting, i used <%= image_tag(http://s3.amazonaws.com/abc/message.photo_fie.url(:medium).to_s) %> but shows an error,here abc is amazon bucket and message is model and photo_file is uploader
[07:40:27] pipecloud: You should probably interpolate a string instead of whatever it is you're doing there, possibly.
[07:40:30] pipecloud: Or you could write a url helper.
[07:44:26] rushed: Rama25: did you get around to reading the carrierwave docs, watching the example railscast, or checking out the carrierwave/fog code you were linked to yesterday?
[07:44:41] sevenseacat: it would appear not
[07:45:07] tagrudev: don't read manuals pff
[07:48:14] Rama25: <rushed> ya i checked but my problem is to get the images from amazon i need proper url,before amazon to store in app public folder and get url is <%= image_tag(message.photo_file.url(:medium).to_s) %> like i need from amazon url
[07:49:01] sevenseacat: you'll find the process is the same
[07:49:02] Rama25: <rushed> whether i need image_tag or not let me clear
[07:49:09] sevenseacat: exactly the same
[07:52:26] rushed: Rama25: carrierwave & fog have several options controlling how the url is built corresponding to the various bucket permission schemes available (public, private, limited) as well as a default setting if you're always going to be in one mode. If you gist the code & output that's not working you'll probably get better suggestions then something with a url pasted in the middle of ruby which basically elicits "wat"?
[08:00:31] tagrudev: got to update the !ydd to http://learnydd.com/
[08:06:00] Rama25: <rushed> here is my gist https://gist.github.com/anonymous/7941173
[08:07:00] bobbobbins: ok, I'm making progress on this thing...lemmie post another gist real quick
[08:07:20] tagrudev: bobbobbins, it's the serializer ?
[08:08:01] bobbobbins: i don't think so...i have it coming over and looking pretty good, but for some reason that ranges value keeps messing up
[08:10:09] bobbobbins: https://gist.github.com/bobbobbins/1699a93c60a6743efa7a
[08:10:52] bobbobbins: so if you check that...i have quote and text coming over right in the create...and if you look at my render text: i print out note_params['json'], and posted the contents of that in the file of the same name
[08:11:36] bobbobbins: and that all looks good, but if try to use note_params['json']['ranges'], it just returns the word 'ranges' again...i don't get it
[08:12:19] spygame: is it possible to make browser to browser calls using twilio without using a number ?
[08:12:49] pipecloud: Use twilio's website to determine that?
[08:12:56] bobbobbins: note_params['json']['ranges'][0] which should contain that array is only printing out 'r'
[08:14:56] tagrudev: bobbobbins, how is that different from before
[08:15:13] bobbobbins: well i don't have to use .to_json now to get any values, thats coming straight from params
[08:15:29] bobbobbins: and in the log, its not coming over all messed up anymore
[08:17:25] bobbobbins: i updated the log in the gist
[08:17:42] ravionrails: Rama25, what's the output of message.photo_file.url(:medium)?
[08:23:01] Rama25: <ravionrails> that is the image src="/uploads/message/photo_file/3/medium_schedule.png" in development,message is model,photo_file is mount uploader but i need this type or url in production
[08:24:17] ravionrails: and what you got in production
[08:25:03] chirag7jain: how can i check if things are getting cached. im using dalli gem and memcached
[08:25:35] ravionrails: from log i think
[08:32:21] henn1nk: i created a new file in lib/active_admin/locale_inputs.rb with module ActiveAdmin .. class FormBuilder .. def locale_inputs .. but i still receive an nomethoderror, how can i load this file in rails 4?
[08:34:09] pipecloud: chirag7jain: Tests, usually.
[08:34:12] dEPy: any idea why when trying to create a user I get "Unable to autoload constant Devise::Mailer" ?
[08:34:14] pipecloud: Logs otherwise.
[08:34:16] Rama25: <ravionrails> in development i am not getting images i just got thumb nail
[08:34:22] bobbobbins: i think i give up
[08:35:04] chirag7jain: is there way i can fetch the item im caching in console
[08:35:42] pipecloud: Probably. I'd bet sevenseacat's holiday on it.
[08:36:27] sevenseacat: please dont do that. l need my holiday.
[08:40:01] tagrudev: holidays are overrated
[08:41:12] rushed: Rama25: in my experience the initializer usually looks more like this https://gist.github.com/anonymous/ab1cd74921887e9fa495, also it's hard to take you seriously when you still have "http://s3.amazonaws.com/messagebucket/" in the middle of your image_tag in _message.html.rb
[08:44:15] chirag7jain: does any one how to check cache for a specific key
[08:48:59] pipecloud: chirag7jain: !g dalli ruby documentation
[08:49:09] pipecloud: Or was it dali, I don't know. Google though.
[08:49:32] dgx: Hey all. What do you think of RoR+MongoDB? I've never worked with either, so im asking for personal experiences :)
[08:50:08] pipecloud: dgx: Use activerecord for the first time through rails.
[08:50:20] pipecloud: Mongo is neat for people who can get the idea of documents around their heads.
[08:51:11] dgx: pipecloud, I've used active record with some PHP libs(ad PHP On Trax, closest Ruby port)
[08:51:26] pipecloud: dgx: Use the proper one.
[08:51:39] tagrudev: it's pattern
[08:51:57] tagrudev: dgx, why do you need mongo /
[08:52:30] pipecloud: tagrudev: Activerecord doesn't implement the Active Record pattern.
[08:52:37] pipecloud: It implements the abstract factory factory pattern.
[08:53:10] dgx: tagrudev, not like "need" more like looking for new things to learn(aside from php/mysql)
[08:53:29] tagrudev: if it's just for learning yeah go ahead
[08:53:33] tagrudev: play with mongoid
[08:53:41] pipecloud: dgx: You should probably keep the amount of balls you're juggling to one at a time until you're comfortable with just the one.
[08:53:49] pipecloud: But if you want to, go nuts.
[08:54:02] dgx: hehe, pipecloud wise words :)
[08:54:25] dgx: the whole idea is that we are creating a browser based game and we are looking for long term options
[08:54:32] dgx: speed/performance is critical
[08:55:25] pipecloud: Then something that sits in memory is best, which you should write to another database that's persisted to disk however is best.
[08:57:29] Rama25: <rushed> Thank you,,it is working in development,i will check in production.
[09:01:48] dgx: pipecloud, right
[09:02:02] dgx: does RoR has some build-in cache system?(for memory I mean)
[09:02:14] pipecloud: It has lots of things.
[09:02:33] Vaibhav_Rajput: I have provided api. Which is used by cronjob, which make many call to that api. but sometimes api server return Connection reset by peer - SSL_connect (Errno::ECONNRESET) my I know why this is happening? what is the solution to handle this?
[09:02:44] pipecloud: dgx: It just depends on the complexity of your needs.
[09:04:15] dgx: pipecloud, agree. I will dive into it, at some point
[09:08:40] tagrudev: pipecloud, how's that ActiveRecord doesnt implement the so called pattern ?
[09:08:57] pipecloud: tagrudev: I don't know what you're asking.
[09:09:15] tagrudev: <pipecloud> tagrudev: Activerecord doesn't implement the Active Record pattern.
[09:09:36] pipecloud: tagrudev: Rails as she is spoke. Look it up, it explains what's up.
[09:10:42] Vaibhav_Rajput: how to handle "Connection reset by peer - SSL_connect (Errno::ECONNRESET)"
[09:10:54] rushed: Vaibhav_Rajput: retry with exponential backoff?
[09:11:36] tagrudev: pipecloud, as much as I appreciate haters words don't think I would have the time for it
[09:11:53] tagrudev: ACTION adds it to-read
[09:11:55] pipecloud: tagrudev: I don't care if you do or don't.
[09:12:16] Vaibhav_Rajput: rushed, exponential backoff?? Can you please elaborate that?
[09:12:19] tagrudev: someone had a rough day
[09:13:08] pipecloud: tagrudev: I thought we were saying useless things the other person doesn't care about. :(
[09:13:08] rushed: Vaibhav_Rajput: I could, but I bet google would do a better job :)
[09:13:22] SirCmpwn: so I'm trying to set up a local instance of danbooru (rails app) on arch linux, and I'm almost there
[09:13:26] pipecloud: Your telling me that you don't have time to look at it doesn't provide anyone any value, so I responded in kind.
[09:13:28] Vaibhav_Rajput: tagrudev, hehehe got it while googling. rushed,
[09:13:35] SirCmpwn: the last step in the install script (which caters to debian) says that I should deploy it with cap
[09:13:38] SirCmpwn: `cap production deploy:setup && cap production deploy`
[09:13:47] tagrudev: pipecloud, nah got my attention on the pattern that's all
[09:13:51] SirCmpwn: output: https://gist.github.com/SirCmpwn/b1ebaa60d270335ca7f6
[09:13:59] SirCmpwn: that file exists (config/deploy.rb)
[09:14:32] SirCmpwn: I don't know a lick of ruby, by the way
[09:15:05] SirCmpwn: same thing, with --trace: https://gist.github.com/SirCmpwn/3bb8fe97399198428b43
[09:15:58] alex88: mmhh using jruby, closure compiler and app.js.coffee.erb (to output Rails.env inside it) I get the first line of the compiled file "Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCodebaseOnly=true"
[09:16:05] alex88: is there any way to suppress this?
[09:16:08] tagrudev: pipecloud, and it costs 37$ which is kind of a robbery just to prove your point on the pattern thingy :)
[09:16:19] pipecloud: It's that or read the source.
[09:16:25] pipecloud: I got it for free from the author myself.
[09:16:29] ace_striker: hello everyone...what is best to insert the text in formatted type to db and then show the same.. right now everything appears as single line when i fetch it back..
[09:16:54] tagrudev: pipecloud, I see
[09:17:45] ace_striker: sorry ..bad english
[09:19:01] tagrudev: ace_striker, just parse the text as you wish when you retrieve it :)
[09:21:25] ace_striker: tagrudev: thanks..sorry i meant , like i have a file to paste to with proper indentation in the text area xand then retrieve it to show..when i push to db it is written as single line text..with any formatting..
[09:22:53] ace_striker: *without any formatting (bad english)
[09:26:02] ace_striker: tagrudev: is there a way to enter the formatted text into db ?
[09:26:37] tagrudev: ace_striker, by default rails sanitizes your inputs check that out
[09:27:26] ace_striker: ok..i have to remove the sanitization then..
[09:27:35] tagrudev: not a good idea
[09:29:38] tagrudev: ace_striker, better use some WYSIWYG editor for the purpose
[09:31:35] ace_striker: ok..thanks..have to dig in more..
[09:37:06] Duckily: is it bad to define a helper method in a view
[09:38:00] Duckily: even if it's some xls view with some annoying equation... i feel like a helper that outputs xls, may be unnecessary...
[09:39:20] tagrudev: there is a place for defining helpers why don't you do it there
[09:40:34] jds: Duckily: if you want an actual reason not to do it, you'll be re-defining the method every time the view renders, which will blow away ruby's method cache, making your app slower
[09:40:45] jds: +1 for sticking it in a helper
[09:41:02] Duckily: jds: awesome, thanks :-D
[09:44:06] Vaibhav_Rajput: rushed, Is this exponential backoff http://stackoverflow.com/questions/6223518/ruby-does-not-ensure-when-i-retry-in-rescue??
[09:46:07] rushed: Vaibhav_Rajput: no
[09:53:32] rushed: Vaibhav_Rajput: exponential backoff is a retrying strategy where for each failure you increase the delay before the next attempt by an increasing amount (sometimes exponential, hence the name). similar to mail delivery where most servers will try, retry a few seconds later, then an hour later, then several hours later then a day later, then fail... what intervals and failure timeout you would want to use depend on your specific
[09:53:33] rushed: application and what you're talking to, how critical it is to get results, etc.
[09:53:46] rushed: Vaibhav_Rajput: if you're working with resque have you looked at https://github.com/lantins/resque-retry ?
[10:02:03] SebastianG: In my controller action I have a parameter that contains encoded URLs. Basically it works fine, but I don't know how to test it with Rspec controller tests. If I use the encoded url like `get :webpage_screenshot, webpage_url: 'http%3A%2F%2Flocalhost%2Ffoobar'` it is not decoded in the controller. When I use the unencoded version `get :webpage_screenshot, webpage_url: 'http://localhost/foobar'` it doesn't match the route, which restricts
[10:02:03] SebastianG: the parameter to match /[^\/]+/. What can I do here?
[10:08:41] rushed: SebastianG: are you trying to replicate something that works outside of a test? was is the intention of the matching regex?
[10:09:39] timmillwood: link_to("Edit", edit_admin_content_path(@content)) has stopped working after 4.0.2 upgrade
[10:09:52] timmillwood: ActionController::UrlGenerationError - No route matches
[10:10:29] SebastianG: rushed, I'm not sure, but I think Rails Guide suggested this regex for parameters that contain URLs.
[10:10:42] rushed: timmillwood: is @content non-nil?
[10:11:34] timmillwood: looking closer at the logs it seems to be "missing required keys: [:id]"
[10:11:41] timmillwood: for content id 293
[10:13:08] SebastianG: rushed, Here it is. I needed this regex to allow dots inside a paramter: http://guides.rubyonrails.org/routing.html#dynamic-segments
[10:13:09] greengriminal: Trying to create a new user seems to make a POST but does not save the user. https://gist.github.com/anonymous/7942295
[10:14:54] ravionrails: greengriminal, look at transaction rollback in your log
[10:18:30] greengriminal: ravionrails: I have just looked at that particular log: https://gist.github.com/anonymous/7942360 and looked at the one before i do the POST still no idea as to what it could be ;/
[10:20:44] rushed: greengriminal: did you read each line?
[10:21:57] ReBa1: Hello! I want to load gmaps for each location, but I end up with multiple javascript files loaded in because of my code: https://gist.github.com/RemiSpot/456d79e3fb4a9540b2a4 How do I only load the javascript files if they are not included yet?
[10:23:33] mrfoto: @ReBa1 well move the javascript_include_tag from _location to index
[10:24:13] mrfoto: also there are much more efficient ways to do that
[10:24:59] mrfoto: you can just make a function that knows how to display an array of locations and then just pass the array of locations to that script
[10:25:18] mrfoto: or do you actually want multiple maps?
[10:25:39] ReBa1: mrfoto: It have to be multiple maps really...
[10:26:17] ReBa1: mrfoto: And I would like to add the _location.html.erb to other pages too, but then again I am not sure if the javascript will be loaded. On the other hand, I have control over it myself...
[10:26:53] ReBa1: mrfoto: Sometimes I use it as a single map with multiple locations, but also as 1 map per location.
[10:27:07] greengriminal: rushed: Yes I've just gone through the line and weirdly its saying that the user exists: https://gist.github.com/anonymous/7942360#file-console-log-L18 which I have checked in IRB that this use does not exists
[10:27:41] AxonetBE: I have some strange behavior with my forms. For one user ( using latest chrome on windows ) this form is always acting as get instead of put : https://gist.github.com/DriesS/7942434
[10:27:44] rushed: greengriminal: how did you do this check?
[10:27:54] rushed: greengriminal: i.e. gist the log :)
[10:27:54] AxonetBE: how can I solve this? Because I can't reproduce this here on my mac with chrome...
[10:28:42] greengriminal: Further more there is not an INSERT query so my user is never being registered.
[10:28:59] rushed: AxonetBE: are you missing ujs, js errors in the browser?
[10:29:11] rushed: greengriminal: no insert because it's failing the validation :)
[10:29:44] AxonetBE: rushed: here in my chrome I don't have any error and the form submission goes fine
[10:30:00] greengriminal: Password I've been using is 4 length probably explains why. Was being lazy to type a long password
[10:30:07] AxonetBE: it just the client who can't submit this form, and I see that the request is made as get instead of put
[10:33:34] AxonetBE: rushed: found on the internet : The GET request is being caused by a form tag around the rails form which was there to add the twitter bootstrap styling class "form-horizontal". Removed the extra form tag and it works fine.
[10:34:03] mrfoto: ReBa1: thats so many use cases...idk i would make a partial that would accept an array of locations and then it would load js and iterate over displaying it
[10:34:47] mrfoto: it = the locations
[10:36:24] Gabriel403: Hey guys, I've got a config/initializers/secret_token.rb on my dev which is ignored in git, what originally generated that file? Was it rails new x ?
[10:37:47] ReBa1: mrfoto: I understand. I'll try and do that and see if it works as I wish :) Thanks for the advise!
[10:37:53] workmad3: Gabriel403: yes, it's generated as part of a new project
[10:38:30] workmad3: Gabriel403: and it contains the application secret that's used to secure your cookie-based sessions
[10:38:53] rushed: Gabriel403: you might consider switching to something like = ENV['SECRET_TOKEN'] or whatever is consistent with your production credential handling methodology
[10:41:40] mrfoto: ReBa1: np
[10:42:14] mrfoto: Gabriel403: yeah, you shouldn't .gitignore it since the app won't run without the token
[10:42:46] mrfoto: you should however load it from an ENV var or sth like rushed suggested
[10:45:06] Gabriel403: So if I stick export RAILS_SECRET_TOKEN='something' in /etc/bash.bashrc for dev and I guess I can put it int he vhost file for apache/nginx+passenger?
[10:46:09] workmad3: Gabriel403: yeah, you can do that
[10:46:34] Gabriel403: Sounds like a plan
[10:47:14] workmad3: Gabriel403: the 'fun' is making sure you have the same secret token for each app server if you have > 1 set up ;)
[10:48:23] mrfoto: and not making your secret ever get public or bad things might happen http://robertheaton.com/2013/07/22/how-to-hack-a-rails-app-using-its-secret-token/
[10:50:07] Gabriel403: So all I need in the secret_token.rb is myapp::Application.config.secret_key_base = ENV['SECRET_TOKEN']
[10:51:26] workmad3: Gabriel403: yup
[10:52:57] Gabriel403: Awesomenessness
[11:00:13] bobbobbins: I'm asking my question again to see if anyone else knows whats up, I have some json that is being submitted to my create method, and i can access all but one json var using params['json']['whatever'], the var 'ranges' though doesn't work, and its the only one that is an array...can someone help me out here? https://gist.github.com/bobbobbins/7942727
[11:00:43] bobbobbins: when i access params['json']['ranges'][0], i get r, 1 is a, etc...spelling out ranges for some reason
[11:01:32] universa1: bobbobbins: could you gist polease the output of params.inspect
[11:01:45] bobbobbins: universa1: sure, one sec
[11:03:12] bobbobbins: universa1: ok, its posted
[11:03:56] universa1: bobbobbins: you've done the params.inspect in the controller?
[11:04:13] bobbobbins: universa1: yeah...then rendered it as text
[11:04:45] bobbobbins: should i not have done that?
[11:05:34] universa1: bobbobbins: ahh ok, missed something ;) looks ok.
[11:06:00] universa1: bobbobbins: so what problem do you have with params["json"]["ranges"] exactly?
[11:06:18] Vaibhav_Rajput: rushed, I got what you r trying to tell me.
[11:06:27] Vaibhav_Rajput: Thanks I will work on this
[11:06:50] bobbobbins: universa1: it doesn't seem to have any values in it, it should be that array, but if i do params["json"]["ranges"][0], it just returns the letter 'r'
[11:07:28] bobbobbins: if I do params["json"]["ranges"][0]["start"], which should return that string, i just get nothing
[11:07:43] bobbobbins: quote and text work fine though
[11:07:58] universa1: bobbobbins: yeah well. that's because json is a string param.
[11:08:07] universa1: look at the beginning of the inspect
[11:08:16] universa1: "json" => "some long string"
[11:08:28] universa1: bobbobbins: how are you posting your json?
[11:08:48] bobbobbins: using jquery $.ajax
[11:08:57] universa1: bobbobbins: show the code please.
[11:09:04] bobbobbins: well if json is a string param, why would the other two work?
[11:10:04] bobbobbins: universa1: https://github.com/okfn/annotator/blob/master/src/plugin/store.coffee
[11:10:17] bobbobbins: its just the apiRequest function here that is making the call
[11:10:37] universa1: bobbobbins: they most likely don't actually work.
[11:11:05] universa1: bobbobbins: but tbh i'm not sure what "some_string"["string"] in ruby does
[11:11:10] bobbobbins: so if the json is just a string, can I just do to_json?
[11:11:57] universa1: bobbobbins: it's already a json string, why convert it to json again?
[11:12:24] universa1: bobbobbins: you want the other way around
[11:12:35] bobbobbins: oh, i see....
[11:12:43] universa1: bobbobbins: in which format does the log say your controller is processing your call?
[11:14:11] universa1: bobbobbins: ok, this should actually be json iirc. so you need to configure coffee script stuff properly
[11:14:46] universa1: bobbobbins: and then rails should automatically parse the json encoded stuff into proper ruby data structures iirc
[11:15:02] bobbobbins: ok, i think i see
[11:15:56] universa1: bobbobbins: but it's been quite a while since i've done some api/json stuff, so i'm just guessing here. if it doesn't work, JSON.parse params["json"] should also work, but i've the feeling that that is not the really correct solution ;)
[11:16:47] bobbobbins: ok, i'll give it a whirl, thanks, thats helpful
[11:18:05] universa1: bobbobbins: yw :-)
[11:23:11] henn1nk: https://gist.github.com/henn1nk/7942923#file-formtastic-rb-L14 my problem on line14 ... instead of self.object i need self.object_de, how could i do this? using self.send("#{self.object}_de") i get undefined method `#<Post:0x007ffda8c56ec8>_de' for #<ActiveAdmin::FormBuilder:0x007ffda2a0c718>
[11:24:51] universa1: henn1nk: why not just write self.object_de ?
[11:26:18] universa1: henn1nk: what you probably mean is: args.dup << self.send("self.object_#{locale}")
[11:26:22] henn1nk: universa1: cause i am trying to change the attribute names.. self.object.title_de etc. but no idea how this really works in formtastik
[11:27:31] universa1: henn1nk: sorry, now i've got absolutely no clue what you actually want...
[11:29:22] henn1nk: universa1: i am using hstore_translate to save translations in my database. setter method for attr title is title_de for german. so my goal ist to create a formtastic helper for this for all available locales
[11:30:51] universa1: henn1nk: so what is object_de ?
[11:31:18] workmad3: henn1nk: so you need to use self.object.send("#{attr_name}_#{locale}") (with correct variables/values used for attr_name and local)
[11:31:50] henn1nk: workmad3: yes but i don't know which are the correct variables :(
[11:31:55] corp_: I am overriding my engine's controller and view in an app, can I somehow access my app's helpers from there?
[11:32:51] universa1: henn1nk: first find out where the input method is defined. that is the one you're interested in...
[11:32:52] BrazenBraden: having a problem with saving a date
[11:33:01] ksinkar: I am currently using delayed jobs as the scheduler in my application. I had used it first because it seemed to be the default choice. Now that I have started facing problems with Delayed Jobs, especially jobs not mysteriously being executed, I am now looking at other options namely redis-resque, beanstalkd etc. I was wondering why is nobody in the rails world using cron jobs as their scheduler? Or is it that cron jobs is a scheduler
[11:33:02] ksinkar: while most of then above solutions are queueing solutions?
[11:33:21] BrazenBraden: using simple_form, set date to as: :string because I am using the jQuery datepicker..
[11:33:26] BrazenBraden: https://gist.github.com/brazenbraden/2253eb7d2b69cb311543
[11:33:57] tagrudev: corp_, no success since yesterday ?
[11:34:28] BrazenBraden: get the error item.date may not be null
[11:34:28] universa1: BrazenBraden: so if rails doesn't accept your date string, what do you think could be the problem?
[11:34:31] henn1nk: universa1: what i did not get is... what is saved in &proc really?
[11:34:36] corp_: tagrudev, oh hi, I was successful but not with the decorator pattern unfortunately, I used inheritance instead then
[11:34:55] BrazenBraden: well.. im wondering if it has something to do with the migration constraint i put on saying null: false
[11:35:10] corp_: a base class with all the logic in it, a dummy class which inherits from it (and routes pointed to it)
[11:35:19] corp_: then I can override the dummy class and routes still work
[11:35:39] BrazenBraden: guess there is one way to find out..
[11:35:40] universa1: BrazenBraden: no. you're trying to set the date by a string and rails can't figure out a date for it - what might be wrong in this case?
[11:35:41] corp_: but of course: new day, new problems ;)
[11:36:04] BrazenBraden: universa1: well, i would need to parse the date before saving it then
[11:36:06] universa1: BrazenBraden: your problem is before you ever hit the database.
[11:36:33] BrazenBraden: universa1: also getting an I18n error
[11:36:46] BrazenBraden: universa1: which agrees that my object is not a Date object
[11:36:53] BrazenBraden: so rails is like wtf O.o
[11:37:01] universa1: BrazenBraden: well, rails (or more likely ruby's date(/time) class) is trying to parse your string, btu can't.
[11:37:15] universa1: BrazenBraden: so i'd try to use a different date-format.
[11:37:29] universa1: BrazenBraden: or as you pointed out, do it yourself.
[11:37:37] universa1: BrazenBraden: can't see any error in your gist.
[11:37:50] workmad3: BrazenBraden: configure your date picker to output dates as YYYY/mm/dd
[11:37:58] workmad3: BrazenBraden: it's currently doing mm/dd/YYYY
[11:38:18] BrazenBraden: in the params, the date is m/d/y, sql is y/m/d right?
[11:38:34] BrazenBraden: workmad3: you were reading my mind
[11:38:40] universa1: BrazenBraden: and again: your problem happens before you ever hit the database.
[11:38:42] workmad3: BrazenBraden: the rails date parsing is locale-dependent
[11:38:51] workmad3: BrazenBraden: but YYYY/mm/dd is pretty safe
[11:39:18] workmad3: BrazenBraden: while mm/dd/YYYY can cause issues as it can lead to ambiguity, or just to errors if your locale is expecting dd/mm/YYYY
[11:39:26] AxonetBE: How can I get the end objects in from my polymorphic class? If I do this https://gist.github.com/DriesS/7943084 I got back list_items, but I want to receive the listable objects
[11:40:03] universa1: AxonetBE: has_many :listables, through: list_items ? not sure that'll work
[11:40:04] workmad3: universa1: I have a suspicion that he's getting a nil back for the date parsing at times ;)
[11:40:06] BrazenBraden: workmad3: ok. will give that a go. (just confuses me cos I have used this same setup in another project and didnt have a problem.. the params split the date into 3 diff params.. i1 => x, i2 => y, i3 => z
[11:40:22] BrazenBraden: workmad3: you are correct there
[11:40:28] workmad3: BrazenBraden: no, you only have one date param
[11:40:33] BrazenBraden: workmad3: "I18n::ArgumentError - Object must be a Date, DateTime or Time object. nil given.: "
[11:40:34] workmad3: BrazenBraden: because you're using a string field
[11:41:02] universa1: workmad3: yeah i know, just trying to point him to the place where the error actually happens and not where he thinks it happens.
[11:41:05] workmad3: BrazenBraden: it's not split up in your case
[11:41:38] AxonetBE: universa1: I'm doing this already, check in user.rb https://gist.github.com/DriesS/7943084 has_many :recently_viewed_items, :through => :recently_viewed, :source => :list_items
[11:43:18] universa1: AxonetBE: then has_many :prefix_listables, through: :recently_viewed_items, source: :listable
[11:49:56] mklappstuhl: whats the smartest way to pass a range in parameters?
[11:50:17] universa1: mklappstuhl: ?
[11:50:35] universa1: where(start_date: 1.day.ago..1.day.from_now) ?
[11:51:02] mklappstuhl: universa1: uh, sorry. url parameters
[11:51:31] universa1: mklappstuhl: i'd say attribute_start and attribute_end
[11:51:50] tbuehlmann: ugh, isn't there a validator for an attribute that has to have an exact value like 'foo'? do I have to use the inclusion validator with an array with just one element? :\
[11:52:19] samotarnik: hi, can someone help me out with an issue? i have the following code: https://gist.github.com/anonymous/b9a05bb7594b7f949440. but i still get "Currency is not included in the list" error, when i run the tests ?!?
[11:52:21] universa1: tbuehlmann: if the value is fixed, why even check it and not just set it fixed?
[11:52:45] universa1: samotarnik: full code + error please.
[11:53:13] workmad3: tbuehlmann: hmm... if an attribute has to have exactly one value, why are you leaving it up to the user to set it instead of just forcing the value? :)
[11:53:15] tbuehlmann: universa1, I want to return an error for that case since the request I'm getting wouldn't be valid
[11:53:35] universa1: samotarnik: and then think about when which code is evaluated.
[11:53:41] tbuehlmann: just wanna be strict about it
[11:54:09] workmad3: tbuehlmann: I just don't get why you're making it part of the request
[11:54:55] tbuehlmann: some background: it's a JSON-RPC server library and I have to check whether the incoming request is valid or not. it shall not be valid if the jsonrpc member of the request is not exactly '2.0'
[11:55:31] universa1: tbuehlmann: either custom validation or the inclusion_of with one element. your requirement is quite an edge case ;)
[11:55:33] workmad3: tbuehlmann: ah, so it's something like a message version number?
[11:55:34] samotarnik: universa1: that is the full code...
[11:55:49] tbuehlmann: protocol version, I'd say, but yes
[11:55:51] universa1: samotarnik: https://gist.github.com/anonymous/b9a05bb7594b7f949440#file-best_offer_price-rb-L8 ? so there is nothing more? ...
[11:56:10] workmad3: tbuehlmann: right... I'd personally verify that in the controller rather than the model
[11:56:20] universa1: samotarnik: still, your problem results from evaluation order.
[11:56:23] tbuehlmann: it's a custom class I'm writing which includes validations
[11:56:25] workmad3: tbuehlmann: but if I was doing it in the model, I'd probably use an inclusion filter
[11:56:34] samotarnik: universa1: just a validation on price attribute
[11:56:43] tbuehlmann: okay, so there isn't such a validator, as I guessed, thanks guys :)
[11:57:37] workmad3: tbuehlmann: there isn't... because it's a very weird case ;) in the case of a protocol/message version identifier, I'd use an inclusion because I'd half-expect to have to support a later version at some point too
[11:58:16] workmad3: tbuehlmann: or, as I said, I'd verify it in the controller or some form of factory object that's responsible for passing the request on to the correct place based on the version
[11:58:16] samotarnik: universa1: i thought about the evaluation order---what am i missing? the currency should be created in the spec before the first expectation. that's why i printed the currencies out and i get a record with the id of 1...
[11:58:36] universa1: samotarnik: when do you think is your model code loaded?
[12:00:58] samotarnik: universa1: ok... i see... i thought that the lambda would take care of that... i.e. the collection of currency ids would be recreated for every validation 'request'
[12:01:05] universa1: samotarnik: which lambda?
[12:01:13] universa1: wrapping something in curly braces is just a hash
[12:03:02] samotarnik: universa1: yeah...
[12:03:31] universa1: samotarnik: https://gist.github.com/anonymous/b9a05bb7594b7f949440#file-best_offer_price-rb-L6 -- you want a lambda in there most likely.
[12:03:32] samotarnik: universa1: it probably works better if you actually write "lambda", right..? =/
[12:03:55] universa1: samotarnik: and please replace collect(&:id) with pluck(:id)
[12:04:08] samotarnik: universa1: faster?
[12:04:29] samotarnik: universa1: will look it up...
[12:04:30] universa1: yes, just lodas the ids from the database iirc, and not all attributes
[12:05:01] samotarnik: universa1: ah, so it's kinda like count vs. length...
[12:05:18] samotarnik: universa1: thanks very much...
[12:05:36] universa1: samotarnik: no, length should do a count query on a not loaded association, and if it's loaded just do whatever length does in ruby
[12:07:00] samotarnik: universa1: em... not sure we meant the same thing.. i meant doing sth. like Entity.all.count vs. Entity.all.length
[12:07:50] workmad3: samotarnik: in rails 3, those are gonna do the same thing
[12:08:28] samotarnik: workmad3: but in r4 there is a difference?
[12:08:50] workmad3: samotarnik: I think so, because 'Entity.all' doesn't immediately execute a query, iirc
[12:09:01] samotarnik: workmad3: not sure where i read that and if if was in the context of r3 or r4
[12:09:03] toss: can I migrate ruby on rails website to wordpress?
[12:09:11] workmad3: samotarnik: but 'Entity.where(foo: "bar").all' does, I believe
[12:09:42] samotarnik: workmad3: ok... in r4 you can do Entity.count anyway... not sure if it works in R3
[12:09:45] workmad3: samotarnik: basically, in r3, once you do '.all' on a query, you have a fully loaded array... so .length and .count both just count the elements in the array rather than doing another query
[12:09:56] workmad3: samotarnik: yes you can, and in both r3 and r4, that will do a count query ;)
[12:10:18] samotarnik: workmad3: ok
[12:10:26] workmad3: samotarnik: in r4, if you did 'Entity.to_a.count' or 'Entity.to_a.length', it would be the same thing :)
[12:10:48] universa1: toss: define migrate?
[12:11:07] workmad3: samotarnik: and that was the point universa1 was making... the behaviour of length and count change depending on if the relation has loaded or not
[12:11:54] samotarnik: workmad3: ok, thanks... will try to remember... i usually flinch when it comes to something like that and then try to look it up or test it in console...
[12:11:56] workmad3: samotarnik: but either way, if you want just a single attibute, use .pluck(:attr) :)
[12:12:02] universa1: workmad3: i should pm you what i want to say and you then just explain it to others ;)
[12:12:16] workmad3: samotarnik: testing in the console with queries is perilous too ;)
[12:12:32] samotarnik: workmad3: =D
[12:12:42] samotarnik: workmad3: why is that...?
[12:12:50] workmad3: samotarnik: as the console will .inspect the returned objects whenever you hit 'return', and .inspect on an AR relation executes it...
[12:13:17] workmad3: samotarnik: which leads to people not familiar with that behaviour getting odd thoughts about when queries are executed...
[12:13:38] samotarnik: workmad3: but you see the actual sql queries... those are left intact right?
[12:14:15] workmad3: yeah... although if you're interested in the sql, just call '.to_sql' on the query instead of .all, .each, .pluck, etc
[12:14:49] samotarnik: workmad3: right...
[12:14:52] workmad3: universa1: sorry :P
[12:15:48] universa1: workmad3: don't be. i'm happy that at least you understand me ;)
[12:16:28] workmad3: I'm not happy
[12:16:42] tagrudev: small whiskey a day keeps the problems away
[12:16:57] helpa: tagrudev: http://youtu.be/kfVsfOSbJY0
[12:16:57] workmad3: tagrudev: !friday
[12:18:09] universa1: i think i'll have to show up at the master thesis presentations today... :-( can't always "miss" them ;)
[12:19:00] tagrudev: nah it's friday :D
[12:19:40] samotarnik: universa1, workmad3: well, thanks for the lesson guys...
[12:19:46] universa1: samotarnik: happy to help :-)
[12:20:03] workmad3: samotarnik: np, I'm always happy to go into massively too much detail about topics no one cares about ;)
[12:20:36] samotarnik: workmad3: some (of us) do care... =)
[12:20:53] workmad3: samotarnik: drats... I need a new topic then...
[12:21:09] workmad3: samotarnik: I could talk about knitting, if you wanted?
[12:21:54] samotarnik: workmad3: some other time maybe? my tests are running again... got new feats to implement =P
[12:22:13] tagrudev: knitting wtf
[12:22:29] samotarnik: knitting ftw =P
[12:22:52] samotarnik: i like sweaters =P
[12:23:10] universa1: knitting: http://www.womantospecial.com/wp-content/uploads/Models-of-cellular-Knit-Blouse.jpg (porbably nsfw) ;)
[12:23:12] workmad3: ah well... I tend to knit hats, scarves, breasts and sprouts...
[12:23:42] BrazenBraden: ag this datepicker is starting to piss me off 0,0
[12:24:05] tagrudev: I think he is not joking
[12:24:13] tagrudev: universa1, gg pic
[12:24:40] workmad3: tagrudev: indeed I am not...
[12:25:54] tagrudev: my reaction factory is broken ( not sure if awesome or too geeky ) :D
[12:26:22] tagrudev: but I may order a hat
[12:27:25] workmad3: yeah, they're not very good hats :P
[12:28:17] tagrudev: Beneath this hat there is an idea, Mr workmad3, and ideas are bullet-proof.
[12:28:33] tagrudev: should kickstart it
[12:28:43] workmad3: tagrudev: ok... so what I'll do is wrap you up in an idea and shoot you... you ok with that?
[12:29:10] workmad3: ok... so yeah, you probably are safe
[12:29:30] workmad3: I've never fired a gun... so I probably couldn't hit you if I was more than 5 ft away...
[12:29:49] tagrudev: you can hit me with the needle though
[12:29:50] corp_: if anyone cares: I found a solution to my problem (exactly as asked, first answer): http://stackoverflow.com/questions/9232175/access-main-app-helpers-when-overridings-a-rails-engine-view-layout
[12:30:01] corp_: might be a bit dirty but it works
[12:30:22] workmad3: tagrudev: I could probably hit you with many things :P
[12:30:40] tagrudev: corp_, nice glad u succeeded
[12:30:52] tagrudev: workmad3, parkour is my second name
[12:30:56] corp_: thanks tagrudev
[12:32:16] BrazenBraden: i dont get it... i am asking $.datepicker to change its format as so: $('.datepicker').datepicker({dateFormat: 'dd-mm-yy'}); but it refuses to work and insists on using the default mm-dd-yy
[12:33:26] workmad3: BrazenBraden: stop using ambiguous formats? :P
[12:33:32] workmad3: BrazenBraden: yyyy-mm-dd
[12:33:53] BrazenBraden: well, dd-mm-yy was a test.. i've been trying all combinations
[12:34:04] BrazenBraden: and for datepicker, it seems just 'yy'
[12:34:47] BrazenBraden: now i have it as: $('.datepicker').datepicker({dateFormat: 'yy-mm-dd'}); and still nothing
[12:35:19] BrazenBraden: i read that this could happen if I had jquery-ui included twice and i have checked... i havent
[12:36:48] universa1: BrazenBraden: are you sure your syntax is correct?
[12:37:42] BrazenBraden: it is a replica from all stackoverflow solutions out there
[12:37:54] universa1: BrazenBraden: http://api.jqueryui.com/datepicker/#option-dateFormat
[12:37:55] BrazenBraden: but im just getting no update
[12:38:03] sevenseacat: that doesnt mean its right
[12:38:03] BrazenBraden: i thought it was caching or something
[12:38:32] BrazenBraden: universa1: exactly.... "$( ".selector" ).datepicker({ dateFormat: "yy-mm-dd" });"
[12:38:33] universa1: BrazenBraden: are you sure you're only calling .datepicker once?
[12:39:00] universa1: BrazenBraden: then disable it all, and do it manually from the browser console
[12:40:55] BrazenBraden: universa1: disabled all. refreshed. no datepicker indeed. ran "[14:39:57.292] $('.datepicker').datepicker({dateFormat: 'yy-mm-dd'});" in console. datepicker now appears... date still in mm-dd-yy format..
[12:41:29] universa1: then try: $( ".selector" ).datepicker( "option", "dateFormat", "yy-mm-dd" );
[12:42:24] BrazenBraden: universa1: same story
[12:42:31] BrazenBraden: still mm-dd-yy
[12:42:50] universa1: BrazenBraden: well then something in your assets looks to be fucked...
[12:43:07] universa1: BrazenBraden: could you gist your application.js please?
[12:45:25] BrazenBraden: universa1: https://gist.github.com/brazenbraden/8b7adbb0bcdad7879a5c
[12:45:54] universa1: no jquery-ui in there?
[12:46:12] BrazenBraden: universa1: its included in the coreadmin.js file...
[12:47:01] universa1: BrazenBraden: i'd create a dummy project and load only the minimal needed assets for the datepicker to work
[12:47:12] universa1: BrazenBraden: and then slowly add stuff and see where it breaks.
[12:47:26] BrazenBraden: that coreadmin.js file is a single js file with jquery, jquery-ui and any other js bits and bobs all minified into a single file..
[12:48:00] universa1: BrazenBraden: you know that the asset pipeline minifies and merges all your files?
[12:48:14] BrazenBraden: but this is how i have the file
[12:48:21] BrazenBraden: i didnt choose it this way :P
[12:48:24] universa1: ok, doesn't matter anyways.
[12:48:27] universa1: BrazenBraden: i'd create a dummy project and load only the minimal needed assets for the datepicker to work
[12:49:00] universa1: something seems to interfer with it, no clue how to find it out in another way
[12:49:10] BrazenBraden: that coreadmin.js file is 57768 lines long lol
[12:49:25] universa1: maybe look at where $('.datepicker').datepicker calls to ;)
[12:50:04] rushed: BrazenBraden: what is the result of the following in your browser console? $.fn.jquery + ' | ' + jQuery.ui.version + ' | ' + jQuery.ui.datepicker.version
[12:50:07] BrazenBraden: universa1: only 127 matches for 'datepicker'
[12:50:58] BrazenBraden: rushed: jquery = 1.9.1, UI = 1.10.2, datepicker not defined
[12:51:07] universa1: BrazenBraden: i meant more in a stack-trace way ;)
[12:51:15] rushed: BrazenBraden: mystery solved, you're not using the jQuery UI datepicker
[12:51:27] BrazenBraden: O.o so which one am I using? lol
[12:51:33] BrazenBraden: lemme go research
[12:59:09] sevenseacat: one to go around for all of us? :(
[12:59:48] BrazenBraden: sharing is caring..
[13:00:13] BrazenBraden: rushed: this is what i get from my console when i type $.fn.datepicker (just to see what happened) https://gist.github.com/brazenbraden/8b7adbb0bcdad7879a5c
[13:05:11] mikecmpbll: thanks for letting us know.
[13:05:42] mikecmpbll: ugh, i can't concentrate today.
[13:06:55] tagrudev: grab a snickers
[13:07:02] tagrudev: or a whiskey
[13:07:18] universa1: or better: both
[13:07:33] mikecmpbll: i can see a cocktail coming on.
[13:07:44] universa1: ACTION *shivers*
[13:12:47] BrazenBraden: mikecmpbll: its a pleasure
[13:17:04] BrazenBraden: what is jquery_ujs ?
[13:17:28] mikecmpbll: unobtrusive javascript
[13:17:41] mikecmpbll: handles stuff like remote: true, etc
[13:17:50] mikecmpbll: and destroy links
[13:26:46] walidvb: i need to build a website that is quite simple, and i want to do it using RoR and angular, to get familiar with the tech
[13:27:06] walidvb: what i need to build is smth that looks quite like this: http://bjoernmeier.com/#/entry/bec-de-livre-side-table/
[13:27:46] walidvb: would love some tips on how to go about?
[13:28:04] walidvb: I did the michae hartl tutorial already
[13:28:32] tagrudev: and you don't need rails and angular js to do a static website
[13:28:37] walidvb: which was great, because you do a lot of things from scratch
[13:29:46] dcope: i have a pretty simple view that is taking ~1000ms to render on my server. is there any way to debug this or is there a guide for common pitfalls in view rendering performance?
[13:30:01] walidvb: tagrudev: agree. I do however need a UI to let my user add projects
[13:30:28] rushed: dcope: lots of options, here is one http://railscasts.com/episodes/368-miniprofiler
[13:30:51] mikecmpbll: dcope: new relic dev version is handy too
[13:31:11] walidvb: tagrudev: and i'd like to use RoR. do you think this is wayy overkill?
[13:31:18] tagrudev: walidvb, my advice define exactly what you want to do and start building small pieces of it
[13:31:30] rushed: dcope: also, if you haven't done any work at all there may be some obvious low hanging fruit, just gisting the page output, a request log and the related code may get you some good suggestions.
[13:31:32] tagrudev: don't go crazy about rails and stuff
[13:32:06] walidvb: tagrudev: so you mean, use rails, but go slow
[13:32:27] Ergo: dcope: you can use appenlight.com API to figure this out, but try to enable logging of sql queries inside your app, maybe you have some row locking that is slow
[13:32:31] dcope: rushed: i was using miniprofiler but it wouldn't ever show sql results
[13:32:35] walidvb: i just want to get it right. but i'll just ask questions by questions, if i don't find anything online
[13:32:36] rushed: walidvb: you haven't explained the full domain of what you're trying to do, so anyone who suggests a tool is not doing you any favors :)
[13:32:54] walidvb: rushed: true. goal is that website, more or less: http://bjoernmeier.com/
[13:33:26] tagrudev: my point was don't go crazy on the tools when you don't know what you want :)
[13:33:36] rushed: walidvb: well it's already done then, nothing to do :)
[13:33:39] mikecmpbll: i recommend html \o/
[13:33:49] walidvb: tagrudev: cheers to that, will really try not to, and I know what you mean :D
[13:33:51] tagrudev: mikecmpbll, I recommend black bushmills
[13:35:01] BrazenBraden: finally managed to fix it!
[13:36:34] dcope: just installed mini profiler and sql works now
[13:36:38] dcope: they must've fixed it! :)
[13:37:05] walidvb: one big difference though, is that the projects should have a description(body), and a list of resources(of type image/text(html=embeddedobject))
[13:40:45] toss: can I migrate ruby on rails website to wordpress?
[13:41:14] workmad3: toss: I know you got given an answer to that in #ruby about 2 hours ago... please stop spamming
[13:41:23] rushed: walidvb: sounds like you might just need a static or cms based site, or even something like http://www.squarespace.com (not a web application)
[13:41:44] henn1nk: does someone know how to resize an image with carrierwave/minimagick to a fixed SIZE?
[13:41:55] toss: I mean I know they are not compatible
[13:41:55] toss: <toss> :)
[13:41:55] toss: <toss> but can it be done?
[13:42:41] mikecmpbll: rails generate migration rails_to_wordpress
[13:42:45] walidvb: i was thinking about using paperclip as an ActiveResource property, and a tinymce field, but I need my user to be able to order these how he wants. So rather than adding these as properties, i figured each project_asset should be an ActiveResource itself, of which a project would has_many
[13:42:59] mikecmpbll: new rails 4 feature
[13:43:01] walidvb: rushed: i know :( i'm a drupaler actually, but i'm real tired of drupal..
[13:43:16] BrazenBraden: mikecmpbll: you trolling :P
[13:43:51] walidvb: and i would like to learn RoR, but I have clients for such websites for the moment, not webapps
[13:44:10] tagrudev: what does activeresource got to do with it
[13:44:18] workmad3: mikecmpbll: sorry, that generator got pulled out... it should be back in rails 5
[13:44:39] tagrudev: ydd new project
[13:46:23] walidvb: tagrudev: erm.. ActiveResources can be assets as in type of content, correct? so they would be projects, here.
[13:47:06] tagrudev: walidvb, https://github.com/rails/activeresource
[13:47:19] walidvb: (sorry, as mentionned i do come from drupal, and my mind is formatted that way. trying to unformat it atm ;) )
[13:47:25] walidvb: on it, thx
[13:51:18] walidvb: tagrudev: ok. so my projects should be ActiveResources, but its attributes would never have reasons to be ActiveResources, except in the case where they would be independant objects linked to the project.
[13:51:29] rushed: walidvb: dude
[13:54:42] walidvb: rushed: ? too many questions? go read some doc? :P
[13:55:05] ryannielson: Hey, are there any articles out there that describe the pros and cons of both spec and the built-in rails testing framework? Basically looking for some sort of comparison before I dive in and try to learn one or the other.
[13:55:21] mikecmpbll: ryannielson: yes
[13:55:48] ryannielson: mikecmpbll: I don't know if I am just bad at searching, but I can't seem to find any posts comparing the two.
[13:56:52] tagrudev: ryannielson, look at most famous ones and choose
[13:56:55] mikecmpbll: even if i did find some for you it's pointless anyway
[13:57:08] mikecmpbll: depends on which side the author is coming from
[13:57:26] mikecmpbll: just pick one and try it, if you don't like it use another one.
[13:57:28] ryannielson: mikecmpbll: Ya, I guess it could be hard to find something that's unbiased.
[13:57:50] mikecmpbll: i find that minitest does everything i want it to, so I use that.
[13:57:58] mikecmpbll: other people prefer to use rspec ..
[13:58:05] ryannielson: mikecmpbll: I'm assuming most gems that enhance testing like factory girl, capybara, etc. work find with both so it's more of a syntax thing.
[13:59:52] AntelopeSalad: i think capybara falls into a different category but maybe i'm wrong
[14:06:04] walidvb: so you all reckon i should give up using rails on this site.
[14:06:10] walidvb: and go back to drupal
[14:08:54] certainty: yeah, back to drupal! why again?
[14:10:26] walidvb: certainty: because i'm too noob
[14:11:10] certainty: ok then back to the tools you know best
[14:11:25] walidvb: and i did the hartl tuto, loved it, but i need to build a pretty simple website, and i want to get the architecture right before i start dev'ing
[14:11:47] certainty: architecture is for wussies
[14:11:58] walidvb: certainty: lol. that's a shame. i'd really like to get away from the drupal mindset.
[14:12:13] walidvb: wussies are for wussies too
[14:13:29] walidvb: certainty: willing to give me hints? :)
[14:13:52] walidvb: there is mainly one thing that I don't know how to do, and that is giving me troubles.
[14:14:30] certainty: walidvb: just ask. I may or may not be able to answer your question.
[14:14:40] tagrudev: I told you don't go crazy over tools when you can't define your problem
[14:15:41] walidvb: i need a certain resource to have the following attributes: {images(multiple), text/html(multiple)}, and I'd like to be able to order the way they're returned arbitrarily(so basically, attach a weight to each attribute)
[14:15:48] workmad3: hehehe, funny joke - 'want to get the architecture right'
[14:16:06] walidvb: tagrudev: not trying to :(, are you talking about rails in general here?
[14:16:13] workmad3: also, 'want to get the architecture right before I start dev'
[14:16:30] workmad3: it's obviously laugh-a-minute-friday here
[14:16:50] tagrudev: workmad3, I see you in different perspective now
[14:16:50] spamotuve: what would be a nice way to make a @globalvariable accessible in every view? I've added it to application_controller, but that doesn't kind of work..
[14:17:38] walidvb: workmad3: it's a pretty simple project, just some projects with {title, body, images+html}
[14:17:55] tagrudev: workmad3, http://static9.depositphotos.com/1005245/1174/i/950/depositphotos_11747677-Image-of-an-old-arabic-woman-sitting-on-a-sofa-and-knitting.jpg
[14:18:58] walidvb: my main problem is I don't know how to attach attributes to an attribute.(as in, caption to an image, weight to the image, weight to a text attribute)
[14:18:59] workmad3: walidvb: if it's that simple, then anything from no architecture upwards should work
[14:19:41] workmad3: walidvb: there isn't a 'right' architecture, and tbh, if some is needed it can get drawn out during dev
[14:19:55] workmad3: walidvb: trying to pin it down up-front is a fool's game :P
[14:19:56] walidvb: oh come on guys, i know i'm totally noob, i know my drupal mindset is not going to work here, but i'm trying.
[14:20:12] workmad3: walidvb: this has nothing to do with a drupal mindset
[14:20:20] workmad3: walidvb: this is purely analysis-paralysis
[14:20:57] walidvb: workmad3: true. maybe better i describe how I plan to go about it, and then see if someone can go over it, and tell me what will defo not work, or what could be improved.
[14:21:12] workmad3: walidvb: or maybe you just start trying things? :P
[14:21:22] tagrudev: also check ydd
[14:21:25] walidvb: workmad3: on it in parralell ;P
[14:21:28] workmad3: walidvb: best way to learn what does and doesn't work is to try things
[14:21:55] workmad3: walidvb: and then you're not leaning on unpaid volunteers to sanity check your every move either ;)
[14:23:42] toss: mikecmpbll <mikecmpbll> rails generate migration rails_to_wordpress
[14:23:59] toss: <mikecmpbll> new rails 4 feature are you joking ? :)
[14:24:06] rushed: walidvb: https://www.ruby-toolbox.com/categories/content_management_systems https://www.ruby-toolbox.com/categories/static_website_generation https://github.com/search?q=rails+portfolio&ref=cmdform http://railscasts.com/episodes/253-carrierwave-file-uploads and just for kicks... http://railsforzombies.org
[14:24:23] mikecmpbll: toss: yeah, i was joking.
[14:24:26] rushed: walidvb: oh, I forgot http://www.squarespace.com
[14:24:51] walidvb: workmad3: thing is, as i don't know how to attach attributes to attributes, i was going to create ActiveResources to create the images, and use has_many images in the projects ActiveResource. which tagrudev pointed out had nothing to do with it.
[14:25:10] walidvb: rushed: thank you very mucho. I'll go through these links
[14:26:06] toss: mikecmpbll ok :)
[14:26:22] walidvb: rushed: but if i don't go ruby i'll go drupal
[14:27:09] mikecmpbll: walidvb: how to attach attributes to attributes? what
[14:27:33] AntelopeSalad: walidvb: think of them as relations, not attachments
[14:27:45] tagrudev: just go and read
[14:27:58] AntelopeSalad: "an image belongs_to a page" and "a page has_many images"
[14:28:33] walidvb: mikecmpbll, AntelopeSalad, tagrudev, reading as we speak. but i'll be back only once i finished reading, promise.
[14:29:09] walidvb: AntelopeSalad: get that, but didn't know if it was necessary to create an ActiveResource image, just for it to have a weight and a caption. back to reading
[14:29:16] walidvb: thanks all for your answers, still :)
[14:29:46] mikecmpbll: why are you even thinking about this before even deciding what framework you're going to use
[14:29:48] AntelopeSalad: a weight for what?
[14:30:57] walidvb: AntelopeSalad: for the order in which they should be returned/rendered
[14:31:08] walidvb: mikecmpbll: because i want to choose ruby :)
[14:31:17] mikecmpbll: then choose it
[14:31:17] AntelopeSalad: sounds like a position
[14:31:21] ryannielson: Hey, I'm trying to make a custom AppBuilder following this tutorial: http://railscasts.com/episodes/148-custom-app-generators-revised. My AppBuilder looks like this: https://gist.github.com/RyanNielson/7945080. I'm creating my Rails project with rails new test_project -b app_builder.rb, but it's not working. No errors or anything, but it doesn't seem to be creating the README.md as I'd expect. Has something changed in Rails 4?
[14:32:41] walidvb: AntelopeSalad: it is a position, indeed.
[14:35:06] AntelopeSalad: walidvb: so what you're basically designing is a page that has 0 or more images and you want the images to have a specific order?
[14:39:23] walidvb: AntelopeSalad: basically i want to do this: bjoernmeier.com except each projects can have either images or html fields, and i want to be able to manually sort them on an admin page.
[14:40:33] walidvb: it could be done by the order in which the form is filled, or on an interfade on which you could set positions to each project.attribute
[14:41:14] AntelopeSalad: did you want to manually sort each project or each image within a project, or both?
[14:42:28] walidvb: each image within a project
[14:42:44] AntelopeSalad: why not start super simple for now just to get the basics going?
[14:43:04] AntelopeSalad: create a Project model , give it nothing but a title and then work on how to add/edit/delete projects
[14:43:31] AntelopeSalad: then once you get that going, you can add more fields to it and figure out how to deal with images, etc.
[14:43:43] walidvb: AntelopeSalad: that's where i am, actually.
[14:44:19] walidvb: but i was stuck at: should images be resources, or something else, considering they need caption and position
[14:44:45] walidvb: AntelopeSalad: thanks for your help, btw :)
[14:45:07] AntelopeSalad: you could introduce a ProjectImage model that has a caption, position and filename field , honestly i haven't worked much with images with rails yet
[14:45:28] AntelopeSalad: if you go that route then you need to keep your database and filesystem in sync, i'm not sure if that's the best way to go
[14:46:06] walidvb: AntelopeSalad: so images(or whatever sortable field I have) do have to be a model
[14:46:22] walidvb: of its own( belonging_to a project)
[14:46:32] AntelopeSalad: walidvb: it could be nothing more than just a filename or any other metadata you might want to store
[14:47:08] walidvb: AntelopeSalad: agree with that. but a model it must be. if i make that decision, then I can go forward
[14:47:26] AntelopeSalad: yeah for now you can go with that approach, it's not the end of the world if you want to change it later
[14:47:37] walidvb: and indeed, start by using urls for the images, and then implement the whole fileupload functionnality
[14:47:43] AntelopeSalad: yeah just use urls for now
[14:47:58] walidvb: AntelopeSalad: true. i'll keep reading, and then start dev'ing! looking forward!
[14:48:00] AntelopeSalad: that would definitely be the easiest way to get going
[14:50:24] AntelopeSalad: walidvb: might want to look into this too at some point https://github.com/swanandp/acts_as_list
[14:50:43] walidvb: (btw i meant ActiveRecord everywhere I wrote ActiveResource, which i understand is actually simply called model)
[14:50:43] AntelopeSalad: it's a nice gem for dealing with positions and sorting
[14:54:23] AntelopeSalad: might want to read all you can about activerecord associations too on the main guides page
[14:54:38] AntelopeSalad: this one http://guides.rubyonrails.org/association_basics.html
[14:57:16] havv: Hello, I'm trying to install rails using gem install rails --no-ri --no-rdoc
[14:57:30] havv: and I get "ERROR: While executing gem ... (Gem::UnsatisfiableDependencyError) Unable to resolve dependency: 'rails (= 4.0.2)' requires 'activesupport (= 4.0.2)'"
[14:57:53] havv: how do I fix this? ;_;
[14:58:44] Giorgio: what is best way to reload lib/ in rails engine ?
[15:00:20] mikecmpbll: Giorgio: why?
[15:01:19] Giorgio: i need class that is placed in one of engines lib folder
[15:01:36] mojjojo: i am having problems with some html pages being cached, could it be beacuase rails by default does some caching?
[15:01:52] mojjojo: tempaltes for my angular view are not getting refreshed after change
[15:02:02] mojjojo: maybe that has got something to do with me putting them in public folder?
[15:05:14] mikecmpbll: Giorgio: then require it?
[15:05:36] Giorgio: i rquire them in engine
[15:05:57] Giorgio: but when make changes there are not reloaded
[15:06:48] mikecmpbll: ah, in development. lib files aren't in the autoload paths
[15:07:11] Giorgio: yes i tried them to add in egine.rb file to autoload path
[15:07:17] Giorgio: but still not reloaded
[15:07:28] workmad3: more than that, gems aren't reloaded during a running app
[15:07:37] mikecmpbll: yeah, just restart the app.
[15:08:14] Giorgio: still nothing i tryed that
[15:08:35] workmad3: Giorgio: how are you using the engine in your rails app?
[15:08:39] mikecmpbll: are you sure you saved it? ;D
[15:08:42] CorySimmons: How can I setup a route in ActiveAdmin that will automatically take the user to a certain URL after they log in?
[15:09:29] Giorgio: its big app that is splitted in engines
[15:09:46] workmad3: Giorgio: right... but how are you pulling the engine into the app?
[15:10:49] Giorgio: gem 'gaku', path: '../gaku'
[15:17:07] Giorgio: workmad3, i tryed with watchable_dir in engine.rb
[15:17:11] Giorgio: still not help
[15:19:21] mikecmpbll: Giorgio: what are you changing and how are you determining that it hasn't changed?
[15:20:18] Giorgio: i`m changing few files on lib/subfolder directory
[15:20:23] Giorgio: that are placces in one rails engine
[15:20:39] mikecmpbll: and then restarting the app?
[15:21:19] Giorgio: yes but is annoying everytime i change something to restart app
[15:21:49] Revolution`: I'm trying to add an rss feed into my basic web blog that I made using the rails startup guide
[15:21:55] Revolution`: with feedzirra
[15:22:02] mikecmpbll: meh, i just put up with it
[15:22:17] workmad3: Giorgio: gems don't get reloaded as part of a running app... pretty sure I just stated that
[15:22:27] workmad3: Giorgio: i thought things weren't updated even with a restart
[15:22:40] Giorgio: after restart is updated yes
[15:22:51] Revolution`: would this be possible if I just generated a controller and added in the correct ruby code in the controller class?
[15:22:52] workmad3: Giorgio: this is one of the things you end up having to live with as part of having your app in several engines
[15:22:56] Giorgio: i was asking is possible to reload while app is running
[15:23:19] Giorgio: ahh undestand
[15:23:38] Giorgio: thank you workmad3
[15:23:55] workmad3: Giorgio: the way to handle this is to TDD your engines separately, so that you're not reliant on continuously manually testing engine behaviour through your main app
[15:24:39] CorySimmons: How can I setup this redirect route? get '/admin', to: redirect('/admin?scope=active')
[15:24:47] CorySimmons: It's not redirecting like I'd expect..
[15:25:20] Giorgio: workmad3, thank you i will go with TDD
[15:25:29] workmad3: CorySimmons: that looks like it's likely to end up with an infinite redirect :P
[15:29:10] CorySimmons: workmad3: How could I change it so when someone goes to /admin it sends them to /admin?scope=active
[15:29:23] CorySimmons: Been fighting with this stupid thing for hours
[15:29:46] Revolution`: what is the benefit of generating a controller versus using scaffolding?
[15:30:25] mikecmpbll: Revolution`: you don't get a load of stuff you don't want.
[15:30:56] Revolution`: hmm, but if I generate a controller, I will have to made a model separately right?
[15:31:08] mikecmpbll: if you want a model, sure.
[15:31:32] Revolution`: still not okay
[15:32:20] mikecmpbll: what's not okay?
[15:32:53] workmad3: Revolution`: if the scaffolded model and controller is exactly what you want, fine
[15:33:22] workmad3: Revolution`: I personally find that the only thing I keep in a scaffolded controller is the name... so I may as well not bother
[15:36:05] CorySimmons: Revolution`: They're saying you should just create these files manually and put the one-liner in them that defines them - as you need them
[15:36:23] CorySimmons: For instance, you might need both the model and controller
[15:36:30] CorySimmons: You might not need a template
[15:36:41] Revolution`: I think I need to read up on models and what they do exactly
[15:36:52] mikecmpbll: or a helper or a stylesheet or a js file
[15:36:55] CorySimmons: Scaffolding and/or the other command line generators can create all kinds of junk
[15:37:11] CorySimmons: Revolution`: This is a great tut http://guides.rubyonrails.org/getting_started.html
[15:37:38] Revolution`: that's the one I'm following
[15:38:39] CorySimmons: So just follow it and when you get to the end move onto the next one
[15:38:45] CorySimmons: http://guides.rubyonrails.org/
[15:39:06] CorySimmons: And if you get curious along the way (for instance, about Models) feel free to study those along your way
[15:40:16] Revolution`: alright thanks
[15:40:40] CorySimmons: np, it's time consuming but just take it slow and try to stick to these guides and you'll get better
[15:40:48] CorySimmons: I'm a newb too, so blind leading the blind, etc.
[15:41:01] CorySimmons: but I've found those guides are really solid
[15:41:42] Revolution`: yeah it's a bit of a learning curve
[15:43:35] CorySimmons: Yeah, it's not going to come fast but it
[15:43:39] CorySimmons: *it's worth it
[15:43:44] Yatekii: https://gist.github.com/Yatekii/88b406cb3b8f916f21e4 what am I doing wrong? :S
[15:46:16] nettoweb: guys, I'd like to know what is this log noise every time I laod a page locally, here is the log: https://gist.github.com/b306f267b4250bca4461
[15:46:23] DouweM: Yatekii: only stuff between <% ... %> is Ruby, everything else is HTML. Your `total += sale.total` is outside <% ... %>, so it's not evaluated as Ruby.
[15:46:43] nettoweb: is there a way to remove that? Its difficult to debug somethings
[15:46:51] DouweM: Yatekii: you'd need to get rid of the %> after |sale| and the <% before end. OR, just use `total = @sales.sum(:total)` to do it all in one line
[15:47:02] Yatekii: works like a charm
[15:48:00] DouweM: Yatekii: in this case, with sum(:total) it's fine to do it in the view, but generally calculations should be done in the controller, and your view should generally only be concerned with representing the data passed to it from the controller
[15:48:16] Yatekii: DouweM: ya
[15:48:29] Yatekii: I am struggeling alittle but I know it :)
[15:48:37] DouweM: Yatekii: knowing is the first step
[15:48:50] Yatekii: how do I send something from the controller that is not a param? just define a variable and then call it?
[15:49:23] DouweM: Yatekii: all instance variables, so those beginning in @, are shared between controller and view
[15:49:45] DouweM: or rather: those set in the controller are passed to the view
[15:50:54] Yatekii: but params are no @
[15:51:23] DouweM: right. Rails also passes a bunch of other vars to the view, like params
[15:51:31] DouweM: Yatekii: to pass your own data however, use instance vars
[15:53:18] lonely_farm_hand: Hi all, I am using uuid's with rails 4 and wanted to set the default sorting order like default_scope -> { order('created_at DESC') } but for the entire application rather than having that in each model. Is there any way to do this?
[15:54:07] Revolution`: so, say I wanted to create a page for an rss feed, would I need to run scaffolding with any arguments besides the name? I don't mind the extra stuff that scaffold creates as long as it works
[15:54:16] waseem_: lonely_farm_hand: There is a way but I'd advise against it.
[15:54:32] nettoweb: anybody here already tested https://github.com/dolzenko/silent-postgres
[15:54:46] waseem_: lonely_farm_hand: You can monkeypatch AR::Base.
[15:55:38] lonely_farm_hand: waseem_ where would i put the monkeypatch file?
[15:55:52] omarqureshi: dont do it lonely_farm_hand
[15:56:05] waseem_: lonely_farm_hand: In your initializer. Don't do it though.
[15:56:17] DouweM: and if you do, don't say we haven't warned you
[15:56:23] lonely_farm_hand: okay, i wont do it. thanks
[15:56:40] omarqureshi: that was easy enough
[15:56:58] mjc_: also default_scope is usually a bad idea too
[15:56:59] waseem_: omarqureshi: How are you adventures with browser issue these days?
[15:57:03] DouweM: lonely_farm_hand is a quick learner
[15:57:05] mjc_: lonely_farm_hand: especially for .order
[15:57:34] omarqureshi: waseem_: not too bad, though, ive spent the last week either raising money or doing sysadmin
[15:57:40] omarqureshi: so maybe i've forgotten
[15:57:44] mjc_: lonely_farm_hand: http://rails-bestpractices.com/posts/806-default_scope-is-evil
[15:58:10] Zendist: Good evening everyone :)
[15:59:02] lonely_farm_hand: mjc_ wow, thanks for sending that. i'll use scope :first, -> { order("created_at").first }
[15:59:25] mjc_: that might also not be a good choice because .first already means something else
[15:59:42] lonely_farm_hand: yes but since im using uuid's it wont return the right stuff
[16:00:08] mjc_: no it returns exactly what it should return
[16:00:09] omarqureshi: the trick is to always specify your order clause
[16:00:20] mjc_: make a :recent scope
[16:00:24] omarqureshi: no, hes right mjc_
[16:00:37] omarqureshi: first with normal AR is order by id limit 1
[16:00:45] omarqureshi: that would be fine with integer IDs
[16:00:51] omarqureshi: not so much with UUIDs
[16:00:59] mjc_: and with uuids it returns the same thing
[16:01:02] bricker`LA: lonely_farm_hand: and put it in a Concern so if it changes you don't have to edit each file
[16:01:07] mjc_: just not in the order you're assuming
[16:01:15] omarqureshi: you make the assumption that UUIDs are ordered
[16:01:19] mjc_: no I am not
[16:01:31] omarqureshi: so "first" loses its meaning
[16:01:49] mjc_: I am saying that it should be expected that uuids are unordered and first gives you exactly what you expect given that
[16:01:50] omarqureshi: its just "any old random one depending on what UUIDs have been made"
[16:02:08] omarqureshi: but, if you have that with an order clause, then yes, its fine
[16:02:27] mjc_: the assumption first makes by default is that ids are ordered numerically
[16:02:35] mjc_: sequentially
[16:02:59] mjc_: what I'm saying is that when you have made the choice to use uuids you must assume that .first will do the same
[16:03:27] mjc_: so make a scope to shorthand it or something and always use that, or explicitly call .order
[16:03:54] mjc_: the behavior is counterintuitive only if your assumptions about how first works are incorrect
[16:04:35] lonely_farm_hand: mjc_ that just seems like it would make .first and .last useless with uuids though
[16:04:50] mjc_: lonely_farm_hand: Thing.ordered.first
[16:04:57] mjc_: or .sorted
[16:05:01] mjc_: scope of your own
[16:05:13] mjc_: when you make a design decision you have to just deal with the tradeoffs
[16:05:41] lonely_farm_hand: i understand. is there any way i could redefine the .first and .last in a concern so its just redefined in one file?
[16:06:04] mjc_: other code that uses it may break in unexpected ways, even within whatever file
[16:06:08] mjc_: I don't suggest that
[16:06:40] mjc_: FWIW I have three different apps in production with UUID id columns
[16:07:54] drim: what's the best way to serialize an activerecord model using websocket?
[16:08:00] mjc_: all it takes is some other thing bolted on to your model that expects first to behave the same as [0] or something will bite you
[16:08:05] mjc_: *to bite you
[16:08:35] rushed: drim: just hook it up to the Bussard collector
[16:08:47] drim: bussard collector?
[16:08:48] lonely_farm_hand: gotcha. i guess i'll go your route and create a new scope
[16:08:58] mjc_: drim: there's a websocket-rails gem but I have no idea how useful it is
[16:09:32] drim: im using em-websocket
[16:09:38] mjc_: lonely_farm_hand: it's a pain but it is safe, you can certainly make tests to ensure you don't miss any calls
[16:10:58] lonely_farm_hand: mjc_ will do! thanks
[16:11:17] pontiki: i haven't heard of Bussard Collectors in ages and ages
[16:11:20] mjc_: lonely_farm_hand: similarly you could probably try and test your method so you'd be aware of failures
[16:11:30] mjc_: but I don't think that's anywhere near as easy to get right
[16:12:08] mjc_: lonely_farm_hand: also postgres has different uuid generation algorithms, one of which is sequential
[16:14:00] Revolution`: will I to store anything in a databse if I'm just fetching an rss feed and displaying it using feedzirra?
[16:15:10] mjc_: Revolution`: if you don't save it somewhere, would you plan on fetching the RSS feed every single page load? that doesn't seem nice
[16:15:14] rushed: Revolution`: what feed? how often are you going to hit it?
[16:15:35] Revolution`: it needs to refresh to be up to date, so I guess so yeah
[16:15:54] rushed: this sounds sound spammy at all :P
[16:15:55] mjc_: does the server it's on not send last-modified, expires, or etags headers?
[16:16:34] mjc_: check the headers in your browser's dev tools or inspector, or curl
[16:16:48] mjc_: if it sends those you can use them for caching and still get up-to-date feeds
[16:17:16] zackseuberling: have been trying to figure this out for a couple days: deploying with capistrano, all assets are compiled and uploaded *except* for fonts. i'm not expecting them to be compiled, but they're getting hashes in my CSS file and not being uploaded. anyone run into an issue like this
[16:17:20] mjc_: drim: you might be able to get some ideas about how to handle websocket stuff from websocket-rails even if you decide not to use it
[16:17:42] mjc_: zackseuberling: what rails version?
[16:18:10] rushed: zackseuberling: application.rb... config.assets.precompile += %w( *.css *.js *.woff *.eot *.svg *.ttf)
[16:18:23] mrfoto: zackseuberling: try sprockets_better_errors gem
[16:18:49] mrfoto: it tells you nicely what is going on and how to fix it
[16:18:54] mrfoto: life saver this
[16:19:09] zackseuberling: I've heard of better_errors gem, but never sprockets_better_errors
[16:19:12] zackseuberling: will take a look
[16:19:18] mjc_: I didn't have to add anything to config.assets.precompile for fonts to work rushed, he shouldn't have to eitehr, probably
[16:19:23] mjc_: zackseuberling: it's fairly new, from schneems
[16:19:36] makerops: I am writing some code to subscribe to a 2 amqp topics, one is content, the other config
[16:19:36] rushed: mjc_: were any of your fonts from gems? like say font-awesome?
[16:19:54] mjc_: rushed: yes but I make sure none have their assets in the vendor directory
[16:19:56] zackseuberling: no, fonts are not from a gem
[16:20:11] zackseuberling: oops, didn't see that was directed at mjc__
[16:20:13] makerops: one the config topic sends out an update, I want to update the content loop
[16:20:21] workmad3: mjc_: rails 4 changed the behaviour of images, fonts, etc in gems so that they're no longer automatically pulled into the precompile
[16:20:33] mjc_: workmad3: wrong, only in gems that put their stuff in vendor/assets
[16:20:38] mjc_: app/assets works fine
[16:21:04] zackseuberling: wondering if it's a capistrano deploy error on my end
[16:21:07] workmad3: mjc_: I stand corrected :)
[16:21:09] zackseuberling: rather than a rails config problem
[16:21:10] workmad3: mjc_: well... sit
[16:21:42] zackseuberling: but, like I said, all other assets are compiled and deployed correctly
[16:21:52] mrfoto: zackseuberling: try the sprockets_better_errors gem
[16:22:05] mjc_: sprockets_better_errors should give you useful info
[16:22:09] mrfoto: its like 5s to get it going and you will immediately know
[16:22:16] mrfoto: cause we can guess all night :P
[16:27:26] zackseuberling: the gem is installed?????reading through the Readme
[16:27:42] zackseuberling: are the error in the log or would they be on the front-end
[16:27:47] zackseuberling: cuz, I'm not seeing any errors
[16:27:51] zackseuberling: which seems like a good thing
[16:29:38] mrfoto: open a site on dev where you require those fonts
[16:29:58] mrfoto: and oh, restart the server if you didnt after changing the development.rb
[16:30:14] zackseuberling: yeah, bundled, added to development.rb and restarted the server
[16:30:22] zackseuberling: watching my dev log and don't see anything scary
[16:30:36] zackseuberling: or out of the ordinary
[16:30:46] mrfoto: opened the page where you require those fonts?
[16:31:13] zackseuberling: and the fonts are working/have always worked locally
[16:31:56] mrfoto: thats weird...could be a capistrano issue then i guess
[16:32:13] mrfoto: where are the fonts located
[16:32:18] rushed: zackseuberling: config.assets.precompile += %w( *.css *.js *.woff *.eot *.svg *.ttf) <= did this not work? :)
[16:32:27] zackseuberling: app/assets/fonts
[16:33:23] mrfoto: try this http://stackoverflow.com/questions/18294150/how-to-use-fonts-in-rails-4
[16:36:04] hackeron: hey, with simple_form f.button :submit creates a nice localised link to create or update a camera. How would I create a localised link for the delete button?
[16:37:51] mrfoto: hackeron: http://guides.rubyonrails.org/i18n.html
[16:38:33] mrfoto: probably something like <%= link_to (t :delete), ... %>
[16:39:36] hackeron: mrfoto: I read that
[16:40:07] mrfoto: hackeron: well thats it
[16:40:11] hackeron: mrfoto: I'm looking for the pre-existing i18n key I can reuse from simple_form for the delete button
[16:40:28] hackeron: mrfoto: or one already in rails
[16:40:41] hackeron: mrfoto: because I want to reuse existing translations if possible instead of re-translating myself
[16:41:17] mrfoto: well yeah but then you are depending on simple_form
[16:41:30] mrfoto: and one day you might change that and stuff will break
[16:42:00] mrfoto: or they might change something
[16:42:05] hackeron: mrfoto: ah, I see there's helpers.submit.create -- there's one for create, save and update but there isn't one for delete :/ - guess I will have to add my own
[16:42:13] hackeron: mrfoto: https://github.com/svenfuchs/rails-i18n/blob/master/rails/locale/en.yml
[16:44:30] haukur: I'm trying to change Rails.configuration.action_mailer.smtp_settings[:domain] dynamically but it doesn't seem to work
[16:44:43] haukur: I have an initializer that sets it to the relevant hostname
[16:45:22] mrfoto: haukur: how do you set it
[16:45:41] haukur: Rails.configuration.action_mailer.smtp_settings[:domain] = 'sub.domain.tld'
[16:46:05] mrfoto: well thats not dynamic
[16:46:34] tubbo: haukur: Rails.configuration isn't supposed to change dynamically.
[16:46:34] haukur: mrfoto: why not?
[16:46:43] tubbo: so you might see problems..
[16:46:45] haukur: How can I do it then?
[16:47:04] haukur: I have some subdomain-specific settings that need to be configured in a gitignored config file
[16:47:22] mrfoto: well you set it with a static string. whats dynamic about that
[16:47:46] tubbo: haukur: unless there's something special going on, i believe changing action_mailer.smtp_settings would require a restart.
[16:48:03] tubbo: haukur: a restart of `rails server` that is.
[16:48:26] mrfoto: tubbo: the way i understand he is changing it in the initializer so thats ok
[16:48:46] tubbo: mrfoto: no, the initializers are *only* run once at initialization of the app.
[16:48:49] tubbo: so they will only be run once.
[16:48:55] mrfoto: yes i know
[16:49:06] mrfoto: thats what i said
[16:49:16] haukur: I guess I could just read from a yml file from the envrionment config
[16:49:31] tubbo: haukur: that would probably be best.
[16:49:38] haukur: okay, thanks for the help :)
[16:49:42] youl: I build a string who will be used in a where clause : "a = ? OR b = ? OR c = ?"
[16:49:51] youl: this will become where("a = ? OR b = ? OR c = ?", true, true, true)
[16:49:52] youl: but I dont know in advance how many "true" to use (d??pends on the string)
[16:49:56] youl: how can I do this ?
[16:50:05] youl: something like : where(myString, myCounter.times { |i| true })
[16:50:22] tubbo: youl: use the hash syntax instead. `where a: true, b: true, c: true`
[16:51:03] bricker`1A: youl: or you can use named interpolation: `"where a = :a or b = :b or c = :c", a: true, b: true, c: true`
[16:51:29] youl: ok Ill see if it fits my needs
[16:51:31] tubbo: bricker`1A: ahh, named interpolation. throwing off "experienced" developers in interviews since 2010.
[16:51:40] tubbo: rails devs*
[16:51:53] bricker`LA: tubbo: I don't understand
[16:52:25] tubbo: bricker`LA: everyone knows 'a = ?', but less people know about 'a = :a'. so when people come in for an interview and we show them parts of our code with named interpolation in there, they sometimes go "whaaaa??"
[16:52:36] tubbo: and then everyone learns something :)
[16:52:48] bricker`LA: tubbo: oh yeah :D
[16:54:05] youl: the hash gives AND
[16:54:05] youl: I need OR
[16:54:27] bricker`LA: youl: you must be using it incorrectly
[16:54:35] bricker`LA: tubbo's thing
[16:54:58] bricker`LA: active record :(
[16:55:18] hackeron: hey, I do Model.human_attribute_name to get a translated/i18n'd attribute name but how do I get the translated model name?
[16:56:00] Kenjin: In Minitest, is there a way to have the method defined by _let_ available in the _describe_ block? It seems it is only available in _it_.
[16:56:48] Kenjin: Maybe I'm going about this wrong, but I'm trying to pass the _let_ binding to a function I call inside _describe_ that generates a bunch of _it_ blocks for me.
[16:56:52] tubbo: youl: you can tack on new queries to an AR::Relation
[16:57:30] bricker`LA: Kenjin: you can't easily, maybe you could use a before block?
[16:57:32] tubbo: youl: %w(a b c).each { |col| rel += or(col => true) } # => WHERE a = 't' OR b = 't' OR c = 't'
[16:58:03] tubbo: or even better.. :)
[16:58:17] Kenjin: bricker`LA: let me show you a gist of what I'm trying to do.
[16:58:32] tubbo: youl: %w(a b c).reduce(YourClass.scoped) { |rel,col| rel += or(col => true) } # => WHERE a = 't' OR b = 't' OR c = 't'
[16:58:44] tubbo: that will simply return an AR::Relation with everything in there you need
[16:59:04] bricker`LA: hackeron: en.activerecord.models.your_cool_model
[16:59:21] lethjakman: hrm...I just tried deploying to my staging environment, and apparently it "Can't verify CSRF token authenticity"
[16:59:23] youl: ok I got the first idea, not the second ><
[16:59:30] youl: @tubbo ^
[16:59:37] lethjakman: I see the token right there in the post under authenticity_token....and I'm using strong params.
[17:00:17] tubbo: youl: the second has to do with reduce()
[17:00:18] mrfoto: lethjakman: using cancan?
[17:00:26] lethjakman: mrfoto: nope.
[17:00:30] Kenjin: bricker`LA: something like this: https://gist.github.com/jsmpereira/e63cc6fc4650560cf3bd
[17:00:38] tubbo: youl: the second has to do with reduce() http://ruby-doc.org/core-2.0.0/Enumerable.html#method-i-reduce
[17:00:53] tubbo: youl: basically it's the same thing but instead of you having to create the rel object yourself it does it for you in the iterator.
[17:01:00] mrfoto: lethjakman: theres a related cancan issue. what raises the error?
[17:01:01] tubbo: youl: reduce() just ensures your iterator returns a given object
[17:01:22] lethjakman: mrfoto: my post does. is that what you mean?
[17:01:24] Kenjin: bricker`LA: I'm under the impression that let vs before block is a case of evaluation time.
[17:01:30] lethjakman: I'm posting to a create action for my user
[17:04:11] Kenjin: bricker`LA: how would you go about achieving that kind of abstraction?
[17:04:35] mrfoto: lethjakman: does the create action raise an error?
[17:04:49] mrfoto: could you post a stack trace to a gist
[17:07:47] havv: hey, I'm trying to install rails
[17:07:57] lethjakman: mrfoto: https://gist.github.com/lethjakman/7947590
[17:08:04] lethjakman: I'll add the stack trace too one sec
[17:08:04] havv: I get Unable to resolve dependency: 'rails (= 4.0.2)' requires 'activesupport (= 4.0.2)' every time
[17:08:08] youl: Ill test where("a = :true OR b = :true", true: true) do you think this could work ?
[17:08:34] havv: so I used the -V flag and it seems that it fails to connect to amazonws GET https://s3.amazonaws.com/production.s3.rubygems.org/specs.4.8.gz connection reset after 1 requests, retrying
[17:08:46] mrfoto: lethjakman: well thats not a stack trace :P
[17:08:49] mrfoto: it works on dev?
[17:08:58] lethjakman: https://gist.github.com/lethjakman/7947590
[17:09:08] lethjakman: I was doing that before I saw your message
[17:09:10] mrfoto: oh sorry didnt see your comment
[17:10:32] bricker`LA: Kenjin: maybe try passing in a symbol to the validates_presence method, and then calling it with send()
[17:10:43] mrfoto: lethjakman: well it never reaches your controller
[17:10:55] lethjakman: mrfoto: why's that?
[17:11:52] mrfoto: no idea...do you send this via ajax?
[17:12:08] Kenjin: bricker`LA: :O That did it. Thanks!
[17:12:28] youl: @tubbo I found an easiest solution : where("a = :y OR b = :y", y: true)
[17:13:38] youl: @bricker`LA Thanks! you gave me the good tip
[17:13:40] Fire-Dragon-DoL: I have some methods that i moved into a module because it must be shared by some models. Which is the "correct" (suggested) directory to place this model in? Is "helpers" the right directory?
[17:14:43] bricker`LA: Kenjin: a few other ideas: You could just use shoulda_matchers, which adds this functionality exactly, or you could *extend* the method into Rspec's config, which (should) make that method available in the describe block (although I've never tried that)
[17:15:45] Kenjin: bricker`LA: about Rspec I was aware, but I'm using Minitest, and am trying to keep a low profile with the matchers :P
[17:15:57] bricker`LA: Kenjin: that's fair :)
[17:16:11] Kenjin: bricker`LA: :) Thanks again.
[17:17:14] lethjakman: mrfoto: no, it's just a regular post. noteven remote: true
[17:21:29] pwz2000_: I am getting a NoMethodError undefined method `message_path' for `<%= form_for @message do |f| %>`. Am I missing something in my routes? https://gist.github.com/pwz2k/7947799 It works if I do <%= form_for @message, :url => user_messages_path(@user) do |f| %> but not how I changed it.
[17:21:51] mrfoto: lethjakman: its really weird that it works on dev...maybe something pops up in logs?
[17:22:14] bricker`LA: pwz2000_: you should do form_for [@user, @message]
[17:22:27] tubbo: youl: boom!
[17:22:32] tubbo: good call
[17:26:07] pwz2000_: bricker`LA: thanks I never did it in brackets like that.
[17:35:48] RobertBirnie: does rails have a callback for when save fails on a new object? i see before_save and after_save but unsure when it fails
[17:37:57] benlieb: RobertBirnie: you can check for errors.any?, assuming that you add errors when there is a reason not to save
[17:39:33] youl: STI really sucks "User < BaseUser" BaseUser.all will sometimes take Users with, sometimes not ><
[17:39:36] benlieb: RobertBirnie: or if saving a new record, you can use the persisted? or I think new_record? methods to check if it saved
[17:44:32] benlieb: RobertBirnie: see this http://guides.rubyonrails.org/active_record_validations.html#working-with-validation-errors
[17:55:17] jwb010: i've got a form where i either make a new entry or choose an existing one by entering the id. where does the logic go to determine which one should be used? (rails4)
[17:55:45] bricker`LA: youl: BaseUser.all should only return BaseUser objects
[17:56:02] bricker`LA: Unless you have a default_scope, of course, which you shouldn't, for this reason.
[17:56:26] jwb010: i suppose in the create function...
[17:56:40] youl: @bricker`LA not always, sometimes i get User too
[17:57:06] youl: @bricker`LA when User class is referenced somewhere in the method ... after some tests
[17:57:50] bricker`LA: youl: I'm saying it *should*, I don't know why it's not in your case, without seeing the code.
[18:03:26] jwb010: will try before_validation in the model
[18:23:29] jmbrown412: What are some recommendations for messaging with rails..we will be looking to do things sms, email, and otherwise notifications within our app.
[18:23:49] GeekOnCoffee: jmbrown412: twilio for SMS, mandrill for email
[18:24:20] jmbrown412: Do those handle querying an API for content that is ready?
[18:25:17] GeekOnCoffee: jmbrown412: I have no idea what you mean by that, but they both have really good docs available
[18:25:23] GeekOnCoffee: so take a look and see :)
[18:25:37] jmbrown412: So we would have content (messages) likely in our DB that will need to be received by other users in our system.
[18:25:39] pontiki: jmbrown412: do you mean you want your rails app to respond to SMS and emails?
[18:26:25] pontiki: sending SMS or email (via twilio and mandrill) would be initiated by your app, probably with a delayed queue
[18:27:08] jmbrown412: We would want to be able to sms/email and potential other messaging types (in app messaging) to our users.
[18:27:34] pontiki: ok, then those are the likely candidates for services
[18:34:40] MrPunkin: Does rails already validate uniqueness of the primary_key column for a table, or is that just implied because primary keys by default are auto-incrementing integers?
[18:34:51] MrPunkin: for a model I should say
[18:35:43] jwb010: MrPunkin: doesnt your db already handle that?
[18:36:37] MrPunkin: jwb010: Yes, just trying to build out the rails layer and asking about it.
[18:37:14] MrPunkin: so that it doesn't try to save to the DB at all if it isn't unique, just to prevent the DB error at a validation level. Same reason you can validate unique in rails even if you set a unique constraint in your table too
[18:38:03] jwb010: right good point :), i'm pretty sure it would but have no source
[18:38:07] tubbo: MrPunkin: the reason for validating uniqueness in rails as well as on the index in the DB is so you can support a better error-handling strategy
[18:38:18] tubbo: MrPunkin: the database will throw an exception, rather than just shove a validation error in.
[18:38:35] tubbo: so the idea is you validate it *before* it gets to the DB, and in the unlikely event that some code doesn't validate that field, throw an error.
[18:39:09] tubbo: going a step further (especially when validating presence), you can ensure certain fields exits before the data is even POSTed to the server :)
[18:41:17] brycesenz: Is there anyone who can help me out with a metaprogramming problem?
[18:41:36] helpa: brycesenz: How to ask good questions and get great answers: http://www.mikeash.com/getting_answers.html
[18:41:36] tubbo: brycesenz: !ask
[18:42:39] brycesenz: Ok, well, I am having problems dynamically defining a class with instance methods. I've highlighted the problem in this gist: https://gist.github.com/brycesenz/59c4e3f1f81e80db2735
[18:43:13] tubbo: brycesenz: why are you trying to do that?
[18:43:14] brycesenz: I'm trying to defining things by passing in a block, and everything is working except for method definitions
[18:43:25] tubbo: brycesenz: oh so kinda like Object.tap?
[18:43:31] brycesenz: Oh. I have some classes that are dynamically defined as part of a gem.
[18:43:53] brycesenz: @tubba - maybe? I'm not terribly familiar with tap
[18:44:15] tubbo: brycesenz: look it up, it's pretty neat :)
[18:44:16] brycesenz: I just need to be able to define a new class with the instance and class methods that I pass in.
[18:44:28] tubbo: brycesenz: "a new class" == the same class every time?
[18:44:49] tubbo: brycesenz: how do you configure which class is being instantiated?
[18:45:00] brycesenz: tubba: No, a different class each time. Dynamically created (and dynamically named) based on other parameters
[18:45:39] Revolution`: so I'm trying to get this RSS feed to work but I keep getting a no method error in the view
[18:45:42] Revolution`: https://gist.github.com/anonymous/7949140
[18:46:06] brycesenz: tubba: a user can call the `define class` method with his/her block, and expect to get back a class that is defined with the methods that he/she passed in.
[18:46:21] MrPunkin: tubbo: Right, basically I was just curious with something like a confirmation code thats a hashed string and not an auto-incrementing pkey if it should be validated before attempting to save, but if I understand correctly since this is a application level situation and not anything the user can help, putting it into the validation system doesn't really help anything as I could just deal with the exception from t
[18:47:17] brycesenz: tubba: I'm not sure how .tap factors in. That seems to be more about getting an object, doing some things to it, and returning that object. I don't see how it's related to my metta programming question.
[18:48:27] tubbo: MrPunkin: i would normally say you shouldn't wait for your DB to throw an exception...but i would also say to look towards Devise as a proper way of handling confirmation code validation.
[18:48:51] tubbo: exceptions are for exceptional cases, like "your code didn't work". not "someone forgot to enter a value"
[18:49:15] tubbo: back in an older job we had Airbrake running so you *really* didn't want exceptions to be thrown around...given that every time one would be thrown everybody on the team gets an email.
[18:49:44] tubbo: brycesenz: is that not what you're doing? you're instantiating an object, applying whatever is in the &block to the instance of that object, and returning it.
[18:49:48] MrPunkin: tubbo: This isn't exactly confirmation code, just was an example of a non auto-incrementing pkey. But I don't see how catching a potential issue at the application level would help anything now I think about it since it can't save to the DB and the user can't change what it's trying to use as the pkey.
[18:50:14] tubbo: MrPunkin: in this case, you probably *do* want to be notified if a confirmation code isn't being generated...
[18:50:28] tubbo: MrPunkin: because that would indicate a problem with your code, right?
[18:50:44] MrPunkin: Right, I'll let the exception throw and get notified
[18:50:55] brycesenz: tubbo: no, not really. And either way, that's not what is failing in the code. Did you look at the gist? I feel like it highlights the problem I'm seeing.
[18:53:37] tubbo: brycesenz: i did, and re-reading it...seems that tap isn't *exactly* what you want here. what you really want is to yield &block to the instance of Class.new
[18:54:09] tubbo: brycesenz: can you try just doing `yield` in there instead of `self.instance_eval`, and see what happens?
[18:54:19] tubbo: yield without arguments just calls the &block
[18:55:14] Revolution`: so I'm trying to get this RSS feed to work but I keep getting a no method error in the view
[18:55:16] Revolution`: https://gist.github.com/anonymous/7949140
[18:58:32] brycesenz: tubbo: yield causes other problems. For example, if I use yield, and then try to pass in a block that defines "attr_accessor :name", I get an error (since the command line scope doesn't understand attr_accessor)
[19:04:19] Dreamer3: ok why can't i get fusion passenger 4.0.29
[19:04:25] Dreamer3: looks like it's not in the gem index?
[19:10:12] tubbo: brycesenz: hmm...weird. it's mixing around a lot of concerns.
[19:10:31] tubbo: brycesenz: i think it's because the "instance" hasn't been created yet, that's why you're not seeing the method
[19:10:47] tubbo: like it's adding to the instance but the instance isn't there so it just goes to /dev/null lol
[19:11:42] brycesenz: tubbo: what do you mean it's because the instance hasn't been created yet? Can you give me an example of how that wouldn't fail?
[19:14:00] tubbo: brycesenz: honestly i'm not quite sure. i think you have to dive further into the "order" of how things are called, *exactly* how instance_eval works, etc.
[19:14:23] tubbo: brycesenz: it looks to me like you're just re-implementing the way one would define a class in Ruby...
[19:14:40] tubbo: brycesenz: like define_class is just `class MyClass;end;Class.new`...
[19:14:52] tubbo: and in the class definition you want to execute code
[19:15:06] brycesenz: tubbo: Well, that is the idea, although I'm seemingly not able to define instance methods. It's just that latter part that is somewhat confusing to me.
[19:15:23] tubbo: brycesenz: i just question why you want to do this at all, seems like a waste of time.
[19:15:36] tubbo: just to learn more about meta-programming or...?
[19:16:11] tubbo: brycesenz: if you're actually solving a problem with this my suggestion is to stop and take a step back to see what you're missing. it definitely shouldn't be this hard :)
[19:16:17] brycesenz: It's really not. I have a form class, and within it one can define nested form classes.
[19:16:36] brycesenz: tubbo: I can basically guarantee you that this is the best way to solve the problem.
[19:18:38] lethjakm1: brycesenz: I think that's an impossible guarantee. there's never a single best way to solve any problem.
[19:19:27] bricker: 100 brickercoins to whoever can come up with the best version of "PEBCAK" for touch-screens
[19:19:45] brycesenz: lethjakml: If I need to be able to define a child class within an existing class, is there any other way that using meta-programming to achieve that?
[19:23:27] lethjakm1: bricker: pebuaf
[19:23:43] bricker: NOT GOOD ENOUGH >:(
[19:23:54] lethjakm1: your moms not good enough!
[19:24:08] lethjakm1: brycesenz: what exactly are you trying to do?
[19:24:08] bricker: my mother is perfect, tyvm
[19:24:18] lethjakm1: bricker: I know ;)
[19:24:24] bricker: lethjakm1: YOU BASTARD!!!
[19:24:32] lethjakm1: bricker: actually...you'd technically be the bastard.
[19:24:56] bricker: lethjakm1: :'-(
[19:25:25] lethjakm1: bricker....I am your father.
[19:26:06] bricker: NO! THAT'S IMPOSSIBLE!
[19:26:15] lethjakm1: I have a feeling it is...how old are you?
[19:26:34] bricker: lethjakm1: late 20's
[19:26:38] brycesenz: lethjakml: For a class I am writing, the user needs to be able to define child classes (essentially, has_many...) within the parent class itself. So, to be able to say that the child class has certain attr_accessors, methods, etc.). My claim is that doing so requires using meta-programming to be able to define those classes dynamically. Your claim is that there is an alternative. What is that alternative?
[19:26:51] lethjakm1: bricker: yep. impossible. early twenties here.
[19:29:37] lethjakm1: brycesenz: you could create an hash on the class and add arrays of attr_accessable to that and process them that way.
[19:29:45] lethjakm1: and don't tell me what I claim, because I never made that claim
[19:30:33] lethjakm1: I just claimed that it's impossible to say you can guarantee you have the best possible solution for any given problem. you can only have the best solution that you can think of.
[19:30:41] tubbo: brycesenz: look to Rails. how do *they* handle nested object associations?
[19:30:41] brycesenz: lethjakml: Sorry, I'm not trying to put words in your mouth. But it sounded like you were proposing a non-metaprogramming solution when you objected to my statement that meta-programming was the best way to solve that problem.
[19:30:42] workmad3: lethjakm1: not impossible... it would just require you to have built a time machine
[19:31:02] tubbo: brycesenz: they build the association outside of the class hierarchy. so there aren't sub-classes, there are just all flat classes with associations built in based on conventions.
[19:31:11] tubbo: brycesenz: y u no follow this model? :)
[19:31:34] pishposh: i just cloned a project and when i try to bundle it seems to be having trouble with the dependencies and wants me to install individually
[19:31:40] tubbo: brycesenz: a "child class" *could* simply be a regular class that include's a module with all the code you need.
[19:31:47] pishposh: i have been using ruby 1.9.3 and this is ruby 2.0.0
[19:31:55] brycesenz: tubbo: I am aware of how rails does it. But that's changing the definition of the problem I'm trying to solve, rather than solving the problem at hand.
[19:31:59] tubbo: pishposh: probably a c extensions issue, and there's your problem. delete your gem directory and try again.
[19:32:01] CorySimmons: Does anyone have an ActiveAdmin dashboard that lists a ton of various ActiveAdmin elements? I'm thinking about re-skinning it and submitting a PR. The whole gray-gradient thing is pretty dated.
[19:32:14] tubbo: brycesenz: not really, it's changing the way you solve the problem. and it does solve the problem at hand.
[19:32:22] tubbo: brycesenz: how does it "change the definition"?
[19:32:39] pishposh: tubbo: won't deleting my gem directory be a problem elsewhere?
[19:32:54] lethjakm1: workmad3: that's assuming a time machine is possible.
[19:33:01] tubbo: pishposh: well when you run `bundle install` it should come back. i meant the gem dir that you install gems to with bundler, btw...not your system gems folde.r
[19:33:08] tubbo: pishposh: sorry probably should've mentioned that :D
[19:33:35] tubbo: bricker: PEBFAG: Problem Exists Between Face And Glass
[19:33:35] pishposh: tubbo: gotcha
[19:33:38] tubbo: ACTION collects tokens
[19:33:50] workmad3: lethjakm1: how about a machine that lets you move into a different everett branch that's exactly <bricker's_age> years in the past, where you find and seduce bricker's mum?
[19:35:11] pishposh: tubbo: I deleted Gemfile.lock and now it tells me Gemfile not found...
[19:35:15] bricker: tubbo: HAHAHAHA
[19:35:17] bricker: tubbo: dude
[19:35:24] tubbo: or PEBGAF if you don't want to offend anybody :)
[19:35:24] bricker: tubbo: you win so fucking hard with that one.
[19:35:48] brycesenz: tubbo: I mean, if part of the problem statement is that end users be able to define sub classes within the parent class, are you explicitly changing that problem statement?
[19:35:50] pishposh: tubbo: my bad
[19:36:01] workmad3: tubbo: I'm resting the back of my head on a window... is it still PEBGAF?
[19:36:03] lethjakm1: workmad3: I plead the 5th ;)
[19:36:25] tubbo: pishposh: heh, path error? :)
[19:36:31] tubbo: pishposh: happens *all* the time with bundler
[19:36:37] pishposh: tubbo: word
[19:36:56] tubbo: workmad3: only if the window is vista.
[19:36:58] bricker: tubbo: you get a bonus for that, here is 10,000 brickercoins
[19:37:03] bricker: ACTION showers tubbo with brickercoins
[19:37:13] tubbo: brickercoins hurt
[19:37:16] bricker: They're made of playdoh, don't worry
[19:41:31] lethjakm1: hrm I still can't figure out why my authenticity_token is being rejected. it isn't even making it to the controller. anyone have any insight? https://gist.github.com/lethjakman/7947590
[19:42:13] lethjakm1: there's certainly a token in that post...
[19:46:38] platzhirsch: Before I make a bad design choice: My domain model is that there are repositories and repositories have snapshots (1-n). Then there are metrics, they store algorithms to be run on the snapshots. They are only instantiated for running a computation. In my controllers and views I use a Symbol representation of each metric to refer to them. Now I want to make proper ActiveModels out of them, so I thought I turn every Metric object into a
[19:47:03] platzhirsch: I doubt anyone can see through this, but if,... let me know :P
[19:47:14] brycesenz: oh, random question for anyone - is there a way to scroll up to past parts of the conversation in XChat (if anyone uses XChat)?
[19:48:12] pragmatism: brycesenz: sounds like you're looking for a scrollback buffer or a logger, and I'm sure xchat has them
[19:48:15] pragmatism: check the menus
[19:49:44] lethjakman: brycesenz: in weechat which should be similar it's page up and down.
[19:51:10] brycesenz: lethjakman: Page up and page down for the win!
[19:51:23] lethjakman: also if I hold alt I can move a little bit at a time.
[20:06:54] shinobi_one: If I were going to create an extremely large application that handles millions and millions entries of data, requires multiple processes and threads, queues, large amounts of disk storage, would Rails be adequate? :D
[20:08:46] lethjakman: shinobi_one: I'd be more worried about the database at that point. however rails has been known to handle a lot especially if you implement caching and load balancing.
[20:08:52] slash_nick: rails alone? no... what do you want to use for persistence? something like Riak?
[20:10:12] shinobi_one: let's say the issue generally wouldn't be number of simultaneous user connections, but just the sheer amount of data coming in and being searched on (perhaps by sphinx or something)
[20:10:49] pragmatism: shinobi_one: It's working fantastically for us :)
[20:11:08] shinobi_one: oh and let's say it has to run well on one server at a time as well as the possibility of multiple servers
[20:11:23] pragmatism: shinobi_one: Like a normal web app? Yeah, Rails scales great.
[20:11:35] pragmatism: That's more of an architectural issue, not a framework issue.
[20:12:06] shinobi_one: pragmatism: yeah i believe architecture will be the biggest factor in speed, but you think using Rails for something like this would work?
[20:12:16] pragmatism: >>Rails or something like this
[20:12:54] pragmatism: Not just in speed, arcitecture will dictate whether or not your app is able to scale _al all_
[20:13:30] shinobi_one: speed and scalability i should have said
[20:13:59] shinobi_one: anyone using Riak? i've heard about it, but never really considered it. I don't think Postgres would be the solution for what i'm trying to do
[20:14:59] pragmatism: Riak is good if it fits your use-case. If you're going to a distributed DB I'd check out Mongo and Cassandra as well.
[20:15:11] pragmatism: They all have their strengths and weaknesses.
[20:16:08] shinobi_one: I've heard mixed reviews about Mongo performance.
[20:16:29] slash_nick: I don't think I'd go with mongo for the amount of writing you're talking about
[20:16:44] pragmatism: Mongo likes to lose things too :/
[20:16:53] pragmatism: We use it for very limited data persistence.
[20:17:10] pragmatism: I'm a die-hard PostgreSQL user.
[20:17:11] slash_nick: pragmatism: likes to lose things? under what circumstances?
[20:17:20] slash_nick: pragmatism: I like it too, but it's not right for some things.
[20:17:56] pragmatism: slash_nick: http://nosql.mypopescu.com/post/12466059249/anonymous-post-dont-use-mongodb
[20:18:08] shinobi_one: What I need is awesome performance, the ability to scale on the cloud as well as not on the cloud, and also is really damn good at not losting/corrupting data
[20:18:36] pragmatism: I would solidify a schema (or lack thereof) first...
[20:18:42] workmad3: slash_nick: a poorly set up single-node mongo cluster can just... lose data
[20:19:27] workmad3: slash_nick: at the time the posts about it happened, the mongo advice was that single-node clusters were not a stable use-case so shouldn't be used
[20:19:39] workmad3: dunno if they've improved on that situation or not
[20:22:42] slash_nick: seems like it's only a problem under significant load
[20:23:06] shinobi_one: how about jruby on rails to get *real* threading?
[20:23:23] ddd: or rbx which does it as well
[20:24:03] slash_nick: shinobi_one: I almost suggested that... then torquebox for clustering your app servers
[20:24:12] pwz2000_: I have a new form page on a message view. But the form box is automatically inserting the body of the message into the form box. How do I have it so that the form is empty? https://gist.github.com/pwz2k/7950749
[20:24:22] slash_nick: riak is probably the most reliable sounding persistence solution i've looked into lately
[20:24:37] pragmatism: shinobi_one: check out event machine with synchrony, reactor model has worked awesome if you're looking to stay on MRI
[20:24:46] slash_nick: there's a lot of overhead i guess, as they recommend 5 nodes minimum
[20:25:18] shinobi_one: torquebox slash_nick ?
[20:25:34] slash_nick: http://torquebox.org/
[20:25:44] slash_nick: oh, riak 5 nodes min is recommended
[20:25:45] shinobi_one: for 5 node minimum you mean riak
[20:26:51] shinobi_one: i'd really love to do this app in ruby, i'm just not sure about speed/threading/framework/db all that jazz
[20:27:40] slash_nick: shinobi_one: question, why is threading so important?
[20:27:50] slash_nick: for your use case
[20:28:33] shinobi_one: the app would have multiple background processes utilizing mulitple threads
[20:29:27] pragmatism: delayed job, event machine, celluloid...
[20:30:01] shinobi_one: event machine and celluloid both have good performance?
[20:30:11] shinobi_one: i've only read a little bit
[20:30:24] pragmatism: Ruby isn't C++
[20:30:27] workmad3: EM, it'll depend on what kind of background job
[20:30:31] bricker: pragmatism: ?!?!!?
[20:30:32] workmad3: IO-heavy, sure
[20:30:35] pragmatism: But with those tools, it's pretty fucking fast
[20:30:38] workmad3: CPU-heavy, not so much
[20:30:45] pragmatism: bricker: I know, I know. I'm sorry.
[20:31:22] benlieb: How do I add to the load_paths in an initializer? Can't find the right syntax or object to call this on...
[20:32:01] makerops: using devise, rails 4, and strong params, what is the easiest way to do nested forms/create another model upon user creation?
[20:32:04] bricker: benlieb: What are you trying to add?
[20:32:05] makerops: https://gist.github.com/makerops/7950863 <?
[20:32:37] lethjakman: makerops: accepts_nested_attributes
[20:32:43] benlieb: bricker: still porting this old app, and I need to convert the fckeditor plugin to a lib type require. The init.rb file has this line: config.load_paths += %W(#{Fckeditor::PLUGIN_CONTROLLER_PATH} #{Fckeditor::PLUGIN_HELPER_PATH})
[20:32:56] lethjakman: then set model_attributes in your strong params
[20:32:57] benlieb: But in an initializer there is no config object, so I need to get one
[20:33:18] makerops: lethjakman, i have that, but what does the users_controller.rb look like w/ devise?
[20:34:23] lethjakman: makerops: oh I see what you're saying. I'm nto sure how to do that in devise.
[20:34:31] makerops: http://stackoverflow.com/questions/17957429/rails-4-nested-attributes-not-displaying-with-devise
[20:34:41] makerops: this is prettty much my question, but it doesnt really answer it
[20:34:43] bricker: benlieb: just toss the files in lib/, they'll be loaded.
[20:34:52] bricker: (probably)
[20:35:15] benlieb: bricker: they're loading fine
[20:35:38] benlieb: bricker: in those files that are loading fine is this line: config.load_paths += %W(#{Fckeditor::PLUGIN_CONTROLLER_PATH} #{Fckeditor::PLUGIN_HELPER_PATH})
[20:35:44] benlieb: but the config var is undefined.
[20:36:12] benlieb: I need a config object, but am not sure how to get one.
[20:36:38] bricker: Er, is it the Rails application config?
[20:37:29] benlieb: bricker: yeah, that line was originally in the init.rb file of the plugin, which got loaded automatically. But those have to be turned into initializers.
[20:37:33] benlieb: I think I'm going to try CseeOrg::Application.configure do
[20:37:52] Dreamer3: is there a way to create a child and tell it what type without defining association joins for all types? (for STI)
[20:38:17] lethjakman: Dreamer3: well first you need a male and a female.
[20:38:33] Dreamer3: @owner.pets.new (how to specify Dog class, Cat class, etc),
[20:38:43] CorySimmons: I'm trying to re-theme ActiveAdmin but I can't seem to override it's variables. I can override one of them for some reason (the one they provide as a demo) but when I try to override other ones the changes aren't applied: http://stackoverflow.com/questions/20575562/how-do-i-actually-change-variables-and-override-styles-in-activeadmin
[20:38:44] Dreamer3: maybe this just works now
[20:38:49] Dreamer3: i haven't tried it in forever
[20:38:58] CorySimmons: As soon as I figure this out I'm going to make a pretty theme for it
[20:39:17] Dreamer3: nope: WARNING: Can't mass-assign protected attributes: type
[20:39:33] Dreamer3: so now i do it backwards Dog.new(:owner => )
[20:39:40] Dreamer3: but it's bugging me since i'm reviewing this code
[20:40:40] bricker: Dreamer3: you might be able to define different associations, `has_many :dogs, has_many :cats`, and @owner.dogs.create() will set the type for you.
[20:40:56] platzhirsch: How should I design model classes which are only required once per class? Simply a singleton?
[20:42:13] tubbo: platzhirsch: wat
[20:42:24] tubbo: platzhirsch: "once per class"?
[20:42:33] platzhirsch: tubbo: yep I have multiple metric classes
[20:42:37] Fire-Dragon-DoL: ahem...in an engine, I created a config variable... how to access it when not in the Engine class?
[20:42:43] platzhirsch: all inheriting from Metric
[20:42:59] tubbo: platzhirsch: bleh..STI... :P
[20:43:10] platzhirsch: So far I used a Symbol representation for them, but it's easier if you have a normal active model, to construct paths and all that stuff
[20:43:40] tubbo: platzhirsch: usually if i need a singleton, i just instantiate a single instance of the model in an initializer
[20:43:44] platzhirsch: tubbo: that's the thing, they are not really persisted because they have no data associated
[20:43:46] tubbo: ServerConfig = Configuration.new
[20:44:09] tubbo: platzhirsch: yeah i guess when you meant "model" you were talking about the concept and not an actual data model
[20:44:37] tubbo: platzhirsch: you should probably be okay by just instantiating the model once in an initializer. they are guaranteed to only run once on startup of app
[20:44:39] tubbo: of the app*
[20:44:55] platzhirsch: Yes, some argued with me that it should be stored in lib anyway, because they encapsulate the algorithms, but they are at the same time essential part of the domain I am dealing with and they are represented as any entity, too in the view
[20:45:21] ddd: oo, i saw an @owner.dog.create() what app be this? (I'm working an animal rescue transporter network app myself)
[20:45:49] tubbo: CorySimmons: as i said the other day, as soon as you need to start hacking active_admin i think it might be time to just make your own solution. it's very easy. active_admin is simply a master/detail view over your models using devise for authentication. in fact, many of its dependent gems like inherited_resources, simple_form, etc. can be combined outside of AA and used independently.
[20:46:05] lxsameer: what is the difference between simple "integer" and "belongs_to" in migrations
[20:46:23] tubbo: CorySimmons: so really, by using AA you're just wasting your own time. if you look into the tools that AA is using, i think you'll be pleasantly surprised to know that you can drop AA and be able to create a new interface very quickly.
[20:46:26] tubbo: plus you'll have WAY more control
[20:46:49] ddd: Dreamer3, reather than Cat Dog etc class, define class Animal and add something like :breed, :species
[20:46:51] tubbo: lxsameer: just a convenience. belongs_to is just an alias for `t.integer :whatever_id, index: true`.
[20:46:52] CorySimmons: tubbo: Trust me I thoroughly hate it by now but my company uses it and I'm sick of looking at it's ugly gradients so I just want to clean up what it looks like
[20:46:55] tubbo: lxsameer: so i guess *that* is a different :)
[20:47:10] lxsameer: tubbo: thanks buddy
[20:47:20] tubbo: CorySimmons: you can try fucking with active_admin.css...i mean worst comes to worst you can always fork the gem.
[20:47:26] CorySimmons: tubbo: I just can't get the damn variables to overwrite because -everything- in ActiveAdmin Land is ridiculously stupid and overcomplicated for no reason whatsoever
[20:47:32] platzhirsch: tubbo: alright then, thanks for your comments :)
[20:47:49] ddd: Dreamer3, or do an STI on it for each. simplifies the # of models, and makes the management easier i found
[20:47:55] CorySimmons: Yeah it just seems like you should totally be able to overwrite those vars (as it says in the actual damn file :((((( )
[20:48:15] tubbo: ddd: until you need to expand past the interface you defined in your base class, in which case you are fucked.
[20:48:32] enape_101: hey guys, so I've created a web app that has user profiles, where users can search for users based on interests etc.. How much I add a feature where users can favorite a persons profile
[20:48:44] workmad3: tubbo: if you're trying to use a model polymorphically and need more than the base-class interface, you're doing inheritance wrong anyway ;)
[20:48:51] CorySimmons: tubbo: See? https://github.com/gregbell/active_admin/blob/master/lib/generators/active_admin/assets/templates/active_admin.css.scss#L8
[20:49:01] CorySimmons: It's practically begging me to overwrite vars
[20:49:20] tubbo: CorySimmons: imho, when you use AA you move the work from programming into configuration. i'd rather program than configure. :)
[20:49:22] tubbo: CorySimmons: "SASS variable overrides must be declared before loading up Active Admin's styles."
[20:49:26] tubbo: ^^^ did you pay attention to that?
[20:49:28] CorySimmons: Even has this stupid vars file.. https://github.com/gregbell/active_admin/blob/master/app/assets/stylesheets/active_admin/mixins/_variables.css.scss
[20:49:50] CorySimmons: tubbo: Yeah I saw that but I don't think I know what it means
[20:49:57] tubbo: CorySimmons: welp, that's probably your issue lol
[20:49:59] bricker: tubbo: don't type that ^^^ it makes me anxious
[20:50:03] CorySimmons: New to rails and don't understand exactly how the asset pipeline works bro ;)
[20:50:11] workmad3: when you're dealing with SASS overrides, you *must* use @import to pull the file in, and you have to define your overridden variables *before* the @import
[20:50:24] tubbo: CorySimmons: u gotta rtfm breh
[20:50:32] tubbo: CorySimmons: !sass
[20:50:34] workmad3: you can't use //= require to pull in and override SASS variables
[20:50:37] makerops: https://gist.github.com/makerops/7950863
[20:50:44] makerops: what am i doing wrong, that the nested :order wont work?
[20:51:23] tubbo: CorySimmons: http://guides.rubyonrails.org/asset_pipeline.html one caveat, as workmad3 said...SASS has its own dependency injection system. require will pre-compile everything and then just concatenate the files, but @import will also include SASS context like variables and mixins
[20:51:33] ddd: where is the order and user models
[20:51:40] ddd: just showing us the controller does diddly
[20:51:49] ddd: add them as files to that gist
[20:52:18] ddd: preferably also add the migrations for those two models as well so we can see id fields and references
[20:52:38] tubbo: CorySimmons: https://gist.github.com/tubbo/2795d2562741a2790463
[20:53:14] tubbo: CorySimmons: don't feel bad this is one of the hardest hurdles to get over wrt asset pipeline/sprockets. but it's not the hardest. just wait until you get a precompile error whilst trying to deploy to prod :P
[20:53:19] ddd: i know you're supposed to thinkj tubbo lard, but i keep thinking of the old matchbox cars tub, tub o cars
[20:53:35] tubbo: ddd: i'm only tubbocars when i'm on the road
[20:53:51] CorySimmons: tubbo: ffs Rails y u so hard?!
[20:54:00] CorySimmons: y u makez errythang so hardz?!
[20:54:02] ddd: this aint rails's fault
[20:54:09] CorySimmons: asset pipeline = rails ;p
[20:54:26] CorySimmons: asset pipeline loading in rando order = rails fault right?
[20:54:49] ddd: but you didn't declare your overrides the way you were supposed to according to the conversation so far
[20:55:07] ddd: which makes it pebkac not rails
[20:55:27] lethjakman: is there a way to make an initializer dependant on which environment you're in
[20:55:42] lethjakman: for example development/staging/production
[20:55:52] workmad3: CorySimmons: require_tree is known to load in a platform-dependent undefined order
[20:56:17] workmad3: CorySimmons: basically, don't use require_tree... and don't use 'require' if you need to maintain a SASS context for variables, mixins, etc :)
[20:56:29] CorySimmons: Appreciate it tubbo I'm going to go spend a few hours of my day trying to figure out how to import sass.........
[20:56:43] CorySimmons: thanks workmad3
[20:57:02] CorySimmons: Sorry I'm being whiny. Just tired.
[20:57:09] workmad3: CorySimmons: @import "some_file"; <-- that's how you import a file with sass
[20:57:31] ddd: whine happens when you're delivered grapes sometimes :)
[20:57:42] workmad3: CorySimmons: just make sure that you put that in a .scss or .sass file, not in a plain .css file... because @import is also (fucking annoyingly) a CSS directive...
[20:58:01] CorySimmons: I know SCSS and such really well actually
[20:58:06] CorySimmons: Which is why this is painful
[20:58:13] CorySimmons: S'ok, I'm gonna go study this stuff
[20:58:56] workmad3: CorySimmons: asset pipeline sets up the sass load paths so that you can @import any sass file with the same path as you'd use //= require
[20:59:31] workmad3: CorySimmons: and you can use @import "somefile"; and it'll pick up '_somefile.scss' if you happen to like sass partials ;)
[20:59:33] ddd: sigh, i separated my desktops so dev was on one, comms on another hoping to keep myself focused. of course not, damned irc and it's siren call
[21:00:02] workmad3: CorySimmons: so mostly, it works the same... just need to be careful about ordering (and remember that //= require != @import :) )
[21:00:19] CorySimmons: workmad3: I appreciate it but I'm gonna go study this crap hard and thoroughly understand it. I -HATE- not knowing how to get css/js even working. :)
[21:00:31] CorySimmons: be back later. Again, thanks guys
[21:01:02] workmad3: CorySimmons: sure :) have fun... it took me quite a while to really get to grips with the asset pipeline when it first came out... it's possible to get it to sing and dance, don't worry ;)
[21:01:56] tubbo: ddd: pebgaf...he could be on a mobile device :)
[21:02:12] CorySimmons: Thanks. I keep thinking I kinda know what it's doing but I've never sat down and thoroughly understood it. It'll be nice not to be css/js deficient.
[21:03:31] shinobi_one: rake assets:precompile, should precompile everything? or just new versions that have changed?
[21:03:42] workmad3: shinobi_one: rails 3 or 4?
[21:03:54] workmad3: should only recompile stuff that's changed, iirc
[21:04:12] workmad3: unless you've done an assets:clean, which wipes out everything anyway :)
[21:04:24] shinobi_one: workmad3: that's funny, because it doesn't.. for me
[21:04:39] shinobi_one: assets:clean feels/looks as if it does nothing
[21:04:56] workmad3: shinobi_one: rake assets:clean == 'rm public/assets/*
[21:05:35] workmad3: unless they've made that closer to turbosprocket's assets:clean_expired in rails 4, so it only wipes out old assets
[21:05:50] workmad3: which could be the case, I've not dug fully into the asset pipeline in rails 4 yet
[21:06:21] shinobi_one: workmad3: i see. it looks to me as if it precompiles everything no matter what too which is odd.. not sure what is going on really
[21:07:29] shinobi_one: has anyone ever tried/had success with creating a rails app as an appliance? i.e. you'd sell hardware that has the web app on it
[21:08:12] ddd: tubbo, so very true
[21:11:30] tubbo: shinobi_one: that is how my company makes all of its money. what's up? :)
[21:11:36] tubbo: shinobi_one: http://www.telvue.com
[21:23:15] Revolution`: so my RSS feed is working finally but
[21:23:22] Revolution`: it doesn't update each time you check the page
[21:23:37] Revolution`: I think it just stores the initial feed in db and views that
[21:23:53] Revolution`: any idea on how to update it on each page request?
[21:28:19] shinobi_one: TorqueBox doesn't work on Rails 4 or it does?
[21:31:51] rordave: how can i dynamically add assets to manifest.yml?.....i want to supply precompiled assets as part of an engine (and not compile on every deployment)
[21:34:05] tubbo: shinobi_one: no idea.
[21:34:14] tubbo: shinobi_one: what are you trying to do?
[21:34:56] shinobi_one: tubbo: going to be writing a hardware appliance, and considering using Rails for it, but it's so much disk i/o idk i'm just lost lol
[21:35:04] tubbo: rordave: if you just ship .js and .css files, they won't be compiled.
[21:35:32] tubbo: shinobi_one: we make video broadcasting software. our rails apps live on the same machine as a streaming video codec.
[21:35:48] tubbo: shinobi_one: they are streaming HD-quality video and simulcasting to many channels, sometimes up to 28 at once. you're fine.
[21:36:05] shinobi_one: i'm not worried about network i/o, but disk i/o lol
[21:36:36] shinobi_one: millions of records and files
[21:36:53] tubbo: shinobi_one: yeah, so are we. the application needs to pull the file off of the HD, then re-encode it as an MPEG-2 transport stream so it can be streamed over multicast
[21:37:17] tubbo: shinobi_one: we had to increase the amount of file descriptors that ubuntu allowed us lol
[21:37:39] tubbo: basically we were attempting to read too many files at the same time
[21:37:42] shinobi_one: most of your backend is in ruby? or just stuff relating the web app itself
[21:38:09] tubbo: shinobi_one: i wouldn't say "most of", but a lot of it is.
[21:38:11] shinobi_one: tubbo: my issue would be more like indexing millions of documents, and also records in a db, and searching/retrieving/writing new stuff
[21:38:22] tubbo: shinobi_one: the software decoders and stream servers are made in C.
[21:38:45] rordave: the main application has its assets precompiled, and so using an engine page with a stylesheet_tag will fail with 'assets are not precompiled'
[21:39:01] tubbo: shinobi_one: so i guess you're using some kind of document-oriented DB then?
[21:39:23] tubbo: shinobi_one: or are you just gonna index those documents on the filesystem
[21:39:24] shinobi_one: tubbo: i don't know what to go with, our current product uses postgres, but i feel that's not the correct solution
[21:40:01] tubbo: shinobi_one: we use postgres for our services, but sadly this appliance app is a relic from the Rails 1 days, so it uses MySQL.
[21:40:12] tubbo: currently it's running rails 2.3 and we are upgrading it as we speak
[21:40:21] shinobi_one: our current product is python/django and every technology is quite old
[21:40:38] shinobi_one: we have erlang, clojure, java, python, c++
[21:40:49] tubbo: shinobi_one: postgres can handle millions of rows, fwiw. we only needed one master/slave replicator at my last job which used postgres for everything
[21:42:15] workmad3: tubbo: postgres with json & hstore types is also becoming a really capabale document-db too
[21:42:36] tubbo: yeah...i guess it depends on the *kind* of documents you're storing
[21:42:44] tubbo: like in our case it still wouldn't make much sense because the video files are binary
[21:42:54] tubbo: still makes more sense to just store them on a RAID in the filesystem
[21:43:02] workmad3: yeah, you're gonna have trouble with them in any 'document-db'
[21:43:19] workmad3: most of them are structured around semi-structured text documents in XML or JSON
[21:43:23] tubbo: but if the documents are like, content + metadata of some other kind...then yeah pg is what you want
[21:43:35] shinobi_one: tubbo: we'd have a large number of files on the file system, pdfs, images, videos, all types of documents
[21:43:38] tubbo: pg also gives you some really neat tools like LISTEN/NOTIFY, fulltext search, etc.
[21:43:49] tubbo: shinobi_one: you definitely do not want to store those in a DB, then.
[21:44:08] tubbo: shinobi_one: all it will do is take longer for the file to become ready
[21:44:12] tubbo: after opening
[21:44:59] workmad3: yeah, storing large blobs in the database is never really a good idea... file systems are great for that storage, and lets you push serving the actual files closer to the user
[21:45:01] shinobi_one: tubbo: i know, we wouldn't store those files in the db :P
[21:45:23] tubbo: shinobi_one: we have a convention for how we name files and where we put them. we store their relative file paths in the DB as well as some other kind of metadata. our appliances are for running a television station, so there's tons of other data like "program guide" (the tv guide metadata you see on digital cable/satellite/etc.), reporting, and episode/series organization
[21:45:25] shinobi_one: but we'd potentially have many many many many, and the db would have to keep track of at least where the files are
[21:45:33] tubbo: shinobi_one: yup, that's how we do it here.
[21:45:37] workmad3: hell, if you use the right web server, you can serve up files from disk without touching the CPU apart from an initial setup :)
[21:46:04] shinobi_one: tubbo: and they have to be indexed and searchable :D
[21:46:30] tubbo: pg can do *all* that.
[21:46:50] workmad3: you may want to consider something like elasticsearch or solr for indexing, depending on your exact needs
[21:47:16] shinobi_one: i was thinking sphinx, have you used it?
[21:47:21] workmad3: yeah... hated it
[21:47:33] shinobi_one: elasticsearch vs solr?
[21:47:45] workmad3: tomatos, tomatos
[21:48:43] workmad3: elasticsearch is somewhat easier to scale out in a distributed searcher, but solr is somewhat easier to find info out for if you need to write your own indexers and tokenizers for more esoteric needs
[21:49:22] tubbo: solr is a lot harder to configure
[21:49:26] shinobi_one: we use lucene for index
[21:49:32] tubbo: you need to pre-build a schema.xml
[21:49:36] tubbo: both ES and Solr are built off of Luene
[21:49:56] tubbo: that's the underlying DB they use. essentially, ES and Solr are different querying mechanisms that work on top of Lucene as a data store.
[21:50:24] tubbo: ES's idea is to use a REST API to query, while Solr does that but also lets you make pre-built matchers and tokenizers based on a collection of basic objecfts
[21:50:36] workmad3: tubbo: sunspot comes with a schema.xml for rails, taking effort out there
[21:50:38] tubbo: fwiw, if you don't know Java, Solr is really annoying. but if you do, it's all good.
[21:50:52] tubbo: Sunspot definitely makes it just as easy as ES
[21:50:52] shinobi_one: java is easy mode
[21:51:17] shinobi_one: we currently use lucene and a combination of erlang/clojure/python/java for the searching luls
[21:52:03] tubbo: workmad3: but there are some limitations to Sunspot's schema.xml...it pre-generates one but that means it doesn't include all of the types of parsers. for example, iirc it uses the dismax strategy instead of levenshtein (or vice versa, can't remember...) for parsing out n-grams
[21:52:14] tubbo: also, n-grams :)
[21:52:19] tubbo: iirc ES does not have those
[21:52:26] workmad3: tubbo: sure, you may need to tweak it
[21:52:30] tubbo: neeever mind :)
[21:52:34] tubbo: it even has edgeNgram!
[21:52:43] tubbo: didn't used to
[21:52:54] workmad3: tubbo: from what I've seen, ES is slightly more limited in tweaking, but the tweaking is easier to do ;)
[21:56:07] shinobi_one: tubbo: how many files would you say you guys use on disk for storage?
[22:00:17] tubbo: shinobi_one: lol...uhhh...that really depends on who owns the box
[22:00:58] tubbo: shinobi_one: could be like a hundred or even thousands. one appliance we make is an ad server, it waits for a signal from the splicer so it can play 30/15 second spots for a number of minutes at commercial breaks.
[22:01:35] tubbo: shinobi_one: if you see a commercial start and then get cut off in the first couple seconds by another commercial, there's a 1 in 3 chance that you just observed a bug by our system :D
[22:01:45] tubbo: shinobi_one: usually you can't tell the difference, though. that's the goal anyway.
[22:02:10] shinobi_one: haha those are pretty obvious :P
[22:02:14] tubbo: workmad3: yeah definitely. i'd wager that most people don't need all the crazy features Solr gives you. i'd also wager that my last company didn't need it either :)
[22:02:41] tubbo: shinobi_one: so yeah, each one of those ads is an MPEG file on the machine somewhere..
[22:02:53] tubbo: or it's being pulled down from a centralized service, we operate that as well
[22:03:02] shinobi_one: tubbo: so this is all configured/set up for the companies using the rails web app
[22:03:22] workmad3: tubbo: I was involved around the edges with a project that needed to do some crazy-fun personalized search stuff that was done directly in solr using customised analyzers that played around with stored, pre-calculated vectors :)
[22:04:08] shinobi_one: tubbo: i need to store/index potentially millions of documents of varying types
[22:05:19] workmad3: shinobi_one: unless you have some weird requirements, that shouldn't be a problem with PG and maybe ES
[22:06:16] tubbo: shinobi_one: yes, we have a sales team and a field engineering team that does all the work for them.
[22:06:34] tubbo: workmad3: yeah so if you're doing that...solr makes sense
[22:06:45] shinobi_one: tubbo: so the customer buys this hardware appliance and doesn't access the front-end to set up what commercials play when and all that stuff?
[22:06:53] workmad3: tubbo: it was also before ES had really come on the scene ;)
[22:07:03] tubbo: workmad3: what we did, and i'm not entirely sure if we NEEDED solr for this...was a lot of fast location-awareness stuff. so we had a db of zips, and they were all indexed...and we would go "i need all of the zips within 25 miles of $address"
[22:07:15] cored: does #destroy returns a boolean
[22:07:21] shinobi_one: workmad3: define weird requirements, how about scalability, performance, and potentially cloud scalability? :D
[22:07:23] tubbo: workmad3: and it was BLAZING fast given the millions of zips it had to look thru!
[22:07:24] workmad3: tubbo: yeah, I'd use ES for that nowadays :)
[22:07:33] workmad3: shinobi_one: none of those are weird requirements ;)
[22:08:06] workmad3: shinobi_one: for cloud scalability, I'd look at solr and use web-solr
[22:08:10] ddd: ES is elapstic search? (if i got that rightr)
[22:08:14] tubbo: shinobi_one: "scalability" => (not defined), "performance" => YAGNI, "cloud scalability" => it should run on a VM
[22:08:18] workmad3: ddd: elasticsearch
[22:08:19] shinobi_one: elastic search ddd
[22:08:35] tubbo: shinobi_one: performance is a hard one. you really can't know what is the least performant parts of the product until you really do a test.
[22:08:36] workmad3: ddd: elaptic search is something very different
[22:08:42] ddd: i've heard a lot about it in the past but never used it
[22:08:52] ddd: yeah elaptic was what i was thinking of
[22:09:01] shinobi_one: tubbo: it's usually bogged down by disk i/o whether be from the db or files
[22:09:13] workmad3: I doubt elaptics would enjoy an elaptic search... no doubt it would be very intrusive...
[22:09:34] ddd: ok, time to go to the son's xmas play and take the daughter to the school dance, all while ensuring the boy knows not to try any monkey business with my daughter
[22:09:54] elaptics: workmad3: lol
[22:09:57] workmad3: ddd: grab a rifle and a gun polishing kit...
[22:10:05] ddd: workmad3, already on the front seat :)
[22:10:41] workmad3: ddd: oh, and don't forget the pig ready for butchering, the large butchers block and cleaver...
[22:11:00] workmad3: ddd: nothing quite drives the point home like casually butchering a pig while telling him to behave...
[22:13:05] shinobi_one: ddd: so not excited to have a daughter if that should happen xD
[22:26:21] lethjakm1: what does it mean when sidekiq has enqued jobs that it's not executing?
[22:30:10] christo_m: hi, im trying to debug this message : "Validation failed: Password can't be blank" , i dont have a password field on the user model im trying to save, and im not doing any validation in the model whatsoever, how can i track where this is coming from?
[22:30:53] helpa: christo_m: We cannot help you with your problem if you don't show us your code. Please put it on http://gist.github.com and give us the URL so we can see it.
[22:30:53] tubbo: christo_m: !code
[22:31:06] christo_m: tubbo: im not sure what to show you specifically.
[22:31:08] tubbo: christo_m: add the model and controller this is occurring in
[22:31:29] tubbo: christo_m: add them both to the same gist with a multi-file gist...btw...
[22:32:01] christo_m: too latetubbo: http://pastie.org/8550902
[22:32:20] christo_m: thats user.rb , heres sessions controller http://pastie.org/8550903
[22:32:49] christo_m: getting this Validation failed: Password can't be blank on "@identity.save!"
[22:33:12] christo_m: i was doing a .save before and noticing the identity record not saving
[22:45:01] AntelopeSalad: christo_m: it's probably because omniauth has password validation
[22:46:45] tubbo: christo_m: yeah, i don't use omniauth (right now...will be soon!), but i would wager that omniauth is validating a password and that password doesn't exist..
[22:47:30] tubbo: christo_m: !lmgtfy omniauth password validation
[22:47:35] tubbo: christo_m: !google omniauth password validation
[22:47:43] tubbo: might help ya, there's some SO posts
[22:51:48] christo_m: i guess ill jsut generate something random, they should never be logging in through an account anyway
[22:52:17] crucify_me: hi what is the flag to uninstall all dependencies associated with rails (only core rails gem was deleted)
[22:52:22] christo_m: tubbo: its when i go to save an identity though, not a user..
[22:52:30] christo_m: you're saying omniauth has slapped a mandatory password on identity?
[22:53:19] crucify_me: I lied I'm trying to uninstall padrino dependencies, only the core uninstalled
[22:55:29] tubbo: christo_m: not sure, like i said...i've never dealt with this. but the SO posts seem to respond to this whole thing quite well.
[22:56:20] tubbo: christo_m: but i feel like you can't be the only person who's run into this :)
[23:00:57] Tamal: christo_m: isn't identity for traditional username/password logins?
[23:02:08] Tamal: Looking at the docs, OmniAuth::Identity::Models::ActiveRecord includes OmniAuth::Identity::SecurePassword, which adds validations
[23:02:56] Tamal: Specifically the class method has_secure_password: http://rubydoc.info/gems/omniauth-identity/1.1.1/OmniAuth/Identity/SecurePassword/ClassMethods:has_secure_password
[23:03:24] tubbo: ahhhhhh :D
[23:03:28] tubbo: has_secure_password :D
[23:07:51] christo_m: Tamal: can i override it?
[23:08:40] christo_m: Tamal: im using identity in this sense here: https://github.com/intridea/omniauth/wiki/Managing-Multiple-Providers
[23:10:43] Tamal: christo_m: you don't need to use the omniauth-identity gem to handle that
[23:11:55] christo_m: Tamal: so i can remove the gem and it should be good?
[23:12:01] Tamal: I can see how one could confuse the two :P My understanding is the omniauth-identity gem a way to do traditional username/password
[23:12:59] Tamal: Note in your link, Identity descends from ActiveRecord::Base, it's just another AR model
[23:13:00] christo_m: im going to change it back to class Identity < ActiveRecord::Base
[23:15:03] christo_m: Tamal: thank you, wow
[23:15:32] christo_m: that bug has been bothering me for a full 24 hours, i must have mixed the railcast video on identity gem for authentication with this tutorial
[23:15:46] christo_m: that and upgrading from rails 3.2.16 to 4.0.2
[23:15:53] christo_m: ya it works
[23:16:04] christo_m: and i sucessfully made a call to twitter api whilst being authenticated
[23:17:07] christo_m: im learning guys, still faster to get these things going than spring/hibernate
[23:17:56] Tamal: I accidentally opened IRC, I've never helped anyone here before :P
[23:18:07] Tamal: Feels good
[23:18:20] Tamal: *productivity dies*
[23:18:28] christo_m: basks in feelgood.jpg?
[23:21:00] tubbo: !feelsgood
[23:21:10] helpa: Tamal: http://taimapedia.org/images/9/9c/Feelsgoodman.jpg
[23:21:10] tubbo: Tamal: !feelsgood
[23:21:23] christo_m: there we go
[23:22:19] crucify_me: anyone have opinion: I heard people are using routing resources less nowadays
[23:25:08] lethjakm1: so...I have a string that looks like this: '2013-12-10 19:44:26 UTC' and I want to change the format and possibly the time zone. what easy ways are there to do that?
[23:27:08] smathy: lethjakm1, DateTime.parse
[23:27:20] lethjakm1: smathy: how do you reformat it though?
[23:29:21] lethjakm1: I want something like what php did where you can .format('%y %d %m')
[23:29:23] smathy: lethjakm1, there are a number of methods: http://www.ruby-doc.org/stdlib-2.0.0/libdoc/date/rdoc/DateTime.html
[23:29:32] smathy: lethjakm1, the most flexible is strftime
[23:30:39] whunt: hello everyone
[23:31:00] lethjakm1: ??ahhhh got it
[23:31:06] lethjakm1: strftime was what I wanted
[23:31:33] whunt: i'm not sure if this is the right room to ask this in, but does anyone know how to make modules from an installed gem accessible within a rails app when you install the gem through bundler
[23:32:08] whunt: as in, if you put a gem such as HTTParty in your gem file, you can then access the HTTParty class and everything associated with it
[23:32:08] lethjakm1: whunt: assuming they put it in lib it shoudl already be available
[23:32:25] lethjakm1: did you bundle update?
[23:32:34] whunt: it just installed the gem
[23:33:25] whunt: and the module i would like to access is in a file in lib
[23:33:49] whunt: but in my app, (that has the gem installed) i cannot access the module
[23:34:07] lethjakm1: whunt: what happens if you pop open a console and type: HTTParty.get('http://twitter.com/statuses/public_timeline.json')?
[23:34:15] lethjakm1: gist please
[23:35:21] whunt: i get a json response
[23:35:23] whunt: in a hash form
[23:35:58] whunt: https://gist.github.com/wesdotcool/a0ec7b40d2801462e8f4
[23:36:29] whunt: so the behavior i want works for httparty, but i can't get it to work for my own gem
[23:37:44] tubbo: whunt: require 'your_gem'; YourGem.do_something
[23:37:49] tubbo: whunt: you need to require it
[23:37:58] whunt: oh wow, i figured it out
[23:38:03] whunt: thanks guys
[23:39:38] smathy: You did get a thanks.
[23:39:42] smathy: ...well, we all did.
[23:39:49] whunt: it's weird, gem list doesn't show my gem, but i can still access it from the command line and in the console
[23:40:15] whunt: the gem code is hosted on github and installed through bundle
[23:40:43] whunt: does bundle do something funky to make the gem usable for you, that the "gem" command does not understand?
[23:49:55] Gues_____: @nahtnam Hey
[23:49:57] tubbo: whunt: it does `require 'bundler/setup'`, which sets up the load paths to point at your gem bundle
[23:50:08] tubbo: whunt: that allows you to do stuff like `require 'my_gem'`
[23:50:34] whunt: ah, but why can't gem find the gem?
[23:50:44] whunt: as in `gem list my_gem` shows nothing
[23:52:21] tubbo: whunt: because, iirc, `gem list` is reading from system gems...which is why bundler/setup is necessary in the first place. by default, your ruby script doesn't know that bundler is installed, so you have to tell it "hey, here's where my gems are located"
[23:52:38] tubbo: whunt: so if you do gem install whatever, it should show up in gem list. otherwise, i think you want `bundle list`.
[23:53:21] whunt: ah, that makes sense. thanks for info tubbo!