« Back to channel list

#RubyOnRails - 17 October 2014

« Back 1 day Forward 1 day »
[00:10:59] tmoore: rkofman_: I don't get the sense that there is a consensus on this :-)
[00:11:34] Scriptonaut: I'm seeing a stylesheet_link_tag being called
[00:11:48] Scriptonaut: styleshee_link_tag 'application', media => 'all'
[00:11:54] Scriptonaut: it's breaking the app in chrome
[00:11:55] Scriptonaut: where is that
[00:12:50] webdestroya: Scriptonaut: grep is your friend
[00:27:53] jnylen: I cant seem to get sidekiq to work via a rake task
[00:28:45] webdestroya: because thats not how it works...
[00:29:10] webdestroya: do you mean "publish a job to the queue" in a rake task? or "run the sidekiq server" in a rake task?
[00:29:21] jnylen: via a model
[00:29:26] webdestroya: oh, well that should work
[00:29:36] jnylen: it works if I run it in rails console
[00:29:38] jnylen: which one?
[00:29:56] webdestroya: if the same code works in console, then it sounds like an environmental issue
[00:30:02] webdestroya: post your rake task code
[00:30:45] jnylen: its quite large but https://gist.github.com/jnylen/8c1207fc2a297988e315
[00:30:59] webdestroya: which one is giving you problems
[00:31:17] webdestroya: jnylen: for the future, put this stuff into a service, dont write huge chunks of code in rake tasks
[00:31:31] jnylen: Series is the one which should run a sidekiq
[00:31:38] jnylen: Im just starting to code in ruby
[00:31:58] jnylen: so #123 and #171
[00:32:18] webdestroya: jnylen: ... those dont use sidekiq, at least not here
[00:32:22] webdestroya: do you have some after_save callback?
[00:32:27] jnylen: after_commit
[00:32:44] webdestroya: maybe theres an error?
[00:32:55] jnylen: after_commit :attach_extra_data, :on => :create
[00:32:57] jnylen: I'll check
[00:33:42] jnylen: No errors
[00:36:37] Radar: rkofman_: In answer to your question about an hour ago: I see nginx+puma is pretty much the community standard these days.
[00:46:55] baash05: Good morning all
[00:47:34] baash05: I'm trying to get resque scheduler to run via a deamon script.
[00:47:48] baash05: I get this error Don't know how to build task 'resque:scheduler' (RuntimeError)
[00:48:10] baash05: Anyone see/solve this one?
[00:48:42] baash05: Oh.. the code that calls it is Rake::Task["resque:scheduler"].invoke
[00:50:42] emocakes: rkofman_ i use passenger + nginx
[00:51:00] emocakes: dont listen to Radar, he isnt part of the rails core team
[00:51:15] Radar: http://contributors.rubyonrails.org/contributors/ryan-bigg/commits
[00:51:17] Radar: Close enough.
[00:51:49] emocakes: better than me I guess :(
[00:52:06] emocakes: documentation mostly
[00:52:33] Radar: can't document it if you don't understand it
[00:52:53] emocakes: well, you are just helpful to other people
[00:53:16] emocakes: i understand, but dont document for others, as that makes me seem les magical :(
[00:54:04] isthisreallife: scope :current_month, -> { where('created_at.month = ?', Time.now.month) }
[00:54:19] isthisreallife: why i get PG::UndefinedTable: ERROR: missing FROM-clause entry for table "created_at"
[00:54:24] isthisreallife: it doesnt work :(
[00:54:30] emocakes: because there is no created_at
[00:54:53] isthisreallife: all posts have created_at
[00:54:55] emocakes: because you are trying to call a method .month in a string
[00:55:00] emocakes: whcih doesnt work
[00:55:16] emocakes: what RBDMS?
[00:55:33] emocakes: http://stackoverflow.com/questions/8863156/selecting-by-month-in-postgresql
[00:55:45] emocakes: http://www.postgresql.org/docs/9.1/static/functions-datetime.html
[00:55:57] isthisreallife: where extract(month from posts.created_at) = extract(month from current_timestamp)
[00:56:11] isthisreallife: this works in raw sql but im trying to use ar
[00:57:08] emocakes: scope :current_month, -> { where('EXTRACT(MONTH from created_at) = ?', Time.now.month) }
[00:58:08] emocakes: so, I just bought a new retina imac
[00:58:28] emocakes: good that apple has the 14day return policy
[00:58:36] emocakes: it works isthisreallife ?
[00:59:33] emocakes: god, I'm being too nice today, I gotta go kick my neighbors dog or something, I don't like this feeling
[01:05:11] sterns: I'm now contemplating the use of sidekiq to process a worker queue on a secondary server. I gather that I will need to have my rails app duplicated on the secondary. I'm now considering how development works in this scenario. If I'm developing my worker class(es), do I have to update both servers simultaneously, and if so, what's the best way to do this?
[01:19:43] baash05: anyone encounter this error when they try to run resque-scheduler via Rake::Task().invoke " Don't know how to build task 'resque:scheduler' (RuntimeError)"
[01:19:54] fp-: I apologize if this has been asked already, but does anyone know how to get webrick to accept incoming connections on Yosemite? I just upgraded and it???s not working.
[01:28:52] emocakes: dont use webrick?
[01:29:12] emocakes: one line to your gemfile in the dev group and it works -> gem 'thin'
[01:29:22] fp-: can???t use thin, unicorn, webrick
[01:29:36] fp-: it???s like yosemite is ignoring my firewall approval of ruby
[01:32:42] emocakes: it works here
[01:32:56] emocakes: has worked for the past week or two
[01:45:34] samg_: Hi. I'm working on a rails app with the default test unit library. I noticed that `rake test` runs all tests together, which is fine, but can I configure it so they are randomized separately? I want to run unit tests before integration tests.
[01:46:20] samg_: Currently all the tests are mixed together, which isn't optimal for me, because the integration tests truncate the database between tests, while the rest of the tests use transactional fixtures.
[01:55:50] wethu: <3 Yosemite
[01:56:00] sevenseacat: it looks pretty.
[01:56:10] wethu: yes its gorgeous
[01:59:29] uberjar: lots of care is given to finding ways to keep people on iOS
[01:59:58] wethu: Bendgate, and a few software bugs isn't going to stop people much
[02:00:50] uberjar: "You can see the status of your iPhone battery and signal strength in the menu bar on your Mac"
[02:00:57] uberjar: ^ why would anyone ever want to do that
[02:01:05] sevenseacat: ACTION has zero desire to switch to iOS
[02:01:28] wethu: i can see the signal strength and power of my phone from my car's HUD
[02:03:38] wethu: If the api supplies that info why not put it there ?
[02:05:15] sevenseacat: i can sorta see the point of that, if it flashes up that your phone is low on battery you know to charge it
[02:05:30] uberjar: I guess I'm just a minimalist who hates clutter in interface design
[02:06:37] wethu: I think its pretty minimalist, plus i have my 5S plugged into my MBP on yosemite now and i can't see it lol
[02:08:22] uberjar: that's how feature creep always starts... next thing you know it's this: http://i.imgur.com/X7ipc.png ;) I'm just giving you a hard time, the OS looks great
[02:08:39] uberjar: the new Alex voice is cool and to me is the only "killer feature" that I'm jealous of
[02:08:50] wethu: i was physically effected (affected?) by that image
[02:15:09] karamazov: sevenseacat: What's your dev machine? Linux?
[02:18:11] wethu: drinks tonight
[02:19:52] wethu: I have 2 bottles of Shiraz and a bottle of Pinot Noir
[02:20:12] karamazov: Best get started.
[02:26:59] karamazov: I can't tell if reading tech books is having any affect on my development.
[02:27:58] wethu: i should do some work
[02:32:26] wethu: i almost wrote an actual line of code then, but I'm back..
[02:33:33] uberjar: karamazov: not all tech books are created equal, that's for sure
[02:34:18] karamazov: uberjar: Yeah - I think I've read the hot list for Rails. It's just finding application in the everyday. I've reasoned it's osmosis.
[02:34:46] karamazov: Granted, I think many deserve to be read more than once to gleam what's relevant for each time. I dunno.
[02:35:00] uberjar: karamazov: I recommend checking out git repos and reading rails app code
[02:35:11] uberjar: thats a good way to pick up lil techniques and stuff by osmosis
[02:35:33] karamazov: I feel like I have lingering imposter syndrome with reading advanced code.
[02:35:44] karamazov: It's purely mental.
[02:36:15] uberjar: karamazov: well there's this bias towards feeling that "someone more advanced than myself would understand this region of code more quickly"
[02:36:19] uberjar: when that might not actually be the case at all
[02:36:30] uberjar: it's tricky to figure out ohter people's code no matter what
[02:36:43] karamazov: True - I paired today and it was great to see how a more advanced developer broke the code down
[02:36:47] uberjar: so it's not like reading a book, more like skimming
[02:37:45] karamazov: Books like POODR and Rails Antipatterns brought sense to a lot of code I come across. But I suppose if I found a block of code that I wouldn't have written a particular way, by googling it, I'd probably find out why it was done in that way.
[02:38:08] sevenseacat: poodr was great.
[02:38:13] sevenseacat: confident ruby was also great.
[02:38:24] karamazov: Sandi Metz is my hero.
[02:38:45] karamazov: I haven't checked out confident ruby.
[02:38:53] christopherbull: I'm having a weird issue where a file in app/ isn't being auto loaded, the file is app/presenters/job_presenter when I try and do require 'job_presenter' in console it throws a load error. where should I be debugging auto load errors in rails 4.1?
[02:39:25] sevenseacat: you dont need to require it
[02:39:55] christopherbull: yeah that's what I thought, the class it declares is showing as an uninitialized constant though
[02:40:04] sevenseacat: what is the class called
[02:41:01] sevenseacat: seems legit, should be autoloaded
[02:41:21] karamazov: Throw that Presenter in a gist
[02:41:26] sevenseacat: everything in app is added to the autoload path, and i very much doubt that that's changed
[02:41:35] christopherbull: yeah that's what i thought, will do
[02:42:08] christopherbull: https://gist.github.com/te-chris/f8e6f2c1270458881ea6
[02:42:09] karamazov: Best thing about Rails 4.1 not having to do RAILS_ENV=test rake db:migrate
[02:42:17] sevenseacat: when it works
[02:42:28] sevenseacat: the auto-test-preparing
[02:42:43] karamazov: True - I've been lucky.
[02:43:02] karamazov: I get bit in the ass by Pry a lot.
[02:45:17] christopherbull: hmm this loading this is so stupid. the spelling's right and everything
[02:45:36] sevenseacat: did you create the folder after loading the console?
[02:45:51] christopherbull: nope, have reloaded the console
[02:46:08] christopherbull: restarted the process
[02:46:17] sevenseacat: restarted the console?
[02:46:37] sevenseacat: what is the full path and filename of the file
[02:46:57] christopherbull: app/presenters/job_presenter.rb
[02:47:23] christopherbull: the weird thing is: rspec binary loads everything just fine
[02:47:36] sevenseacat: need to restart spring?
[02:47:54] karamazov: Oh yeah - spring comes with 4.1
[02:48:12] sevenseacat: yes, that menace
[02:48:13] christopherbull: sigh, that was it
[02:48:18] christopherbull: totally forgot about it
[02:48:49] karamazov: Spring is nice when it doesn't get in the way
[02:48:57] linoge: l0c1r4pt0r_!
[02:49:13] christopherbull: yeah, i've never had load path issues with it yet
[02:49:13] sevenseacat: linoge: you might wanna change that pw now
[02:49:39] sevenseacat: spring is a menace and i advise everyone to remove it from their projects
[02:49:47] christopherbull: yeah I'm not a massive fan
[02:49:48] karamazov: Anyone else use 1password? I just got the trial today...seems efficient.
[02:50:01] christopherbull: i love 1password.
[02:50:03] sevenseacat: i keep thinking i should try a password manager
[02:50:06] karamazov: I really like zeus because I can easily turn it off.
[02:50:11] MrPepper: Keepass is great
[02:50:15] christopherbull: was super sceptical but now i'm sold on it (1pass)
[02:50:24] karamazov: I like how it syncs on all the things
[02:50:35] christopherbull: only problem is you need to remember your dropbox password too, as the only web interface is stored in dropbox
[02:50:49] sevenseacat: i dont really care about the syncing, i just want to not have to remember passwords for random services
[02:51:04] christopherbull: it's great for that
[02:51:13] karamazov: Yeah but what about when you need to login on your phone?
[02:51:20] karamazov: The syncing is reaaaaal nice then
[02:51:23] MrPepper: I use KeePass and store the password encyrpted file on dropbox so it sync's between computers.
[02:51:28] sevenseacat: atm i just think of random passwords and then if they log me out, i have to reset them
[02:51:29] MrPepper: My dropbox password isnt super complicated
[02:51:30] karamazov: But when you're away from your laptop?
[02:52:03] christopherbull: i used to rely on chrome pwd sync, any real manager is so much better
[02:52:20] karamazov: I love it and it's only been a day. hha
[02:53:55] uberjar: what I like even more is (free) multi-factor authentication (from duosecurity.com). I use it all over the place, like to access my production environments or repos
[02:54:17] karamazov: I use google auth for that
[02:54:43] uberjar: ahh you setup 2-factor auth on google accounts then signed up for github via google ?
[02:54:53] uberjar: that's a good way to do it too.. googles' authenticator app works great
[02:55:24] uberjar: it's basically a push notification that you get, with a code that you type in.. everytime you need to access your app, or email, or whatever
[02:55:26] karamazov: google auth stores codes for more than just google accounts
[02:55:31] sevenseacat: my phone is too slow for any kind of actual web service usage
[02:56:07] karamazov: sevenseacat: I sort of read your messages in a eeryore sort of tone :)
[02:59:41] uberjar: I think this 2-factor auth thing is going to be a huge deal and it will be standard across the board in a few years... even for social stuff like twitter or facebook
[03:00:08] karamazov: Definitely. I use it for every work account.
[03:02:32] uberjar: I didn't know the google authenticator can do more than just google services, thanks for showing me that
[03:03:23] karamazov: Yeah - I just discovered it could. It makes it real simple - you can scan the QRC (QCR?) codes on most sites to add it to google auth.
[03:11:59] emocakes__: itns really easy to implement in your projects as well (2 factor auth)
[03:12:16] emocakes__: i have TOTP on my projocts
[03:12:33] emocakes__: clients like it, makes them think you are secure as a bamn
[03:12:47] MrPepper: Question - What is the free tutorial book for RoR? Was linked here before
[03:12:53] helpa: For a *FREE*, online book on learning Ruby On Rails, please see http://ruby.railstutorial.org/ruby-on-rails-tutorial-book
[03:12:53] sevenseacat: !railstutorial
[03:13:30] uberjar: emocakes__: yea I think it should totally be a best practice in the "startup world" but small shops just haven't caught on yet en mass
[03:14:41] uberjar: phishing attacks are just too common these days.. damn scurry
[03:14:45] emocakes__: i bought a retina imac sevenseacat
[03:14:46] uberjar: I almost fell for one the other day actually
[03:15:54] sevenseacat: emocakes__: u so craycray
[03:17:11] shellox: hey guys, i could need a hint. I'm building a todo list app to practice with rails. One list has_many :tasks and tasks belongs_to :list. However, i still need to do a migration for the db separately right?
[03:18:01] sevenseacat: fucking spotify. new album out to listen to! *listens* 'oh, no longer available in australia, sorry bout that'
[03:18:09] sevenseacat: not-so-happy friday
[03:18:38] MrPepper: I listen to one genere on spotify and it goes to something completely different, start off with classic rock and end up in trance.
[03:18:48] sevenseacat: the spotify api even still reports it as available
[03:18:49] emocakes__: sevenseacat use swedish spotify
[03:19:01] karamazov: sevenseacat: Grooveshark?
[03:19:13] emocakes__: i get a friend in sweden to buy me 6month giftcards
[03:19:29] emocakes__: then i vpn to sweden, apply the cards and voila
[03:20:20] wethu: Nothing gets me going than entire country lock outs online, I always get the content though.. one way of the other
[03:20:20] MrPepper: why sweden?
[03:20:31] emocakes__: http://i.imgur.com/EwO2eVa.jpg @ sevenseacat
[03:20:40] emocakes__: why not sweden?
[03:20:51] emocakes__: ive been usin it since it came out
[03:20:53] MrPepper: mm I want that monitor mount.
[03:21:05] emocakes__: its a dual mount
[03:21:06] shellox: emocakes__: where do you live :P?
[03:21:13] sevenseacat: nice keyboard.
[03:21:13] emocakes__: you want the link MrPepper ?
[03:21:21] emocakes__: pretty cheap mount
[03:21:27] karamazov: emocakes__: that keybooard....
[03:21:36] emocakes__: ty sevenseacat, DIY labels :p
[03:21:48] shellox: emocakes__: are you in australia too?
[03:21:53] emocakes__: yeah shellox
[03:21:55] MrPepper: http://i.imgur.com/9GFf1cK.jpg?1
[03:21:59] MrPepper: I love my keyboard :D
[03:22:08] karamazov: Why is everyone in Aus a badass?
[03:22:08] baahs05: Hey mates...
[03:22:15] sevenseacat: because we're awesome.
[03:22:18] emocakes__: i wanna buy some of those LG screens
[03:22:21] emocakes__: the curved ones
[03:22:29] emocakes__: but ill wait till later next year
[03:22:35] shellox: emocakes__: haha :p
[03:22:41] karamazov: I want to use an Oculus Rift with a keyboard mount on my stomach
[03:22:43] baahs05: karamazov: because we have to be. We're just born that way..
[03:22:47] baahs05: even the imports :)
[03:22:54] karamazov: That way, I can turn and BAM new screen
[03:23:01] shellox: emocakes__: i just lived close to you before :D
[03:23:11] emocakes__: where do i live?
[03:23:22] shellox: emocakes__: i mean i just lived in NZ for a year
[03:23:30] shellox: which is close to australia :D
[03:23:31] emocakes__: south island
[03:23:35] emocakes__: http://www.ebay.com.au/itm/13-27-Dual-LCD-LED-Monitor-Mounts-Arm-Desk-Bracket-Mount-/261532764684?pt=LH_DefaultDomain_15&hash=item3ce4914a0c
[03:23:44] emocakes__: its built really strong
[03:23:49] shellox: emocakes__: yeah lived in the south
[03:23:53] shellox: cuz auckland sucks
[03:24:05] baahs05: Question on validations.. is there a way to stop running them if one fails
[03:24:12] shellox: emocakes__: are you in sydney?
[03:24:14] MrPepper: I'll have to find it in the states.
[03:24:29] emocakes__: close to sydney, will be moving back down in a month or two
[03:24:34] wethu: So many aussies here, this is cool
[03:24:38] emocakes__: MrPepper ship from .cn?
[03:24:50] baahs05: I have two validations.. one that checks that a price is present, and another that checks if that price * 100 is under a specific value.
[03:24:56] emocakes__: baahs05 you mean like dont run the other ones?
[03:24:57] shellox: emocakes__: just visited sydney. bloody expensive over there ;)
[03:25:06] emocakes__: me get paid well ;)
[03:25:18] emocakes__: property here is expensive as hell thouh
[03:25:25] baahs05: the issue is when the price is nil.
[03:25:36] emocakes__: however I bought an apartment last year and its already jumped > 100k in value
[03:25:38] baahs05: then the price*100 fails
[03:25:56] emocakes__: chek for price baahs05
[03:26:06] MrPepper: emocakes__ what size dell monitor is that.
[03:26:16] baahs05: well I already know that there's no price..
[03:26:18] shellox: emocakes__: i may also move to australia sometime. salary over here in asia sucks :D
[03:26:26] baahs05: because the validation failed.
[03:26:34] baahs05: but the other validation still runs.
[03:26:39] emocakes__: dont buy one, im getting rid of it, its great, apart from the fact that it makes noise with a dark colorscheme
[03:26:51] emocakes__: maybe only mine though
[03:27:09] MrPepper: I have 2 24" ultrasharps and can't complain
[03:27:13] MrPepper: 3 years old and going strong
[03:27:59] baahs05: emocakes__: Yeah.. I don't want to run validation x if validation a failed.
[03:28:32] sj26: baahs05: investigate allow_blank?
[03:28:36] baahs05: LIke I don't need to check if the value is between 0 and 10 if the presence validation failed.
[03:28:40] karamazov: I have a retina monitor but all it ever holds is Vim in full screen
[03:29:02] sj26: baahs05: http://guides.rubyonrails.org/active_record_validations.html#allow-blank
[03:29:10] shellox: uch yosemite is out
[03:29:25] shellox: i'm sure if i'm gonna upgrade now shit will break
[03:30:18] baahs05: I think you miss my question sj26
[03:30:25] emocakes__: karamazov the text looks good though :p
[03:30:35] baahs05: I'm trying to stop the validation if a previous one fails.
[03:30:35] sj26: baahs05: you only want a validation to run on a field when that field is non-blank?
[03:30:38] karamazov: ha it does :)
[03:31:08] baahs05: I only want to stop checking if a record is valid if I already know it's not.
[03:31:18] sj26: then you might want to use strict validations
[03:31:23] sj26: which should throw an exception when validation fails
[03:31:57] sj26: but apart from that, activemodel validations are not considered ordered so short-circuiting isn't really possible without overhauling how vlaidations work
[03:32:02] baahs05: But then I get the overhead of a rescue
[03:32:43] sj26: but the case you describe??- a price field being present and between 1 and 100 - is exactly what allow_blank was built for
[03:32:45] baahs05: It seems like something that would make sense..
[03:32:59] baahs05: it was a contrived example..
[03:33:04] helpa: Please do not use fake values, as they can be confusing or misleading. Sometimes both.
[03:33:05] sj26: a state graph of validations and their depdencies is mostly premature complexity
[03:33:36] baahs05: we could do a chained validation.
[03:33:39] sj26: if you can gist an example of what you are actually trying to do we might be able to help you come up with something that makes sence :-)
[03:33:43] baahs05: or an arrayed validation.
[03:33:49] sj26: *sense ugh
[03:34:42] baahs05: the example represented my issue.. if validation A fails then validation B and C will always fail.
[03:34:58] sj26: yes, but the use case is satisified by allow_blank
[03:35:07] baahs05: validate age over 18
[03:35:23] baahs05: validate age over 16
[03:35:24] sj26: how is validating age over 18 not covered in the same way/
[03:35:26] baahs05: validate can drive
[03:35:43] baahs05: validate can buy beer
[03:35:49] baahs05: validate can work in bar
[03:36:11] helpa: baahs05: Please do not use fake values, as they can be confusing or misleading. Sometimes both.
[03:36:11] sevenseacat: baahs05: !fake
[03:36:24] emocakes__: sevenseacat !iloveyou
[03:36:52] baahs05: I don't understand that fake values thing.
[03:37:01] sevenseacat: if the solution we give you doesnt apply to your actual problem because you only gave us a fake 'representation' of it, then your problem is misleading.
[03:37:27] sevenseacat: dont do that. it makes us sad.
[03:38:00] baahs05: Oh.. I learn from every answer sevenseacat
[03:38:06] emocakes__: sevenseacat is sad enough as well baahs05, and shes a womyn. you donst want to make a womyn sad?
[03:38:28] sevenseacat: baahs05: then your problem is fixed :)
[03:38:54] baahs05: were that learning one thing, would solve all my problems
[03:39:11] sevenseacat: we can only help you with the problems you tell us about
[03:39:31] baahs05: I question was no-specific because I was trying to figure out how to stop validation if an earlier one failed.
[03:39:42] sevenseacat: not the ones you give us 'representations' of
[03:39:44] baahs05: there are a few reasons for it.
[03:39:54] sevenseacat: and you've been told, validations are not ordered
[03:40:01] sj26: but you're asking how to implement a solution without describing the problems
[03:40:56] baahs05: The problem is as described originally, however I wanted to dig a little deeper.
[03:41:06] baahs05: one validation is raising an exception.
[03:41:14] baahs05: because a value is blank.
[03:41:24] sevenseacat: validations should not do that.
[03:41:28] sevenseacat: fix your validations.
[03:41:32] baahs05: the allow_blank answer fixed that.
[03:41:44] baahs05: well that's just it.. I don't like testing something twice.
[03:42:03] emocakes__: gottta save those clock cycles!
[03:42:16] baahs05: How many times to I have to check that there's a price, if I know there's no price.
[03:42:40] sevenseacat: well if you're going to do things that depend on a price, it makes sense to make sure there is a price
[03:42:50] sevenseacat: and not just assume there is one
[03:43:01] sevenseacat: obviously not if its throwing exceptions
[03:43:10] baahs05: I validated that there's a price.
[03:43:28] sj26: You're conflating sanitization with business rules
[03:43:38] sevenseacat: conflating something alright
[03:43:40] sj26: validations are for business rules. the sanitization is secondary.
[03:43:49] sevenseacat: just because you validated that there is a price, doesnt mean you can write code that assumes there is one
[03:43:51] sj26: allow_blank is sanitization
[03:44:08] baahs05: sevenseacat: that is the funniest thing I've ever read.
[03:44:14] sevenseacat: because its perfectly acceptable for an instance to not have one
[03:44:16] sevenseacat: if its not valid
[03:45:00] sevenseacat: baahs05: if thats the funniest thing ever, you need to get out more
[03:45:09] sj26: here's a solution to your age example: there is only one business rule you actually care about: https://gist.github.com/sj26/9c7e291fc35486048cfa
[03:45:26] Nic_home: would yall suggest devise to a RoR beginner
[03:45:40] sevenseacat: baahs05: @foo = YourClass.new @foo.something_that_assumes_that_a_price_is_present
[03:46:05] sj26: Nic_home: are they new to the web? Then I'd suggest http://railscasts.com/episodes/250-authentication-from-scratch. But if they understand authentication then yes.
[03:46:41] baahs05: Oh.. yeah.. I agree with that.. but
[03:46:54] Nic_home: its for me, but i understand authentcation some from an abstract level... thinking i should go with the from scratch
[03:47:28] baahs05: foo.save && foo.something_that_assumes_that_a_price_is_present.
[03:47:51] sj26: Nic_home: everyone should do it from scratch at least once and understand all the corners. :-)
[03:48:01] Nic_home: thanks sj26 :)
[03:48:14] Nic_home: starting there now
[03:48:14] sevenseacat: having a public api for your object that will readily throw exceptions if looked at wrong, is bad practive
[03:49:11] sevenseacat: foo.save; foo.price = nil; foo.something_that_assumes_a_price_is_present
[03:49:14] sevenseacat: more explosions!!
[03:52:20] baahs05: I like that.. more explosions :)
[04:30:19] Cache_Money: I've traditionally pushed my side project RoR apps up to Heroku. However, I came across this article on DigitalOcean and it sounds pretty easy to get everything setup https://www.digitalocean.com/community/tutorials/how-to-scale-ruby-on-rails-applications-across-multiple-droplets-part-1
[04:30:47] Cache_Money: Does it seem like a good idea to have one droplet serving up my website content and another droplet serving up requests/responses for the API?
[04:34:15] gizmore: Cache_Money: if you got load problems, there are multiple things you can try to do
[04:36:23] Cache_Money: gizmore: So, should I serve requests to api.example.com and requests to www.example.com on the same application server and not worry about it?
[04:37:13] gizmore: well, ... planing ahead is always good
[04:38:13] Cache_Money: gizmore: that's what I'm thinking. Problem is I've never worked with more than 1 app server before... which is why I'm trying to feel out what I should do from the onset
[04:39:04] emocakes__: yeah i wouldnt bother Cache_Money
[04:39:08] emocakes__: if it becomes bad
[04:39:13] emocakes__: stick them behind haproxy
[04:39:42] emocakes__: dont waste time prematurely optimsing
[04:40:06] emocakes__: if the website is high traffic, stick it behind cloudflare to get some cdn / caching
[04:40:33] emocakes__: if the api starts to get overloaded, get a bigger droplet
[04:40:44] emocakes__: once that doenst work, you'll be making some $$
[04:40:50] emocakes__: make sure the api is stateless though
[04:41:16] emocakes__: and if it will have state, make sure its kept in something external i.e redis / memcahcehd
[04:41:27] emocakes__: I know an idiot who coded a new api in node
[04:41:55] emocakes__: and stored stateful objects in ram of the node process, couldnt scale more than one core
[04:42:10] emocakes__: he was the CTO of a well funded company as well
[04:42:49] emocakes__: s/ram/memory space
[04:43:45] emocakes__: had a bit of a laugh, considering he was on php before, and went to use node because it said webscale on the box
[04:46:26] Cache_Money: emocakes__: So on Heroku you pay for Worker Dynos, etc. On DigitalOcean I'm going to buy a droplet, say 4GB/2CPUs. How many Worker Dyno equivalents does the DO droplet have?
[04:46:47] emocakes__: heroku is a waste of money, they run on aws
[04:46:49] Cache_Money: I'm trying to understand the relationship there..
[04:46:53] emocakes__: and never lower their price
[04:47:17] emocakes__: no idea on a direct comparison Cache_Money
[04:47:24] Cache_Money: So I basically pay a premium so that it's easy to deploy an app?
[04:47:34] uberjar: Cache_Money: expect to serve at least 2x as many requests per GB of ram on a droplet
[04:48:09] uberjar: Cache_Money: at least that's what I saw running jruby..
[04:48:15] emocakes__: and you dont need a background worker dyno to run a background worker i.e sidekiq
[04:49:31] uberjar: Cache_Money: that's exactly correct
[04:50:04] uberjar: Cache_Money: you're paying for "easy elasticity" and "easy deployment"
[04:51:23] emocakes__: http://blog.clearbit.co/ec2-heroku?hn
[04:51:33] uberjar: Cache_Money: if you suddenly need to scale your droplet setup from 1 droplet to say.. 20 droplets, you're going to need to roll your own deployment stack to accomodate it
[04:51:50] emocakes__: which isnt hard
[04:52:01] Cache_Money: uberjar: what does that look like?
[04:52:01] baahs05: actually you don't need a background worker on heroku either.
[04:52:15] baahs05: You can spin up one on the same dino as the app.
[04:52:19] drale2k: I am having trouble understanding ActiveSupport::Notifications. I created my own custom notification and subscribed to it. Now everytime this event fires, it remembers al previous events. So the first time i see it once, the second time twice etc
[04:52:20] uberjar: Cache_Money: that depends if you want zero-downtime deployments, git based workflow, etc
[04:52:24] emocakes__: ah, didnt know baahs05
[04:52:33] emocakes__: dont use heroku
[04:52:43] baahs05: I did at my old gig..
[04:52:48] uberjar: Cache_Money: it can be a pain in the ass.. learn chef, ansible, saltstack, or even... capistrano 3
[04:53:03] uberjar: those technogies make it possible, but there is a learnign curve
[04:53:14] Cache_Money: uberjar: gotcha. I've heard of chef and capistrano
[04:53:25] baahs05: We had two web workers dyno's
[04:53:39] emocakes__: cap is a must imo anyway
[04:53:44] emocakes__: so easy to deploy code
[04:53:50] baahs05: and each one had a dj_worker along side.
[04:54:12] baahs05: Heroku is great... the price you pay is nominal (starting out)
[04:54:25] baahs05: less than an hour of employee pay per month.
[04:54:50] baahs05: it's not as fast as local AWS, but most sites (starting out) would be fine.
[04:55:18] emocakes__: can do it for free in aws though
[04:55:25] emocakes__: just without the automation
[04:55:41] drale2k: Heroku is great if they just would lower their price a bit. EC2 has cut prices i think 2 or 3 times without Heroku doing anything
[04:55:41] baahs05: I suspect emocakes__ you've spent more time thinking about if you should host their then if you just paid the premium :)
[04:55:50] emocakes__: personally i prefer to own the hardware and run my own hypervisor etc
[04:55:58] emocakes__: but that is not always possible
[04:56:16] baahs05: drale2k: Heroku on the other side has gotten even easier..
[04:56:19] emocakes__: but i like learning
[04:56:26] uberjar: I'd like to own the hardware and run containers with no hypervisor
[04:56:46] baahs05: I fired up a test app the other day, and I was amazed at how easy it was.
[04:56:47] uberjar: one of these days I'll be on bare metal + docker
[04:56:48] emocakes__: im more of a solaris man :p
[04:56:49] uberjar: but I"m not there yet
[04:57:22] baahs05: emocakes__: I managed to get my kindle (keyboard) to host a web page.
[04:57:37] emocakes__: paperwhite though
[04:58:23] baahs05: though to be fair, it was a custom cut server..
[04:58:31] baahs05: and took me weeks to do.
[05:04:21] baahs05: morning :)
[05:04:38] emocakes__: morning Macaveli
[05:08:03] baahs05: I actually just finished reading the prince.
[05:08:16] baahs05: Not as rough as I'd have thought.
[05:09:48] baahs05: I mean the guy got such a bad name.. but honestly I rather liked his take on things.
[05:12:19] emocakes__: what baahs05 ?
[05:15:09] baahs05: emocakes__: macavelion.. it's sort of overblown adjective.. the book isn't that bad.. he seems like an honest enough bloke.
[05:16:23] baahs05: I've been chaining my reading lately.. if a book mentions another book I go find it and read it.
[05:16:53] baahs05: evil by design mentioned it, so I figured I'd give it a go.
[05:18:18] emocakes__: god im so lost
[05:18:35] baahs05: Oh.. the name of the book is "the prince"
[05:18:45] emocakes__: ahh, 4pm, friday! thats why i need adrink
[05:19:06] SPYGAME: has_many :sub_categories, through: :video_categories, class_name: "Categories", where: "parent_id is not null" can i do something like this ?
[05:19:13] baahs05: when Macev... logged in I said.. cool I just finished reading "the prince"
[05:19:59] sevenseacat: its not beer oclock yettttt
[05:19:59] baahs05: I figured if he/she took the name as their nic, they must have read it.
[05:20:02] emocakes__: didsst see that baahs05
[05:20:15] emocakes__: it is here sevenseacat , shame you are in perth
[05:20:20] baahs05: so close... a few more hours out west though.
[05:20:42] emocakes__: macavelli is 2pac
[05:20:50] emocakes__: thats where i think he got he word from
[05:21:00] emocakes__: being some white gangsta on IRC, like myself
[05:21:14] emocakes__: although biggie > 2pac
[05:21:30] baahs05: I got my nic 20 years ago.
[05:21:47] baahs05: my wife actually calls me by it instead of my name
[05:22:12] emocakes__: baahs05, come to bed honey?
[05:22:35] baahs05: typo.. baash
[05:22:49] emocakes__: still makes no sense
[05:23:04] baahs05: met her first year uni.. and had the nic..
[05:24:23] emocakes__: sevenseacat you stilrl with your bf?
[05:24:41] emocakes__: when you wanna ditch that zero and get yourself a hero let me know
[05:24:44] sevenseacat: he kasnt kicked me to the curb yet
[05:25:08] emocakes__: lol, with that attitude sure
[05:25:17] gizmore: what is the correct way to configure sendmail in actionmailer? ... the hostname is 12x43x52 but we want sender / name like support@fubaar.com
[05:25:28] emocakes__: http://disney.spiderpaws.com/pooh/eeyore2.gif
[05:25:34] sevenseacat: ACTION shrugs
[05:25:51] gizmore: the emails send as support@fubaar.com might get handled as spam?
[05:25:53] sevenseacat: dont ask questions if you dont want me to answer them.
[05:25:56] emocakes__: default from: 'foo@bar'
[05:26:54] gizmore: X-Authentication-Warning: 345s167045.foo-baaaaar.de: apache set sender to support@foo-baaaaar.de using -f
[05:26:57] emocakes__: you arent supposed to let anyone know you are sad sevenseacat , you have to bottle it all in and keep it to yourself
[05:27:03] emocakes__: thats what men do!
[05:27:09] sevenseacat: i'm fucking tired of doing that.
[05:27:10] emocakes__: it works just fine for us
[05:27:26] baahs05: I just tweet it and hope no-one notices :)
[05:27:42] sevenseacat: oh i do that too
[05:27:47] emocakes__: instagram.com/itslavishbitch
[05:28:00] emocakes__: i wish my instagram was like his
[05:29:58] baahs05: actually I got pre-schoolers.. hard to be sad when they are about.. Nothing like a hug from a 5 year old to make life perfect.
[05:38:46] SPYGAME: how can i filter values for a dropdown in active admin ?
[05:50:35] uberjar: founder depression is a big deal. I recommend.. pushups, zazen, drink more water, and then uh.. get back to shipping product.
[05:51:24] uberjar: nothing cures depression like finally launching something cool
[05:54:59] uberjar: http://blog.codinghorror.com/yes-but-what-have-you-done/
[05:56:05] sevenseacat: i've shipped a lot. i'm proud of very little of it.
[05:56:42] uberjar: client work ? i
[05:56:53] sevenseacat: thats all i do
[05:57:09] uberjar: sometimes you've gotta do what you've gotta do.. *sigh*
[05:57:22] uberjar: I bet that can be rewarding in it's own way
[05:57:40] uberjar: at least you have a "it's finally done" moment
[05:57:53] uberjar: whereas with startups it seems like you're never done even after you launch
[05:58:25] sevenseacat: you also get very little time for reflection and polish
[05:59:01] sevenseacat: refactoring i meant
[06:02:04] uberjar: well with startups it's easier to justify crappy code... "we'll fix it later" because there's no client who's gonna complain
[06:02:31] uberjar: and that can spiral out of control quick if dicipline isn't applied
[06:03:18] rao: Hi, is this possible to get number of forms in a awb page using url?
[06:03:48] uberjar: rao: what's an awb page ?
[06:05:19] rao: <uberjar> sorry it's web page
[06:05:49] sevenseacat: what do you need to know the number of forms for?
[06:06:04] sevenseacat: nokogiri could help with that
[06:06:20] rao: <uberjar> document.write(document.forms.length); it's giving length in html document
[06:07:10] uberjar: sevenseacat: do you think you'll ever end up building an app on your own one day (no client) ? It's addictive, but you need an idea.. thats the thing
[06:07:22] sevenseacat: i'd love to, more than anything
[06:07:39] baahs05: I started a few months back.
[06:07:48] uberjar: sevenseacat: a bunch of prominent product companies started off doing client work.. 37signals for instance
[06:08:13] helpa: http://youtu.be/kfVsfOSbJY0
[06:08:14] baahs05: I keep getting side tracked by paying work
[06:08:24] uberjar: baahs05: are you just gradually enhancing it in your spare time ?
[06:08:47] rao: <uberjar> any solution?
[06:09:21] baahs05: I consider myself full stack.. but I don't include browers in there.
[06:09:36] baahs05: so I've got a bit to go before I can CSS like a pro
[06:09:54] uberjar: rao: $("form").length()
[06:10:00] sevenseacat: i could css like a pro like five years ago, but css has changed a lot since then
[06:10:05] uberjar: rao: that's jquery.. it might work
[06:10:17] baahs05: helpa: sounds like robin sparkles.
[06:10:31] sevenseacat: baahs05: !auto
[06:11:22] baahs05: spam.. here.. wow..
[06:11:52] baahs05: I figured this place was forgotten, by spamers
[06:13:08] uberjar: I don't consider myself a pro at anything.. but I do a little bit of everything. I'm just a guy who worked at a few venture backed startups which all failed and is now burning thru his personal savings building an app
[06:13:47] baahs05: you read lean startup?
[06:13:54] uberjar: but I'm having a great time doing it.. and soon I'll launch it and we'll see what happens
[06:13:58] shortCircuit__: i want to test some things before actually implementing it. can i not just require 'activerecord' and test controller and model stuffs ?
[06:14:09] uberjar: baahs05: yea..
[06:14:11] baahs05: or 4 steps to epiphany?
[06:14:45] baahs05: I'm currently re-reading design for emotion.
[06:15:07] uberjar: baahs05: I favor a slightly older book.. "getting real" by 37signals.. I think DHH made the point "ship half a product, not a half-assed product" and ries is just kind of restating that in his own words
[06:15:08] sevenseacat: shortCircuit__: what does requiring activerecord have to do with testing controller and model stuffs
[06:15:12] uberjar: but that's drama :x
[06:15:45] uberjar: baahs05: I have not read 4 steps, I'll peep it
[06:15:50] shortCircuit__: i mean want to check if some of my codes are working, i don't want to create a new rails project for that
[06:16:15] shortCircuit__: by test i didnot mean rspec and factories
[06:16:24] sevenseacat: err... what did you mean then
[06:16:40] uberjar: baahs05: here's one I'm looking forward to reading soon http://www.nirandfar.com/hooked
[06:16:44] baahs05: 4 steps is like the prequil.. I am (I've said this earlier) reading books that other books reference.
[06:18:48] shortCircuit__: i mean like if i want to suppose check how to generate a base64 random number, in the irb i require 'securerandom' (i forgot the actual name) and then i do p SecureRandom.base64
[06:19:26] fp-: So, Safari 8 in Yosemite won't resolve .local domains
[06:19:59] baahs05: 4.. 4 is a good base64 randomnumber
[06:20:18] shortCircuit__: wll um its better i do it in an existing project
[06:20:20] uberjar: baahs05: wow this "designing for emotion" book is written by the Mail Chimp UX guy.. they're from the city where I live (Atlanta) and I have a lot of respect for their product
[06:20:35] uberjar: plus I love their site design.. I'll definitely read it now
[06:20:48] sevenseacat: shortCircuit__: so you want to test your code by running it in a console? you can do that
[06:20:54] sevenseacat: but thats also what automated tests are for
[06:25:31] baahs05: 35 minutes.. (east coast rules)
[06:27:20] uberjar: baahs05: ?
[06:29:16] baahs05: beer-o-clock in 31 minutes.
[06:29:35] sevenseacat: pfft, beer oclock in an hour and a half - you do beer oclock late
[06:29:56] tmoore: busy day :-(
[06:31:47] tmoore: rake spec && git push && open beer
[06:34:39] baahs05: we can open beer with a rake task..
[06:34:51] sevenseacat: rake beer:open
[06:34:59] baahs05: matz you think of everything
[06:35:16] tagrudev: I like that rake
[06:35:16] sevenseacat: matz didnt write rake, and he didnt call a rake task to open beer :P
[06:40:25] Varun_krishna: Hi all have any one worked with telegram gem ?
[06:40:34] Varun_krishna: https://github.com/Homestyle/telegram
[06:40:43] helpa: Nope. No one. Ever. In the history of the world.
[06:40:46] uberjar: baahs05: here's that book I mentioned: https://gettingreal.37signals.com/toc.php I'm not saying I agree /w everything in there.. but I'm a fan
[06:41:30] Varun_krishna: sevenseacat: Did ask anything worng ?
[06:42:18] tmoore: I'm pretty sure matz doesn't drink beer, either :-P
[06:42:40] tmoore: but I do... so see ya!
[06:43:32] rvanlieshout: varun_krishna: you asked something irrelevant
[06:43:43] sevenseacat: tmoore: see ya :P
[06:43:57] rvanlieshout: no.. something rhetorical
[06:44:36] Varun_krishna: rvanlieshout: Yup, but there is no other info about that gem in that repo. :)
[06:48:04] shortCircuit__: i umm, wanted to clarify if the associations written are correct https://gist.github.com/aghosh47/f1c46024f7a3b8b3583e specially in academic.rb , shpuld it be belongs_to :college_application or belongs_to :applications
[06:48:25] rvanlieshout: shortCircuit__: to what does it belong to?
[06:48:43] donnib: Hi, i am trying to run following code and i get an error : https://bitbucket.org/atlassianlabs/moodapp/src/da159d474c51b52691d97a090aa4903ca51b6785/db/migrate/20130327010536_make_first_user_admin.rb?at=develop
[06:48:44] uberjar: sevenseacat: so what exactly is stopping you from building a product right now ? You said you want too one day.. why wait ?
[06:48:59] sevenseacat: uberjar: a lot of things, all mental
[06:49:00] donnib: and the error i get is undefined method `update_attribute' for nil:NilClass/Users/xxx/moodapp/db/migrate/20130327010536_make_first_user_admin.rb:4:in `up'
[06:49:01] donnib: NoMethodError: undefined method `update_attribute' for nil:NilClass
[06:49:13] sevenseacat: donnib: maybe try to not call update_attribute on nil.
[06:49:14] shortCircuit__: belongs to college_application. it has a fk called college_application_id
[06:49:18] rvanlieshout: donnib: what part of that error don't you understand?
[06:49:31] sevenseacat: donnib: obviously you have no first user.
[06:49:36] rvanlieshout: shortCircuit__: the line use there is not really related to the technical part
[06:49:38] donnib: i haven???t written the code so i don???t know anything about it
[06:49:43] rvanlieshout: shortCircuit__: give it the name it should have
[06:49:59] donnib: trying to follow this guide : https://bitbucket.org/atlassianlabs/moodapp
[06:50:11] rvanlieshout: donnib: the error is clear
[06:50:28] donnib: and maybe there is a step they have not defined in the readme above
[06:50:36] donnib: any idea how i do that ?
[06:51:29] uberjar: sevenseacat: well I'm glad to hear it's not a lack of product ideas... because I've got several that I freely give away from time to time.. people call me a troll when I drop them in here though
[06:52:05] uberjar: mainly they're products that *I want to exist* right now so I can make use of them..
[06:52:57] shortCircuit__: isn't it right?
[06:53:43] rvanlieshout: donnib: you're calling that url for a non existent user
[06:53:50] sevenseacat: shortCircuit__: there is no 'right'
[06:53:54] sevenseacat: its whatever you want it to be
[06:53:58] rvanlieshout: shortCircuit__: same question: to what does it belong to
[06:54:07] rvanlieshout: without thinking of the database and keys
[06:54:13] rvanlieshout: add that to belongs_to ...
[06:55:01] baahs05: donnib: you need a user..
[06:55:11] baahs05: isn't one of the steps to create a user?
[06:55:28] baahs05: "Create the first admin user"
[06:55:38] shortCircuit__: belongs to an association.
[06:56:35] baahs05: donnib: User.create(....)
[06:56:48] rvanlieshout: shortCircuit__: explain to me in plain english to what it belongs to
[06:57:46] shortCircuit__: it belongs to one application
[06:57:55] rvanlieshout: so has_one :application
[06:58:03] donnib: baahs05: the script is called make_first_user_admin.rb
[06:58:19] donnib: baahs05: so i would have guessed that would create the user
[06:58:29] sevenseacat: read it - it does not
[06:59:03] shortCircuit__: no, for one application an user can have many qualifications (which is academics table in here)
[06:59:21] baahs05: no. it makes the first user admin
[06:59:53] rvanlieshout: shortCircuit__: so a application has_many :qualifications
[07:00:13] rvanlieshout: so your question is?
[07:00:14] donnib: baahs05: hmm, i need to figure out how to do that, haven???t played with ruby on rails
[07:01:24] baahs05: donnib: you very likely have a controller?
[07:01:45] shortCircuit__: in the belongs_to of academic.rb i have written :college_application , is it correct .? does it have anything to do with this line https://gist.github.com/aghosh47/f1c46024f7a3b8b3583e#file-user-rb-L3 ?
[07:02:02] donnib: baahs05: idk, this is the code they made
[07:02:03] donnib: https://bitbucket.org/atlassianlabs/moodapp/src/da159d474c51?at=develop
[07:02:20] rvanlieshout: shortCircuit__: does a academoc belongs to a college application?
[07:02:33] rvanlieshout: then it's correct
[07:02:34] baahs05: how about in your seed
[07:02:34] sevenseacat: ACTION gives rvanlieshout a #{relaxing_beverage_of_choice}
[07:02:50] baahs05: beer + 2 min..
[07:02:55] baahs05: see you all
[07:02:57] rvanlieshout: i'm in friday mode :)
[07:03:04] uberjar: 2x vodka shots 2 minsago
[07:03:10] sevenseacat: i was going to say beer, but hey, not everyone drinks it
[07:05:28] shortCircuit__: ACTION likes whiskey
[07:05:44] sevenseacat: ACTION partial to vodka but instead nursing a can of pepsi max
[07:06:14] rvanlieshout: i'm still drinking water / cola / tea here.. too early
[07:06:28] sevenseacat: said can may or may not get vodka added to it in about an hour
[07:07:28] bricker`work: Is there a better way to remove :en as the fallback locale for every other locale, other than iteration through all the fallbacks and removing it?
[07:07:38] bricker`work: Like, I can't figure out why it's there in the first place
[07:18:51] shortCircuit__: http://www.youtube.com/watch?v=aKPoQYevoLs
[07:25:29] uberjar: shortCircuit__: hella creepy, this is why I go for redbull /w my vodka only
[07:26:03] shortCircuit__: the only think that is pure is alcohol
[07:27:05] rvanlieshout: i don't really care about alcohol
[07:31:25] uberjar: rvanlieshout: it's cool if you prefer the harder drugs, but we try to keep that on the DL in here.. after all it's only been friday for a few hours :)
[07:31:54] rvanlieshout: i don't even do that
[07:31:59] rvanlieshout: although i live in nl :)
[07:42:59] tbuehlmann: so we are neighbors \o/
[07:45:53] rvanlieshout: tbuehlmann: that might be possible
[07:46:28] tbuehlmann: sitting somewhere east of you
[07:50:03] hightower6: I'm having trouble with more database stuff - been struggling since yesterday so time to ask you gentle gurus
[07:50:41] hightower6: I have a Players table and a Statistics table
[07:50:54] hightower6: Each player row can have many statistics rows
[07:51:05] hightower6: That's how it's configured in the model too
[07:51:29] hightower6: However, in the player model I have a method that helps return some statistics for a player
[07:51:53] hightower6: and I'm not quite sure how to get in to the statistics part of the records
[07:52:20] hightower6: Just putting a snippet in a paste bin
[07:52:20] MattDunbar: has_many :classifications, -> { order(:position) }, dependent: :delete_all, inverse_of: :taxon
[07:52:21] MattDunbar: has_many :products, through: :classifications
[07:52:57] MattDunbar: What would be the best way to access products that belong to each of the current class??? children (instances of other objects of the same type)
[07:53:26] hightower6: http://pastebin.com/s8yg77U0
[07:53:47] hightower6: Oh, ok - will transfer to there
[07:54:08] hightower6: http://pastie.org/9655109
[07:54:55] hightower6: Oh, I haven't explained this very well - I missed a part of it out
[07:55:31] hightower6: I forgot to mention there's a Fixtures table, which each stat also belongs to
[07:55:53] hightower6: So the stat table belongs to both a fixture in the Fixtures table and a player in the Players table
[07:56:28] hightower6: So in that pastie I'm trying to iterate through each stat that belongs to a player, and then try and call the data for the fixture it belongs to aswell
[07:58:25] Radar: Hightower_: why are you using fixture_id?
[07:58:28] Radar: and not .fixture?
[07:58:39] Radar: Hightower_: And you're missing the Fixture, Stat and Player models
[08:01:07] hightower6: Because I'm lost hehe - if I try stat.fixtures for example I get a 'nil'
[08:01:16] hightower6: Ok, repasting with models
[08:01:47] Radar: Hightower_: I didn't say "fixtures"...
[08:01:55] Radar: I said "fixture", with no S.
[08:02:08] hightower6: That produces an error
[08:02:18] hightower6: In the console, undefined method
[08:02:26] Radar: Hightower_: ok, so please create a pastie with everything
[08:02:28] helpa: Hightower_: Please section your pasties using the syntax of "## section header". Alternatively, use https://gist.github.com's and click "Add Another File".
[08:02:28] Radar: Hightower_: !section
[08:04:05] hightower6: http://pastie.org/9655121
[08:04:24] hightower6: Hope that's all the things needed
[08:10:20] agent_white: Ello everyone
[08:11:32] Radar: Hightower_: belongs_to should be singular
[08:11:45] Radar: Hightower_: belongs_to :fixture
[08:11:52] Radar: Hightower_: then: stat.fixture.name
[08:12:34] hightower6: Changed that, still getting an error "undefined method 'name' for nil:NilClass
[08:15:36] hightower6: Oh, wait, could be database error - sorry about this
[08:15:38] hightower6: Will let you know
[08:18:51] hightower6: Yeah, ok, I'm officially a doofus
[08:19:36] hightower6: For some reason I had a stat row, id 1 (so the one I was testing on) that was just nil values - can't see the wood for the trees or something like that
[08:19:42] hightower6: Sorry Radar, really appreciate your help
[08:19:59] hightower6: But question for learning: you said belongs_to should be singular
[08:20:03] Radar: Hightower_: no worries :) Glad you were able to figure it out
[08:20:08] hightower6: And I had mine as plural
[08:20:14] helpa: http://guides.rubyonrails.org/association_basics.html - Active Record Association Basics by Mike Gunderloy
[08:20:14] Radar: !associations
[08:20:19] hightower6: Would that have made a difference too, or is it just convention
[08:20:23] Radar: belongs_tos always return only one record
[08:20:30] Radar: has_manys always return multiple records
[08:20:33] Radar: comment belongs_to :post
[08:20:41] Radar: Which is correct, comment.post or comment.posts?
[08:20:50] Radar: If you want to find out which post the comment belongs to?
[08:20:53] Radar: Yes, post is right.
[08:20:57] Radar: so belongs_to should be singular :D
[08:21:18] hightower6: But that wouldn't have broken the app? It would just look wrong (or unconventional)?
[08:22:48] uberjar: ACTION <3 dwbutler/logstash-logger + shadabahmed/logstasher + elasticsearch/logstash + elasticsearch/kibana for rails logging management 
[08:23:23] uberjar: I just couldn't contain that sentiment any logger
[08:24:32] Radar: Hightower_: It wouldn't have broken the app, it would indeed just look wrong.
[08:26:02] shortCircuit__: can i build two objects simultaneously and save them. like user.academics.new() twice and then save both
[08:29:07] hightower6: Cheers Radar, very helpful :)
[08:29:09] shortCircuit__: i actually have to implement a feature when user can add new fields and then on form submit all of them gets saved to database
[08:29:13] Radar: Hightower_: no worries :)
[08:29:48] uberjar: shortCircuit__: https://github.com/zdennis/activerecord-import <-- you can add many records to the db at once if that's really what you want..
[08:31:33] uberjar: shortCircuit__: otherwise just call #save on both of them.. ?maybe I misunderstand?
[08:34:49] shortCircuit__: here is the issue. there is an academics table columns: board_name| institute_name| year_of_passing. now in the ui at first there is one form, for one academic qualification. but then if he wants to add another form in case he has another degree. another form would appear beneath the existing, then he fills it up and maybe when he submits the records gets saved in the table
[08:37:37] shortCircuit__: we could take an array and then do a user.academics.transaction do abc.map{... save ..} end
[08:38:00] shortCircuit__: but i was thinking of something smart-ish
[08:38:55] uberjar: ahh.. yea I dunno.. it sounds like a time for a transaction to me, but admittedly my active record foo is rusty
[08:39:57] uberjar: I'm used to using couchdb's bulk document API to save multiple documents atomically
[08:40:10] uberjar: I'd probably save all of that stuff in a single json doc
[08:40:22] uberjar: but I digress..
[09:12:25] shortCircuit__: i think, i would save the entered record and redirect to new, because submitting like 4-5 forms together and inserting records to database, isn't a good thing maybe. i never did such thing in php
[09:14:35] gizmore: it??s not very frequently you read "good idea" and "php" so close to each other
[09:15:54] uberjar: shortCircuit__: for the record I think it'll be fine
[09:16:46] uberjar: shortCircuit__: if you're worried that the saves might take too long (latency) then you can do it asynchronously with some kind of worker queue or backgrounding library
[09:27:02] hightower6: Grrr, another problem - I have a fixtures form that I want a drop down that pulls entries from another table, so the user can add a new fixture and choose the competition it is for from the related table rows
[09:27:08] hightower6: So this is what I have: http://pastie.org/9655306
[09:27:33] hightower6: The dropdown is correctly populated with the entries from the Competitions table
[09:27:51] hightower6: But when saving I get an error: Competition(#38095620) expected, got String(#17790216)
[09:31:05] tbuehlmann: Hightower_, I think you want to set the competition_id in the controller instead of the competition
[09:32:25] tbuehlmann: wanna show us the controller?
[09:33:48] hightower6: http://pastie.org/9655332
[09:34:24] hightower6: The controllers haven't been changed at all though I'm sure, they are as they are in the scaffold generate
[09:34:54] tbuehlmann: try this: https://gist.github.com/tbuehlmann/954564f0deac394523d3#file-fixtures_controller-rb-L72
[09:35:06] hightower6: You're a star
[09:35:20] hightower6: At the bottom: params.require(:fixture).permit(:
[09:35:24] hightower6: It was listed as competition
[09:35:38] hightower6: I did a db:migrate to change competition to competition_id
[09:35:56] hightower6: And this change musn't have replicated here causing the error?
[09:36:06] tbuehlmann: the reason it didn't work, when you call Fixture.new(competition: '42').save it won't work because the #competition= method on Fixture expects a Competition object
[09:37:35] hightower6: Thanks buddy
[09:37:51] tbuehlmann: very welcome
[09:41:42] doerteDev: hi. did someone yet blog a comparison of rails -> middleware <- nginx that is some up2date'ish?
[09:42:31] doerteDev: I'm just starting with rails on a vm and I couldn't find any tuts on what to pick
[09:43:04] elaptics: doerteDev: what info are you looking for?
[09:43:13] tbuehlmann: and what do you mean, "rails -> middleware <- nginx"?
[09:43:21] doerteDev: stuff like unicorn
[09:43:33] doerteDev: google spams me with possibilities and I'm confused
[09:43:59] elaptics: what do you want to do? Get a box set up to run rails in production?
[09:44:40] doerteDev: elaptics: set up a vm to get used to one of them to later run them in production
[09:44:44] tbuehlmann: ther are some comparisons in the wild, like https://www.digitalocean.com/community/tutorials/a-comparison-of-rack-web-servers-for-ruby-web-applications or https://blog.engineyard.com/2014/ruby-app-server-arena-pt1
[09:45:00] tbuehlmann: I personally use nginx with puma and I'm happy so far
[09:45:04] doerteDev: asking for personal preferenced articles here :)
[09:45:24] elaptics: nginx and unicorn is a popular configuration
[09:45:42] elaptics: or nginx and passenger
[09:46:14] doerteDev: yes and I'm considering a choice on the "or" part :P
[09:46:23] x44x45x41x4E: Hi guys. Any guide you know in setting up Rails, Nginx, Node.js in a CentOS 6.5 VPS? I can't seem to find a good one. There are some but I felt lack in it. Hope you can suggest one. Thanks.
[09:46:27] elaptics: the best app server to use can depend on the type of application you're developing and its characteristics
[09:46:50] doerteDev: elaptics: TL;DR it's a newsletter tool ... simple administration and a sidekiq background worker
[09:47:12] elaptics: doerteDev: any probably fine then :)
[09:47:22] doerteDev: yes and that's why I'm asking :D
[09:48:08] doerteDev: elaptics: whanted to experiment with http2 ... does any of these cover that?
[09:48:12] elaptics: doerteDev: if you just want a no hassle setup and you don't mind paying a little bit then you could look at something like cloud66 which will take care of that for you on your own vps
[09:48:30] doerteDev: elaptics: I'm building FOSS here :D
[09:49:26] doerteDev: also delivering a chef config'd vm to dev with, later deploying the thing to a nginx-gentoo-stack so... puma, passenger, thin or unicorn or ... ? :)
[09:50:38] tbuehlmann: elaptics is right, for your usecase almost everything will do. and again, my favorite so far is nginx with puma
[09:51:02] doerteDev: does any of the mentioned cover http2 goodness? :)
[09:54:34] doerteDev: man I have to dig into so much software
[09:56:01] cornerman: hej, does anyone of you know howto manually call a serializer from active_model_serializer without using respond_to or render? i would like to store the serialization result in a variable (using the gon gem to make it available in javascript)
[09:57:52] workmad3: cornerman: pretty sure you can just do 'MySerializer.new(model).to_json'
[09:58:03] agent_white: So quick question. Using rspec/capybara in Rails for creating authentication... I see a example test of "scenario: 'using valid pass' ... scenario 'using invalid pass'" as well as "scenario: 'needs pass confirmation to save'". Which way is correct?
[09:58:25] workmad3: agent_white: imo, none of them
[09:58:33] agent_white: workmad3: Huh, why not?
[09:58:52] cornerman: workmad3: thank you, that works as expected :)
[09:58:55] workmad3: agent_white: because they're all focussed on the implementation detail of providing a password rather than the behaviour of identifying yourself
[10:01:11] workmad3: agent_white: when I write that sort of scenario in cucumber, I tend to call it 'Identifying as a known user' or similar, and then the steps are along the lines of 'Given I am not identified, When I provide my credentials, Then my identity should be established'
[10:01:33] agent_white: workmad3: Does that apply even though this (i don't know the vocab to describe it) a behavior test? -- As in I'm acting as though I was the user attempting login, so I don't want him to enter a username, pass blank, and know the user existst?
[10:02:46] workmad3: agent_white: it can apply however you want, I'm giving you my opinions and outlook here ;)
[10:03:05] agent_white: workmad3: Oh no I'm taking them into consideration! Just asking for further guidance :)
[10:03:07] workmad3: agent_white: for invalid, I tend to mask it all under 'When I provide invalid credentials'
[10:03:36] agent_white: workmad3: Just re-read what you said before, and it makes much more sense! Thank you!
[10:04:01] workmad3: agent_white: and I'd probably write a lower-down, non-acceptance test specific to un/pw authentication regarding that specific security constraint ;)
[10:04:23] workmad3: agent_white: or I'd rely on devise already having such a test ;)
[10:05:05] agent_white: Hm... I'll look into it! Thank you!
[10:11:39] agent_white: workmad3: I live in the country and work at the town pizza-shop, so I am making a restaurant POS system for us for fun. Luckily however my tests come out the only eyes on them are my own ;P
[10:12:03] workmad3: agent_white: good practice then ;)
[10:12:46] agent_white: workmad3: Indeed! Everything I do is at least until I can program pizzas. :P
[10:12:58] agent_white: workmad3: Thanks again for the help! Just what I needed.
[10:19:03] alex88: in an around_update callback
[10:19:21] alex88: how do I know if an object is actually updated or it failed e.g. due validation?
[10:44:51] xhoy: https://gist.github.com/xhoy/7c7fbacc5cfcd2c0e723 << what option is the 'beter' style
[10:45:15] rvanlieshout: what's an ocu?
[10:45:26] xhoy: otrs customer user :)
[10:45:33] rvanlieshout: what's 'otrs'?
[10:45:37] xhoy: just a random function :) its about how i should type the loop
[10:45:43] xhoy: http://www.otrs.org
[10:45:47] xhoy: ticketing system
[10:46:01] xhoy: is a customer
[10:46:07] rvanlieshout: is it an abbreviation?
[10:46:10] rvanlieshout: i prefer option 2
[10:46:13] xhoy: an object :)
[10:46:31] xhoy: in my rails i have all customers and in otrs all tickets, and now i match them
[10:46:31] workmad3: xhoy: I prefer option 2 too
[10:46:41] xhoy: i would but the style guide says no :)
[10:46:45] rvanlieshout: but you should change ocu if it's an abbrivation
[10:46:52] rvanlieshout: what style guide?
[10:46:53] tbuehlmann: what styleguide?
[10:46:58] tbuehlmann: flame dat thing
[10:46:59] workmad3: xhoy: I avoid ternaries in all but the absolute simplest circumstances
[10:47:04] xhoy: https://github.com/bbatsov/ruby-style-guide
[10:47:16] xhoy: or i read the wrong page :)
[10:47:22] rvanlieshout: never seen that style guide
[10:47:25] xhoy: rvanlieshout: otrs_customer_user
[10:47:38] xhoy: is really handy for short hands etc
[10:47:40] rvanlieshout: xhoy: then chante it to otrs_customer_user
[10:47:50] xhoy: its a lot of typing :P
[10:48:05] rvanlieshout: that's irrelevant
[10:48:09] xhoy: and its just a var i set one line earlyer
[10:48:13] xhoy: earlier?
[10:48:18] rvanlieshout: but an other developer doesn't know that
[10:48:20] rvanlieshout: and it's harder to read
[10:48:36] xhoy: that is true
[10:48:51] workmad3: xhoy: that style guide says to avoid single-line if statements and to use ternaries for them instead
[10:48:54] xhoy: i also have occ, Otrs_Customer_companies
[10:48:55] workmad3: xhoy: which I agree with :)
[10:49:00] tbuehlmann: I don't approve some of the style guide's recommendations
[10:49:15] tbuehlmann: Limit lines to 80 characters <-- seriously, what year is it?
[10:49:16] workmad3: xhoy: also, figure out some form of tab-completion for at least existing variable names :P
[10:49:18] rvanlieshout: xhoy: drop occ :)
[10:49:24] workmad3: tbuehlmann: 1979, obv
[10:49:51] workmad3: tbuehlmann: either that, or he thinks you should be coding in 30pt fonts
[10:50:13] xhoy: workmad3: i have tab compleation but they all start with otrs_c so thats 3 chars more then ocu
[10:50:16] tbuehlmann: maybe I should, I mean, never tried
[10:51:13] hightower6: There's three things I know at this moment in time 1) Rails is awesome, why oh why did I spent so long with PHP 2) The Rails community (read: this IRC) is wicked and 3) I'm gonna become a dad, not the place to announce it but it's early days and we're keeping quiet and I just had to get it off my chest
[10:51:32] xhoy: but it's a really nasty peace of code anyway
[10:51:32] hightower6: So yeah, overview can be equated as: keep up the awesome work
[10:51:39] xhoy: but it only runs one's
[10:51:47] xhoy: but thanks for the suggestions
[10:51:50] rvanlieshout: Hightower_: congracts
[10:51:55] rvanlieshout: Hightower_: mine is 3 months now :)
[10:52:04] xhoy: my ruby mine suggested option 1 by the way
[10:52:56] tbuehlmann: Hightower_, congratulations :)
[10:52:56] xhoy: Hightower_: you switched to rails so you could spend more time with your kid :)
[10:53:05] hightower6: Only 2 weeks gone so very early, waiting till the 12 weeks before we tell people - it's strange, it's not a big thing until you go through it yourself, then the whole world revolves around this one bit of news
[10:53:13] dangerousdave: What does SAP stand for in the context of software development? and why doesn't google know?
[10:53:51] dangerousdave: more specifically, what is a "SAP environment"?
[10:54:00] tbuehlmann: dangerousdave, you mean ASAP, right? that's what PMs are talking about all the time :p
[10:54:01] xhoy: is't that that big german company?
[10:54:20] dangerousdave: tbuehlmann, nah, just "SAP"
[10:54:21] workmad3: dangerousdave: only place I've come across SAP is http://www.sap.com/uk/index.html
[10:54:29] tbuehlmann: just kidding
[10:54:34] workmad3: dangerousdave: and is probably what you're looking for
[10:54:48] workmad3: dangerousdave: and if you're being offered a job with SAP... run, run like the wind in the opposite direction
[10:54:56] rvanlieshout: Hightower_: we didn't wait 12 weeks to tell some people. I know it's common cause the 'thing' is not yet feature complete in the first 11 weeks-ish, so the risk of failure is bigger. But hey.. don't you want to share that with some of your closest friends too?
[10:55:06] tbuehlmann: well, yea, SAP is a german company. wouldn't know what SAP should mean regarding software development
[10:56:04] hightower6: I do, but I think we're at least gonna wait until she goes to the nurse next week
[10:56:16] xhoy: speedy application programming
[10:56:22] workmad3: tbuehlmann: entire companies base all of their internal stuff on SAP stacks
[10:56:22] xhoy: single asset programm
[10:56:28] hightower6: Plus, I reckon if the worst happens you want your family aware so they can be there as a support network
[10:56:38] workmad3: tbuehlmann: as in, they force everything into a SAP cookie cutter
[10:56:45] xhoy: silent action process?
[10:56:47] workmad3: tbuehlmann: similar to SharePoint
[10:56:59] rvanlieshout: Hightower_: exactly. it would be a strange conversation when you have to tell that you're a) pregnant and b) it failed
[10:57:04] rvanlieshout: Hightower_: but enjoy this :)
[10:57:04] xhoy: sharepoint awsome processor
[10:57:14] hightower6: Cheers, appreciate the nice comments
[10:57:31] xhoy: Hightower_: yw! but let us know in 3 months if it's still going strong!
[10:57:40] cornerman: so, i am trying to use spin.js and installed it via bower. but as the package name is spin.js, i am not able to require it in my application.js. it seems, rails is searching for the file spin.js instead of the bower package. any ideas?
[10:58:00] xhoy: buy the way, the ruby style guide should be part of the getting started guide
[10:58:17] rvanlieshout: xhoy: it's a personal preference
[10:58:24] dangerousdave: tbuehlmann, workmad3, thanks, I think it must the companies ERP software
[10:58:46] xhoy: rvanlieshout: Convention over configuration
[10:59:01] rvanlieshout: xhoy: true, but that only requires you to write valid ruby code
[10:59:05] xhoy: and when commiting to rails there are some basic style guides :)
[10:59:23] rvanlieshout: so you're allowed to apply certain rules to your own project
[10:59:44] xhoy: rvanlieshout: true but i notice that i now can write 'working' ruby/rails code quite easy, but that it looks really messy from time to time
[11:00:19] shortCircuit__: some codes like getting the academic qualifications already filled in a formatting for the view could be put in a helper, but then i need in some other views. it doesnot feel right to put it in a model. and i have heard about a concept called decorator. what should i use?
[11:00:23] rvanlieshout: so you still have to learn how to write clean stuff
[11:00:38] rvanlieshout: shortCircuit__: you can access that helper from any view
[11:01:02] shortCircuit__: like include AcademicHelper
[11:01:08] dangerousdave: Stands for "Systems, Applications, Products" - http://en.wikipedia.org/wiki/Systems_Applications_Products_audit
[11:01:09] rvanlieshout: you don't have to include it
[11:01:28] rvanlieshout: shortCircuit__: or, if you prefer, place it in the application_helper
[11:01:38] tbuehlmann: dangerousdave, they renamed some time in the past
[11:02:21] shortCircuit__: why come i don't have to include it!!
[11:02:34] shortCircuit__: not the application_helper
[11:02:43] rvanlieshout: shortCircuit__: because helpers are made available?
[11:03:34] shortCircuit__: but isn't that Academic helper for academics/*.html.erb and SomeOtherHelper for someothers/*.html.erb
[11:03:51] rvanlieshout: it is, but iirc it's still available elsewhere
[11:05:11] cornerman: ok, i was able to require the package by explicitly providing the packagename as well as the javascript file name: require spin.js/spin.js
[11:17:12] techsethi: Hi Folks, I am doing view testing using Rspec. I have assigned some data using assign, the data is avaiable in the view but how can I access it in the spec itself. here is my gist. https://gist.github.com/techsethi/6ca30900c57758902d28 please help. Thanks in advance
[11:18:47] Godd2: take away the @
[11:19:36] Godd2: If I'm not mistaken, the assign creates a local method called data that returns the array. so you would say data.first, not @data.first
[11:20:50] Godd2: also, use before(:each) instead of before(:all) so that the assign is refreshed for each test.
[11:20:54] shortCircuit__: http://stackoverflow.com/a/9754287/1503615 couldn't that render line be replaced with render "shared/display_services", user: user}
[11:24:44] techsethi: godd2: nope, didn't work. got undefined local variable or method `data' for #<RSpec::ExampleGroups::HomeIndex::AuthorizedLoggedInUserVisitsHomePage
[11:25:19] techsethi: I am able to access @data in the view, using @
[11:28:16] freezevee: can I alter Json data before rendering them ?
[11:28:34] rvanlieshout: freezevee: how are you rendering it?
[11:29:08] freezevee: rvanlieshout: render json: @tickets.to_json
[11:29:33] freezevee: included in a format.json { }
[11:29:37] rvanlieshout: freezevee: in that case i believe there are some methods to change that
[11:29:49] rvanlieshout: but you know you can render any hash to json there? i don't know what you want to render
[11:30:02] rvanlieshout: read http://api.rubyonrails.org/classes/ActiveModel/Serializers/JSON.html#method-i-as_json
[11:30:09] freezevee: rvanlieshout: basically I get the datetime and then I show it with Angular.js
[11:30:23] freezevee: I want to change the datetime with the friendly dates RoR provides
[11:30:50] rvanlieshout: then render json: { foo: :bar }
[11:30:50] freezevee: so Angular.js receives "2 days ago." instead of the long string of datetime
[11:30:53] rvanlieshout: so create a hash yourself
[11:31:37] freezevee: that's what I am asking
[11:31:52] freezevee: how I get the data, alter one value and render them
[11:32:01] rvanlieshout: did you read that as_json thing?
[11:32:09] rvanlieshout: or create a hash yourself
[11:32:29] freezevee: the link you just sent
[11:32:35] freezevee: json = { name: 'bob', age: 22, awesome:true }.to_json
[11:32:46] freezevee: could be all I want
[11:33:09] freezevee: but he's creating it inside the model
[11:33:09] hardy12: what is quickest way to skip after filter in rails 3.2.3 ?
[11:33:37] rvanlieshout: hardy12: open the api documentation
[11:33:41] rvanlieshout: and look for skip_after_filter
[11:33:49] freezevee: rvanlieshout: either way, I hope my thought on converting to friendly date instead of letting any .js external lib as moment.js do it is not BS
[11:33:55] hardy12: its says that method has been deprecated
[11:34:09] hardy12: Ref: http://apidock.com/rails/ActionController/Filters/ClassMethods/skip_after_filter
[11:34:28] rvanlieshout: hardy12: that's because in rails 4 it's skip_after_action
[11:35:09] rvanlieshout: freezevee: i won't include yet another js thing to do that
[11:35:12] shortCircuit__: https://gist.github.com/argentum47/be510d35f53174823b26 i have added binding.pry and i have seen qualification in the partial and q in the helper are valid objects (i mean they are not nill) but the html is not rendered in the new.html.erb .. : ( why
[11:35:46] freezevee: rvanlieshout: that's what I am thinking, I find rails more concrete than angular
[11:36:09] rvanlieshout: shortCircuit__: that's a strange helper
[11:36:32] rvanlieshout: it could call that render 10 times, but will only display one
[11:36:33] shortCircuit__: i didnot want to put those .each and if in the view
[11:36:57] rvanlieshout: change the name of your partial to _qualification.html.erb
[11:37:07] rvanlieshout: then only use <%= render @application.qualifications %>
[11:37:49] shortCircuit__: ok but this Rendered academics/_show_detail.html.erb (0.9ms) appears 5 times in the log
[11:38:09] rvanlieshout: but only one is displayed?
[11:38:21] shortCircuit__: nothing is displayed, its blank
[11:38:48] rvanlieshout: <% show... vs <%= show...
[11:39:01] brazenbraden: what does "stack level too deep" mean?
[11:39:31] rvanlieshout: BrazenBraden: when you call a method it places that on a stack
[11:39:36] shortCircuit__: i did that, it printed out the output we get by doing Academic.all in the console
[11:39:39] rvanlieshout: when a second method is called within that method you're at stack level 2
[11:39:48] rvanlieshout: so when you call too much methods your stack level is too high
[11:39:59] rvanlieshout: which in most cases imply you're calling a method that calls itself
[11:40:16] rvanlieshout: shortCircuit__: use the <%= render @application.qualifications %> with a proper partial name
[11:40:52] hardy12: thanks @rvanlieshout but that method won't work in rails 3.2
[11:40:56] brazenbraden: hmm.. ok.. havent had it before and im doing a similar thing to what I have done many times before
[11:41:10] rvanlieshout: hardy12: so use the skip_before_filter
[11:41:29] rvanlieshout: BrazenBraden: talking about if you've had it before won't get it fixed
[11:41:47] freezevee: rvanlieshout: the greatest thing could be to be able to change ONLY the value of the hash you want
[11:42:06] freezevee: rvanlieshout: otherwise I could just violate DRY :)
[11:42:07] brazenbraden: I know. im compiling a gist with the code. its only a couple lines long
[11:42:15] rvanlieshout: freezevee: @user.as_json.merge{ something: :someting }
[11:42:37] freezevee: rvanlieshout: If this works...
[11:43:14] brazenbraden: rvanlieshout, this little chunk is causing the problem. Im using prawn and trying to pull out all my receipt information and turn it into an array so Prawn Table knows what to do with it https://gist.github.com/brazenbraden/5608a98c9a05ad4cd581
[11:43:30] brazenbraden: obviously i dont much expect that code to work
[11:43:33] doerteDev: anyone using rubymine here?
[11:43:38] brazenbraden: im busy learn prawn and prawen table
[11:43:44] brazenbraden: doerteDev, i use RubyMine
[11:44:11] shortCircuit__: hoouuly caaow undefined local variable or method `f' . <%= render 'shared/error_messages', object: f.object %>
[11:44:15] doerteDev: BrazenBraden: can you tell me the keymap name for that thing where you can multiselect carets with your mouse?
[11:44:18] doerteDev: as in pulling down?
[11:44:36] shortCircuit__: after i renamed to _qualification and render @...
[11:44:43] jnylen: How do delayed_paperclip save the image url?
[11:44:50] doerteDev: on my *nix machine it's defaulted to CTRL+button2click but I whant it to match my sublime definitions
[11:45:08] doerteDev: cant find the thing
[11:45:17] brazenbraden: doerteDev, not too sure what you mean? You want to place multiple mouse cursors in the editor?
[11:45:28] brazenbraden: * keyboard cursors
[11:45:30] rvanlieshout: sublime can do that
[11:45:35] doerteDev: not by clicking each, by clicking once + pulling the mouse down
[11:45:43] doerteDev: yeah jetbrains too but i cant find the setting
[11:45:44] brazenbraden: on Mac its Alt + click
[11:46:09] brazenbraden: doerteDev, never done it like that before
[11:47:36] rvanlieshout: shortCircuit__: does your partial require locals?
[11:47:57] rvanlieshout: then you should revert to the <% @application.qualifications.each do |qualification| %>
[11:48:14] rvanlieshout: <%= render partial: 'qualification', locals: { qualification: qualification, f: f } %>
[11:48:18] freezevee: rvanlieshout: https://gist.github.com/chrisvel/9dfca5b053668f7f90dc what did I do wrong ?
[11:48:41] rvanlieshout: freezevee: the , before ]?
[11:48:49] rvanlieshout: what is @tickets_all?
[11:49:14] freezevee: rvanlieshout: undefined method `merge'
[11:49:25] shortCircuit__: i have two two render's one is the helper method and the other is the <% render 'form' f: f%>
[11:49:30] rvanlieshout: what's the result of the @tickets_all.to_json()?
[11:49:35] rvanlieshout: shortCircuit__: <%=
[11:49:46] freezevee: rvanlieshout: it's a huge json file
[11:49:52] rvanlieshout: freezevee: hash? or string?
[11:49:52] freezevee: rvanlieshout: @tickets_all = Ticket.all
[11:50:00] freezevee: rvanlieshout: hash
[11:50:11] rvanlieshout: a hash should have merge
[11:50:17] freezevee: rvanlieshout: I've already been using it by viewing the data via Angular.js
[11:50:28] rvanlieshout: { foo: :bar }.merge(foo: :baz)
[11:50:52] freezevee: rvanlieshout: as .to_json is used, it has to become a hash
[11:51:13] rvanlieshout: so you should be able to call .merge on it
[11:51:49] universa1: to_json should return a string, not a hash.
[11:52:21] universa1: in the ruby part...
[11:52:36] freezevee: rvanlieshout: do you think I should put merge before to_json ?
[11:53:05] rvanlieshout: it's {hash}.merge(hash).to_json
[11:53:13] rvanlieshout: that hsould be as_json
[11:53:14] Rhainur: If I have an array of Post objects, each of which has many Comments, is there a convenient way for me to convert it into one array of comments each of which links back to its post? Or do I have to go back to the DB and do Comment.includes(:post)?
[11:53:17] rvanlieshout: to_json won't return a hash
[11:53:43] rvanlieshout: Rhainur: how did you get those post objects? cause you're most likely better of the find them properly
[11:53:48] freezevee: rvanlieshout: actually ror takes @tickets and creates a json with to_json out of it
[11:53:56] rvanlieshout: Rhainur: or... array.map(&:comments).flatten
[11:54:10] universa1: Rhainur: posts.map(&:comments).flatten.uniq
[11:54:10] rvanlieshout: freezevee: exactly, but that's a string, not a hash
[11:54:23] rvanlieshout: Rhainur: but, it's better to fetch them properly
[11:54:30] Rhainur: rvanlieshout: I just already have them as part of the processing that I'm doing
[11:54:31] freezevee: rvanlieshout: so what do I do ?
[11:54:34] Rhainur: and would prefer not to go back to the DB
[11:54:40] rvanlieshout: freezevee: use as_json and merge it
[11:55:42] freezevee: rvanlieshout: how I am going to use as_json side by side with to_json
[11:55:47] freezevee: rvanlieshout: it's a paradox :P
[11:55:58] Godd2: http://ruby-doc.org/core-2.1.3/Enumerable.html#method-i-flat_map
[11:56:00] rvanlieshout: forget about the to_json
[11:56:04] universa1: freezevee: gsub("to_json", "as_json")
[11:56:27] rvanlieshout: godd2: awesome
[11:56:45] freezevee: rvanlieshout: I have an array, how I am going to use it as_json ?
[11:56:58] freezevee: rvanlieshout: that's the reason I am using to_json
[11:57:02] rvanlieshout: freezevee: @tickets.map{ |ticket| ticket.as_json().merge() }.to_json
[11:57:39] freezevee: rvanlieshout: I don't get it but it's not your fault
[11:57:42] universa1: freezevee: [User.first].as_json -> [{emaiL: ...}]
[11:57:55] jottr: Could someone help me understand why 1) passes at all? http://git.io/ri3KNg
[11:59:16] universa1: jottr: controller code? error traces?
[11:59:28] jottr: universa1: hold on
[12:00:10] universa1: jottr: ha you're calling to_json on your params, but posting to the html version of the action... so it receives just a string as the params.
[12:02:02] jottr: universa1: OK
[12:05:54] universa1: jottr: but you can easily check that by inspecting the params hash ;)
[12:07:37] jottr: universa1: I've updated the gist with the controller, and also by calling class() on params
[12:08:33] jottr: So I still don't understand why 1) passes.
[12:08:44] universa1: jottr: not your params, the params the controller has parsed. so in your controller look at params
[12:08:49] universa1: jottr: why should it not?
[12:09:07] martinmvc: Hi guys. Wondering if any of you can help me with this. I've conntected to a mssql database and one of the column names has a # in the name. So trying <%= stock.DESC#1 %> wont work. Any ideas to get around this?
[12:09:16] jottr: universa1: I expected it to only accept JSON data.
[12:09:37] universa1: jottr: you're only responding with json. but you've made no restriction on what it accepts.
[12:09:49] jottr: universa1: ok
[12:10:29] jottr: universa1: Since this is an API only app, should I make sure it only accepts JSON?
[12:29:07] elaptics: jottr: yes, it's never a bad idea :)
[12:29:56] jottr: elaptics: How would I do that?
[12:30:35] jottr: elaptics: I mean, I know that I can enforce rendering of JSON via render :json. But how do I limit what the controller responds to?
[12:32:41] elaptics: jottr: partly depends on what you've got so far but you can specify in the controllers what it responds to with responds_to :json but rails defaults to html so you can also force the format on the routes - see here http://guides.rubyonrails.org/routing.html#defining-defaults
[12:33:00] jottr: elaptics: thx
[12:33:47] elaptics: jottr: also, if you're building only an api you might consider https://github.com/rails-api/rails-api
[12:34:00] jottr: elaptics: thats what I am actually using
[12:34:01] elaptics: that provides a stripped down rails
[12:37:54] elaptics: jottr: more info http://stackoverflow.com/questions/21978580/rails-4-respond-only-to-json-and-not-html
[12:38:23] jottr: elaptics: neat. thank you :)
[12:48:48] freesteph: does anyone have recommandations for a nicer PostgreSQL console than `psql` ?
[12:50:25] rvanlieshout: freesteph: define nicer
[12:51:24] freesteph: rvanlieshout: I find editing queries a bit tedious
[12:51:37] freesteph: it's always intended weirdly because of the prompt
[12:51:38] rvanlieshout: i edit them in my text editor
[12:51:46] rvanlieshout: and only have psql run it
[12:52:05] rvanlieshout: edit.. up + enter
[12:52:05] freesteph: I see, interesting
[12:52:32] freesteph: good call, this gets me syntax highlihgting and Emacs goodness as well
[13:00:02] srt: Hi there, I have trouble fetching all users who don't have orders where order's state != 'complete'.
[13:00:11] srt: I did: `User.joins(:orders).where('orders.state != ?', 'complete')` ??
[13:00:17] srt: But, it fetches those users too, who have more than one orders and one of the orders is not 'complete'. Is there any Rails-way of doing this?
[13:01:07] rvanlieshout: srt: User.joins(:orders).where.not(orders: { state: :complete })
[13:01:29] rvanlieshout: you don't want users that have ANY order that's incomplete?
[13:01:38] srt: rvanlieshout: correct
[13:02:06] rvanlieshout: User.where.not(id: Order.where(state: :complete).select(:user_id))
[13:02:38] User458764: Hi, Can someone clear my mind in this application, there is two models, Member and User but what is the difference between them? It use a relation has_many :through Account > Member > User but I don't understand the difference between these two models?
[13:02:44] User458764: https://github.com/radar/saas_book_examples/tree/master/subscribem/app/models/subscribem
[13:03:01] srt: For example: User 1: [Item: {state: 'address'}, item: {state: 'complete'} ], User 2: [Item: {state: 'init'}, item: {state: 'address'} ]
[13:03:13] Notte: Hi guys, i need to use a nosql db along with activeredord, do you have any doc, article on this please?
[13:03:17] rvanlieshout: srt: ? did you try that User.where.not-line?
[13:03:21] srt: then query should only fetch: [User2] and not user1
[13:03:47] rvanlieshout: Notte: read the documentation of the provider for activerecord. also know that activerecord is kinda designed for things with schema's
[13:03:53] rvanlieshout: srt: the User.where.not(id: Order.where(state: :complete).select(:user_id)) ?
[13:04:06] srt: User.joins(:orders).where('orders.state != ?', 'complete') is same as: `User.joins(:orders).where.not(:orders => {:state =>'complete'})`
[13:04:13] rvanlieshout: srt: User.where.not(id: Order.where(state: :complete).select(:user_id))
[13:04:18] srt: It's just in Rails 4.
[13:04:27] rvanlieshout: don't make me paste it again please :)
[13:04:45] Notte: rvanlieshout: ok. Maybe i wasn't clear i want to use both mysql (with activerecord) and mongodb (with mongoid i believe)
[13:04:50] srt: wait, let me try, sorry for inconvenience
[13:05:05] rvanlieshout: Notte: in a single application?
[13:05:19] rvanlieshout: Notte: and what part of it fails?
[13:05:43] Notte: rvanlieshout: what do you mean, sorry?
[13:05:51] rvanlieshout: Notte: what's the problem with that?
[13:06:26] srt: rvanlieshout: Thanks, it did the work, however, is it possible to run this is one query instead?
[13:06:40] rvanlieshout: srt: what queries does it produce?
[13:06:41] srt: this as* one
[13:06:52] Notte: rvanlieshout: i can't find any good doc about that. How to configure, how to write certain models for mongoid and others for activerecord. Best practices, pitfalls
[13:07:19] rvanlieshout: Notte: would you be able to do so if it where two separate apps?
[13:07:22] srt: SELECT "users".* FROM "users" WHERE ("users"."id" NOT IN (SELECT user_id FROM "orders" WHERE "orders"."state" = 'complete'))
[13:07:30] rvanlieshout: srt: how is that not 1 query?
[13:07:34] Notte: rvanlieshout: i think so, yes.
[13:07:36] srt: You see, there's one sub query.
[13:07:52] rvanlieshout: srt: as that is required for your problem. what's wrong with a subquery?
[13:08:01] rvanlieshout: Notte: then copy + paste the models in one app :)
[13:08:51] srt: rvanlieshout: problems with subqueries are that they gets slow and error prone overtime, however in this case it'd be slower when data grows.
[13:09:09] rvanlieshout: srt: it depends on the indexes and such.. this is a fine query
[13:09:26] Notte: rvanlieshout: have you ever done that? Because i'm sure that's not enough. For example, when you install mongoid, activerecord is broken
[13:09:31] srt: Alright, no problem. Thank you rvanlieshout.
[13:09:49] srt: It's better to have something working than nothing.
[13:10:13] Notte: rvanlieshout: anyhow, thanks for the answer
[13:11:06] rvanlieshout: Notte: it's only broken in the models you include it in?
[13:19:54] angelocordon: I'm trying to figure out the associations concept with a Q&A app I'm working on. I have a Question model and an Answer model. A Question can have many Answers and that an Answer belongs to a Question. However, whenever I post an Answer, it doesn't tie to the question. Here's a gist: https://gist.github.com/angelocordon/f2e3c120a30c9d9d6cb1
[13:20:43] angelocordon: I'm able to tie the user to both models, which I'm assuming is the same exact concept, but not sure how to do that from answer to question
[13:21:28] Godd2: in line 9 of your questions controller you dont want Answer.all
[13:21:41] Godd2: you only want the ones whose question_id is the current question id
[13:23:09] Godd2: so something like Answer.where(question_id: @question.id)
[13:23:20] Godd2: since you have set_question already setting @question for you
[13:23:24] elaptics: angelocordon: what do your routes look like? Can you add it to the gist?
[13:24:36] angelocordon: elaptics: updated the routes in there
[13:24:38] workmad3: godd2: or maybe even @question.answers ? :P
[13:24:51] elaptics: angelocordon: with the code you have now you probably want @answers = @question.answers
[13:25:12] elaptics: angelocordon: ^ yep that's what you want
[13:25:33] angelocordon: @elaptics: yes, that makes sense; however when I do a callback in the console, this comes up as nill
[13:26:06] angelocordon: undefined method as answer*
[13:26:30] elaptics: angelocordon: gist what you're doing
[13:26:42] angelocordon: in my schema, I've set it up so that an answer will have a question_id and a belongs_to, but that's not populating when posting
[13:27:42] angelocordon: I think I might be missing something in my answers_controller
[13:27:48] brazenbraden: anyone here use PDFKit?
[13:28:28] angelocordon: In my create method, should there be something there associated with the question?
[13:28:30] elaptics: angelocordon: yes, you should be doing it through questions. You should look at nested resources, because you probably only want to be dealing with answers in context to the question it belongs to
[13:28:33] helpa: BrazenBraden: 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.
[13:28:33] rvanlieshout: BrazenBraden: !used
[13:28:46] brazenbraden: right. forgot
[13:29:01] angelocordon: elaptics: ah, awesome
[13:30:30] angelocordon: elaptics: I think this is what I'm looking for, thanks!!
[13:30:34] brazenbraden: I hope to use PDFKit to generate a pdf of my show view. Now, in app, the show view is layout: false as the view is ajaxed in. Therefore PDFKit is generating the plain html. That should be fine as all the div id's and classes are there but I stylesheets wont work with it
[13:33:38] User458764: Hi, I have this error after running 'rake db:migrate' NameError: uninitialized constant Thor::Base what do I do wrong?
[13:34:38] angelocordon: User458746: spelling error in your migrations?
[13:36:55] User458764: angelocordon I haven;t modified the generated migration from 'rails g model member account_id:integer user_id:integer
[13:38:40] rvanlieshout: User458764: something is trying to use Thor::Base
[13:38:43] angelocordon: User458764: Have you seen this? https://github.com/bundler/bundler/issues/2901
[13:40:11] User458764: angelocordon It seems to be related I am reading the issue... thanks
[13:40:25] angelocordon: User458764: Good luck!
[13:46:45] User458764: Removing 'guard' gem from gemspec does the job but the issue is not resolved
[13:59:25] frank_o: Hi! Is it normal behavior in Paperclip (for `medium: "480x480>"`) that the taller the image is, the more Paperclip will shrink it?
[14:01:12] pedromoreira: frank_o: yes, since the '>' at the end tells imagemagick to shrink the largest dimension of the image
[14:02:33] frank_o: pedromoreira: Ah, thank you so much for that! I thought it just meant unlimited height
[14:02:47] shortCircuit__: ACTION wavs goobye and a happy friday NIGHT
[14:03:14] frank_o: pedromoreira: So what value would only enforce 480px width?
[14:04:07] pedromoreira: according to the imagemagick docs that shrinks the largest dimension of the image (if it is taller, it will shrink height and vice versa)
[14:04:40] frank_o: pedromoreira: Maybe just "480x"?
[14:05:13] frank_o: giving it a go one sec
[14:05:54] frank_o: pedromoreira: was trying to upload https://i.chzbgr.com/maxW500/8348948992/hEDABA8EF/ but noticed it was so small :P
[14:08:49] frank_o: No, "480x" seems to do the same as "480x480>" except it resizes the image back to 480px width after shrinking it (thus a major loss in quality)
[14:09:14] pedromoreira: yeah, you might not get much out of a small image, I guess
[14:15:19] mwlang: ok, I have yet another oldie, but goodie from the Rails 1.2 on 1.8.7 (stone age, I know!): If I use the DBI:ODBC driver to connect to SQL Server 2005 and attempt to insert a string with international characters, I get ???BI::DatabaseError: S1000 (2402) [FreeTDS][SQL Server]Error converting characters into server's character set. Some character(s) could not be converted??? Any ideas how to resolve this one? I think this was befo
[14:15:19] mwlang: encoding: utf8 in the database.yml was relevant.
[14:15:54] mwlang: (in any event, setting encoding: utf8 doesn???t solve it) and neither does setting the client encoding in the freetds.conf to ???UTF-8"
[14:16:17] centrx: mwlang, Could be collation related?
[14:16:39] mwlang: centrx: any way I can confirm that?
[14:16:58] mwlang: I???m actually thinking its driver related because it works with Sequel ORM using Tiny_TDS
[14:17:15] centrx: mwlang, You could look at what collation the column(s) have on SQL Server, change it as a test
[14:17:30] mwlang: on ruby 1.8.7, that is???
[14:18:13] centrx: I know Ruby 1.8.7 works with SQL Server 2005 with FreeTDS on Rails 2.3
[14:18:32] mwlang: this is my collation: SQL_Latin1_General_CP1_CI_AS
[14:18:43] mwlang: centrx: what collation do you use?
[14:19:35] centrx: that's the usual one, Latin1_General
[14:19:49] centrx: and CI is Case-Insensitive and so forth
[14:20:08] centrx: did this all work before? what changed?
[14:20:15] relix: hey guys - I've got many models in my app and I'm organizing them in subdirs, e.g. I have "/app/models/account/user.rb" and "/app/models/account/account.rb". I've also added the subdirs to the load path. However, when in Account model, if I do has_many :users, it complains about a circular dependency in User. If I add class: ::User to the association, it works fine. I don't want to add the class to all associations. Is there another
[14:20:15] relix: solution?
[14:21:19] centrx: relix, I thought those subdirs in app/models worked without changing the load path/using require?
[14:21:30] mwlang: centrx: basically, I???m deploying the app on linux. its currently deployed on Windows Server under Ruby 1.8.6
[14:21:48] mwlang: we???re trying to get the environment stabilized under linux because of frequent crashes
[14:22:03] centrx: mwlang, hmm yeah our app in the stone ages was on Linux, worked well
[14:22:22] relix: centrx where would I put the require statement though? Also, probably best the require_dependency instead, but even so where should I put it?
[14:22:25] mwlang: centrx: I???m also MSSQL 2005
[14:22:39] mwlang: so not too far off your own situation.
[14:23:00] Hates_: relix: I'd almost say if you're going to put models in sub dirs, you're probably better off namespacing them properly into modules
[14:23:25] Spami: Anyone having issues with the update to Yosemite and Postgresql ?
[14:23:29] workmad3: mwlang: you could be getting the encoding/transcoding errors because you have characters in a utf8 string that aren't in the latin1 character set
[14:23:35] relix: Hates_ I've thought of that, but is there a way to not do so?
[14:23:43] Spami: I'm getting this error: G::ConnectionBad: could not connect to server: No such file or directory"
[14:23:44] centrx: mwlang, do you have tds version set to a good value?
[14:24:22] mwlang: workmad3: possible, but I think these are fairly safe ones at the moment, but I???ll double-check to confirm
[14:24:26] mwlang: centrx: 7.2
[14:24:36] _lazarevsky: hello guys. I am experiencing a really weird problem with the rails compressor
[14:24:42] _lazarevsky: tried both yui and uglifier
[14:24:46] mwlang: hmmm???I might drop it down to 6.0
[14:25:04] _lazarevsky: when I compress and obfuscate my assets, one of the component's javascript stops working properly
[14:25:23] _lazarevsky: no js errors are thrown, it's just that the code becomes buggy.. When I remove it, it's all dandy
[14:25:26] _lazarevsky: what gives? :/
[14:25:34] workmad3: _lazarevsky: is it a plain JS file?
[14:25:44] _lazarevsky: workmad3: what exactly are you talking about?
[14:25:57] workmad3: _lazarevsky: is the source plain JS rather than, e.g. coffeescript
[14:25:59] sterns: I'm researching the idea of incorporating sidekiq into my Rails app. I understand that I will need my app code on the main server as well as my worker server(s). During development: After getting the basic classes setup in the main app is there anything preventing me from making code changes to my worker classes directly on the worker server. Trying to keep both server synd'd during development seems like a real PITA. Am
[14:25:59] sterns: I missing something?
[14:26:09] _lazarevsky: but the .coffee gets compiled to .js
[14:26:27] workmad3: _lazarevsky: right... but the semantics of separate JS files and a compiled, single JS file are different
[14:26:40] workmad3: _lazarevsky: hence the question, because coffeescript takes some steps to alleviate that
[14:26:55] _lazarevsky: workmad3: ok. So the file is .coffee
[14:27:02] centrx: gah Unicode sucks, everyone should have stuck with ASCII and changed their ancient natural language character sets
[14:27:43] _lazarevsky: workmad3: so.. is there a workaround?
[14:27:52] workmad3: centrx: or they should have come up with unicode/utf8 much earlier on and not had this proliferation of text encodings which are all very difficult to tell apart
[14:28:32] workmad3: _lazarevsky: god knows... it's most likely an artifact of some particular bit of the code hitting the top-level scope and therefore revealing bugs that aren't visible in isolation
[14:28:52] dideler: is it possible to get a callback (e.g. after_create) to call a class method of the model (e.g. def self.foo)? i get undefined method
[14:29:02] workmad3: _lazarevsky: but without actually seeing the code, playing with it and spending time trying to figure it out, I couldn't say for certain
[14:29:13] LazyCoder8: https://gist.github.com/TomasAchmedovas/9c593ba26841270ee38a How to pass f to _fields.html.erb ?
[14:29:33] workmad3: LazyCoder8: render "fields", f: f
[14:29:45] LazyCoder8: workmad3, thanks
[14:30:13] workmad3: _lazarevsky: and no, I don't have time to diagnose your JS issues right now ;)
[14:30:20] mekhami: workmad3, i came around to your initial suggestion of using ajax to load these really slow methods
[14:30:35] workmad3: mekhami: was that my initial suggestion? :)
[14:30:38] nrsk: hi all! I am new to rails, need help)) I have a form, that upload a file and call /some_custom_upload, in controller in method some_custom_upload i get uploaded file by file = params[:file] and it works fine. I need to write a test (rspec), how can I mock or specify some_custom_method call process with file?
[14:30:42] workmad3: mekhami: I can't remember what I suggested now :P
[14:30:45] workmad3: mekhami: or when
[14:31:03] mekhami: hah i was talking about running background tasks with sidekiq
[14:31:15] workmad3: _lazarevsky: I may take this opportunity to point out that unit-testing and integration-testing javascript is a thing nowadays and maybe you should investigate ;)
[14:31:24] workmad3: mekhami: I remember that much
[14:31:53] workmad3: mekhami: ah yeah, I remember suggesting you could do it without the background tasks and do it in the response with ajax requests
[14:31:57] _lazarevsky: workmad3: as a temporary workaround though, can't i compile the js file into .js manually
[14:31:59] centrx: mwlang, Maybe try Latin1_General_BIN
[14:32:02] _lazarevsky: remove the .coffee extension
[14:32:04] workmad3: mekhami: I don't think that was an initial suggestion though
[14:32:05] _lazarevsky: and see what happens?
[14:32:18] workmad3: _lazarevsky: sure you could do that
[14:32:28] workmad3: _lazarevsky: it's your problem, how you debug it is up to you ;)
[14:32:57] mwlang: centrx: I was thinking of trying SQL_Latin1_General_CP437_BIN
[14:33:16] mikecmpbll: sounds like a blast.
[14:33:41] workmad3: wtf is latin1 cp437? isn't latin1 cp2251?
[14:33:43] mwlang: Latin1_General_BIN by itself doesn???t exist (for my server)
[14:34:06] centrx: yeah I can't seem to find the complete list for 2005, only 2000
[14:34:19] mwlang: workmad3: Latin1-General, binary sort for Unicode Data, SQL Server Sort Order 30 on Code Page 437 for non-Unicode Data
[14:34:29] workmad3: mwlang: sounds disgusting
[14:34:52] mwlang: no CP2251 option. :-(
[14:35:20] workmad3: is there not a collation of 'SQL_UTF8_BIN' or similar? :P
[14:35:53] mwlang: workmad3: nope. I???d try that in a heartbeat
[14:36:04] mwlang: maybe a downloadable addon?
[14:36:22] workmad3: wouldn't know... never touched SQL server
[14:37:19] centrx: SQL Server is actually really good
[14:37:33] workmad3: centrx: apart from its collations? </troll> ;)
[14:37:38] centrx: but now Postgresql is the king
[14:37:58] centrx: SQL Server is the only good software product that company makes
[14:38:01] workmad3: centrx: what's the SQL server installation like on a mac? :)
[14:38:24] workmad3: centrx: does it have debian packages? a ubuntu ppa? ;)
[14:38:48] centrx: I don't know, I've only used it on Windows 98SE
[14:39:01] workmad3: ah, the classic server environment :D
[14:39:09] mwlang: hmmm???I???ll have to come back to this???.but starting to eye the ???varchar??? column type. Just saw in Knowledge base that NVARCHAR stores unicode
[14:39:13] Godd2: I thought it was Spanish Edition
[14:39:14] mwlang: varchar doesn't.
[14:39:21] centrx: mwlang, oh yeah that is key
[14:39:29] centrx: nchar and nvarchar
[14:39:37] mwlang: ah! glad to get that confirmed.
[14:39:40] workmad3: godd2: I can't tell if you're trolling or not :P
[14:39:46] mwlang: ok, I???ll recreate the DB
[14:39:50] lexi87: I am deleting users but I get an ArguementError Unknown key: username when I use the line `User.find(username: params[:id]).destroy`.
[14:40:14] mwlang: having to use a raw SQL file to create it since schema.rb is so far off the accuracy map.
[14:41:13] workmad3: mwlang: it is possible to configure AR to store the schema as db/structure.sql instead, you know
[14:42:15] centrx: mwlang, Are you using activerecord-sqlserver-adapter
[14:44:37] isthisreallife: http://pastie.org/9656595 how to write this using ar?
[14:45:59] workmad3: isthisreallife: User.joins(:comments).group('users.id').having("count(comments.id) > 1").pluck(:id)
[14:46:13] workmad3: oh, that may need to be .pluck('users.id')
[14:46:52] workmad3: isthisreallife: the pluck will give you back an array of ids
[14:47:06] MrPepper_: besides amazon aws server for mysql db's, who are other reliable providers?
[14:47:12] workmad3: isthisreallife: rather than loading activerecord instances (which is what I assumed you'd want as you were doing a select users.id)
[14:47:20] MrPepper_: aws cloud services*
[14:49:28] DrShoggoth: The newer sprockets has broken the assets pipeline for certain gems. I've been googling and asking here but nobody seems to know about this. I'm sure the issue is known, is it something that needs to be patched in the gems?
[14:50:00] DrShoggoth: If so I can just check out the gems, patch them for my app and then submit pull requests to the maintainers but I'm not sure what got changed.
[14:55:14] mekhami: how horrible is it to upgrade a large (16k lines) project to a newer version of rails and all its gems? I want my company to prioritize this but if it's not worth it i will just continue working with older versions
[14:56:31] Godd2: mekhami it will probably take some time to make sure the components work, depending on the design of the system.
[14:56:31] Hates_: mekhami: depends on a lot of things really
[14:56:47] Hates_: mekhami: and what version you're moving from
[14:56:54] Godd2: but there's no harm in trying. Just make a branch in git and try it out.
[14:57:09] mekhami: is it worth doing?
[14:57:10] Hates_: mekhami: if it's 1.x to 4 then expect a lot of pain. if it's 3.x to 4.x then it might be simple.
[14:57:20] mekhami: it's 3.2 to 4
[14:57:24] mekhami: but there's so many outdated gems...
[14:57:44] mekhami: and if i try to update them the entire thing stops working
[14:58:09] _lazarevsky: mikecmpbll: hey man.. I wanted to ask you a question real quick
[14:58:58] _lazarevsky: mikecmpbll: am using rails' default uglifier
[14:59:00] Hates_: mekhami: I'd only really push for an upgrade if there security holes
[14:59:15] _lazarevsky: however, when the files are obfuscated, my js is not working properly in one of the components :(
[14:59:19] mekhami: Hates_, i'm mostly just frustrated by getting deprecation warnings and super old gems causing development slow downs
[14:59:20] Hates_: mekhami: sounds like your first port of call is upgrading third party gems first
[14:59:26] _lazarevsky: mikecmpbll: when I remove the uglifier all is well
[14:59:35] _lazarevsky: all the files in my app are .coffee files
[14:59:51] _lazarevsky: workmad suggested that the problem may lie in the fact that we're working with .coffee files
[14:59:52] centrx: Your app has been replaced by beverages!?
[15:00:20] Godd2: mekhami is the app using git for version control?
[15:00:40] _lazarevsky: mikecmpbll: converted manually, what I thought was, the problematic file into .js and ran the app but no success
[15:00:47] mekhami: godd2, yeah
[15:01:22] mekhami: i'm getting a 'Less::ParseError' on this line '= stylesheet_link_tag "bootstrap_and_overrides", :media => "all"'
[15:01:24] Godd2: mekhami branches are cheap in git. just make a branch and try each gem one at a time.
[15:01:42] mekhami: and i can't tell which gem i upgraded that broke it
[15:01:46] mekhami: i wish there was a bundle uninstall
[15:01:57] Hates_: mekhami: then revert your Gemfile and start one by one :)
[15:02:07] Hates_: mekhami: don't just blindly bundle update
[15:02:13] mekhami: my gemfile is fine but i did a bundle update 'gem' and that updated everything??
[15:02:39] Godd2: your gemfile should specify the version of each gem you're using as well
[15:02:56] Godd2: if you aren't specifying each gem version, you're gonna have a bad time
[15:03:07] Hates_: mekhami: It will have have updated your lock file
[15:03:15] centrx: bundle update vs bundle install
[15:03:46] mekhami: how can i revert all these changes i just made to my gems
[15:03:54] mekhami: so i can at least have my environment be functional first
[15:04:18] Hates_: mekhami: reset your Gemfile and Gemfile.lock
[15:04:51] Godd2: mekhami if Gemfile is in the repo, you can look at old versions of the file
[15:08:06] mekhami: i just deleted th em both and we'll see if this works
[15:08:12] mekhami: there's probably 3 dozen outdated gems
[15:08:34] Godd2: well you don't want to delete the Gemfile, just Gemfile.lock
[15:08:45] mekhami: i have a copy of the gemfile anyway
[15:09:52] mekhami: I feel like...
[15:09:59] mekhami: I'm only one of like three devs on this project
[15:10:01] mekhami: and one of them is useless
[15:10:15] Godd2: you don't have to be pessimistic :)
[15:10:16] mekhami: but I want to update this app to current versions and write a ton of documentation that shows what each gem is used for in our project
[15:10:16] Hates_: mekhami: dont delete it. just revert it in git
[15:10:34] mekhami: i just want to make it better for developers
[15:10:42] mekhami: cause right now this job is not good for me lol
[15:13:46] mekhami: cause like if i do a bundle install
[15:13:55] mekhami: i should be able to run my rails server lol
[15:14:02] Hates_: then it sounds like your Gemfile is borked
[15:14:17] mekhami: /home/mekhami/.rvm/gems/ruby-2.0.0-p576/gems/railties-3.2.19/lib/rails/railtie/configuration.rb:85:in `method_missing': undefined method `assets' for #<Rails::Engine::Configuration:0x000000066d07d0> (NoMethodError)
[15:14:29] Hates_: and your first job is to assign proper versions to each gem inside
[15:14:48] Godd2: proper Gem version specification is part of the job
[15:15:09] mekhami: unfortunately nobod yhas done that part of the job
[15:15:22] Hates_: mekhami: well it's a quick job
[15:15:38] Hates_: mekhami: bind them all to whatever you're running in production, easy
[15:16:02] mekhami: i don't know what that is
[15:16:05] mekhami: i've been at this job for 2 weeks
[15:16:12] mekhami: i don't know what they're running in production
[15:16:43] Hates_: mekhami: If you're project doesn't have a working Gemfile.lock then nothing would ever work
[15:16:51] Hates_: mekhami: so can't you just work backwards from that
[15:17:01] mekhami: my project isn't working right now
[15:17:07] mekhami: so i can't work backwards from something that doesn't work
[15:17:11] Hates_: mekhami: yes, but the Gemfile in the repo
[15:17:13] mekhami: https://gist.github.com/mekhami/ba6968eb8c231889373a
[15:17:31] Hates_: mekhami: So you're telling me no one else has a working version of the project
[15:17:44] mekhami: i just pulled this gemfile from a working version in the repo
[15:17:48] mekhami: and then i did bundle install
[15:17:50] mekhami: and it executed
[15:17:53] mekhami: and now i still can't start my project
[15:18:07] Godd2: can you gist the allegedly working gemfile?
[15:18:49] mekhami: added to that gist
[15:19:18] Hates_: mekhami: thats the latest version of font-awesome-sass, are 100% sure that's the right one?
[15:19:19] Godd2: jeez, like half of them arent versioned
[15:19:26] mekhami: i inherited someone's pile of shit
[15:19:41] mekhami: i'm just trying to set up a dev environment on a second computer lol
[15:19:42] mikecmpbll: godd2: so what? :)
[15:19:43] Hates_: mekhami: every project is a pile of shit after enough time
[15:19:44] mekhami: and i can't even get that done
[15:19:51] mikecmpbll: you don't need to version every gem, that's the point
[15:19:56] mekhami: Hates_, I may be naive but I just don't think that has to be true
[15:19:58] mikecmpbll: that's what the lock file is for.
[15:20:09] Hates_: mekhami: I find it hard to believe the lock file doesn't have the right versions in it
[15:20:20] Hates_: what mikecmpbll said
[15:20:29] mekhami: Hates_, i deleted my lockfile and gemfile, grabbed the gemfile from the repo and ran bundle install
[15:20:32] Hates_: the project shouldn't just break unless someone commits a bad lockfile
[15:20:35] mekhami: and i'm still getting errors
[15:20:39] Hates_: mekhami: did you also grab the lockfile?
[15:21:15] Hates_: mekhami: the lockfile is whats important at the moment
[15:21:33] Hates_: mekhami: if it's wrong then nothing would work on any machine
[15:22:07] Godd2: he was trying to do bundle update at one point, and if I'm not mistaken, that overwrites the current lockfile
[15:22:13] vedu: Hello. I want to create a placeholder entry in my table: I have a Seller model that has many categories. I want "seller 1" (say) to have all possible categories so that when I want to list all categories I will just do Seller.find(1).categories
[15:22:57] mikecmpbll: it does, and he shouldn't be.
[15:22:58] Hates_: yeah. why I've been banging on for the last 30 mins about reverting the Gemfile and Gemfile.lock
[15:23:07] vedu: what is the correct way to enter this? in a migration? in seed data? or should I keep "all categories" separately?
[15:23:10] mekhami: Hates_, i grabbed both of them this time we'll see if it works
[15:23:25] mekhami: godd2 i wasn't -trying- to do bundle update, i tried to update a single gem
[15:23:26] Godd2: vedu are you sure you don't want to make a Category model with it's own table?
[15:24:02] edwardloveall: vedu: what do you mean by placeholder?
[15:24:03] Godd2: mekhami go ahead and put the lockfile in that gist when you get a chance
[15:24:08] terrellt: vedu: Why not Category.all?
[15:25:12] mekhami: godd2, added
[15:25:31] mekhami: and i'm back to old errors
[15:25:39] mikecmpbll: what's old errors?
[15:25:41] mekhami: 'fontawesome.less' wasn't found.
[15:25:43] Hates_: Gemfile.lock says font-awesome-sass (
[15:26:18] mekhami: what does that mean hates
[15:26:36] Hates_: mekhami: well your error from before references version 4.2.1
[15:26:48] Hates_: mekhami: paste the new error
[15:27:16] mekhami: updated the error in the gist
[15:27:26] mikecmpbll: this is the peril of not paying attention to error messages, debugging like a headless chicken
[15:27:28] vedu: godd2: yes I was thinking about that as well. I think I can have a CategoryName model
[15:27:46] Hates_: mekhami: ok so looks like the error is in your stylesheet
[15:27:54] mekhami: Hates_ I literally just cloned this repo
[15:27:59] vedu: terrellt: Category.all would be listing multiple times. Categories have many Brands. so that is why
[15:28:05] mekhami: oh you know what i might be stupid
[15:28:19] Hates_: mekhami: remove the font awesome reference from /bootstrap_and_overrides.css.less
[15:28:22] Godd2: not stupid, just learning :)
[15:28:40] Hates_: mekhami: because it looks like you're trying to use the sass version not the less version
[15:28:58] terrellt: vedu: Your database structure has some problems here pal. You should be using a HABTM for Category -> Seller, and it sounds like you just have has_many.
[15:29:53] mekhami: Hates_, i think I was on the wrong branch hah
[15:30:12] mekhami: it's always the little things.
[15:31:23] tockitj: mekhami, https://www.youtube.com/watch?v=zrQMjx3KAXQ
[15:32:09] vedu: terrellt: I have a join table for Category and Seller. using has_many through
[15:32:23] mekhami: okay so i also run into these problems
[15:32:31] mekhami: where i do bundle install and the install fails on a few different gems
[15:32:33] mekhami: for instance on debugger
[15:32:37] terrellt: vedu: Then why are there duplicate categories when you do Category.all?
[15:32:40] mekhami: and it doesn't really give a clear error
[15:32:59] mekhami: updated the gist with the most recent 'error'
[15:33:13] mekhami: it just doesn't give me much information to work with on why it failed..
[15:34:07] tuelz: anyone know if I can change solr to start indexing at one instead of zero?
[15:34:08] Hates_: mekhami: ahhh this is a weird osx one
[15:34:18] mekhami: Hates_, ironic considering I'm not on OSX
[15:34:34] Hates_: mekhami: ahhh guess it's not limited to osx
[15:34:39] Hates_: mekhami: there is a fix if I can find it
[15:34:45] tuelz: mekhami: apparently osx can screw you over even when you aren't on osx
[15:34:50] Godd2: tuelz: why... would you want to do that?
[15:35:01] tuelz: godd2: to match postgres
[15:35:25] tuelz: godd2: bunch of 1 off errors matching postgres ID's to solr ID's
[15:36:04] tuelz: It seems really brittle to patch in +1 code everywhere I want it to match
[15:36:31] tuelz: alternatively, any suggestions on how to handle this error elegantly?
[15:36:31] Godd2: but like, why are you referring to items by their index directly
[15:36:48] User458764: In this file https://github.com/radar/saas_book_examples/blob/master/subscribem/spec/features/users/sign_in_spec.rb line 23 there subscribem.root_url, 'subscribem' is the name of the engine I would like to know how does Rails knows this instance where does it instanciated?
[15:37:04] Hates_: mekhami: I think I just did gem install debugger-ruby_core_source
[15:37:10] Hates_: mekhami: then bundle install
[15:37:15] tuelz: godd2: no idea, not my app never used a key/value store extensively
[15:37:22] jaake: I am trying to better understand ActiveRecords update method with all this new private example_params stuff
[15:37:27] jaake: https://gist.github.com/jaake/fc7cefb58808327e9c30
[15:38:04] jaake: what's the best way to get the values from params[:food_panel] into the database?
[15:38:05] tuelz: essential solr has user_id: 0 while postgres has id on User table = 1
[15:38:19] mekhami: hates_ i still get the same error :/
[15:38:25] mekhami: i'm not even sure what this gem does rofl
[15:38:34] tuelz: is that solr behavior or is the code explicitly setting it to zero and then pushing it to solr?
[15:39:02] Hates_: mekhami: not sure how to really fix on linux. I know I've had the same problem on osx before.
[15:39:13] Godd2: mekhami try commenting out the gem and see what happens then
[15:39:39] Godd2: mekhami after all if you're on an update git branch you can try things without risk
[15:41:10] mekhami: i need to update a single gem
[15:41:13] mekhami: only the backports gem
[15:41:24] mekhami: how can i only update that one
[15:41:39] mikecmpbll: gems have dependencies, that doesn't make sense
[15:41:49] mekhami: you know what i mean
[15:41:52] mekhami: i need to update backports
[15:41:54] mikecmpbll: gem update <gem_name> will try yo update the one gem
[15:41:58] Godd2: he means how to update backports and its deps
[15:42:21] mekhami: whenever i do gem update backports its 'updating installed gems' and seems to update the entire damn thing
[15:42:32] mikecmpbll: nah, it'll update backports and it's dependencies
[15:42:48] mikecmpbll: if necessary
[15:43:00] Godd2: mekhami that just means "updating the installed gems that you told me about"
[15:43:15] mekhami: what the hell
[15:43:39] mekhami: /home/mekhami/.rvm/gems/ruby-2.0.0-p576@global/gems/rubygems-bundler-1.4.4/lib/rubygems-bundler/noexec.rb:5:in `pwd': No such file or directory - getcwd (Errno::ENOENT)
[15:44:31] mikecmpbll: gem --version ?
[15:44:39] mikecmpbll: probably have an ancient version of rubygems.
[15:45:01] mikecmpbll: ACTION shrugs
[15:45:05] mikecmpbll: try updating it anyway
[15:45:19] mekhami: 'Nothing to update'
[15:45:35] mekhami: why is this so fucking awful
[15:45:48] mikecmpbll: what directory are you in?
[15:46:05] tubbo: hi fellas
[15:46:11] tubbo: i have an interesting problem for you guys
[15:46:18] mikecmpbll: it's having problem getting the current working directory, are you sure it's not been removed in another shell?
[15:46:20] Hates_: mekhami: I don't get the impression that these problems are from the project
[15:46:46] tubbo: i backported active_support/concern to a rails 2.3/ruby 1.8.7 app, then `extend`ed my module with it and included said module into my class. NOTE: there are NO other concerns included into the class!
[15:47:11] tubbo: now i'm getting an error: "Cannot define multiple 'included' blocks for a Concern"
[15:47:24] tubbo: almost positive that this is a 1.8.7 bullshit thing but i can't really figure out where the problem is
[15:47:39] Hates_: tubbo: yeah at a guess I would have said the same thing
[15:47:48] Hates_: tubbo: but that's a total wild guess
[15:48:13] mekhami: oh god it's finally working
[15:48:26] mikecmpbll: mekhami: were you in a deleted directory? :p
[15:48:39] mikecmpbll: how'd you sort it?
[15:48:41] mekhami: but what the hell i have the wrong dashboard somehow?
[15:49:33] centrx: You've been using Django with MongoDB this whole time without realizing
[15:49:51] Hates_: all these years you thought it was rails and mysql
[15:49:53] mekhami: i wish i were using django
[15:50:04] mekhami: i miss django :(
[15:50:40] Godd2: Rails unchained
[15:50:50] Godd2: The DHH is not silent
[15:51:26] mekhami: okay maybe i'm being an idiot. i've just deleted my entire repo on my machine and am gonna start from step one
[15:51:40] Hates_: it was the wrong project all along
[15:52:06] mekhami: it was the wrong branch of the project
[15:52:11] mekhami: but i don't know how that's possible really
[15:53:00] Hates_: wow I've never seen an emoji in irc
[15:53:29] Varun_krishna: Hates_: What is that ?
[15:53:37] mekhami: okay. how do i make sure i'm cloning the correct branch from git? as far as i can tell i am just cloning the entire repo and then switching branches, right? (I thought i understood git until today.)
[15:53:52] Hates_: mekhami: you clone the repo and checkout the branch
[15:54:04] Hates_: Varun_krishna: It's happy poo
[15:54:12] mekhami: Hates_ I swear I thought I did that
[15:54:32] mikecmpbll: you probably bundled first, or something.
[15:54:37] mikecmpbll: ACTION shrugs
[15:54:51] mekhami: well the problem wasn't with the gems in this situation, i got it working and then ran the server and it was the wrong version of the project rofl
[15:55:40] Godd2: mekhami you need to pull branches separately
[15:56:04] Godd2: but hopefully master has a working copy of teh app
[15:56:07] mekhami: okay so i did git checkout -b dev-new-layoutr
[15:56:28] mekhami: after that what's the correct pull syntax?
[15:56:33] mekhami: git pull origin dev-new-layout
[15:56:48] mikecmpbll: did you delete the repo?
[15:56:55] mekhami: i just cloned it again
[15:56:59] mikecmpbll: so just checkout the branch
[15:57:04] mikecmpbll: git checkout <branch>
[15:57:06] Hates_: you don't need the -b
[15:57:20] Godd2: mekhami when you checkout a branch it creates a new branch off of HEAD
[15:57:33] mikecmpbll: with -b, sure.
[15:57:40] mikecmpbll: not if it exists though
[15:57:48] mikecmpbll: thought you wanted to switch to an existing branch?
[15:58:09] Hates_: yeah so -b will create a new branch surely
[15:58:15] mikecmpbll: git checkout <branch>
[15:58:15] mekhami: well that's not good.
[15:58:27] mekhami: but i used the same name as an existing branch
[15:58:27] Godd2: and then git pull origin <branch>
[15:58:33] mekhami: so it shouldn't overwrite should it?
[15:58:37] mikecmpbll: you don't need to pull it, you've just cloned the repo
[15:58:50] mikecmpbll: anyway, 5pm, friday, pub
[15:58:52] helpa: http://youtu.be/kfVsfOSbJY0
[15:59:08] helpa: davidcelis
[15:59:14] Hates_: wrong one :(
[15:59:57] mekhami: git checkout dev-new-layout
[15:59:57] mekhami: error: pathspec 'dev-new-layout' did not match any file(s) known to git.
[16:04:43] EminenceHC: Anyone know if ruby gems is down?
[16:04:57] mekhami: okay thankfully, luckily, my project is now workintg
[16:04:58] Godd2: not for me
[16:04:59] mekhami: just in time for lunch
[16:05:11] jnylen: Any ideas why this is in sidekiq/delayed_paperclip: sh: 1: file: not found ?
[16:06:19] EminenceHC: godd2: I can go to the website but I cant seem to bundle install if I add a gem
[16:06:33] mekhami: EminenceHC, i just did a bunch of bundle installs. =P
[16:06:41] EminenceHC: mekhami: thanks
[16:07:02] Godd2: EminenceHC: http://status.rubygems.org/
[16:08:29] Varun_krishna: Hi guys how to integrate telegram with Rails ?
[16:10:23] EminenceHC: godd2: That is helpful
[16:16:44] jaake: what's the best way to change an item in a migration from t.text to t.string?
[16:17:10] edwardloveall: is it already migrated?
[16:17:13] jaake: delete the database, rake db:migrate, rake db:setup?
[16:17:20] Varun_krishna: jaake: generate a new migration
[16:17:35] jaake: edwardloveall: yes, I am running into some weird behavior trying to update things with forms
[16:17:42] jaake: but ony on the text fields
[16:17:56] edwardloveall: keep in mine string tops out (by default) at 255 length
[16:18:13] Varun_krishna: jaake: roll back to the previous version of the migration which contains t.text
[16:18:19] edwardloveall: if it's a migration you wrote long ago, i'd go with Varun_krishna's suggestion and make a new migration
[16:18:27] mikecmpbll: that's what a migration is for
[16:18:31] edwardloveall: if it's something you just wrote, rollback and remake the migration
[16:18:47] edwardloveall: and by just wrote, i mean, not deployed or pushed anywhere yet
[16:18:57] jaake: rollback == git reset HEAD --hard?
[16:19:02] edwardloveall: rake db:rollback
[16:19:13] Varun_krishna: then before doing the rake db:migrate then manually change t.text to t.string.
[16:19:28] jaake: in the migration file yes?
[16:19:59] bricker`work: edwardloveall: hi edward loveall :D
[16:20:12] edwardloveall: haha hey brian
[16:20:26] mikecmpbll: take it mekhami found his branch in the end?
[16:20:54] Earthnail: I have a polymorphic association, and would like the code on the "polymorphic" side to reside in a single file. I thought the best way to do it is to create a module and put the code in there. However, I get errors when using has_many in there (first it's not defined, then I include ActiveRecord::Associations, then it breaks at "undefined method `dangerous_attribute_method?` ...). How do people work around that?
[16:20:55] jaake: well that is very handy
[16:23:25] mikecmpbll: Earthnail: not sure what you mean, some description of your data model would be useful.
[16:23:35] mekhami: mikecmpbll, yeah i got it all working
[16:23:38] Earthnail: mikecmpbll: let me do a gist
[16:23:41] mikecmpbll: mekhami: nice one.
[16:23:45] mekhami: mikecmpbll, i'm still pretty new to all this and make some bone headed mistakes
[16:24:14] mikecmpbll: mekhami: yep, we all did at some point. analyse the errors though, don't try stuff at random
[16:28:30] Earthnail: mikecmpbll: https://gist.github.com/tcwalther/d545d45466cc4660fe27
[16:29:29] mikecmpbll: Earthnail: ah, i see
[16:29:42] mikecmpbll: Earthnail: use concerns
[16:29:43] helpa: Concerns are smelly: http://programmingtour.blogspot.co.uk/2012/12/why-i-dont-use-activesupportconcern.html
[16:30:09] mikecmpbll: http://api.rubyonrails.org/classes/ActiveSupport/Concern.html
[16:30:39] Earthnail: perfect, thanks
[16:30:57] smathy: ???helpa agenda.
[16:31:21] mikecmpbll: helpa is smelly
[16:32:08] helpa: Stack overflow at line: 0
[16:32:14] smathy: Apparently not.
[16:37:20] mekhami: i can't seem to figure out where i messed up my methods here
[16:37:22] mekhami: https://gist.github.com/mekhami/985a3d10ca6f39332235
[16:37:35] mekhami: They were working at some point but now format_phone_listeners is returning zero listeners.
[16:38:11] mekhami: the widget users are working just fine which is interesting...
[16:38:32] mekhami: so somewhere in the phone_users methods something is returning nil
[16:39:11] smathy: mekhami, so add some logger.debug or puts or debugger breakpoints and work out what???s not as you expect it to be.
[16:39:13] MrPepper_: Has anyone used CleanCoders Tutorials?
[16:39:18] MrPepper_: http://cleancoders.com/category/build-an-app#videos
[16:39:45] Godd2: MrPepper_ I have not, but I have read Clean Coding by Robert Martin
[16:40:58] jaake: Now I know there is a much better way to do this, but everything works EXCEPT that any changes in item0* or notes0* don't take effect but changes on title do..https://gist.github.com/jaake/186d55b13d1ed4bb549b
[16:41:00] MrPepper_: Was what you read good?
[16:41:19] jaake: why would one work but not the other?
[16:41:47] Godd2: MrPepper_ oh definitely. recommended A+. Also, check out this vid: https://www.youtube.com/watch?v=DC-pQPq0acs
[16:41:58] MrPepper_: godd2: thank you
[16:42:00] jaake: if I change the title through the form it works fine, but anything else doesn't but there is no error it just doesn't update
[16:44:40] Varun_krishna: jaake: https://gist.github.com/jaake/186d55b13d1ed4bb549b#file-gistfile1-rb-L51 did you try if @food.update(:food_panel)
[16:45:55] Varun_krishna: jaake: Take a look at the update method here http://guides.rubyonrails.org/getting_started.html
[16:46:58] jaake: Varun_krishna: I did that but then it complained that it needed a hash
[16:47:09] jaake: which is what I thought :food_panel was
[16:47:24] jaake: params[:food_panel] is indeed a hash
[16:49:05] Varun_krishna: I think you need to access panel instead or :food_panel
[16:49:29] mekhami: area_code_list = AreaCodes.where(area_code: listeners)
[16:49:29] mekhami: area_code_list.each
[16:49:33] mekhami: that seems to be invalid
[16:49:40] mekhami: you can't do .each over the activerecord object
[16:49:51] jaake: Varun_krishna: @foods isn't passed back through the patch params though right? I have to set that in the update controller with @foods = FoodPanel.find(params[:id])
[16:49:54] mekhami: can i do .to_a on the end of an activerecord object to make it an array?
[16:50:29] helpa: mekhami: Why don't you try it and find out for yourself?
[16:50:29] smathy: mekhami, !try
[16:51:30] rhizome: mekhami: .all
[16:51:44] mekhami: does not seem to work
[16:52:21] Varun_krishna: jaake: check this https://gist.github.com/jaake/186d55b13d1ed4bb549b#file-gistfile1-rb-L51
[16:53:27] mekhami: what i'm trying to do is query a list of area codes against the AreaCode table and get back all of the details
[16:54:27] mekhami: i swear this code was working yesterday @.@
[16:55:21] rhizome: ^z^z^z^z^z^z^z^z^z^z^z
[16:55:27] mikecmpbll: mekhami: you can do .each
[16:55:44] mikecmpbll: once again, what is the error? the error will tell you what the problem is
[16:55:55] mikecmpbll: you seem to have a disdain for error messages and stack traces :)
[16:56:14] mikecmpbll: trying stuff at random again, no wonder you get so frustrated
[16:56:44] mekhami: there is no error
[16:56:47] mekhami: there is no stack trace
[16:56:50] mikecmpbll: uh, so what doesn't work?
[16:56:57] mekhami: it's returning zero
[16:57:10] mekhami: i have 2486 listeners and my final results length is zero
[16:57:22] mikecmpbll: what is a "listener"?
[16:57:26] mikecmpbll: i don't know what you're on about now.
[16:57:35] rhizome: frankly that whole method should just be AreaCode.select(:latitude, :longitude).where(...)
[16:57:58] mikecmpbll: rhizome: yep ..
[16:58:04] frank_o: Hi! I'm trying to add Paperclip to Forem: https://gist.github.com/frankie-loves-jesus/f25e546844d9771e7d7c (live app: http://runnable.com/VEEnRTEK-igg4XGD/forem-with-paperclip-for-ruby-on-rails) -- but how come the file seems to be uploading, however when I load the post, it will not display?
[16:58:15] mekhami: rhizome, when i do select on this i get a wrong number of arguments 2 for 0
[16:58:17] mikecmpbll: whatever `listeners` is, it probably isn't a bunch of area codes.
[16:58:25] mekhami: listeners in that method is a bunch of area codes
[16:58:26] s2013: with hstore you need to use store_accessor on your model right
[16:58:29] mekhami: i already verified that
[16:58:51] mikecmpbll: well then, there's no AreaCodes (sp?) with any of those area_codes
[16:58:57] mikecmpbll: how about putting some debugging in to your gist
[16:59:24] mekhami: i don't know exactly what you mean by that, specifically what i'm supposed to do to debug it
[16:59:34] mekhami: i'm literally week 3 rails and less than 6 months of dev experience period
[16:59:48] frank_o: Ofcourse, sorry about that
[17:00:00] Varun_krishna: mekhami: Try with rails console.
[17:00:20] rhizome: @user.phone_listeners etc. seems a good direction to go in
[17:01:19] Shuttle_: I would need some beginners help. I have a vague idea how to do this, but I haven't got a lot of time (I would actually need this tomorrow morning) to figure it out all by myself. I have a model Item, and I would like to have a separate page where I'd first fill in weight, and then read a barcode (:tagid) that would update sais item with weight and date today as :last_seen. Return to same page with some feedback
[17:01:45] mikecmpbll: mekhami: yep, what varun says. basically, AreaCodes.where(area_code: listeners) isn't returning any results
[17:01:47] mikecmpbll: so find out why
[17:02:01] mekhami: well it is returning just a list of area codes
[17:02:09] mekhami: it's not returning the lat long values that are in those db tables
[17:02:25] mikecmpbll: what is returning a list of area codes?
[17:02:29] mekhami: like i did puts area_code_list and it printed like a query
[17:02:35] mekhami: let me show ya
[17:03:57] mekhami: this is what i get in the server log when i do 'puts area_code_list'
[17:03:58] mekhami: https://gist.github.com/mekhami/82919b9630f879c774d9
[17:04:18] mikecmpbll: that's not the result of `puts area_code_list`
[17:04:27] mekhami: it is because this is what i did in my code
[17:04:33] mekhami: puts "!!!!!!!!!!!!!!!!!!!!!!"
[17:04:33] mekhami: puts area_code_list
[17:04:33] mekhami: puts "!!!!!!!!!!!!!!!!!!!!!!"
[17:04:33] mikecmpbll: it might be a consequence of that statement, but it's definitely not the output
[17:04:38] mekhami: and it's in between those !!
[17:05:03] mikecmpbll: is there a blank line?
[17:05:17] mikecmpbll: gist the whole bit from the log
[17:05:31] mikecmpbll: an empty relation will puts nil
[17:05:35] mekhami: it's in the gist
[17:05:48] mekhami: just straight copy pasted from terminal
[17:05:54] mekhami: brb going to pick up food
[17:06:15] mikecmpbll: that's how it'll show.
[17:06:28] mikecmpbll: do puts area_code_list.inspect
[17:06:33] mikecmpbll: and you'll see the empty relation.
[17:06:40] Varun_krishna: Hi all how do I integrate https://telegram.org/ this in rails application ?
[17:07:26] mikecmpbll: logic dictates it's empty anyway, you don't need to debug that.
[17:07:33] mikecmpbll: but you can do that just to prove it ;)
[17:08:22] Varun_krishna: mikecmpbll: even .inspect works with puts ?
[17:08:44] mikecmpbll: sure, inspect is completely independent of any other method :)
[17:09:00] Varun_krishna: Oh I didn't know that .
[17:13:05] frank_o: Hi, I just did `gem install gist`, but when doing `gist log/development.log` I get `Error: "export LC_ALL=en_US.UTF-8`
[17:13:08] frank_o: export LANG=en_US.UTF-8
[17:14:48] frank_o: Hi, I just did `gem install gist`, but when doing `gist log/development.log` I get `Error: "\xE2" on US-ASCII`. Anybody know what to do?
[17:16:36] frank_o: `iconv -f UTF8 -t US-ASCII//TRANSLIT > new.log` did the trick
[17:16:50] frank_o: * development.log > new.log
[17:17:22] epochwolf: TIL: 3 phase power
[17:26:30] mekhami: mikecmpbll, okay so why is it empty, that's the next question i guess
[17:27:15] mikecmpbll: because there's no AreaCodes objects with a value of `area_code` that is equal to any of the items in the `listeners` array :)
[17:29:02] mekhami: there damn well should be
[17:29:29] mikecmpbll: well, there's not.
[17:31:39] mekhami: okay well... that's a problem.
[17:33:28] mekhami: yeah somehow my area codes db is empty. who knew.
[17:33:47] mekhami: see, my code does work! Validation, haha.
[17:33:56] lapidary: I???m looking to learn the Rails framwork, is the Rails Tutorial book my best bet?
[17:34:21] weaksauce: how much programming have you done before lapidary
[17:34:27] mekhami: weaksauce, my buddyyy
[17:34:38] weaksauce: ha. how's it going mekhami
[17:35:08] lapidary: PHP, Javascript, C (not object orented here), and some random stuff
[17:35:46] weaksauce: lapidary the rails tutorial is good. it's a little slow if you have a lot of experience, at least that's how it felt to me
[17:37:21] lapidary: yeah, that???s what I thought looking trough the pages online. Do you have a better idea? rails for zombies is a fun site, but I have to play each video several times before all the key words sink in.
[17:38:14] lapidary: if I had the time and money I would look at my community college.
[17:40:46] weaksauce: lapidary agile web development with rails is pretty good.
[17:41:12] weaksauce: lapidary I have heard good things about rails 4 in action but haven't read it. that one is written by Radar
[17:42:10] weaksauce: I think the move away from setting up your own stack in the latest version of the rails tutorial is not great.
[17:42:43] lapidary: thanks weaksauce!
[17:42:59] frank_o: Hi! I'm trying to add Paperclip to Forem: https://gist.github.com/frankie-loves-jesus/f25e546844d9771e7d7c (live app: http://runnable.com/VEEnRTEK-igg4XGD/forem-with-paperclip-for-ruby-on-rails)
[17:43:03] frank_o: But why am I getting `Unpermitted parameters: photos_attributes` when I have `params.require(:post).permit(:text, :password, :photos_attributes)` in `application_controller.rb`?
[17:43:08] weaksauce: np lapidary
[17:44:27] frank_o: Nevermind I think that code is supposed to be in `posts_controller_decorator.rb` instead
[17:46:51] Shuttle_: I would need some beginners help. I have a vague idea how to do this, but I haven't got a lot of time (I would actually need this tomorrow morning) to figure it out all by myself. I have a model Item, and I would like to have a separate page where I'd first fill in weight, and then read a barcode (:tagid) that would update sais item with weight and date today as :last_seen. Return to same page with some feedback
[17:50:05] weaksauce: Shuttle_ what have you tried so far?
[17:50:58] Moridin666: Friends, I have a class, Item, with a many to many relationship to Tag, with blank set to True. My ModelForm is failing validation, with an error stating that ?????? is not a valid value for a primary key. - ideas?
[17:51:35] mekhami: what does this error message mean? NameError - uninitialized constant HomeController::MapsWorker: i'm unfamiliar..
[17:52:14] Moridin666: woops, wrong room. Rails isn???t Django. :-D sorry
[17:52:56] Godd2: mekhami it means some ruby code tried to create a MapsWorker object, but no such class exists.
[17:53:11] mekhami: godd2, interesting. but I created that class in workers/maps_worker.rb
[17:55:19] Godd2: can I see the maps_worker.rb code in a gist?
[17:56:02] mekhami: https://gist.github.com/mekhami/f0f9d077a8a64daef95b
[17:56:04] Godd2: Rails seems to think it is supposed to be namespaced inside the HomeController
[17:56:24] mekhami: i'm calling it from the HomeController
[17:58:31] Godd2: my hunch is that maps_worker.rb isn't being loaded
[17:58:38] TeckniX: I???m trying to bring a 3.2 rails app to the 4.1.6 - Currently running into test issues with ???include AuthenticatedTestHelper??? NameError: uninitialized constant. What is the proper way to include/call it?
[17:58:59] Godd2: otherwise, rails would be aware of what a MapsWorker is and not try to look inside the HomeController namespace
[18:01:12] Godd2: TeckniX you have to require the library that defines AuthenticatedTestHelper when your tests run. This is usually done in rails_helper.rb
[18:02:52] mekhami: okay so why would it not be loaded
[18:03:02] Godd2: mekhami Okay I think I know the problemo
[18:03:18] Godd2: line 6 of your maps_worker.rb says MapWorker
[18:03:37] Godd2: but the error you posted says MapsWorker
[18:03:40] mekhami: Yeah I fixed that already
[18:03:41] TeckniX: godd2: hmm don???t have a rails_helper.rb, just the test_helper.rb
[18:03:45] mekhami: I fixed that right before I posted here actually
[18:03:47] mekhami: still same problem
[18:04:11] Godd2: TeckniX k put it in the test_helper.rb
[18:04:25] Shuttle_: weaksauce: I'm actually getting there, albeit slowly. What's the correct way to show multiple attributes in a view, ie. write the following in a smarter style: <%= item.tagid %><%= item.make %>?
[18:04:46] Godd2: mekhami can you update the gist with the new maps_worker.rb and with the home_controller.rb?
[18:05:32] mekhami: godd2, updated. have fun digging through home_controller th ough
[18:06:28] Godd2: mekhami you need to name the worker file to match what class it being loaded
[18:06:35] Godd2: otherwise Sidekiq doesn't know what to do
[18:06:40] Godd2: so name it map_worker.rb
[18:07:37] mekhami: still same error i think :/
[18:07:58] weaksauce: restart the server?
[18:08:12] mekhami: restarted both of them
[18:08:51] weaksauce: Shuttle_ there are some helpers to create tags. you can also use partials with a collection to render the partial with the collection
[18:09:31] Godd2: and you are running sidekiq in the background before you try anything right?
[18:10:20] mekhami: but this error seems more general than that, doesn't it?
[18:10:33] mekhami: like it could be a syntax error
[18:10:39] Godd2: you didnt put the most recent error in the gist
[18:10:41] mekhami: but no obvious ones
[18:12:27] Shuttle_: weaksauce: I'm actually now able to retrieve the item with searched tagid. I would now like to update an attribute (:last_seen) with Date.today. Should this be done in the controller or model?
[18:13:11] Shuttle_: I'm having @item = Item.where("tagid = ?", params[:search]), using @item.size will fail with undefined method 'size='...
[18:14:12] Godd2: mekhami k I think I have a solution
[18:14:18] Godd2: https://github.com/mperham/sidekiq/issues/1043
[18:14:32] mekhami: i saw that
[18:14:35] Godd2: you need to add some code in your application.rb to make sure to load the workers
[18:14:41] mekhami: in my application.rb i have
[18:14:53] mekhami: config.autoload_paths += %W(#{config.root}/lib)
[18:14:53] mekhami: config.eager_load_paths += %W(#{config.root}/lib)
[18:15:13] Godd2: yea but your workers arent in lib
[18:15:17] Godd2: they're in app/workers
[18:15:35] mekhami: i'll add that line but it didn't seem to work last time
[18:15:42] Godd2: so you also need to add config.autoload_paths += %W(#{config.root}/app/workers)
[18:16:00] mekhami: i added that, restarted both servers, and same error still
[18:16:12] Godd2: and also the eager_load_paths
[18:16:44] Godd2: mekhami are you in development?
[18:16:47] weaksauce: Shuttle_ can you gist the exact line and error?
[18:16:54] mekhami: godd2 in what way, lol
[18:16:56] mekhami: i think so?
[18:17:15] Godd2: "Sidekiq does not support development mode and ignores cache_classes."
[18:17:49] mekhami: this was working yesterday though
[18:18:03] Godd2: then I have no idea
[18:18:38] Shuttle_: weaksauce: erm, not sure. I'm trying to use "if @item.size = 1" to check if there is one result to update :last_seen, but it results in an error (used in the controller)
[18:18:52] Shuttle_: weaksauce: using @item.size in the view however, results in 1
[18:18:58] weaksauce: you need to use ==
[18:19:34] Scriptonaut: always do if 1 == @item.sizer
[18:19:38] Scriptonaut: to avoid that kind of stuff
[18:21:21] mekhami: weaksauce, any idea what's going on here
[18:21:24] mekhami: https://gist.github.com/mekhami/f0f9d077a8a64daef95b
[18:22:27] mekhami: oh wait it's working
[18:23:10] Scriptonaut: haha, is that what it's called
[18:23:28] mekhami: godd2, renaming my file was the answer. I thought I did but I must have hit escape or something and it didn't actually rename. who knows what happened there
[18:23:43] rubyonrailed: I have this is my `rails_helper` to mock oauth. https://gist.github.com/anonymous/a51f3b838abb1097efde That works fine, but when I go to test a stripe charge, it thinks my api key is "1234". Why does it think that mock includes my api key?
[18:23:50] weaksauce: Scriptonaut yoda conditions is the true term
[18:24:55] mekhami: okay sidekiqy types
[18:25:04] Nic_home: beginner here, following 250-authentication-from-scratch-revised. how can i view the model for a user from console?
[18:25:42] mekhami: https://gist.github.com/mekhami/f0f9d077a8a64daef95b my home_controller has get_map_of_listeners which is an action controller for an AJAX request
[18:26:08] mekhami: i need that get_map_of_listeners to render :json the return of the asynch method that sidekiq performs
[18:26:51] weaksauce: Nic_home `rails c` then User.where(id: x)
[18:27:07] weaksauce: or whatever your model is named
[18:28:18] Shuttle_: weaksauce: holy crap. It's working. I'm worth a can of something sizzly, too bad the're not for sale anymore (it's after 21:00 here). The update works. How should I manage to clear the search-fields after a search?
[18:29:40] Scriptonaut: I'm gonna ask this here because ##bootstrap seems to be pretty dead. Anyone use the jasny bootstrap image upload widget?
[18:29:50] Scriptonaut: if you open the modal on that photo upload page, and drag a photo to it, it uploads to both (uploads the image twice)
[18:29:57] Scriptonaut: I have an image upload page, but on any page there is a modal available to you that also has an image upload widget
[18:30:13] weaksauce: you should be able to set value=""
[18:30:15] Scriptonaut: switch those last two comments, wrong order
[18:30:52] weaksauce: or if that doesn't work you can use javascript to clear it out
[18:30:54] mekhami: weaksauce, you may be able to help me with this one: https://gist.github.com/mekhami/f0f9d077a8a64daef95b js file has my ajax calls (which are converted from coffee so pardon any syntax errors)
[18:31:07] mekhami: i need to know if that ajax call will handle an asynchronous request
[18:31:28] mekhami: i am very very poor with javascript
[18:31:56] mekhami: but basically i want the page to load and kick off a background process which returns the calculated information, then loads the calculated information a few seconds later when it's ready
[18:33:01] weaksauce: mekhami you are not calling that function anywhere
[18:33:25] Shuttle_: weaksauce: hmm. I'm using text_field_tags
[18:33:37] mekhami: weaksauce, i added the entire home.js.coffee file to the gist
[18:34:30] Shuttle_: weaksauce: nevermind. was just a matter of finding the right syntax (, :value => "")
[18:34:47] weaksauce: Shuttle_ I prefer value: ""
[18:35:09] weaksauce: both are the same though.
[18:35:21] weaksauce: mekhami can you post the rendered javascript?
[18:35:33] wmoxam: I dislike value: :value
[18:35:37] mekhami: the rendered javascript or converted lol
[18:35:41] tbuehlmann: I like value: :value
[18:35:59] wmoxam: my internal parser doesn't like it
[18:36:02] weaksauce: easier to type and cleaner looking
[18:36:11] wmoxam: and burns a few extra cycles when I see it
[18:36:17] mekhami: weaksauce, updated the gist
[18:37:08] weaksauce: mekhami what does your console say?
[18:37:18] weaksauce: webbrowser console
[18:37:28] mekhami: Failed to load resource: the server responded with a status of 500 (Internal Server Error) http://localhost:3000/home/get_status
[18:37:38] mekhami: not a related method though
[18:37:55] mekhami: i know what that error's from
[18:40:12] mekhami: it's not an error necessarily
[18:40:22] mekhami: but if i tick the refresh box it just stays on 'loading'
[18:42:04] weaksauce: try adding a button to manually refresh it
[18:42:17] mekhami: that's what i have i think
[18:43:33] mekhami: <a id="reloadMap">thingy</a>
[18:45:07] weaksauce: add some logging to make sure that stuff is happening like you expect it to
[18:45:13] weaksauce: console.log("text");
[18:45:56] mekhami: i would if i even knew what i wa slooking for =P i have only a very basic syntactical knowledge of js (that's my project for the next couple weeks)
[18:46:51] weaksauce: I don't use coffeescript so I am not much help there
[18:47:39] frank_o: Hi! Does anyone know why PostgreSQL is giving me `FATAL: Peer authentication failed for user "admin"`? https://gist.github.com/frankie-loves-jesus/fd5e46bbb0f6a983eda4 (live app: http://runnable.com/VEFe5hZXSE9z0q5x/forem-with-pgsearch-for-ruby-on-rails)
[18:47:44] mekhami: should just be console.log text
[18:48:08] mekhami: but i don't know what i'm trying to log
[18:48:32] weaksauce: you can set breakpoints in the javascript console.
[18:48:54] mekhami: i mean like i said i don't see an actual error i
[18:49:03] mekhami: just don't know if it's even a functioning ajax request the way i think it is
[18:49:11] mekhami: ajnd nobody on my team is worth talking to about this shit
[18:49:38] weaksauce: that's why you need to look at the output from each function to see if it's what you expect/actually getting called at all etc...
[19:03:02] cheesedanish: I'm getting an 'Unpermitted parameters: data' when trying to create an order for a profile. But the params.require statements are there and seem to be correct. What am I missing? What should I check? http://pastie.org/private/kft162lqjjvcuvv5k23pfq
[19:03:23] mekhami: how do i select multiple 'count' items (in sql terms)
[19:03:39] mekhami: this is the sql string: sql = "select count(*),count(distinct(call_gateway_id)),count(distinct(listen_content_id)),count(distinct(call_server_id)) from now_session where call_ani_e164 <>''"
[19:06:52] weaksauce: mekhami you mean in active record terms?
[19:07:03] mekhami: i know you can do .count
[19:07:19] mekhami: is there a way to do multiple .counts in one query
[19:07:34] weaksauce: mekhami I think you have to use raw sql for that
[19:09:45] weaksauce: cheesedanish try orders_attributes
[19:13:47] cheesedanish: weaksauce: no change, same error
[19:14:06] weaksauce: you have accepts_nested_parameters_for in you model?
[19:16:35] cheesedanish: 'accepts_nested_attributes_for :orders, allow_destroy: true' is in profile.rb
[19:19:00] weaksauce: can you post the two models too
[19:21:58] cheesedanish: sure, i've updated with the models http://pastie.org/private/rvwehfdarjsoturu5cdlxg
[19:24:04] frank_o: cheesedanish: http://runnable.com/ is really nice for that sort of stuff (voted "Best article of the year": http://css-tricks.com/reduced-test-cases/)
[19:28:55] mekhami: ugh i need something like this https://github.com/cryo28/sidekiq_status but it's apparently broken
[19:32:15] intuxicated: is there something like http://elfinder.org/ for rails ? I can't find.
[19:32:38] centrx: intuxicated, you mean written in Rails?
[19:34:57] intuxicated: centrx, I just need it in my rails app. its better if it's ruby or rails.
[19:35:55] centrx: intuxicated, Try https://www.google.com/search?q=ruby+toolbox+file+manager
[19:35:57] bradfordli123: what is a good gem for uploading images on a database to associate with user profiles?
[19:36:25] centrx: intuxicated, Some of those are old
[19:36:32] centrx: intuxicated, There is also related "Content Management Systems" and "File Uploads"
[19:37:03] literary: Does Sass (not SCSS) have some single-line syntax?
[19:37:04] literary: I want to do "body: color: 3" on one line somehow. Can Sass do this?
[19:37:09] intuxicated: bradfordli123, if its going to be large database , so don't do that. if its not just convert image to blob and write it to your db
[19:37:57] centrx: bradfordli123, https://www.ruby-toolbox.com/categories/rails_file_uploads ?
[19:37:58] bradfordli123: intuxicated: what if it is a large database?
[19:38:20] centrx: bradfordli123, Generally the database just stores a listing and metadata, the file itself stays somewhere on the filesystem
[19:38:21] frank_o: Hi! I'm trying to add PgSearch to Forem: https://gist.github.com/frankie-loves-jesus/f34fee3e2c739127aea8 -- but why am I getting `ActiveRecord::RecordNotFound` despite searching for a post that exists?
[19:38:25] frank_o: Live app: http://runnable.com/VEFe5hZXSE9z0q5x/forem-with-pgsearch-for-ruby-on-rails (note that you must first run `/etc/init.d/postgresql start` from the terminal before hitting the green `Run` button)
[19:38:38] bradfordli123: centrx: okay thank you!
[19:38:40] intuxicated: bradfordli123, upload it, write it somewhere , store the path.
[19:39:24] centrx: frank_o, Usually that's from something like Model.find(5) where none exists with id 5
[19:39:34] centrx: frank_o, From the error stack trace, it looks like this one is coming from cancancan
[19:40:12] frank_o: centrx: I can't remember adding cancancan to the Gemfile
[19:41:37] frank_o: centrx: Any chance you could take a stab at the live app?
[19:42:09] centrx: frank_o, I started postgresql, and then I just click Run?
[19:42:24] centrx: literary, Anyone around in #sass ?
[19:42:42] centrx: frank_o, I am getting undefined local variable or method `search_path' for #<#<Class:0x0000000368e810>:0x00000003cea150> from a view
[19:43:17] frank_o: centrx: Oops, forgot to publish that fix. Please reload the live app and try again. sorry..
[19:46:11] bradfordli123: hmm paperclip or carrierwave
[19:48:37] bricker`work: bradfordli123: carrierwaev
[19:50:24] frank_o: nobody in favor of paperclip?
[19:55:14] bradfordli123: why no paperclip?
[19:57:37] frank_o: yeah why. it has 1000 or so more stars on GH
[19:58:05] weaksauce: I've used paperclip and it's fine
[19:58:25] centrx: frank_o, Sorry I stepped away, but it seems to work now on that site? The links don't work, but no crash
[19:59:20] frank_o: centrx: Im not able to search for mangos =/
[19:59:31] frank_o: centrx: did it work for you?
[20:01:24] centrx: frank_o, no
[20:01:25] Shuttle_: would someone care to help me creating a scope? I have Items with service_interval and purchased_at_date. An Item may or may not have a comment with service true or false. A comment always belongs to an item. I would like to have a scope with those Items where: !service_interval.blank, Date.today is over service_interval + date for last comment with service true OR when there is no comment where service is true, service_interval+purchased_at_date < D
[20:01:47] centrx: frank_o, this devise, does devise depend on cancancan, I can't help but it looks like the problem is cancancan or something that's using it
[20:02:37] weaksauce: devise is authentication and cancancan is authorization
[20:02:38] frank_o: cool, ill look into it. thanks a lot!
[20:02:57] weaksauce: they don't depend on each other but are used together a lot
[20:05:12] adac: Does someone know if I can have a "description list" within slim (or erb)
[20:05:29] adac: it seems that dl is interpretet as ol in slim
[20:05:37] folippi: If you scaffold a model, view and controller, you get the whole REST package: new, update, delete, all of those actions. How can you 'turn off' some of them? I want users not to be able to edit records. Is this possible in Rails?
[20:05:38] mekhami: anyone know if the sidekiq status gem still works?
[20:07:12] rhizome: folippi: delete the actions and remove the routes
[20:08:12] weaksauce: folippi remove the actions from the controller, update your routes.rb file to have resources :model, except: [:update, ...]
[20:14:34] xcyclist: I'm seeing api.rubyonrails.org is much different than in this demonstration by Wolfram Arnold 4 years ago. I also don't see the verify stipulation he is showing in the video.
[20:15:17] rhizome: "verify stipulation?"
[20:15:53] frank_o: Hi! I'm trying to add Paperclip to Forem: https://gist.github.com/frankie-loves-jesus/f25e546844d9771e7d7c (live app: http://runnable.com/VEEnRTEK-igg4XGD/forem-with-paperclip-for-ruby-on-rails)
[20:15:57] frank_o: But why am I getting `Unpermitted parameters: photos_attributes` despite `params.require(:post).permit(:text, :password, :photos_attributes)` in `posts_controller_decorator.rb`?
[20:17:08] sloggerkhan: If I want to bulk assign some values to an active record model instance like as with the update method, but want to do it without saving, is there a call for it?
[20:18:26] xcyclist: verify (ActionController::Ver...
[20:18:46] xcyclist: I don't find one exactly like that...
[20:18:57] sloggerkhan: Googling, I guess you can assign to attributes plural or assign_attributes.
[20:19:04] sloggerkhan: (Answering my own question.)
[20:19:40] xcyclist: It looks like there are two ActionController items for forgery protection, but nothing more general.
[20:20:21] xcyclist: verify(options={})
[20:21:51] xcyclist: Okay, sorry I found this has a deprecation statement: http://apidock.com/rails/ActionController/Verification/ClassMethods/verify
[20:28:49] folippi: rhizome: weaksauce thank you guys! You helped me with my problem :). Senting you both a thousand internet points
[20:29:05] folippi: ACTION bows
[20:31:07] bradfordli123: does anyone here have experience with angularjs?
[20:32:24] Shuttle_: if I use a where-clause below a scope, exists(select1 from ..... comments.created_at >= ???. What would I use as Date.today? how should it be inserted here to work?
[20:34:10] rubyonrailed: After capybara hits "Submit Payment" How do I pull the request into my spec from the controller? https://gist.github.com/anonymous/a9db6a6559f88372b684
[20:35:53] kwerle: I have a best practice question. My IT department has asked me to put a version number on my app. Where/how should I store that version number? I know it???s a basic question, and I should google it - but googling ???rails app version number??? isn???t too constructive???
[20:38:49] jonathan_alban: Hi Guys, I want to ask if you could help me improve the way I'm creating a bike for a user in this app. The bike information is available from a website called Strava so I'm using a gem that can pull in the bikes information with its id. Here's a gist of what I'm doing: https://gist.github.com/jonathan-alban/5941df8b2e9ffbd3bdf6
[20:38:49] xcyclist: Say, in this demonstration tutorial 'https://www.railstutorial.org/book/static_pages', why is he testing view titles from the controller test script?
[20:39:26] weaksauce: kwerle like a version number to display to the user?
[20:39:36] weaksauce: or just a version number somewhere for the developers
[20:39:56] kwerle: Well, both, really. For developers I???d version my API - but that???s not the same.
[20:40:46] kwerle: Mostly for users - so that when they submit bug reports (not that it will ever come to that!) they will have a reference. Frankly, I think it???s a little silly, but IT says, and so....
[20:41:53] weaksauce: I'd probably put it in a yaml file and/or have a postcommit hook that updates a file with the current first 5 or 6 digits of the git commit hash
[20:42:23] kwerle: Yeah. There really doens???t seem to be a convention for it, does there.
[20:42:40] weaksauce: don't think so
[20:42:47] kwerle: Welp. Thanks!
[20:46:36] jonathan_alban: made a quick update to my gist but my issue remains
[20:48:41] weaksauce: jonathan_alban what are you trying to accomplish with the refactoring?
[20:49:02] weaksauce: remove the many lines of self.attribute = something
[20:49:27] jonathan_alban: Yeah or more the before_save callback
[20:50:19] Shuttle_: could someone help me out with a somewhat complex scope?
[20:50:43] jonathan_alban: Maybe there's another call back or a better practice but I dont know if calling that method on before save everytime is required
[20:51:21] weaksauce: jonathan_alban how often do those values change?
[20:51:52] weaksauce: you could call it on create only or only on update etc.
[20:52:26] weaksauce: Shuttle_ gist what you have tried
[20:53:05] jonathan_alban: Ok thats my aim actually but I cant seem to use the strava_client methods until its an instance
[20:53:05] Shuttle_: https://gist.github.com/oh2ftu/332e1207ec0edda5095a
[20:53:31] Shuttle_: weaksauce: I do have a thing to give me a true/false value in my model, that could probably be reused
[20:54:43] Shuttle_: weaksauce: I left a comment with something that actually does work while showing the product. The scope is needed for filterrific
[20:55:50] jonathan_alban: weaksauce: it says "undefined local variable or method `strava_client'" if I dont use the callback method to set the attributes
[21:01:48] weaksauce: Shuttle_ what happens when you run that scope?
[21:01:54] weaksauce: say from the rails console
[21:02:27] Shuttle_: weaksauce: I get nothing. Plus it doesn't check for the presence of a comment with true (if none is present, it should use purchased_at_date as a base)
[21:03:22] Shuttle_: AND (comments.created_at + items.service_interval) < '2014-10-18')
[21:07:28] weaksauce: I see. that's a complex thing. what db are you using? Shuttle_
[21:08:21] Shuttle_: weaksauce: mysql
[21:08:25] TheAtomicGoose: with bootstrap-sass version, the variable $greyLight isn't working, nor is $grey-light.
[21:08:27] TheAtomicGoose: why would that be?
[21:08:28] weaksauce: you could use coalesce() I think
[21:09:40] weaksauce: coalesce(comments.created_at, items.purchased_at_date)
[21:10:37] sterns: redis labs limits one to 10 connections on their free plan. Does Redis To Go have a similar limit? Or, can anyone recommend another free redis provider that has a significantly greater connection limit?
[21:14:33] Shuttle_: weaksauce: oh. Testing is on sqlite
[21:14:58] weaksauce: hm... I think coalesce is a standard function though
[21:16:49] weaksauce: i'd explicitly call the joins out too
[21:17:30] weaksauce: and make it a left join so you can use coalesce
[21:17:32] MrPunkin: Are OmniAuth handled OAuth tokens already encrypted using the app???s secret? I???ve been AES encrypting the tokens before storing them to the DB but wondering if that is overkill.
[21:21:22] ferr: I use omniauth with devise, how do I call "successfully signed in" message? Is it alert, flash message or what?
[21:23:51] matt_d: ferr: Are you using an OmiauthCallbacksController you created, or perhaps a gem to handle your omniauth authentication?
[21:24:36] ferr: matt_d: I am using OmniauthCallbacksController
[21:25:28] matt_d: ferr: So, within your controller, within your logic, you can set a flash notice when a user has successfully signed in.
[21:26:12] Nic_home: When a user is created I want to make an API call to add more information to them. Any suggestions, or is there a RoR way of doing this? Should it be in the model? or controller?
[21:27:26] ferr: matt_d: I've got set_flash_message(:notice, :success, kind: "#{provider}".capitalize) if is_navigational_format? but it does not work
[21:28:11] Shuttle_: weaksauce: I tried with just sql, came up with: where([ %(exists ( SELECT * FROM items, comments WHERE items.id = comments.item_id AND comments.service == 'true' AND datediff(now, coalesce(comments.created_at, items.purchased_at_date)) > items.service_interval
[21:28:23] Shuttle_: ends with ))])
[21:28:42] weaksauce: does that work?
[21:28:54] weaksauce: you should do a left join though
[21:29:10] weaksauce: as items,comments is an inner join
[21:29:25] Shuttle_: weaksauce: nope. The now -part is not workint
[21:30:32] Shuttle_: and also, datediff isn't present on sqlite apparently
[21:31:01] Shuttle_: didn't work either (testing on sqlite)
[21:34:02] weaksauce: Shuttle_ date('now') should work in sqlite
[21:34:13] rubyonrailed: I'm testing a payment form, and when that form is submitted a request is sent to stripe to create a customer like this https://gist.github.com/anonymous/ad9af05c46a327bdd8cc When I click that "Submit" button in capybara, how can I get that request back in my testing environment?
[21:36:41] Shuttle_: weaksauce: how should I perform the left join?
[21:38:03] weaksauce: https://gist.github.com/anonymous/d770650ef0e97ab7efff
[21:38:44] weaksauce: Shuttle_ fwiw I never use "natural joins" because they are less explicit in my head
[21:39:27] fretsejaz: I found a weird quirk with Rails AR earlier and I was hoping someone could explain it to me: https://gist.github.com/fretsejaz/499b02751e23b66ce676
[21:39:49] fretsejaz: basically setting self.attribute vs attribute in before_create
[21:42:33] Shuttle_: weaksauce: still nothing. Damn.
[21:45:43] weaksauce: can you go into your console and do a Model.with_service_overdue and see what the raw sql is
[21:47:24] weaksauce: Shuttle_ ^\
[21:47:26] Shuttle_: erm. Gives me an argumenterror (0 for 1)
[21:48:51] Shuttle_: https://gist.github.com/oh2ftu/b9189da628084db9340e
[21:49:45] weaksauce: Shuttle_ can you try that from the rails db shell
[21:50:04] Shuttle_: weaksauce: how do I do that?
[21:50:12] weaksauce: instead of rails c
[21:51:32] Shuttle_: hmm, nothing
[21:52:19] Shuttle_: if fails on the comments == 'true'
[21:52:30] weaksauce: try just true
[21:52:39] Shuttle_: no such column
[21:53:30] weaksauce: I meant comments == true
[21:53:39] weaksauce: it works in postgres
[21:55:00] Shuttle_: it's the comments.service -part that fails
[21:56:59] weaksauce: is there a column named service?
[21:57:06] Shuttle_: it's boolean
[21:57:45] weaksauce: and you tried: AND comments.service == true
[21:57:54] Shuttle_: Error: no such column: true
[21:59:25] weaksauce: should be just one = there too and use comments.service >= 1
[21:59:31] weaksauce: I hate mysql
[21:59:50] weaksauce: it treats a bool as a tinyint
[22:00:07] weaksauce: with 0 = false and anything not 0 true
[22:00:34] weaksauce: so try that out Shuttle_
[22:00:35] Shuttle_: I can get from comments with service == "t" or "f" for true or false
[22:01:26] Shuttle_: with that I can separate comments that are true or false. But. When used in conjunction with the whole query (less the date-comparison) I always get everything
[22:01:50] weaksauce: on sqlite though... every db seems to treat bools differently
[22:12:48] Shuttle_: SELECT "items".* FROM "items" WHERE (EXISTS (SELECT 1 FROM items left join comments on items.id = comments.item_id WHERE comments.service == "t"));
[22:12:52] Shuttle_: this selects all for some reason
[22:18:27] rhizome: is "t" how sqlite3 stores booleans?
[22:18:46] Shuttle_: oo. A new error: ActionView::Template::Error (SQLite3::SQLException: only a single result allowed for a SELECT that is part of an expression:
[22:25:15] ferr: https://gist.github.com/Fercell/a6c1ce019998b921deeb it should come with a flash message, unfortunately it does not work for me, any ideas?
[22:26:24] Radar: https://gist.github.com/Fercell/a6c1ce019998b921deeb#file-gistfile1-txt-L9
[22:26:27] Radar: ferr: Why notice and success?
[22:26:51] ferr: Radar: found so on tutorial, there's should be only one?
[22:27:00] Radar: ferr: which tutorial?
[22:27:07] Radar: [citation needed]
[22:27:16] ferr: http://sourcey.com/rails-4-omniauth-using-devise-with-twitter-facebook-and-linkedin/
[22:27:38] Radar: Are you sure the code is even getting to that point?
[22:27:48] Radar: You could find out by putting a binding.pry there and seeing if it reaches it.
[22:28:04] ferr: Everything seems to work fine, I am able to sign up, sign in
[22:28:24] Radar: ferr: But are you POSITIVE that it's getting to that line?
[22:28:29] weaksauce: Shuttle_ seems like you need to reference the outer items in the inner sql
[22:28:52] ferr: Radar: I hope so
[22:28:57] Radar: ferr: ffs.
[22:29:08] Radar: ferr: Please. For the love of all that is precious. Put a binding.pry there and MAKE SURE it's getting there.
[22:29:29] Radar: I don't want you to *think* it's getting there. I want you to *know*
[22:29:57] ferr: Ok, master, hold on a moment, I need to check what's binding.pry. Thanks a lot
[22:30:13] Radar: ferr: github.com/pry/pry
[22:30:18] Shuttle_: weaksauce: errrr
[22:30:42] Radar: gem 'pry' -> bundle install -> put a "binding.pry" above where it's setting the flash message -> do the process again -> view rails server output and you should see a prompt
[22:36:27] ferr: Radar: now I believe it does not
[22:36:35] Radar: ferr: ok good
[22:36:49] Radar: What do the logs for that request say?
[22:37:35] ferr: Should I paste it for you?
[22:37:50] Shuttle_: shit. Gotta hit the rack. nn.
[22:41:39] Radar: ferr: yes
[22:42:52] ferr: Radar: just to clarify, I should execute my code in the prompt right, so I will get the error message?
[22:43:16] Radar: ferr: you don't have to execute anything in the prompt. The prompt is just verification that it's actually hitting the right action in the right controller.
[22:47:23] ferr: Radar: check if this is what you needed https://gist.github.com/Fercell/c9641416013dfd800689
[22:48:17] Radar: ferr: Does the user exist in the DB before you call this action
[22:48:26] Radar: ferr: because there's a branch in your code on line 7 of your original gist
[22:48:33] Radar: And in that else, you're not setting any messages
[22:49:25] ferr: I have just ran rake db:migrate:reset before this
[22:49:35] ferr: and also my home page lists all of users and there was none
[22:50:11] ferr: I'll just do it from scratch once again, because I've mixed lots of things and it's really tough to get it
[22:50:25] ferr: I appreciate your help Radar
[22:52:42] DoctorMonocular: I'm trying to run devise tests under ActiveSupport::TestCase (so, minitest) like so: https://gist.github.com/PeteMichaud/36de415ce2e73f738951--and I'm gettingthe error in the gist as well. I can't figure out what I'm doing wrong?
[23:02:00] Radar: DoctorMonocular: request.env isn't available in those types of tests.
[23:02:53] DoctorMonocular: I'm not calling that, so it must be internal. Surely I'm not the only one who wants to test my controllers with devise? How do I work around it?
[23:02:55] DukeDave: DoctorMonocular: try reopening `ActionController::TestCase` in your `test_helper.rb`, and `include Devise::TestHelpers` in there
[23:03:41] DoctorMonocular: dukedave: not sure what you mean, I think I have that already?
[23:04:31] DukeDave: DoctorMonocular: like this: https://gist.github.com/PeteMichaud/36de415ce2e73f738951#comment-1320431
[23:05:22] DoctorMonocular: so after I open and close the first ActiveSupport::TestCase, you're saying I should reopen it for a second time and add it there? what would the difference be?
[23:07:35] DoctorMonocular: ohhh, I see now, it's not ActiveSupport::TestCase, it's ActionController
[23:08:03] DukeDave: DoctorMonocular: oh, yeah, sorry, I probably could have spelled that out a little clearer
[23:08:57] DoctorMonocular: ok, so now the error is that sign_in is not a method for DayTest, which I suppose just means the ActionController::TextCase isn't the right class to include it in
[23:09:55] DukeDave: DoctorMonocular: ActionController::TestCase <-- did you typo that as TextCase in your code? ;)
[23:10:15] DoctorMonocular: so, here's the thing -- when I include tyhe devise stuff directly in the DaysTest class I get the env isn't a method for nil, so I don't think it's a problem with the inclusion
[23:10:31] DoctorMonocular: I think it's actually a problem with the TestHelpers not playing nice with PerformanceTests
[23:10:36] DoctorMonocular: but I don't know how to work around that
[23:10:38] DukeDave: ACTION shrugs
[23:12:26] DoctorMonocular: doh, looks like I have to do it a different way:
[23:12:26] DoctorMonocular: http://stackoverflow.com/questions/4653788/performance-testing-with-devise-authentication
[23:25:57] jlpeters: Greetings, all. Is there a way to override << when adding elements to a postgres array type? My goal is to prevent duplicates of items in a 'wishlist' where the items are simply ids. Something akin to: https://gist.github.com/larsthegeek/df254e1ba1f12c9adefd
[23:28:13] jlpeters: Note this is mainly for curiosity as I know I can roll my own method.
[23:30:10] bricker`work: jlpeters: yep.
[23:30:38] bricker`work: jlpeters: a = [1,2,3]; def a.<<(arr); self.push(arr).uniq; end
[23:30:47] bricker`work: something like that
[23:31:12] bricker`work: Actually, probably calling super is a better idea
[23:34:18] jlpeters: bricker`work: thanks! I'll poke around with calling super
[23:44:08] DoctorMonocular: so, I think I have something mostly working to get sign_in going, but I'm having a weird problem where it's saying my login is invalid. I'm seeding the database with a known username/password, and then using it to login, and it's saying the login is wrong. I'm not really sure how to troubleshoot this
[23:44:43] weaksauce: gist what you've tried
[23:50:23] DoctorMonocular: https://gist.github.com/PeteMichaud/13d4189c21131f932555
[23:52:26] weaksauce: DoctorMonocular you might want to test logging in in a few tests but it's not a bad idea to mock it out
[23:53:32] weaksauce: DoctorMonocular what auth engine are you using?
[23:54:42] weaksauce: add Warden.test_mode! to the first line of your test then in a before :each do block you can instantiate your users
[23:54:56] pontiki: DoctorMonocular: what's up here? https://gist.github.com/PeteMichaud/13d4189c21131f932555#file-test_helper-rb-L13
[23:54:57] weaksauce: call sign_in from there
[23:55:12] pontiki: that looks wrong to me
[23:55:35] DoctorMonocular: pontiki: to verify the login worked I'm checking the response body for the string that says you logged in successfully
[23:55:51] weaksauce: the : is out of place no?
[23:55:54] pontiki: when i use I18n.t, the string key isn't a symbol when it's put together as dotted elements
[23:56:15] DoctorMonocular: I've manually verified that it works, returning the string I expect
[23:56:29] DoctorMonocular: and I've also manually verified that the response body is the page that says the login is invalid
[23:56:46] pontiki: yeah, it's the I18n.t call i'm talking about
[23:56:46] DoctorMonocular: the :'sdfsdf' syntax is just a way of making more complex symbols
[23:57:10] pontiki: but it's not normally done that way
[23:57:18] DoctorMonocular: like, you can't just do :foo.bar , but :'foo.bar' is perfectly legal
[23:57:32] pontiki: right, i understand, but it still isn't what i mean
[23:57:38] pontiki: yes, you *can* make symbols that way
[23:57:44] DoctorMonocular: ok, maybe I don't understand what you mean then
[23:58:34] pontiki: but that would imply a key in the locale file of :'devise.sessions.signed_in' instead of the usual devise:\n sessions:\n signed_in: blah blah\n
[23:58:41] pontiki: woops, not quite right
[23:58:59] pontiki: signed_in is a descendent of sessions
[23:59:41] DoctorMonocular: yeah, it just says that for the language (eg. en) look for devise: sessions: signed_in