« Back to channel list

#RubyOnRails - 06 October 2015

« Back 1 day Forward 1 day »
[00:00:43] willardg: has joined #RubyOnRails
[00:00:46] krainboltgreene: I wish I could just do Account.conccurent(10).each(&:reset_password) and have it use 10 threads.
[00:00:53] smathy: krainboltgreene, update_all
[00:00:56] ellisTAA: has joined #RubyOnRails
[00:01:12] rhizome: he's running a method
[00:01:26] ellisTAA: i???m getting an error that says there???s an unexpected end ??? anyone know why? https://gist.github.com/anonymous/9a57ec02599f17f65193
[00:01:52] smathy: rhizome, yeah, you have to change that so you either don't have to run a method, or you run all the methods ahead of time.
[00:02:38] rhizome: it sounds to me like he's at the latter step
[00:02:48] krainboltgreene: smathy: Yeah, can't use update_all
[00:02:51] ellisTAA: oh it???s cuz i???m trying to use erb inside erb. nvm :\
[00:02:54] kies: has joined #RubyOnRails
[00:02:57] smathy: rhizome, yeah, probably something CPU heavy, bcrypt rounds or something.
[00:03:12] smathy: krainboltgreene, just create threads inside an iterator over your records.
[00:03:31] krainboltgreene: smathy: Then I run into connection pool problems :/
[00:03:57] rushed: has joined #RubyOnRails
[00:04:49] bricker1: has joined #RubyOnRails
[00:05:10] krainboltgreene: I could compute the bcrypt early, turn it into [id, encryped_password], then junk those into connection.execute.
[00:05:16] krainboltgreene: The former is threadable.
[00:05:43] baweaver: has joined #RubyOnRails
[00:06:04] yaymukund: has joined #RubyOnRails
[00:06:29] smathy: krainboltgreene, right, you need to manage that pool with something like https://github.com/mperham/connection_pool
[00:06:51] smathy: krainboltgreene, or just send it all into a sidekiq queue, that's automatically concurrent.
[00:07:11] smathy: krainboltgreene, or use celluloid directly if you want to do it yourself: https://github.com/celluloid/celluloid
[00:07:41] smathy: krainboltgreene, I'd probably use ActiveJob with sidekiq as my backend.
[00:10:29] annlewis: has joined #RubyOnRails
[00:11:28] smathy: EllisTAA, you've got erb in your erb.
[00:11:42] ellisTAA: smathy: thanks
[00:12:38] Radar: EllisTAA: You should be interpolating instead.
[00:12:46] krainboltgreene: Kinda wanted to avoid the overhead of resque worker/resque server, but if I have to...
[00:12:47] ellisTAA: Radar: got it. thanks
[00:12:54] bifflechip: has joined #RubyOnRails
[00:13:14] willardg: has joined #RubyOnRails
[00:14:19] smathy: krainboltgreene, yeah, that's why I said sidekiq not resque.
[00:15:47] smathy: krainboltgreene, but, as I mentioned, you're free to use celluloid yourself, or even https://github.com/brandonhilkert/sucker_punch if you wanted.
[00:15:50] smathy: So many options.
[00:15:51] krainboltgreene: Well I'm not going to bring in a new worker framework for one thing haha.
[00:17:00] smathy: SuckerPunch even shows the syntax for checking out/in connections from the ActiveRecord connection pool.
[00:17:08] uris: has joined #RubyOnRails
[00:17:30] chills42: has joined #RubyOnRails
[00:18:06] bricker1: has left #RubyOnRails: ()
[00:19:43] jgt: has joined #RubyOnRails
[00:23:49] mices: how do i make an action render a page before it ends and not render a page after it ends because i already rendered it
[00:27:25] ellisTAA: i need to run some code every 30 minutes to check all accounts to see if they meet some condition. how can i do this? i heard someone say i can have a rake task that runs? i heard background processes cost more money through hosting companies ???
[00:27:32] ellisTAA: i???d like to avoid additional costs
[00:27:55] simplyianm: has joined #RubyOnRails
[00:28:38] workmad3: has joined #RubyOnRails
[00:28:57] jobewan: has joined #RubyOnRails
[00:29:49] one_zero: has joined #RubyOnRails
[00:30:11] parkerbond: has joined #RubyOnRails
[00:30:28] htmldrum: has joined #RubyOnRails
[00:31:25] herbst: has joined #RubyOnRails
[00:31:47] dici: has left #RubyOnRails: ()
[00:31:49] Palsson_: has joined #RubyOnRails
[00:32:07] rhizome: that's a bug
[00:32:08] bonhoeffer: has joined #RubyOnRails
[00:32:49] xcesariox: has joined #RubyOnRails
[00:33:13] rhizome: get rid of the need to check all accounts for something
[00:34:27] annlewis: has joined #RubyOnRails
[00:35:45] ellisTAA: rhizome: i want to check if anyone has filed a return, and if they haven???t charge them and pay the other person. do you think this is a bad idea?
[00:37:01] bonhoeffer: has joined #RubyOnRails
[00:37:47] rhizome: i have no idea what that means
[00:38:26] darrencauthon: has joined #RubyOnRails
[00:39:39] fedexo: has joined #RubyOnRails
[00:40:13] chills42: has joined #RubyOnRails
[00:42:33] ellisTAA: rhizome: i???m going to check if a user wants to cancel some service before it ends, if they don???t want to then ill charge them. is this still a bad design?
[00:43:17] stardiviner: has joined #RubyOnRails
[00:43:35] bonhoeffer: i???ve run into a snag with my form ??? my token fields clear if there is an error ??? anyone experienced this?
[00:44:34] atomical: has joined #RubyOnRails
[00:44:52] OnkelTem_: has joined #RubyOnRails
[00:45:02] s2013: has joined #RubyOnRails
[00:45:14] FailBit: updated production to 2.2.3
[00:45:17] FailBit: todaywasagoodday
[00:47:20] rhizome: EllisTAA: just find those who aren't canceled and charge them
[00:47:43] Sigma00: FailBit: we went from 1.9.1 to 2.1.6 over the weekend. Shit loads so much faster D:
[00:47:58] enlycanment: has joined #RubyOnRails
[00:48:05] FailBit: >being on 1.9.1
[00:48:09] ellisTAA: rhizome: i think i???d still have to run it every 30 minutes ...
[00:48:42] yaymukund: has joined #RubyOnRails
[00:48:46] rhizome: EllisTAA: can people subscribe in 30min increments?
[00:49:26] ellisTAA: rhizome: yeah. events happen every 30 minutes.
[00:50:57] rhizome: so a subscription or whatev is like a switch they can turn off and on?
[00:50:58] charliesome: has joined #RubyOnRails
[00:51:13] stannard: has joined #RubyOnRails
[00:52:49] smathy: bonhoeffer, as in your hidden authenticity_token field?
[00:53:27] bonhoeffer: smathy: no ??? sorry i wasn???t clear ??? i???m using some token fields (javascript) rails clears the form if there is an error
[00:53:40] bonhoeffer: i think what really happens is that the object repopulates
[00:54:04] bonhoeffer: the form, but that doesn???t work for the way i pull out tokenfields ??? i might have to load that in case of error
[00:54:18] bonhoeffer: just thought about how to do that in the controller
[00:54:59] ellisTAA: rhizome: i guess. basically if their date cancels they can ask for a refund and then i wont charge them
[00:55:12] FailBit: something else I'm gonna get to tomorrow is enabling threading
[00:55:23] xcm: has joined #RubyOnRails
[00:55:27] FailBit: this codebase is completely threadsafe, just need to check that the gems we use are fine
[00:56:24] dllama: has joined #RubyOnRails
[00:56:50] paolodoors: has joined #RubyOnRails
[00:58:40] nya: has joined #RubyOnRails
[00:58:45] enlycanment: has joined #RubyOnRails
[00:58:50] smathy: bonhoeffer, yes, the object repopulates the form based on the values it has in the controller.
[00:58:55] zhkirill: has joined #RubyOnRails
[00:59:19] smathy: bonhoeffer, are you maybe not using an attribute on the model object you're returning?
[00:59:35] smathy: EllisTAA, who are you hosting with?
[00:59:35] bonhoeffer: yeah ??? because it is a token field
[00:59:53] smathy: bonhoeffer, one doesn't mean the other.
[01:00:03] ellisTAA: smathy: i was going to host with aws
[01:00:27] bonhoeffer: def friend_tokens=(names) ids = Friend.where(name: names.split(',').map(&:strip)).pluck(:id) self.friend_ids = ids end
[01:00:35] bonhoeffer: in the model
[01:01:04] smathy: bonhoeffer, the form fields will be set by corresponding getter method.
[01:01:26] bonhoeffer: ha ??? so i have a setter method ??? perhaps i need a getter method for that
[01:02:16] pwnd_nsfw: has joined #RubyOnRails
[01:03:04] smathy: EllisTAA, I think you can just run cron jobs on an EC2
[01:03:19] ellisTAA: smathy: ok i don???t know anything about aws yet
[01:03:21] smathy: bonhoeffer, well you absolutely will need a getter method if you want the values displaued.
[01:03:30] ellisTAA: smathy: will i get charged extra for that?
[01:04:12] rushed: has joined #RubyOnRails
[01:04:42] smathy: EllisTAA, not unless you need to resize your instance.
[01:05:08] ellisTAA: smathy: what???s an instance?
[01:05:30] smathy: EllisTAA, https://aws.amazon.com/ec2/instance-types/
[01:05:37] smathy: EllisTAA, you have a lot of reading to do.
[01:05:53] k776: has joined #RubyOnRails
[01:05:54] k776: has left #RubyOnRails: ()
[01:05:56] k776: has joined #RubyOnRails
[01:06:20] smathy: (but in general, no, you won't pay extra to run cron jobs on AWS)
[01:06:25] k776: Hey. I am trying to mount an engine into rails 4 (dj_mon), but the routes it is making look like this: https://$http_host/delayed_job/dj_reports/dj_counts
[01:06:32] ellisTAA: smathy: thanks
[01:06:34] k776: Any idea why $http_host in the url rather than the actual domain?
[01:06:56] k776: Seems to work fine in development, but not production
[01:07:12] smathy: EllisTAA, you're welcome.
[01:07:45] sevenseacat: k776: !mindread
[01:07:45] helpa: k776: Sorry, we are unable to read your mind at this time. Please gist (http://gist.github.com) your code and any relevant stacktrace so we can assist you.
[01:09:04] k776: sevenseacat: There is nothing to gist though, all information I know/can give is above.
[01:09:36] sevenseacat: k776: we don't know how you've mounted the engine
[01:09:50] Radar: k776: can you reproduce it in a new app?
[01:10:18] cnk: k776: Sounds like there is a config option for the engine that defaults in dev but not prod?
[01:10:29] k776: sevenseacat: Radar: Its a brand new app, add delayed_job_active_record, and then gem from git: https://github.com/akshayrawat/dj_mon
[01:10:36] qejk: has joined #RubyOnRails
[01:10:41] k776: Other than that, nothing out of the ordinary
[01:10:47] smathy: k776, probably your problem: https://github.com/akshayrawat/dj_mon/issues/52
[01:11:05] k776: smathy: Na, the gem is rails 4 comptible if you use master
[01:11:10] hydrozen: has joined #RubyOnRails
[01:11:13] sevenseacat: so you didnt actually mount anything?
[01:11:44] infoget: has joined #RubyOnRails
[01:12:12] smathy: k776, who told you that man? https://travis-ci.org/akshayrawat/dj_mon
[01:12:25] infoget: Hi guys, I have a category which has many a
[01:12:33] Radar: infoget: !fake
[01:12:33] helpa: infoget: Please do not use fake values, as they can be confusing or misleading. Sometimes both.
[01:13:32] lampshades: has joined #RubyOnRails
[01:14:13] darrencauthon: has joined #RubyOnRails
[01:14:21] infoget: Hi guys, I have a category which has many adverts and advert has many items, how can I get all items which belongs to category?
[01:14:47] Radar: infoget: has_many :items, through: :adverts on category.
[01:14:51] Radar: infoget: Thank you for not using fake variables.
[01:14:56] Radar: infoget: !associations for more information
[01:14:56] helpa: infoget: http://guides.rubyonrails.org/association_basics.html - Active Record Association Basics by Mike Gunderloy
[01:15:01] lampshades: greetings :-)
[01:15:05] Radar: hi lampshades
[01:15:13] lampshades: How are you Radar?
[01:15:27] Radar: doing well, thanks :) about to make some lunch up
[01:15:30] Radar: how about you?
[01:16:37] lampshades: not too bad. I got to the office early this morning, I figured I'll be able to get a head start with ember, but I couldnt find any good tutorials yet
[01:16:39] s2013: sup Radar
[01:16:45] lampshades: besides that, I had an epic breakfast
[01:16:48] Radar: lampshades: not even the official tutorial?
[01:16:56] sevenseacat: if you find one, plz share
[01:16:57] k776: sevenseacat: smathy: It works perfectly fine in production, it is mounted correctly
[01:17:09] k776: But when deployed, the rails _url helpers dont use the actual host
[01:17:21] k776: the URL becomes https://$http_host/.....
[01:17:23] sevenseacat: k776: not interested when you cant answer a simple question
[01:17:31] k776: It's like it's not substitiuing the value properly
[01:17:41] lampshades: sevenseacat: this one seems interesting http://wyeworks.com/blog/2015/6/30/how-to-build-a-rails-5-api-only-and-ember-application
[01:18:06] hightower4: Hey gents, I'm looking to hire a rails/spree/solidus developer. If interested, please privmsg me, thanks.
[01:18:34] k776: Opps, I meant: "It works perfectly fine in development, it is mounted correctly"
[01:18:37] sevenseacat: hightower4: as long as they're male?
[01:18:50] k776: sevenseacat: Sorry, which question did I miss?
[01:18:57] smathy: k776, I assume you meant "development" above (you said "production"). And I'm not arguing with you, I'm just telling you that this isn't being maintained, hasn't been tested with ruby > 1.9.3 and the apparent merge for Rails > 4.0 compatibility errored in Travis and has remained unfixed for 12 months.
[01:19:15] hightower4: sevenseacat, as long as they own it. :)
[01:19:18] sevenseacat: k776: what did you mount and how? we have no idea what you've done to set this up so we cannot help you fix your problem.
[01:19:19] smathy: k776, this is not a good bet.
[01:19:27] k776: So no one has heard of similar issues then with other engines?>
[01:19:28] sevenseacat: hightower4: you might want to tone down the exclusionism then
[01:19:35] Radar: k776: It's likely that it's just this engine.
[01:19:43] Radar: k776: could we please just focus on that until it's proven otherwise?
[01:19:50] k776: sevenseacat: dj_mon plugin using it's setup instructions: "mount DjMon::Engine => 'delayed_job'"
[01:19:53] Sigma00: exclusionism? are you secretly an SJW?
[01:20:09] EminenceHC: has joined #RubyOnRails
[01:20:10] Radar: Sigma00: Are you using SJW as an insult there?
[01:20:17] k776: If I put this line in my production.rb is works:
[01:20:18] Sigma00: tumblrisms
[01:20:19] smathy: k776, no, I've never heard of that. $http_host is actually an nginx variable.
[01:20:20] sevenseacat: Sigma00: you don't see 'hey gents, I'm hiring' as exclusionary?
[01:20:22] Radar: +q Sigma00!*@*
[01:20:25] havenwood: has joined #RubyOnRails
[01:20:25] k776: config.action_controller.default_url_options = { host: 'uploader.ourwebsite.com' }
[01:20:33] smathy: ...no idea why/how your Rails app could cause that to be messed up.
[01:20:37] Radar: Sigma00: I'll be having none of that, thanks.
[01:21:02] pwnd_nsfw: has joined #RubyOnRails
[01:21:09] Radar: hightower4: keep in mind that there are more than just 'gents' in the channel. Thanks.
[01:21:54] p1k: has joined #RubyOnRails
[01:21:55] hightower4: It's a figure of speech, but whatever. Thanks for the correction.
[01:22:13] sevenseacat: hightower4: so you'd be cool if someone reversed it, right
[01:22:16] Radar: hightower4: Ok, can I refer to you as "Lady hightower4" from now on?
[01:22:41] Radar: Since it's just a figure of speech.
[01:23:10] smathy: ACTION would be fine if someone wanted to hire just women - their dollar
[01:23:27] hightower4: It's a figure of speech when one is addressing unspecific audience. But I did not want to add noise to the channel, so given my thanks for your correction, I would assume that we'd be OK with dropping the subject.
[01:23:41] Radar: hightower4: 'gents' is very specific imo
[01:23:55] Radar: hightower4: We'd appreciate it if you didn't use it again to address the channel. Thanks.
[01:23:57] Radar: Topic, dropped.
[01:23:59] s2013: hightower4 just ignore it.. this is like the 30th time this conversation happened int hsi channel
[01:23:59] smathy: hightower4, at best it's a dated figure of speech, if you actually care about the non-gents in the audience then it would behoove you to adjust your salutation.
[01:24:11] Radar: hightower4: Tried getting in touch with http://stembolt.com/?
[01:24:19] sundhell: has joined #RubyOnRails
[01:24:19] smathy: hightower4, if you don't, then you'll just have to put up with the barbs from those you offend.
[01:24:22] sevenseacat: s2013: no, it's not to be ignored.
[01:24:23] smathy: (don't care)
[01:25:17] hightower4: Radar, yes, I did and actually made some contributions myself, but they seemed too busy with other projects to help in a way that'd assume some commitment beyond IRC help
[01:25:32] xcv: has joined #RubyOnRails
[01:25:49] Radar: hightower4: ... that's confusing language. Did you contact them asking if they had spare bandwidth for consulting or not?
[01:26:01] k776: has left #RubyOnRails: ()
[01:26:22] hightower4: Radar, Oh yes, I asked specifically and got referred to one specific person, which replied after 7+ days and didn't seem too available
[01:26:29] Radar: hightower4: ok
[01:26:30] diegobiavati: has joined #RubyOnRails
[01:27:13] EminenceHC: has joined #RubyOnRails
[01:28:50] hightower4: What's the best way to go about serving a generally static file, such as /test.js, but after being parsed with ERB? (E.g. if I would want a request for /test.js to go /test.js.erb and parsed into final .js before delivering, what's the optimal way to do it?)
[01:29:00] Radar: hightower4: look at nanoc
[01:35:38] s2013: our json renders a json of the object but for some reason its having issue with encoding.. ex: instead of & it returns &
[01:39:09] bonhoeffer: are there some docs on @user.journal_entries.between.old if @journal_entry.save fails in a rails default controller
[01:39:55] sekrit: has joined #RubyOnRails
[01:40:02] Aeyrix: bonhoeffer: did you just merge three questions together?
[01:40:13] bonhoeffer: the .between.old mehod on failure
[01:40:18] lasker85: has joined #RubyOnRails
[01:40:45] bonhoeffer: sorry i wasn???t clear ??? i???m curious what is happening there ??? why not present the original object that didn???t save
[01:40:56] sevenseacat: still not clear
[01:41:00] sevenseacat: some code might help.
[01:42:35] Ropeney: Any inputs on best place to spec core class extensions in rails?
[01:44:13] p1k: has joined #RubyOnRails
[01:44:47] appcademics: has joined #RubyOnRails
[01:45:18] diegobiavati: has joined #RubyOnRails
[01:46:03] rhizome: probably where they're used, at least
[01:46:23] bonhoeffer: sevenseacat: ok ??? i???ll peek at the source a bit ??? oh ??? this is my custom code
[01:46:48] Ropeney: rhizome: seems to repetitive
[01:46:55] FailBit: tildes are nice
[01:47:26] FailBit: good night~
[01:48:52] s2013: anyoen used redcarpet to convert markdown to html? for some reason its having issues with some encoding.. for example its outputting & as amp;
[01:49:15] rushed: s2013: because & in html is & ?
[01:49:21] sevenseacat: thats not encoding, thats escaping
[01:49:35] sevenseacat: and you're likely not marking your output as html safe
[01:50:15] diegobiavati: has joined #RubyOnRails
[01:50:52] Glyphik: has joined #RubyOnRails
[01:50:59] User458764: has joined #RubyOnRails
[01:51:13] diegobiavati: has joined #RubyOnRails
[01:52:10] mices: my mailer works great i already got some good responses the only thing is passenger times out waiting for it to send all those mails and fails to render the page, i think i have to render my page first or something
[01:52:31] s2013: nah it is html safe.. let me paste the code.. i didnt write it. just trying to fix the issue
[01:52:40] rushed: mices: don't send mail in your response, throw it in a background queue
[01:52:41] mices: i think that's why i get a page returned that says we're sorry something went wrong
[01:52:54] rushed: mices: don't guess why you get error pages, look at the logs
[01:52:56] mices: what response?
[01:53:06] mices: logs don't tell anything
[01:53:07] s2013: https://gist.github.com/ss2k/e37e40181e95ff4d4d0c this is the relevant piece
[01:53:21] mices: i haven't looked at passenger log yet wait
[01:53:27] C0L0R: has joined #RubyOnRails
[01:54:03] rushed: s2013: you're creating html so you can turn around and parse it with Nokogiri?
[01:54:09] s2013: i have no clue
[01:54:18] s2013: like i said i didnt write it.. the codebase is a piece of shit
[01:54:27] s2013: without rewriting it im trying to find a quick fix
[01:54:29] sevenseacat: its also not html safe
[01:54:51] sevenseacat: but that is awesome, converting markdown to html to parse with nokogiri and build up new htmlk
[01:55:11] pwnd_nsfw: has joined #RubyOnRails
[01:55:16] sevenseacat: let me count the ways that can go wrong
[01:55:17] mices: rushed: how do i put the mail in a background que instead of just sending it
[01:55:28] s2013: sevenseacat tell me about it
[01:55:36] sevenseacat: s2013: so fix it
[01:55:49] s2013: how do i make what we have now html safe
[01:56:21] sevenseacat: ...by marking the result as html safe
[01:56:36] bruno-: has joined #RubyOnRails
[01:56:53] rushed: mices: depends what background queue you're using, some have gems you can just throw in (ie resque_mailer)
[01:56:55] bonhoeffer: ok ??? so this is odd: @journal_entry.friends.first -> #<Friend id: 1, name: ???foo??? . . . but @journal_entry.friends.pluck(:name) => []
[01:57:24] sevenseacat: bonhoeffer: you said you were going to show us your code
[01:57:25] s2013: i added .html_safe at the end but didnt work. let me try something else
[01:57:30] paulcsmith_: has joined #RubyOnRails
[01:58:11] rushed: s2013: why do you think the &amp; is a problem?
[01:58:40] s2013: i guess on our mobile app its displaying as &amp; instead of & this was a request from the app developer
[01:59:01] rushed: s2013: it looks like you're using <table tags and other items so it seems like the code path you're in is used to dealing with html
[01:59:04] rushed: s2013: you guess?
[01:59:12] bonhoeffer: sevenseacat: fair ??? but in order to know what to push ??? any thought on how the name could be empty if it is show in the .first message
[01:59:23] rushed: s2013: so what is your test case for knowing if you've fixed the issue?
[02:00:00] s2013: this was just a request that came in earlier today. im hitting the api endpoint and i see the result that dispplays it as &amp; so if it works then it would return &
[02:00:05] bonhoeffer: @journal_entry.friends.map(&:name) -> ???Fred??? @journal_entry.friends.pluck(:name) -> []
[02:00:51] cih: has joined #RubyOnRails
[02:01:00] rushed: s2013: is there also the <table tags next to it that nokogiri is looking for? because in that context &amp; would be appropriate?
[02:01:52] bonhoeffer: any thoughts appreciated
[02:02:22] inanepenguin: has joined #RubyOnRails
[02:02:22] s2013: rushed the setup is that in the admin panel people can enter markdown.. and then on our site it shows as html .. and same goes for the app
[02:02:41] bonhoeffer: ah ??? pluck is on the db level
[02:02:48] rushed: bonhoeffer: Fred isn't persisted
[02:02:56] bonhoeffer: so it doesn???t save and the db doesn???t have that vlue
[02:03:37] Maletor: has joined #RubyOnRails
[02:04:01] rushed: bonhoeffer: which contridicts your fake data earlier~ which is why it's annoying when you use fake data~
[02:04:20] bonhoeffer: sorry ??? i didn???t use fake data ???
[02:04:37] rushed: bonhoeffer: "Friend id: 1, name: ???foo??? "
[02:04:59] bonhoeffer: ah ??? foo was fake true ???
[02:05:15] infoget: Can I do has_many :through, when it is same model? I mean, it's self-referential association, here is my code http://pastie.org/10462977
[02:05:20] rushed: bonhoeffer: id: 1 was the problem
[02:05:26] rushed: bonhoeffer: if in fact it wasn't saved
[02:05:37] bonhoeffer: that was correct
[02:06:03] s2013: rushed ok so i got rid of most of the stuff and now only have markdown(benefit.new_benefits) it returns & as amp; even if i add html_safe
[02:06:08] bonhoeffer: yes, strange ??? let me poke around with this
[02:06:34] rushed: s2013: of course it does, markdown's job is to produce html, and &amp; is the appropriate HTML
[02:06:51] s2013: so how can i make it return & instea dof &amp;
[02:06:58] rushed: s2013: you can't
[02:07:05] rushed: s2013: you can unescape it
[02:07:34] rushed: s2013: but you should make sure that all codepaths are not expecting html
[02:09:01] RockLee: has joined #RubyOnRails
[02:09:27] pwnd_nsfw: has joined #RubyOnRails
[02:09:41] s2013: k ill look at it in the morning. my head hurts
[02:09:52] rushed: s2013: CGI.unescapeHTML
[02:10:04] rushed: s2013: but be careful~
[02:10:36] s2013: alright.. thanks
[02:11:57] PhantomS_: has joined #RubyOnRails
[02:15:43] darrencauthon: has joined #RubyOnRails
[02:16:53] workmad3: has joined #RubyOnRails
[02:18:14] rickmasta: has joined #RubyOnRails
[02:19:46] darrenca_: has joined #RubyOnRails
[02:20:22] jaequery: has joined #RubyOnRails
[02:20:24] jgt: has joined #RubyOnRails
[02:21:22] RegulationD: has joined #RubyOnRails
[02:21:27] EminenceHC: has joined #RubyOnRails
[02:21:36] jobewan: has joined #RubyOnRails
[02:31:05] artto: has joined #RubyOnRails
[02:32:59] artto_: has joined #RubyOnRails
[02:35:28] yaymukund: has joined #RubyOnRails
[02:37:27] ror15: has joined #RubyOnRails
[02:39:24] jellyjellyrobot: has joined #RubyOnRails
[02:40:37] jellyjellyrobot: has joined #RubyOnRails
[02:41:07] Guest28550: has joined #RubyOnRails
[02:46:14] baweaver: has joined #RubyOnRails
[02:49:05] banjara: has joined #RubyOnRails
[02:53:15] DmitryBochkarev: has joined #RubyOnRails
[02:54:32] p1k: has joined #RubyOnRails
[03:00:40] mrtomme: has joined #RubyOnRails
[03:02:12] lasker85: has joined #RubyOnRails
[03:10:33] p1k: has joined #RubyOnRails
[03:10:51] hephaestus_rg: has joined #RubyOnRails
[03:11:17] harisamin: has joined #RubyOnRails
[03:11:42] braincrash: has joined #RubyOnRails
[03:14:21] rushed: has joined #RubyOnRails
[03:14:58] deuxclique: has joined #RubyOnRails
[03:19:56] uris: has joined #RubyOnRails
[03:22:10] prgrmmr: has joined #RubyOnRails
[03:24:27] p1k: has joined #RubyOnRails
[03:26:52] abel: has joined #RubyOnRails
[03:28:22] krz: has joined #RubyOnRails
[03:29:04] tubbo: has joined #RubyOnRails
[03:29:06] uris: has joined #RubyOnRails
[03:29:53] Dreeg: has joined #RubyOnRails
[03:31:35] abel: has joined #RubyOnRails
[03:31:53] lasker85: has joined #RubyOnRails
[03:32:02] artto: has joined #RubyOnRails
[03:32:30] darrencauthon: has joined #RubyOnRails
[03:32:54] zpe: has joined #RubyOnRails
[03:33:16] annlewis: has joined #RubyOnRails
[03:33:38] chills42: has joined #RubyOnRails
[03:34:05] aquiles: has joined #RubyOnRails
[03:35:52] IFrank00: has joined #RubyOnRails
[03:36:06] uris: has joined #RubyOnRails
[03:36:18] fifi-v: has joined #RubyOnRails
[03:39:17] fifi-v: hi, I'm having troubles with a spec: 1. `it { is_expected.to have_css(".myclass") }` fails; 2. `it { is_expected.to have_css(".myclass", visible: false) }` passes; 3. page.save_screenshot clearly shows that element is visible. Any idea?
[03:39:56] helpa: You have not provided enough information to debug your problem. Please provide this information: https://gist.github.com/radar/5384431
[03:42:57] pawnbox: has joined #RubyOnRails
[03:43:24] acti0nman: has joined #RubyOnRails
[03:49:01] EminenceHC: has joined #RubyOnRails
[03:51:40] Oog: has joined #RubyOnRails
[03:51:45] User458764: has joined #RubyOnRails
[03:52:29] lasker85: has joined #RubyOnRails
[03:53:50] pawnbox_: has joined #RubyOnRails
[03:55:21] slash_nick: fifi-v: what does `have_css(".myclass", visible: true)` get you?
[03:56:11] EminenceHC: has joined #RubyOnRails
[03:56:48] fifi-v: slash_nick: it fails, `page.has_css?(".myclass", visible: false)` returns true, which confuses me because `page.save_screenshot` gives me a picture that displays that element.
[03:57:01] slash_nick: fifi-v: are there any animations involved?
[03:58:20] fifi-v: slash_nick: yes, javascript is responsible for hiding/showing that element
[03:58:33] slash_nick: fifi-v: but... animations?
[03:58:34] fifi-v: if that's considered as animations
[03:58:45] fifi-v: other than that, no
[04:00:26] slash_nick: fifi-v: fade in, fade out?
[04:02:05] fifi-v: slash_nick: no
[04:02:11] rakm: has joined #RubyOnRails
[04:02:38] slash_nick: fifi-v: i'm just guessing... but i'm guessing the screenshot shows it visible where checking to see whether it's visible says nope, not visible. what if you put binding.pry right before the `page.has_css?` line?
[04:03:08] slash_nick: just stop execution and let it resume
[04:03:28] pydave6367: has joined #RubyOnRails
[04:04:58] workmad3: has joined #RubyOnRails
[04:06:32] fifi-v: sorry I don't quite get it, what's the order? `binding.pry`, then `page.hass_css?`?
[04:07:19] slash_nick: binding.pry;page.hass_css?(".myclass", visible: true) #|| page.hass_css?(".myclass", visible: false)
[04:08:09] slash_nick: binding.pry;page.hass_css?(".myclass", visible: true) # or `page.hass_css?(".myclass")`, i meant...
[04:08:51] fifi-v: currently I have binding.pry before `is_expected....`, and execute `page.has_css?...` by hand when it reaches there
[04:08:52] Haydos: has joined #RubyOnRails
[04:09:04] sevenseacat: this would be a lot easier if you just showed the actual code
[04:09:13] fifi-v: isn't it the same?
[04:09:27] slash_nick: fifi-v: i dunno... i'm just guessing. there's no code.
[04:10:31] slash_nick: `page.hass_css?` would obviously not work well
[04:11:30] Maletor: has joined #RubyOnRails
[04:13:59] EminenceHC: has joined #RubyOnRails
[04:15:48] rakm: has joined #RubyOnRails
[04:16:38] gambl0re: i'm using basic validation: "validates :name, presence: true" but in the console i can still submit an empty name field
[04:16:57] rushed: gambl0re: reload!
[04:17:10] zhkirill: has joined #RubyOnRails
[04:17:10] rushed: gambl0re: (and don't reuse an existing instance)
[04:17:36] w0rd-driven: has joined #RubyOnRails
[04:18:21] gambl0re: why do i have to reload?
[04:18:28] gambl0re: it works by the way after reload
[04:19:24] rushed: gambl0re: you changed the code, why would you not?
[04:19:28] slash_nick: console doesn't do all the things the server does... can you use view helpers in your console (without doing anything extra)?
[04:20:30] rushed: slash_nick: "without doing anything extra" <= no
[04:21:13] jgt: has joined #RubyOnRails
[04:21:24] slash_nick: console doesn't do all the things the server does. :)
[04:21:28] gambl0re: oh ok....i didnt know you had to reload the console after you added validation
[04:21:58] rushed: gambl0re: not because you added validation, because you changed the code
[04:22:49] RegulationD: has joined #RubyOnRails
[04:23:11] Joufflu: has joined #RubyOnRails
[04:23:19] techsethi: has joined #RubyOnRails
[04:23:19] rushed: gambl0re: and if you change something from the config, or an initializer, you need to exit completely, "spring stop" (or kill whatever pre-loader you're using, if any) and then restart the console
[04:23:46] Joufflu: has joined #RubyOnRails
[04:24:14] Goliathus: has joined #RubyOnRails
[04:26:19] hahuang61: has joined #RubyOnRails
[04:28:15] RockLee: has joined #RubyOnRails
[04:28:48] yoloscoped: has joined #RubyOnRails
[04:28:52] Aeyrix: You answered your own question.
[04:29:40] sarink: has joined #RubyOnRails
[04:32:16] nKulo: has joined #RubyOnRails
[04:32:43] artto: has joined #RubyOnRails
[04:33:22] zpe: has joined #RubyOnRails
[04:34:04] annlewis: has joined #RubyOnRails
[04:34:08] hahuang61: has joined #RubyOnRails
[04:34:12] tsujp: has joined #RubyOnRails
[04:34:44] tsujp: Hey guys I am developing a rails web app which will have hundreds of thousands, or millions of records (basic numbers) in a postgresql table which I need to take statistics from. Stuff like an average, frequency of a value, std dev. The stats need to be updated in real time as records are input. Does anyone know of a best practice here or resources to help me out cos I have no idea where to start.
[04:34:57] tsujp: Seems to me that doing all of this in a model/controller would make my rails app REALLY REALLY slow
[04:35:31] mices: rushed: this is from the docs for resque_mailer
[04:35:39] mices: rushed: The queue we're using is imaginatively named mailer, so just make sure your workers know about it and are loading your environment: QUEUE=mailer rake environment resque:work
[04:36:16] Aeyrix: tsujp: leverage the SQL server as much as you can
[04:36:19] Aeyrix: if you can use it for calculations, do it
[04:36:23] mices: i don't understand who my workers are and the resque:work thing
[04:36:24] Aeyrix: e.g., to count or get averages
[04:36:38] Aeyrix: tsujp: the SQL server is many, many times better at handling the data than the rails server
[04:36:58] tsujp: Aeyrix how would I store these values? I mean, if I get it to do an average or what have you, where do I put that output?
[04:37:08] tsujp: Aeyrix redis? in the sql server? in rails?
[04:37:18] Aeyrix: "the data"
[04:37:32] Aeyrix: http://www.postgresql.org/docs/current/static/functions-aggregate.html
[04:37:38] tsujp: So the postgres server does an average over all the records
[04:37:38] Aeyrix: PSQL can do a lot of data-related calculations.
[04:37:41] tsujp: ohk sec let me read that
[04:37:50] sevenseacat: has joined #RubyOnRails
[04:37:51] Aeyrix: Don't store the stats
[04:37:57] Aeyrix: unless they're going to be more or less static
[04:37:57] tsujp: I just call it every time then hey?
[04:38:07] Aeyrix: if you're updating in real time don't add even more shit to do by recalculating and saving it
[04:38:11] Aeyrix: just get the stats when you need it
[04:38:17] Aeyrix: by the sounds of it you're writing more than you're reading
[04:38:27] Aeyrix: so you don't want to add the extra calculation + write for almost no reason
[04:38:42] Aeyrix: if you can only do that calculation every 100th time, you've cut down the amount you need to process
[04:38:53] tsujp: Makes sense :)
[04:39:01] Aeyrix: if you want to cache stats kinda
[04:39:04] Aeyrix: i'd recommend using redis yeah
[04:39:11] Aeyrix: calculate them using something like Sidekiq to do it out of band
[04:39:15] Aeyrix: then stash them in redis for <x> time
[04:39:58] Aeyrix: if you need to do continuous statistical tracking
[04:40:03] Aeyrix: e.g., an average over the course of a day or something
[04:40:13] Aeyrix: use Sidekiq again but probably create another PSQL table to store that with a date/time
[04:40:31] tsujp: yeah I need both kinds
[04:40:31] Aeyrix: I wouldn't store anything you need to use reliably in Redis, only temporary stuff you can recalculate if required
[04:40:35] tsujp: average over day and the previous
[04:40:45] Aeyrix: Average over day and realtime?
[04:40:59] Aeyrix: How often are your writes?
[04:41:05] tsujp: That was my second question
[04:41:11] Aeyrix: I can't answer that one.
[04:41:26] tsujp: I am getting this data from an API, and I need to poll that API so that the second new data is available I have it. What's the best method for doing that?
[04:41:34] tsujp: Methods I can think of would get me restricted for spamming it likely
[04:41:43] tsujp: and having a 'refresh' button is not an option
[04:41:51] Aeyrix: that makes it sound like you shouldn't be polling it that frequently.
[04:41:53] Aeyrix: What are you polling?
[04:42:06] Aeyrix: Yes, I know that
[04:42:11] Aeyrix: or, what kind of data are we talking
[04:42:13] Aeyrix: inb4 stock market
[04:42:17] tsujp: https://developer.riotgames.com
[04:42:23] tsujp: match history
[04:42:55] tsujp: The second a match finishes I need the data, and I cannot think of a way to do that at all
[04:43:12] rromanch_: has joined #RubyOnRails
[04:43:28] tsujp: I'm still reading through the API but nothing to solve that problem seems to come up so far
[04:44:00] Aeyrix: The game-1.3 endpoint?
[04:44:33] Aeyrix: how are you getting match ids?
[04:44:42] baweaver: so what exactly made you want to go with Rails for this venture?
[04:44:47] Aeyrix: ignore that
[04:44:49] Aeyrix: for a second
[04:45:04] PhantomSpank: has joined #RubyOnRails
[04:45:11] tsujp: sec checking gme-1.3
[04:45:19] Aeyrix: tsujp: what were you using?
[04:45:21] Aeyrix: or intending to use?
[04:45:25] Aeyrix: there's nothing where you can pull recent matches
[04:45:42] tsujp: hmm thats the problem
[04:45:51] tsujp: there are other websites with current games and stuff
[04:45:53] acti0nman: has joined #RubyOnRails
[04:46:06] tsujp: so as far as match IDs, I don't know
[04:46:11] pydave6377: has joined #RubyOnRails
[04:46:17] Aeyrix: link to example site
[04:47:12] tsujp: this one gets previous games http://champion.gg
[04:47:58] tsujp: this one gets recents http://www.lolnexus.com/recent-games
[04:47:58] Aeyrix: I'd venture that's the featured games endpoint
[04:48:03] Aeyrix: as it's only analysing the Platinum+ stuff
[04:48:47] tsujp: carry.gg used to have this but that site went down due to API changes
[04:48:53] jobewan: has joined #RubyOnRails
[04:50:27] Aeyrix: Probably featured yeah.
[04:51:36] tsujp: So it seems impossible to do this without having people input the data themselves :\?
[04:51:41] makman: has joined #RubyOnRails
[04:51:58] Aeyrix: I noticed you can't search by summoner name on those sites.
[04:52:07] Aeyrix: One of my friends is like some major league LoL streamer
[04:52:10] charliesome: has joined #RubyOnRails
[04:52:10] Aeyrix: couldn't find her on the charts
[04:52:31] tsujp: op.gg lets you search by summoner name
[04:52:53] tsujp: There might be some hack way to get summoner IDs, store them in a database, and periodically ask for their games?
[04:53:00] tsujp: that seems slow and hacky tho?
[04:53:15] Aeyrix: >she's listed as unranked
[04:53:20] Aeyrix: i think it might be broken
[04:54:24] tsujp: check the region is correct
[04:54:26] jun: has joined #RubyOnRails
[04:54:32] tsujp: also have to manually update the page
[04:57:01] dionysus69: has joined #RubyOnRails
[04:57:56] tsujp: Anyway about polling, if it were possible
[04:59:01] tsujp: Like, storing the requests and then sending them off in one big lump
[04:59:06] mices: i don't think resque_mailer is working because it waits until all emails are sent to render a page to the browser
[04:59:14] tsujp: baweaver I chose rails cos that's what I know 'best' so far, why?
[07:34:40] helpa: has joined #RubyOnRails
[07:34:45] Radar: !botsnack
[07:34:45] helpa: Nom nom. Thanks, Radar!
[07:34:47] Anubix: rly have to do helper cause of this simple one line statement?
[07:34:48] Radar: Possible netsplit.
[07:35:06] sevenseacat: yeah because its a long clunky line that can be made much simpler (and the bugs can be removed)
[07:35:11] baweaver: Anubix: more that you should keep logic out of your view
[07:35:13] Radar: !botsnack
[07:35:13] helpa: Nom nom. Thanks, Radar!
[07:35:18] Radar: ok, it's up.
[07:35:32] baweaver: there was a small exodus earlier
[07:35:50] chills42: has joined #RubyOnRails
[07:36:03] baweaver: though not really cataclysmic netsplit looking, unless they can be small too.
[07:36:06] baweaver: ACTION shrugs
[07:36:21] annlewis: has joined #RubyOnRails
[07:36:38] baweaver: Anubix: you may want to go through a Rails tutorial
[07:38:48] Anubix: baweaver: already done
[07:39:31] AxonetBE: has joined #RubyOnRails
[07:40:25] _lazarevsky: sevenseacat: what about my question. have you any idea if there's a config setting I can set?
[07:40:31] sevenseacat: I didn't read it.
[07:41:12] workmad3: has joined #RubyOnRails
[07:41:33] _lazarevsky: sevenseacat: whenever this one button is clicked, I am hiding the button and replacing it with a loading gif. however, whenever i insert the loading gif into the template, the same image is requested from the server over and over again..
[07:41:42] _lazarevsky: sevenseacat: how do I stop this one image from being requested constantly, or in other words, how do I cache it on the client side?
[07:42:02] arup_r: _lazarevsky: I think, you load it at the first time... and keep it hidden using CSS. and then show it when you want using JS ..show() method
[07:42:22] arup_r: Jquery show() method
[07:42:44] linus4: has joined #RubyOnRails
[07:42:51] arup_r: add a CSS there as { display: none; }
[07:43:05] arup_r: makes sense ?
[07:43:09] _lazarevsky: arup_r: ya I think that's the issue.. ember recompiles the templates whenever an attribute is changed
[07:43:21] _lazarevsky: and it inserts and removes and image from the template rather than hide/show it
[07:44:10] arup_r: hide and show will be done using CSS .. not anything else.. and you trigger it when to show using Jquery
[07:44:40] arup_r: Anyway I know only Rails :) .. No idea about anything else atm :(
[07:45:18] dionysus69: has joined #RubyOnRails
[07:45:19] Peg-leg: has joined #RubyOnRails
[07:46:22] pawnbox: has joined #RubyOnRails
[07:47:20] pawnbox_: has joined #RubyOnRails
[07:47:35] Anubix: heh anyway what changes if i moved logic to helper, its still escaped
[07:48:04] Radar: Anubix: !code
[07:48:04] helpa: Anubix: We cannot help you with your problem if you don't show us your code. Please put it on http://gist.github.com and give us the URL so we can see it.
[07:48:09] arup_r: Anubix: .. there is a helper.. maybe .htm_sqlf
[07:48:16] arup_r: .html_safe
[07:48:36] arup_r: checkout the API
[07:48:47] Anubix: well and it cannot be used in view?
[07:49:23] Radar: Anubix: It can be used in a view.
[07:49:34] Radar: Anubix: As the bot says, please show us your code.
[07:49:52] nickjj: has joined #RubyOnRails
[07:49:54] Anubix: Well then i dont what why i rewrited it to helper :) anyway thanks
[07:50:33] futilegames: has joined #RubyOnRails
[07:53:48] baweaver: you should probably go back over that Rails tutorial again and make sure you complete everything in it.
[07:53:48] arup_r: I installed gem ( https://github.com/adelevie/parse-ruby-client#installation) . But it is no method "create" . What wrong am I doing ? https://gist.github.com/aruprakshit/7bf609ad64f2ed6323da
[07:54:18] Anubix: baweaver: thats your answer on all problems?:)
[07:54:43] Radar: arup_r: Please read the README from the top.
[07:55:30] jsrn_: has joined #RubyOnRails
[07:55:37] baweaver: Anubix: because I'm willing to bet the mistake is something covered in a good Rails tutorial, though we can't begin to say what the mistake is without seeing the actual code, now can we?
[07:55:43] helpa: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[07:55:45] arup_r: Radar: Thanks.. I always missread ..
[07:55:57] Radar: baweaver: blood, stone, etc.
[07:56:07] arup_r: In Spree I did same mistakes lot of time :)
[07:56:30] Radar: baweaver: It's like getting blood from a stone.
[07:56:37] Anubix: baweaver: I wrote whats wrong, community anwsered html_safe and everything is fine
[07:57:05] baweaver: Radar: tag, I'm out
[07:57:06] AxonetBE: has joined #RubyOnRails
[07:57:16] Anubix: baweaver: I don't think its good idea again go throught full Rails tutorial, which learn you nothing if you dont begin creating apps
[07:57:51] baweaver: as I said, I'm out.
[07:58:09] workmad3: has joined #RubyOnRails
[07:58:18] Radar: baweaver: I'm out too.
[07:58:34] Radar: Anubix: If you refuse to read the Rails tutorial then at least read the rules.
[07:58:35] Anubix: baweaver: And this IRC is except Stack and Reddit last place, where can begginers place questions
[07:58:35] Radar: Anubix: !rules
[07:58:35] helpa: Anubix: https://gist.github.com/996779
[07:58:39] helpa: Clearly explain what is happening and create a Gist (http://gist.github.com), (formatted neatly please: http://bit.ly/1q75oia) of the code that is causing the problem you are encountering, as well as any useful output like stacktraces.
[07:58:46] helpa: Show rather than tell. Explaining your problem with code, stacktraces or errors is always preferred to explaining it with just text. Show us what's happening, rather than telling us.
[07:58:53] arup_r: people should not change the external API really..
[07:58:54] Radar: You're breaking two of the rules atm and it's super annoying tbh.
[07:59:16] Anubix: Radar: ok i am muted now ty
[07:59:22] AxonetBE: has joined #RubyOnRails
[07:59:29] Radar: gnight folks
[07:59:30] cih: has joined #RubyOnRails
[08:00:30] CheckYourSix: has joined #RubyOnRails
[08:00:37] DylanJ: Is this possible or is my design bad? I have a model, i do something in an after_commit. (I realize that it's been commited in the db at this point, the transaction is over). But if the after_commit fails, the record is removed but acts like it was rolled back. model fails with some error.
[08:01:07] DylanJ: Or to word it better. I would like the model to be removed if my after_commit raises an exception.
[08:01:19] sevenseacat: thats not what an after_commit is for.
[08:01:28] DylanJ: What's an after_commit for
[08:02:03] sevenseacat: doing stuff after the transaction is done and dusted
[08:02:10] DylanJ: I have some external service I need to talk to /after/ my record is saved in the database.
[08:02:16] sevenseacat: everything was processed successfully and happily
[08:02:22] DylanJ: But if that service is down, i'd rather the model be removed.
[08:02:31] sevenseacat: then use after_save or something, not after_commit
[08:03:01] DylanJ: but the problem is that the service sends me a message /right after/ i send a message saying hi this model with id 123 has been created.
[08:03:16] helpa: We cannot help you with your problem if you don't show us your code. Please put it on http://gist.github.com and give us the URL so we can see it.
[08:03:23] artto: has joined #RubyOnRails
[08:03:31] DylanJ: sevenseacat: this is a conceptual issue
[08:03:33] DylanJ: not a code issue
[08:03:49] sevenseacat: then I don't see your problem
[08:04:05] SteenJobs: has joined #RubyOnRails
[08:04:26] pecpec: has joined #RubyOnRails
[08:05:14] universa1: DylanJ: why not mark the newly created record as still being checked, pass the external service stuff into a background job, and either delete it or mark it as active afterwards.
[08:05:27] universa1: no need for complex logic in an after_whatever
[08:05:28] arup_r: DylanJ: You will send the id to the external servoce right ?
[08:07:41] arup_r: DylanJ: You need to send them id or something else also you can send ?
[08:10:54] tallmocha: has joined #RubyOnRails
[08:10:55] mlangenberg: has joined #RubyOnRails
[08:11:42] krisquigley: has joined #RubyOnRails
[08:11:53] mlangenberg: I???m trying to debug an issue where I assign a date attribute to an ActiveRecord object and asked ???object.changed????. This returns true instead of false when using the same date.
[08:11:58] mlangenberg: https://gist.github.com/mlangenberg/d808b28c74e63056d930
[08:12:14] mlangenberg: I???ve tracked this down to the comparison of ActiveSupport::TimeWithZone
[08:12:34] mlangenberg: Is there a way to compare two instances without converting to Fixnum?
[08:12:43] universa1: mlangenberg: sub-second precision is different
[08:13:35] universa1: mlangenberg: new instances have millisecond precision, instances from the database only have seconds, with zero milliseconds iirc
[08:13:42] mlangenberg: [34] pry(main)> [d1.to_f, d2.to_f]
[08:13:42] mlangenberg: => [1293836399.0, 1293836400.0]
[08:14:31] kitsuneyo: has joined #RubyOnRails
[08:14:54] mlangenberg: Can I remove the milliseconf precision from my date before assigning it to my AR object?
[08:15:34] dionysus69: ok I am in this situation I launched passenger with nginx and in my site.conf file I pointed app to lets say myapp.com, if I go to myapp.com it goes to rails error page says site doesnt exist but if I go to the IP where the domain is pointing to it shows me the intro nginx page, which one is correct and what am i missing? should I put site name to localhost instead of myapp.com?
[08:16:12] rakm: has joined #RubyOnRails
[08:16:12] Guest86944: has left #RubyOnRails: ()
[08:16:14] Guest86944: has joined #RubyOnRails
[08:16:16] Guest86944: has left #RubyOnRails: ()
[08:16:24] mloy: has joined #RubyOnRails
[08:16:26] universa1: mlangenberg: there is probably a "setter" like method, to remove the milliseconds, but i don't know it of the top of my head
[08:16:47] universa1: dionysus69: can you show your config? what does the error page say? did you check the application log?
[08:16:57] youngbaks: has joined #RubyOnRails
[08:17:11] jgt: has joined #RubyOnRails
[08:17:22] mlangenberg: hmm??? does DateTime even have ms precision? I cannot seem to set one in DateTime#change
[08:18:26] universa1: mlangenberg: change is a rails method ;)
[08:18:29] dionysus69: universa1: at this point I don't know how to check logs but the error is this: The page you were looking for doesn't exist. You may have mistyped the address or the page may have moved. >>>>>> this error is really correct though I didnt setup ANY routes so there are no pages in rail app at all yet, my question was that was I supposed to be welcomed by nginx static page or a rails error page?
[08:18:51] adre: has joined #RubyOnRails
[08:18:52] universa1: mlangenberg: http://api.rubyonrails.org/classes/Time.html#method-i-change
[08:19:08] dionysus69: it makes more sense to be welcomed by rails error page since passenger should be taking control instead of nginx right? I dont want users to see nginx page while going to the IP of my site
[08:19:22] universa1: dionysus69: then remove the default site.
[08:20:17] rushed: dionysus69: rack-canonical-host if you want to enforce the inbound host
[08:20:21] dionysus69: universa1: but why I am not getting the same rails error page when I go to the IP of the site? thats the source of my confusion
[08:20:32] universa1: dionysus69: because you have a default site config active
[08:20:52] universa1: dionysus69: and your site config is only for whatever domain you configured, not an ip address.
[08:20:53] dionysus69: hmm ok I guess I will remove it thanks :)
[08:21:45] dionysus69: I see thanks, that implies I could host multiple sites on this nginx
[08:22:05] mlangenberg: universa1: thx, perhas I was looking at old docs
[08:22:20] arup_r: mlangenberg: Can you call http://api.rubyonrails.org/classes/ActiveSupport/TimeWithZone.html#method-i-to_datetime method ?
[08:22:23] universa1: mlangenberg: no, the datetime method doesn't mention the usec
[08:22:31] pecpec: has joined #RubyOnRails
[08:22:52] universa1: mlangenberg: http://api.rubyonrails.org/classes/DateTime.html#method-i-change -- so you are right, it might accept it or just set it to zero ;)
[08:22:59] charliesome: has joined #RubyOnRails
[08:23:15] AxonetBE: has left #RubyOnRails: ()
[08:23:36] rushed: dionysus69: if you don't feel like dealing with all the server configuration might consider heroku.com (or another PaaS) which may let you get back to working on your application
[08:23:58] mlangenberg: universa1: Ah, to_datetime.end_of_day has 0 for usec. So passing that to ActiveRecord isn???t a change.
[08:24:22] universa1: mlangenberg: :-)
[08:26:20] noodle: has joined #RubyOnRails
[08:27:28] hephaestus_rg: has joined #RubyOnRails
[08:27:48] yfeldblum: has joined #RubyOnRails
[08:28:23] yfeldblum: has joined #RubyOnRails
[08:28:43] dionysus69: yay check this out http://smugglers.ge/
[08:28:53] universa1: why? what is it?
[08:29:08] dionysus69: rushed: I am using heroku, its just I will host my own site for fun and for some experience :)
[08:29:18] dionysus69: universa1: just my hello world site :D
[08:29:58] dionysus69: its going to be an alcohol store website :D
[08:30:11] dionysus69: al capone theme lmfo
[08:30:26] rushed: dionysus69: what could go wrong?
[08:30:54] platzhirsch: has joined #RubyOnRails
[08:32:02] rushed: dionysus69: depending where you are that sounds like a minefield~
[08:32:06] Pupeno: has joined #RubyOnRails
[08:32:17] danlucraft: has joined #RubyOnRails
[08:32:18] zemmihates: has joined #RubyOnRails
[08:32:19] machty: has joined #RubyOnRails
[08:32:51] dionysus69: what do you mean I dont understand hehe
[08:33:07] markelite: has joined #RubyOnRails
[08:33:20] skarn: has joined #RubyOnRails
[08:33:29] eggoez: has joined #RubyOnRails
[08:33:34] universa1: selling alcohol is often a very restricted business
[08:33:42] sadaf2605: has joined #RubyOnRails
[08:33:51] universa1: so you need a license, need to make sure only adults receive the packages, ...
[08:34:47] tvw: has joined #RubyOnRails
[08:35:49] dionysus69: oh I know hehe I am working for a company and we have right to do so, it wont be ecommerce website anyways just for presenting our store
[08:36:28] rushed: dionysus69: http://www.squarespace.com ~
[08:36:34] Klumben: has joined #RubyOnRails
[08:36:44] skroon: has joined #RubyOnRails
[08:37:03] tenderlove: has joined #RubyOnRails
[08:37:07] annlewis: has joined #RubyOnRails
[08:37:14] mosez: has joined #RubyOnRails
[08:37:48] dionysus69: well whole point here is to learn to do all that by myself :) rushed
[08:37:55] rushed: dionysus69: or a free tumblr for that matter... doesn't sound like something that calls for a bespoke rails app and server setup~
[08:38:16] rushed: dionysus69: you might consider that step one of learning something is knowing what it's useful for
[08:38:26] dionysus69: well, to be honest I do this for learning purposes and for fun, I know rails is overkill in this situation ^.^
[08:39:14] dionysus69: but who knows how the site might expend, later rails might become something very useful for this site even
[08:39:20] rushed: dionysus69: overkill suggests it's more of the right solution then necessary, but it's actually the wrong solution
[08:40:21] dionysus69: well ye I know I could have done same with Lamp stack installer in one click haha and then copy a theme and change the title of the site etc
[08:41:56] stannard: has joined #RubyOnRails
[08:46:10] tallmocha: has joined #RubyOnRails
[08:46:23] Peg-leg: has joined #RubyOnRails
[08:47:00] Peg-leg: has joined #RubyOnRails
[08:47:31] rubyonrails582: has joined #RubyOnRails
[08:48:05] zpe: has joined #RubyOnRails
[08:48:12] jenrzzz: has joined #RubyOnRails
[08:49:02] charliesome: has joined #RubyOnRails
[08:49:26] weckl: has joined #RubyOnRails
[08:50:24] User458764: has joined #RubyOnRails
[08:50:52] elsurudo: has joined #RubyOnRails
[08:54:45] techsethi: has joined #RubyOnRails
[08:54:58] sdwrage: has joined #RubyOnRails
[08:55:21] marr: has joined #RubyOnRails
[08:55:38] bonhoeffer: has joined #RubyOnRails
[09:01:08] arBmind: has joined #RubyOnRails
[09:05:34] tenderlove: has joined #RubyOnRails
[09:06:12] kitsuneyo: has joined #RubyOnRails
[09:07:51] sevenseacat: has joined #RubyOnRails
[09:08:16] futilegames: has joined #RubyOnRails
[09:08:50] jerin: has joined #RubyOnRails
[09:08:53] linus4: has joined #RubyOnRails
[09:09:12] jerin: Is an API backend necessary if making the frontend via angular js?
[09:09:40] arup_r: has joined #RubyOnRails
[09:09:59] rushed: jerin: necessary for what?
[09:10:32] jerin: ror + angular
[09:11:24] rushed: jerin: "an API backend" and "ror" in those two cases are potentially the same thing
[09:11:30] sevenseacat: if you want to build a rails and angular app, then yes you need rails.
[09:11:38] sevenseacat: you also need angular.
[09:12:49] chipotle: has joined #RubyOnRails
[09:17:31] jerin: If I added Active Record Associations in app/models/*.rb, will I have to manually write the migrations for that?
[09:17:53] jerin: has_one, has_many, belongs_to and all?
[09:18:17] pecpec: has joined #RubyOnRails
[09:18:17] rushed: jerin: changing the model doesn't change the database
[09:18:19] sevenseacat: you have to generate the appropriate migrations, yes.
[09:20:05] jerin: thanks. Is there some command line tool which scaffolds this for you, or is it to be done the hard way?
[09:21:19] chipotle: hey ror'ers
[09:24:50] linus4: has joined #RubyOnRails
[09:25:09] RegulationD: has joined #RubyOnRails
[09:30:47] wpp: has joined #RubyOnRails
[09:30:51] inoter: has joined #RubyOnRails
[09:31:28] inoter: has joined #RubyOnRails
[09:32:03] roshanavand: has joined #RubyOnRails
[09:36:13] mrbubbles: has joined #RubyOnRails
[09:37:41] rikkipitt: has joined #RubyOnRails
[09:38:41] rikkipitt: hey guys, i'm trying to check to see if a company name is not included in a list (~10k) of strings in a sort of fuzzy way (limited, ltd, etc)
[09:38:44] annlewis: has joined #RubyOnRails
[09:39:28] rikkipitt: i've tried a fuzzy search but it returns too many completely dissimilar results. I need a more accurate fuzzy search, anyone got any ideas?
[09:40:57] rikkipitt: i essentially need to prove that the company name doesn't appear in the list with a bit of fuzziness on the generic words...
[09:41:35] defsdoor: has joined #RubyOnRails
[09:43:43] AzaToth: has joined #RubyOnRails
[09:45:26] helpa: We're not all guys here - while you probably don't meant to be exclusive, not everybody feels that way. Maybe consider using "folks", "y'all" or "everyone" instead?
[09:47:49] htmldrum: has joined #RubyOnRails
[09:48:45] tsujp: Can I have a class in a module instantiated? See here: https://gist.github.com/tsujp/53d1315ba18ef37d7179
[09:49:11] big|bad|wolf: has joined #RubyOnRails
[09:49:14] Technodrome: has joined #RubyOnRails
[09:49:15] rikkipitt: has joined #RubyOnRails
[09:49:24] tsujp: how arup_r it's throwing errors for me
[09:49:29] Technodrome: any decent CMS solutions in rails that are mature these days?
[09:49:38] arup_r: tsujp: show the error then
[09:49:38] rikkipitt: sevenseacat: guys is unisex
[09:49:46] sevenseacat: no, it's not.
[09:50:01] tsujp: arup_r let me rewrite the code and ill get back to ya, 1-2 minutes
[09:50:12] sevenseacat: you can argue with me, or you can just accept the fact that not everyone agrees with you.
[09:50:26] arup_r: sevenseacat: that helpa command should be removed from the IRC list. Really, it is needed..
[09:50:37] mloy: I think that it is important to use gender-inclusive language, and I like the way helpa's response is written because many grow up in environments where "you guys" is seen as gender neutral. However, there's a typo that bugs me. "don't meant" :x
[09:50:38] kitsuneyo: has joined #RubyOnRails
[09:50:57] sevenseacat: mloy: haha I never noticed that
[09:51:15] arup_r: tsujp: sure
[09:51:23] rikkipitt: yeah, guys is totally acceptable in the workplace
[09:51:50] sevenseacat: rikkipit_: it's not unisex here.
[09:52:20] tenderlove: has joined #RubyOnRails
[09:52:38] rikkipitt: clearly not
[09:52:43] sevenseacat: I don't care what you do/dont do in your workplace. I do care about donating my time to people who don't even think its important to include my entire gender when talking to people.
[09:52:51] sevenseacat: rikkipit_: what did we just say?
[09:53:02] mloy: English just needs "you" to not be both the singular and plural form of "you"
[09:53:09] lipoqil: has joined #RubyOnRails
[09:53:16] mloy: I've started using "y'all" though I avoided it while growing up in the South
[09:53:33] rikkipitt: has joined #RubyOnRails
[09:53:38] stardiviner: has joined #RubyOnRails
[09:53:55] mloy: Sorry, this is super off topic d:
[09:54:11] sevenseacat: it's cool, it's a conversation we seem to need to have a dozen times a day.
[09:54:12] rikkipitt: sorry for causing any upset
[09:54:48] Shoutsid: has joined #RubyOnRails
[09:55:53] tsujp: arup_r i tried out the logical thing and it seems to work but now I don't know how to access it in my view https://gist.github.com/tsujp/53d1315ba18ef37d7179
[09:56:11] tsujp: arup_r access in view/model/controller (view only for testing purposes)
[09:56:18] Silex: has joined #RubyOnRails
[09:56:32] appcademics: has joined #RubyOnRails
[09:57:19] jenrzzz: has joined #RubyOnRails
[09:59:24] arup_r: you need to add a factory method ..
[10:00:04] mloy: rikkipitt, have you read up on soundex, metaphone, etc http://aspell.net/metaphone/
[10:00:12] infoget: has joined #RubyOnRails
[10:01:07] mloy: rikkipitt, also this gives a decent rundown of how to approach fuzzy matching company names: http://blog.match2lists.com/data-matching/b2b-data-matching-fuzzy-matching-company-names/
[10:02:09] arup_r: tsujp: add a factory method which create the object of the class. Your code needs to be restructured
[10:02:11] Balzrael: has joined #RubyOnRails
[10:02:16] arup_r: currently it is wrong
[10:02:38] tsujp: arup_r ill do some research now and get back to you if I have problems or solve it :)
[10:02:57] jgt: has joined #RubyOnRails
[10:04:02] nhhagen: has joined #RubyOnRails
[10:07:04] tenderlove: has joined #RubyOnRails
[10:07:52] arup_r: tsujp: I could give a code.. too much busy.. :(
[10:11:22] platzhirsch: has joined #RubyOnRails
[10:12:09] lucha: has joined #RubyOnRails
[10:16:21] elton: has joined #RubyOnRails
[10:18:56] tsujp: hmm nah im stuck
[10:19:53] tenderlove: has joined #RubyOnRails
[10:20:02] User458764: has joined #RubyOnRails
[10:20:07] tsujp: Hello everyone, I am using a gem which provides me access to an API easily and since this is my first time ever working with an API I think it would be better to have API connections in one place rather than being created on every action in a controller, or per model. I've created a module which will create a class containing the API connection but I am stuck on how to access the API connection class in a model https://gist.github.com/
[10:20:07] tsujp: tsujp/53d1315ba18ef37d7179
[10:20:09] xcv_: has joined #RubyOnRails
[10:20:19] rickmasta: has joined #RubyOnRails
[10:20:29] tsujp: Fairly simple for the experts here I bet but I have little idea what I am doing, and I don't even know if this is good practice
[10:20:55] DoubleMalt: has joined #RubyOnRails
[10:21:26] tsujp: Can anyone help?
[10:23:58] habitullence: Hi, how should I do seed data for a rails engine?
[10:28:29] workmad3: tsujp: personally, I'd suggest starting off with creating an API client on-demand where you need it
[10:29:01] mrbubbles: has joined #RubyOnRails
[10:29:26] tsujp: workmad3 I don't understand, all I want to do is put 'client = LoL:: ...' in a 'global' place
[10:29:33] tsujp: I'm not creating an APi, I am using one
[10:29:45] workmad3: tsujp: it'll be easier for you to grok your code, and it relieves you of the worry of figuring out how to correctly access your connections in a thread-safe way (and from how to create your connections in a way that doesn't break with a preloading, forking app server)
[10:30:14] tsujp: oh I get ya
[10:30:22] tsujp: How do I accomplish that then?
[10:30:25] workmad3: tsujp: if you really want to start out straight away with sharing your API clients <-- https://github.com/mperham/connection_pool
[10:31:12] xcv: has joined #RubyOnRails
[10:31:29] tsujp: So workmad3 I issue 'client = LoL:: ...' with this connection_pool gem and it canbe used anywhere without all the hassle I was trying to go through?
[10:31:41] workmad3: tsujp: read the docs ;)
[10:32:32] workmad3: tsujp: but mostly, yes... but `$client = ConnectionPool.new { LoL }` and then access with `$client.with{ |conn| conn.do_stuff }`
[10:34:02] tsujp: let me give this a shot right now workmad3
[10:34:07] zpe: has joined #RubyOnRails
[10:34:55] mark3: has joined #RubyOnRails
[10:35:43] tsujp: Wait workmad3 this is almost back to square one, I need this defined in an area where it can be access by all models
[10:35:45] mostlybadfly: has joined #RubyOnRails
[10:35:49] tsujp: Where should I place it?
[10:36:46] workmad3: tsujp: config/initializers/something.rb will do for creating connection pools
[10:38:39] annlewis: has joined #RubyOnRails
[10:39:57] tsujp: legend workmad3
[10:40:22] tsujp: I just have two or so questions cos I am bad at this stuff right now
[10:40:47] tsujp: the size property cannot be used for mine can it?
[10:40:56] xcv: has joined #RubyOnRails
[10:41:36] workmad3: tsujp: it can, but chances are you'll want to use 1 for that, unless you happen to know the API connection you're creating is capable of supporting multiple threads
[10:41:38] tsujp: I don't get how I could have 5 connections with the same key if you get what I am poorly trying to say
[10:42:08] tsujp: the API I am accessing is https://developer.riotgames.com
[10:42:15] stamina: has joined #RubyOnRails
[10:42:24] workmad3: tsujp: there wouldn't be any problems there, unless the API itself is limited to only support one connection for a particular API key at a time
[10:42:36] darrencauthon: has joined #RubyOnRails
[10:43:30] workmad3: tsujp: all the API client is doing is creating requests to a server with the appropriate credentials, after all... saying you can't have 5 connections with the same key is like saying your rails app can't cope with 5 requests from the same user at the same time... it doesn't (or shouldn't) care in most cases ;)
[10:43:32] jgt: has joined #RubyOnRails
[10:43:47] tsujp: Ahh now I get ya
[10:43:56] tsujp: Thanks for all this workmad3 :)
[10:45:15] blackmesa: has joined #RubyOnRails
[10:45:31] workmad3: tsujp: the main thing with using the connection pool is that if you now use a multi-threaded app server (like puma), then each thread will get a different API connection instance, which will be fine as long as the API connection doesn't do something inherently thread-unsafe, like stash per-request data in a class variable that would be shared amongst all instances of the connection class
[10:45:51] herbst: has joined #RubyOnRails
[10:46:05] bonhoeffer: has joined #RubyOnRails
[10:46:15] tsujp: all the data I am getting is either being directly displayed or sent to a database for processing by the database itself, so I think we're good there
[10:46:16] workmad3: tsujp: in that situation, by setting your pool size to 1, you can maintain some thread-safety because you'll essentially stop multiple threads from using the connection at once
[10:46:19] tsujp: using unicorn
[10:46:40] workmad3: tsujp: no, I'm talking about how the API connection itself could be implemented ;)
[10:46:46] workmad3: tsujp: nothing to do with how you're using it
[10:47:25] workmad3: tsujp: and I'm not saying it *is* implemented like that... just that before you started using a larger connection pool in a threaded server, you should double-check the implementation
[10:47:41] chills42: has joined #RubyOnRails
[10:47:48] bruno-: has joined #RubyOnRails
[10:48:08] workmad3: tsujp: but as you're using unicorn, you can set the pool size to 1 for now and just gain the benefits of the lazy-initialization and sharing of the connection
[10:48:43] tsujp: I will do, I never realised such tiny details could be so important
[10:48:51] workmad3: tsujp: i.e. you don't need to worry about whether the connection is safe to copy from the unicorn master process to worker processes
[10:48:54] tsujp: Any tips on how to check this short of asking the developer of the API?
[10:49:19] workmad3: tsujp: API docs and reading the API client code are your main sources of reference
[10:52:02] rodfersou: has joined #RubyOnRails
[10:52:55] kitsuneyo: has joined #RubyOnRails
[10:53:40] stannard: has joined #RubyOnRails
[10:56:27] Macaveli: has joined #RubyOnRails
[10:57:01] charliesome: has joined #RubyOnRails
[10:57:40] appcademics: has joined #RubyOnRails
[10:58:00] comrad: has joined #RubyOnRails
[10:58:05] roshanavand: has joined #RubyOnRails
[11:00:45] dashedstripes: has joined #RubyOnRails
[11:01:25] mlangenberg: has joined #RubyOnRails
[11:01:45] bonhoeffer: has joined #RubyOnRails
[11:01:54] tsujp: workmad3 last thing
[11:02:14] tsujp: workmad3 I need different $clients for each region, and I have those as a list in a do block
[11:02:22] tsujp: 'kr','oce', etc..
[11:02:28] linus4: has joined #RubyOnRails
[11:02:40] tsujp: is there a way to make $client have the region name appended to it?
[11:02:44] tsujp: $client_kr
[11:02:46] tsujp: $client_oce
[11:02:49] tsujp: programatically
[11:03:08] workmad3: tsujp: you could create a hash of connection pools, one for each region
[11:03:18] workmad3: tsujp: and then do $client[region].with ...
[11:04:13] workmad3: tsujp: although you're getting to the point where you may want to consider wrapping the original API client up with your own wrapper that has a more explicit understanding of these different regions
[11:04:48] tsujp: Well the only difference is literally the data it pools from, no special methods or anything other. All methods are shared between all regions
[11:05:01] tsujp: Given that much, hashing seems the way to go yeah?
[11:05:42] workmad3: tsujp: it's probably a good starting point at least ;)
[11:06:12] bonhoeffer: has joined #RubyOnRails
[11:07:19] Palsson_: has joined #RubyOnRails
[11:07:21] jerin: can someone tell me if I have to do manual migrations if I have to add Active Record Associations, or is there some command line tool to generate it?
[11:07:30] rikkipitt: has joined #RubyOnRails
[11:07:59] kitsuneyo: has joined #RubyOnRails
[11:08:56] jalnt: has joined #RubyOnRails
[11:12:46] linus4: has joined #RubyOnRails
[11:14:48] freezevee: has joined #RubyOnRails
[11:15:35] arup_r: jerin: command line is there
[11:16:02] arup_r: jerin: in your command line do `rails model` and Enter and then see the help text. Very userful
[11:16:13] mark3: has joined #RubyOnRails
[11:16:25] arup_r: I do it.. I can't remember many syntaxes.. so I use shortcuts and quick referenced
[11:16:36] arup_r: references
[11:16:42] tetraktys: has joined #RubyOnRails
[11:18:00] elsurudo: has joined #RubyOnRails
[11:18:17] ddv: jerin: rails generate migration
[11:18:20] rushed: has joined #RubyOnRails
[11:18:25] elsurudo: has joined #RubyOnRails
[11:18:42] arup_r: yes.. that one also helpful.. just type and hit enter
[11:20:17] freezevee: Is anyone using devise? I am trying to create a new user by submitting a user form to the user create action but nothing is happening = no error, no INSERT in the rails WEBrick server etc. and the action redirects back to the previous page.
[11:20:25] arup_r: me ofcourse
[11:20:26] roshanavand: has joined #RubyOnRails
[11:21:05] freezevee: this is the view https://github.com/chrisvel/ticketbox/blob/master/app/views/users/_full_form.html.erb
[11:21:13] darrenca_: has joined #RubyOnRails
[11:21:20] doerteDev: has joined #RubyOnRails
[11:22:56] Cervajz: has joined #RubyOnRails
[11:23:37] arup_r: freezevee: use f.button
[11:24:10] freezevee: arup_r: why ?
[11:24:39] arup_r: oh.. you have button_tag. I see now
[11:25:20] freezevee: arup_r: it's something strange with devise
[11:25:46] arup_r: can you check the generated HTML .. in the browser.. ? Genrally it happened.. when you have button outside the form or form inside a foem
[11:26:00] arup_r: but you have button inside.. that part is ok
[11:26:06] freezevee: After submitting I get the message "you are already signed in"
[11:26:33] rikkipitt: hey mloy, thanks for that. I was looking at soundex earlier but thanks for that article
[11:26:48] arup_r: ok. That form is for sign in ?
[11:26:57] freezevee: arup_r: and my controller is here https://github.com/chrisvel/ticketbox/blob/master/app/controllers/users_controller.rb
[11:27:04] freezevee: arup_r: no it's for creating users
[11:27:14] arup_r: well sign up then.
[11:27:19] mark3: has joined #RubyOnRails
[11:27:22] freezevee: arup_r: meaning that I log in with my devise credentials and then I want to create others
[11:27:26] arup_r: please log out.. and then try again
[11:27:57] arup_r: ok.. that is not possible..
[11:28:33] arup_r: You can use Invitation module to onboard users .. but that is different thing..
[11:28:43] freezevee: let's say you are an admin and you want to create other users
[11:28:49] universa1: freezevee: you can create users... just like you can create any other record.
[11:28:49] freezevee: why can't you do that ?
[11:28:50] arup_r: bevause devise is not for that..
[11:29:20] universa1: freezevee: you just don't use devise for it, but a controller like any other controller
[11:29:29] arup_r: universa1: While you logged in.. you will be able to access sign up page in devise?
[11:29:35] freezevee: universa1: that's why I built my own https://github.com/chrisvel/ticketbox/blob/master/app/controllers/users_controller.rb
[11:29:47] universa1: arup_r: you do not use devise provided controllers / pages.
[11:29:49] arup_r: I am not sure.. May be then I am wrong
[11:29:57] zpe: has joined #RubyOnRails
[11:29:57] universa1: freezevee: ok. what is your problem?
[11:29:59] freezevee: but it seems that the controller works ok, I 've written a spec for it
[11:30:43] universa1: freezevee: to which url does the form point? is it the one your controller is responsible for?
[11:30:44] Goliathus: has joined #RubyOnRails
[11:30:46] freezevee: in rails console, User.create!(email: "my@email.com", password: "12312345", password_confirmation: "12312345") works just fine
[11:31:09] herbst: has joined #RubyOnRails
[11:31:10] universa1: freezevee: yes. you just have a wiring problem. your code looks ok.
[11:31:16] User458764: has joined #RubyOnRails
[11:31:28] freezevee: universa1: <%= form_for(@user, :html => {:class => "ui small form", id: "myForm"}) do |f| %>
[11:31:33] universa1: freezevee: run rake routes and check who handles /users
[11:31:43] freezevee: I did that, it's this controller
[11:31:52] jerin: has joined #RubyOnRails
[11:31:58] universa1: freezevee: please add a gist with the output of rake routes
[11:32:07] freezevee: universa1: POST /users(.:format) users#create
[11:32:08] universa1: freezevee: and also gist the generated html of your form.
[11:32:44] freezevee: universa1: https://gist.github.com/chrisvel/fa7d698d22eb6de8f874 routes
[11:33:07] tallmocha: has joined #RubyOnRails
[11:33:15] universa1: freezevee: https://gist.github.com/chrisvel/fa7d698d22eb6de8f874#file-gistfile1-txt-L11
[11:33:28] universa1: freezevee: https://gist.github.com/chrisvel/fa7d698d22eb6de8f874#file-gistfile1-txt-L20
[11:33:33] universa1: routes are matched top-down
[11:33:56] universa1: freezevee: so the devise route for users takes precidence over yours.
[11:34:00] freezevee: universa1: https://gist.github.com/chrisvel/a2e0a8424d29711c2a96
[11:34:16] banister: has joined #RubyOnRails
[11:34:19] freezevee: universa1: I see
[11:34:31] freezevee: but wait a minute
[11:34:38] universa1: freezevee: so you either need to move the devise routes to another one, or yours.
[11:35:03] freezevee: universa1: something I don't understand
[11:35:22] freezevee: you refer to routes as for example user_registration_path
[11:35:26] freezevee: or user_registration_url
[11:35:38] freezevee: so they shouldn't overlap
[11:35:40] universa1: freezevee: yes. but the actual url in the browser is the same!
[11:35:45] freezevee: but the url is the same
[11:36:03] universa1: freezevee: the rails app just sees "/users" and has then to map that to a controller and action
[11:36:05] ldnunes: has joined #RubyOnRails
[11:36:11] universa1: freezevee: what name it has is irrelevant at that point.
[11:36:15] freezevee: universa1: what do you suggest ?
[11:36:21] universa1: freezevee: so you either need to move the devise routes to another one, or yours.
[11:36:22] freezevee: universa1: I can do many things
[11:37:15] FailBit: https://www.washingtonpost.com/news/post-nation/wp/2015/10/05/11-year-old-charged-with-murdering-8-year-old-after-arguing-about-puppies/?tid=sm_fb
[11:37:28] xcv: has joined #RubyOnRails
[11:37:33] freezevee: universa1: I am setting up the routes as "resources :users" and "devise_for :users"
[11:37:54] universa1: freezevee: yes. and you need to adopt one of them to have only one be responsible for /users
[11:38:06] freezevee: universa1: I can change the names of the actions inside users_controller also
[11:38:09] TPBallbag: has joined #RubyOnRails
[11:38:13] freezevee: universa1: do I need them both ?
[11:38:20] universa1: freezevee: that does not solve your problem.
[11:38:27] yekta: has joined #RubyOnRails
[11:38:32] universa1: freezevee: i don't know if you need them both. that depends on your app....
[11:38:38] krisquigley: has joined #RubyOnRails
[11:39:01] universa1: freezevee: that can either be devise (check the docs how to do that) or the resources :users one (check the routing guide, the docs on resources on how to do it there).
[11:39:09] freezevee: universa1: I mean that all I want to do is to be able to signup as a new user
[11:39:09] syath: has joined #RubyOnRails
[11:39:10] fschuindt: has joined #RubyOnRails
[11:39:20] freezevee: universa1: but also as a user to be able to add others
[11:39:33] annlewis: has joined #RubyOnRails
[11:39:33] universa1: freezevee: so you need both.
[11:39:49] freezevee: universa1: can't I post my "sub-users" data to user_registration POST /users(.:format) devise/registrations#create ?
[11:39:57] universa1: freezevee: o0
[11:40:14] freezevee: isn't it a simple form post ?
[11:40:24] freezevee: the data are the same
[11:40:29] universa1: the business logic is quite different.
[11:40:52] freezevee: I believe so
[11:41:39] roshanavand: has joined #RubyOnRails
[11:41:51] mlangenberg: has joined #RubyOnRails
[11:41:58] freezevee: finally devise/registrations# should be /register/ and not /users/
[11:42:35] Ropeney: has joined #RubyOnRails
[11:43:34] htmldrum: has joined #RubyOnRails
[11:44:01] suchness: has joined #RubyOnRails
[11:44:04] yekta: Hello, two questions (A) where are the rails docs on updating multiple records in a batch? `update_all` is not what I need, since it only updates all queried records with the same value. Instead I want to see rails documentation on updating multiple records with unique values for each record. Question (B) How can I test this in rspec? Telling ???Schedule??? to expect a update doesn???t work: https://dpaste.de/qB8O ?????Note: this cod
[11:44:05] yekta: does work, just the test is not configured correctly..
[11:44:47] suchness: a ) rails doesn't have anything to do with updating records
[11:45:07] suchness: a.5 ) I am not certain you can accomplish that without writing a specific sql query.
[11:46:18] yekta: suchness: The code in https://dpaste.de/qB8O shows how I???m accomplisning it. Yes this is Active Record specific.
[11:46:28] yekta: s/accomplisning/accomplishing
[11:47:04] suchness: Ah, you are updating them all the same way. Yeah that's possible.
[11:47:42] suchness: Sounded like you wanted to update them all at the same time with different individual attributes.
[11:47:49] universa1: but then your test doesn't actually test that it works. just that you called the methods you wanted
[11:48:45] elaptics: yekta: http://api.rubyonrails.org/classes/ActiveRecord/Relation.html#method-i-update
[11:48:48] yekta: Exactly, I want to update them all at once with different individual attributes. How could I test that?
[11:49:01] youngbaks: has joined #RubyOnRails
[11:49:12] yekta: @elaptics Yeah, that???s exactly what I???m using here: https://dpaste.de/qB8O
[11:49:33] suchness: I am saying I don't think you can do that with ActiveRecord, if you can then that's great and would like to know as well. I haven't used active record for years, that might make me switch.
[11:49:39] elaptics: yekta: yep, so what is wrong with your specs?
[11:49:56] suchness: Why don't you just query for those objects again and assert they did indeed save with the proper values?
[11:50:09] elaptics: suchness: you can do it with the update method I linked to
[11:50:21] suchness: If the values are the same as you updated them with, pass, if not, fail.
[11:50:22] yekta: suchness: because I???d rather not hit the DB, as its slower
[11:50:42] yekta: elaptics: here???s the failing specs https://dpaste.de/Gm4b
[11:50:52] suchness: Then your question isn't how do I do it, it's how do I do it without hitting the database.
[11:50:56] yekta: I.e. Couldn't find Schedule with 'id'=1 ??? thats what I???m trying to stub
[11:51:10] suchness: Wastin time
[11:51:19] suchness: elaptics: That's fantastic.
[11:52:04] yekta: elaptics: yeah, thats for the doc link ?????I was using it but couldn???t find the docs for it
[11:54:00] elaptics: yekta: take out your allow line
[11:54:15] lapide_viridi: has joined #RubyOnRails
[11:54:25] elaptics: and do you actually have a Schedule record in your test db with ids 1 and 2?
[11:54:34] nettoweb: has joined #RubyOnRails
[11:55:06] elaptics: if you want to avoid hitting db, then instead use your allow line and expect the args on update there instead of the expect
[11:55:14] yekta: elaptics: Ok, then this is the error that I get, which I was trying to avoid with teh allow line???????https://dpaste.de/JD84#L11,19
[11:55:16] chills42: has joined #RubyOnRails
[11:55:24] Moeh: has joined #RubyOnRails
[11:55:49] yekta: I tried that too, let me get you an example of where I did that, maybe you???ll notice something wrong in what I tried there, just a sec
[11:56:29] User4587_: has joined #RubyOnRails
[11:57:12] jgt: has joined #RubyOnRails
[11:57:16] yekta: elaptics: https://dpaste.de/aDaV#L6,9
[11:57:34] Moeh: What is the best practice to adjust permissions so that users can only access / edit resources that belong to them? I have a "Organization" and most of the other entities are "owned" by an "Organization", e.g. "User". Say I want to make sure that any user can only access all "Posts" that belong to the same organization that he belongs to. Is there any "rails way" to achieve this?
[11:58:21] Moeh: I could of course add before_filter for each all actions and check this condition there, but it would be lots of duplicated code.
[11:59:13] nettoweb: hello guys, I have a User, Company and Curriculum class, User has_one Company which has_one Curriculum, so Im creating the curriculum with this current_user.company.create_curriculum(params[:curriculum]). But when I try to create my curriculum, my company is being destroyd automatically, maybe because in Curriculum form I put some fields_for Company object.
[11:59:16] yekta: Moeh: I suggest checking out https://github.com/ryanb/cancan
[11:59:32] yekta: Moeh: as well as the railscast http://railscasts.com/episodes/192-authorization-with-cancan
[11:59:46] nettoweb: Im not able to create my Curriculum and update my Company object as well
[12:00:50] Moeh: yekta: Thanks, will check it out!
[12:01:40] Goliathus: has joined #RubyOnRails
[12:01:57] fschuindt1: has joined #RubyOnRails
[12:02:22] roshanavand: has joined #RubyOnRails
[12:02:37] Moeh: yekta: It hasn't been touched in two years. Do you know if it still works?
[12:02:56] arup_r: Moeh: If you think .. It is possible to do without using a Gem.. got with your own logic. Gems are more general.. There are cases .. where I saw a gem is not meeting my business need when I implemented 60% of my app using that gem. Then it is a hard time to revert
[12:02:58] bitkiller: has joined #RubyOnRails
[12:03:06] arup_r: so think before including a Gem always.
[12:03:37] spiman: has joined #RubyOnRails
[12:04:07] yekta: Moeh: I don???t use it myself, but the build is passing, so I don???t see any reason why it wouldn???t be working. Alternatively you can build your own roles/rights management, which is annoying. If I weren???t stuck with a custom built one I???d use can-can, but the transition is too difficult right now.
[12:04:33] yekta: Moeh: https://www.ruby-toolbox.com/categories/rails_authorization
[12:04:47] nya: has joined #RubyOnRails
[12:04:54] elaptics: Moeh: cancancan is the one that's currently kept up to date
[12:05:01] spiman: hello, I am using capistrano v2.3. Is it possible and/or recommended to extract my deployment recipes to a gem? Is there a good guide on getting started with creating your own gems? Thanks
[12:05:06] elaptics: Moeh: or you might want to look into pundit - which is my preference
[12:05:18] blackmesa: has joined #RubyOnRails
[12:05:33] tsujp: rails or my YAML reader isn't parsing my environment variables.. instead it's just returning the environment variable syntax as a string... https://gist.github.com/tsujp/0a14cd48cd4c61e3a28d
[12:05:37] tsujp: can anyone help or tell me why?
[12:05:51] elaptics: nettoweb: !code
[12:05:51] helpa: nettoweb: We cannot help you with your problem if you don't show us your code. Please put it on http://gist.github.com and give us the URL so we can see it.
[12:06:20] tsujp: database.yml has no problem having it's environment variables read, and setting those in api.yml to database.ymls one's aren't working either so it's definitely the YAML.load_file method
[12:06:27] elaptics: tsujp: if that's your own yaml file then you need to parse it for erb itself
[12:06:42] tsujp: how do I do that? I have no idea elaptics
[12:06:44] elaptics: tsujp: e.g. you need to run it through Erubis
[12:06:56] elaptics: tsujp: 1 sec, I'll paste the line
[12:06:58] Moeh: yekta: elaptics: Thanks for the pointers. I will check if it makes more sense to use a gem or roll my own solution.
[12:08:20] tsujp: okay elaptics
[12:08:49] elaptics: tsujp: you'll want something like YAML::load(ERB.new(File.read(File.join(Rails.root, "config/settings.yml"))).result)
[12:09:43] Goliathus: has joined #RubyOnRails
[12:10:36] freezevee: universa1: I did it and it works fine, thanks a lot !
[12:10:47] universa1: freezevee: yw :-)
[12:11:28] wethu: has joined #RubyOnRails
[12:11:45] arup_r: freezevee: So you are doing sign up.. while you are signed in ? :)
[12:11:54] universa1: arup_r: no.
[12:11:55] tsujp: elaptics this worked for me: configuration = YAML.load(ERB.new(File.read("#{Rails.root}/config/api.yml")).result)[Rails.env]
[12:11:57] tsujp: thanks elaptics
[12:11:59] freezevee: signing up others
[12:12:09] freezevee: adding users
[12:12:14] arup_r: I know.. got it..
[12:12:16] universa1: arup_r: he just creates users, like he would create a book, whatever...
[12:12:37] arup_r: that's a like a invitation .. right ?
[12:13:12] arup_r: anyway. I got it what you are doing..
[12:15:03] chills42: has joined #RubyOnRails
[12:15:19] mlangenberg: has left #RubyOnRails: ()
[12:15:23] jenrzzz: has joined #RubyOnRails
[12:15:51] nettoweb: elaptics https://gist.github.com/osnysantos/4d50d1d677cfc647bb70 with this code I get this error when trying to create curriculum: ActiveSupport::HashWithIndifferentAccess
[12:17:32] sadaf2606: has joined #RubyOnRails
[12:17:40] elaptics: yekta: sorry, I missed your gist. You only need to allow or expect. The issue is that I'm guessing you're using an up to date rspec so since you have a Schedule model then it's a verifying double so it's not mocked out and hence is calling the originals
[12:17:48] nKulo: has joined #RubyOnRails
[12:19:18] elaptics: nettoweb: what errors specifically? Gist the output of the log
[12:20:04] jkamenik: has joined #RubyOnRails
[12:20:25] nettoweb: elaptics https://gist.github.com/osnysantos/4d50d1d677cfc647bb70#file-gistfile1-txt
[12:20:34] stannard: has joined #RubyOnRails
[12:20:43] yekta: elaptics: yeah, I???m on rails 4 and rspec 3, so I need to use a double, somehow?
[12:20:58] FailBit: https://mobile.twitter.com/rechelon/status/650202732217761792
[12:22:31] jerin: I'm trying to work with devise_token_auth for user registration, attempt to sign_in says confirmation mail sent, which I obviously did not receive. How to fix this?
[12:22:39] Ergo: has joined #RubyOnRails
[12:22:52] elaptics: nettoweb: current_user.company.create = params[....
[12:23:01] elaptics: nettoweb: line 8 in gisted controller
[12:23:05] roshanavand: has joined #RubyOnRails
[12:23:28] elaptics: nettoweb: you just assigned a hash to the company association :)
[12:23:41] trautwein: has joined #RubyOnRails
[12:24:17] elaptics: FailBit: lol
[12:24:27] atomical: has joined #RubyOnRails
[12:27:03] FCser: has joined #RubyOnRails
[12:27:48] nettoweb: elaptics yes I did it because the other way (<%= f.fields_for :company, current_user.company do |company| %>) the form generated a hidden field (curriculum[company_attributes][id]) and this gives me a "Couldn't find Company with ID=2000 for Curriculum with ID="
[12:28:29] elaptics: nettoweb: you need to create the company using the params so you need to use create or build off the association
[12:28:36] nettoweb: so I tried to unlink company from curriculum and update only after created the curriculum
[12:28:52] nettoweb: elaptics company is already created
[12:29:03] elaptics: nettoweb: where?
[12:29:16] elaptics: prior to this controller?
[12:29:17] nettoweb: Im pull the fields... it's additional fields for curriculum
[12:29:30] elaptics: nettoweb: you mean on line 8? Where you're getting this error
[12:29:36] nettoweb: elaptics exactly
[12:29:56] elaptics: nettoweb: yes, am I'm telling you your line is wrong. You need to add either build or create to it
[12:30:25] nettoweb: when user signup in my websites he creates automatically his company, and tehn he can create a curriculum anytime... after
[12:30:32] elaptics: you're currently just assigning the params hash directory to the association not creating the company so now when you try to create your curriculum you're calling methods on the hash not the company association
[12:31:14] elaptics: nettoweb: so here you're actually changing an existing company attributes?
[12:31:21] nettoweb: elaptics yes
[12:31:24] kenpoint: has joined #RubyOnRails
[12:31:24] elaptics: if so, then you need to use update
[12:31:33] elaptics: and consider that it could fail
[12:31:55] nettoweb: elaptics I removed line 8 and got "Couldn't find Company with ID=2000 for Curriculum with ID=" because of that hidden field referencing the company id
[12:33:16] nettoweb: elaptics So Im creating curriculum and updating company... they are additional data
[12:34:31] IceyEC: has joined #RubyOnRails
[12:34:57] Icey: has joined #RubyOnRails
[12:34:59] rikkipitt: has joined #RubyOnRails
[12:35:53] wpp: has joined #RubyOnRails
[12:36:01] elaptics: you just need to change line 8 to use update,e.g. current_user.company.update_attributes(params[...])
[12:36:53] herbst: has joined #RubyOnRails
[12:36:53] herbst: has joined #RubyOnRails
[12:37:12] elaptics: the issue is that you weren't using, create, build or update_attributes - you were simply assigning the actual hash to company itself, not assigning the data in the hash to the company attributes
[12:39:51] pwnd_nsfw: has joined #RubyOnRails
[12:40:00] linus4: has joined #RubyOnRails
[12:40:09] annlewis: has joined #RubyOnRails
[12:41:19] fschuindt1: has left #RubyOnRails: ()
[12:41:44] fschuindt: has joined #RubyOnRails
[12:44:02] roshanavand: has joined #RubyOnRails
[12:45:31] Macaveli: Who debugs using pry and pry-remote and running pow?? Could you please list your gem versions?
[12:45:39] appcademics: has joined #RubyOnRails
[12:46:22] wpp: has joined #RubyOnRails
[12:48:33] bkulbida: has joined #RubyOnRails
[12:49:14] qejk: has joined #RubyOnRails
[12:50:00] melonstorm: has joined #RubyOnRails
[12:52:38] dllama: has joined #RubyOnRails
[12:53:13] CustosLimen: I'm having problems with passenger and gollum
[12:53:35] universa1: gollum has your ring? the one? ;)
[12:53:45] CustosLimen: yes - unfortunately ;(
[12:54:04] CustosLimen: if I just run `bundle exec gollum --port 4141` I get gollum working fine
[12:54:59] CustosLimen: if I run via passenger standalone I keep getting 404/403(due to no dir index allowed)
[12:55:46] CustosLimen: config.ru and passengerfile and everything else is here: https://gitlab.com/aucampia/gollum-wiki/tree/master
[12:56:06] Guest53: has joined #RubyOnRails
[12:56:20] Synthead: has joined #RubyOnRails
[12:56:26] krisquigley: has joined #RubyOnRails
[12:56:36] kallisti5: has joined #RubyOnRails
[12:57:03] mclee_: has joined #RubyOnRails
[12:58:01] ramortegui: has joined #RubyOnRails
[12:58:54] andersoldahl: has joined #RubyOnRails
[12:59:25] sdwrage: has joined #RubyOnRails
[12:59:52] arup_r: has joined #RubyOnRails
[13:01:53] hron84: has joined #RubyOnRails
[13:02:16] User458764: has joined #RubyOnRails
[13:03:00] hron84: I have the following snippet, but I get undefined method `assigns' http://pastie.org/10463841
[13:03:13] nya: has joined #RubyOnRails
[13:03:17] alienaut: has joined #RubyOnRails
[13:03:46] jmignault: has joined #RubyOnRails
[13:04:04] sankaber: has joined #RubyOnRails
[13:04:41] jmignault: has joined #RubyOnRails
[13:04:45] sevenseacat: has joined #RubyOnRails
[13:05:04] elaptics: hron84: it's not an instance variable
[13:05:23] elaptics: hron84: it's a method available within your it blocks
[13:05:27] hron84: elaptics: To be more precise, i tried with assigns(:users) and @assigns[:users] but neither works
[13:05:45] jmignault: has joined #RubyOnRails
[13:06:05] hron84: elaptics: so i can use it only within the block?
[13:06:13] sankaber: has joined #RubyOnRails
[13:07:27] jmignault: has joined #RubyOnRails
[13:07:52] elaptics: hron84: you should have something like it "assigns users" do; expect(assigns(:users)).not_to be_empty; end
[13:08:09] Wikiti: has joined #RubyOnRails
[13:08:30] elaptics: hron84: alternatively you can set the subject to be assigns instead so you can use your one-liners
[13:08:58] elaptics: maybe that's what you were trying to do with it as a describe argument?
[13:09:07] joshkovach: has joined #RubyOnRails
[13:09:43] PhantomSpank: has joined #RubyOnRails
[13:11:04] jerin: how do I write a migration for has_many in the migration file?
[13:11:21] jerin: I found belongs_to on the internet couldn't find has_one or has_many
[13:11:38] IFrank00: has joined #RubyOnRails
[13:11:43] elaptics: jerin: you would need to put the appropriate belongs_to on the right model
[13:12:12] arup_r: yes.. right
[13:12:29] elaptics: jerin: e.g. User has_many :posts would require that you have a user_id field on posts
[13:12:38] Macaveli: Added bounty to my SO topic for my pry-remote issues -> http://stackoverflow.com/questions/32883285/pry-remote-byebug-next-goes-into-teardown
[13:12:45] elaptics: because a post belongs_to a user
[13:14:14] arup_r: All what you need is a foreign key..
[13:14:56] voker57: has joined #RubyOnRails
[13:15:23] sevenseacat: http://guides.rubyonrails.org/association_basics.html#the-has-many-association
[13:15:28] sevenseacat: right there in the guides
[13:15:36] chills42: has joined #RubyOnRails
[13:15:54] jenrzzz: has joined #RubyOnRails
[13:18:53] jtb__: has joined #RubyOnRails
[13:21:15] habitullence: has joined #RubyOnRails
[13:21:22] mlangenberg: has joined #RubyOnRails
[13:21:32] Shoutsid: has joined #RubyOnRails
[13:24:09] jtb___: has joined #RubyOnRails
[13:24:29] nhhagen: has joined #RubyOnRails
[13:25:28] roshanavand: has joined #RubyOnRails
[13:26:40] RegulationD: has joined #RubyOnRails
[13:26:57] kitsuneyo: has joined #RubyOnRails
[13:27:09] brazenbraden: has joined #RubyOnRails
[13:27:41] alex88: has joined #RubyOnRails
[13:28:04] metalic: has joined #RubyOnRails
[13:28:46] paolodoors: has joined #RubyOnRails
[13:29:26] paulcsmith_: has joined #RubyOnRails
[13:30:19] techsethi: I folks, I am trying to chain a few methods in a model as well as will_paginate methods etc. I am conditionally checking if a user is allowed to view the appointments or not, my query is , what should be returned, if I don't want to add a class or add more query. Here is a gist for referece https://gist.github.com/techsethi/32a6c6400c31fa598ef3
[13:31:41] techsethi: please let ne know, of any pointers. i am sure there would be a better different way to accomplish this. thanks in advance
[13:32:00] devdazed: has joined #RubyOnRails
[13:32:23] Peg-leg: has joined #RubyOnRails
[13:32:45] rromanch_: has joined #RubyOnRails
[13:33:36] arup_r: mattt: Hi
[13:34:07] Peg-leg: has joined #RubyOnRails
[13:35:45] Peg-leg: has joined #RubyOnRails
[13:35:46] Klumben: has joined #RubyOnRails
[13:36:40] dstarh: has joined #RubyOnRails
[13:37:41] mattt: arup_r: howdy
[13:37:44] User4587_: has joined #RubyOnRails
[13:37:56] arup_r: mattt: pm ?
[13:38:12] symbol: has joined #RubyOnRails
[13:39:13] newdan: has joined #RubyOnRails
[13:39:52] arup_r: techsethi: return a scope ? it really depends on what you want achiveve..
[13:40:30] Technodrome: has joined #RubyOnRails
[13:40:47] antgel: has joined #RubyOnRails
[13:40:57] annlewis: has joined #RubyOnRails
[13:41:05] arup_r: But not much sure your business requirement or what you actually want to achieve..
[13:41:54] stannard: has joined #RubyOnRails
[13:42:10] linus4: has joined #RubyOnRails
[13:42:39] quazimodo: has joined #RubyOnRails
[13:42:43] stannard: has joined #RubyOnRails
[13:42:44] quazimod1: has joined #RubyOnRails
[13:45:13] roshanavand: has joined #RubyOnRails
[13:45:15] blackmesa: has joined #RubyOnRails
[13:46:25] appcademics: has joined #RubyOnRails
[13:47:27] rromanch_: has joined #RubyOnRails
[13:48:00] loc22: has joined #RubyOnRails
[13:48:19] chrisja: has joined #RubyOnRails
[13:48:22] grn: has joined #RubyOnRails
[13:49:06] Cervajz_: has joined #RubyOnRails
[13:50:51] techsethi: arup_r: basically, I want to restrict the records to a set of users, if user is not an "admin" and return all, if he is an admin. this method would be chained with others though. I am not clear what do you mean by "return a scope". pls explain
[13:51:09] darrencauthon: has joined #RubyOnRails
[13:51:38] darrencauthon: has joined #RubyOnRails
[13:52:37] infoget: has left #RubyOnRails: ()
[13:52:39] rubyonrailed: has joined #RubyOnRails
[13:53:27] arup_r: techsethi: If you want to make a query on the return value.. You need to return a object of this http://api.rubyonrails.org/classes/ActiveRecord/QueryMethods.html like.
[13:53:59] arup_r: ttyl.. need to leave.
[13:54:28] arup_r: techsethi: also this http://api.rubyonrails.org/classes/ActiveRecord/Scoping/Named/ClassMethods.html
[13:54:33] mary5030: has joined #RubyOnRails
[13:54:57] platzhirsch: has joined #RubyOnRails
[13:55:18] mary5030: has joined #RubyOnRails
[13:55:22] IFrank00: has joined #RubyOnRails
[13:55:23] dopie: has joined #RubyOnRails
[14:02:07] Stuffness: has joined #RubyOnRails
[14:02:56] zordrider: has joined #RubyOnRails
[14:03:41] rushed: has joined #RubyOnRails
[14:04:30] axl_: has joined #RubyOnRails
[14:04:44] eikood: has joined #RubyOnRails
[14:05:40] ingusmat: has joined #RubyOnRails
[14:06:21] zordrider: has left #RubyOnRails: ()
[14:11:19] podman: has joined #RubyOnRails
[14:12:04] tsujp: hey guys if I was going to implement some hooks into my postgres database should I find a way to do that through rails or do it with postgres directly?
[14:12:09] tsujp: what's the best practice here
[14:12:17] wpp: has joined #RubyOnRails
[14:12:50] umgrosscol: has joined #RubyOnRails
[14:12:57] RegulationD: has joined #RubyOnRails
[14:13:35] wpp: Hello, have the performance tests (generators etc) mentioned here http://guides.rubyonrails.org/v3.2.13/performance_testing.html been deprecated in Rails 4?
[14:14:02] siddart: has joined #RubyOnRails
[14:14:35] Stuffness: has joined #RubyOnRails
[14:14:37] wpp: Does someone have a alternative for perf testing? (esp. controller actions?)
[14:14:53] umgrosscol: has joined #RubyOnRails
[14:15:41] diegoviola: has joined #RubyOnRails
[14:16:12] A124: has joined #RubyOnRails
[14:17:07] rromanch_: has joined #RubyOnRails
[14:18:35] orikremer: has joined #RubyOnRails
[14:19:14] highcup: has joined #RubyOnRails
[14:19:42] shmoon_: has joined #RubyOnRails
[14:20:44] kitsuneyo: has joined #RubyOnRails
[14:21:41] chills42: has joined #RubyOnRails
[14:23:20] Encapsulation: has joined #RubyOnRails
[14:25:21] jtb__: has joined #RubyOnRails
[14:27:56] Guest53: has joined #RubyOnRails
[14:28:01] sarink: has joined #RubyOnRails
[14:28:38] krz: has joined #RubyOnRails
[14:29:31] idd2d: has joined #RubyOnRails
[14:29:46] hephaestus_rg: has joined #RubyOnRails
[14:31:31] stannard: has joined #RubyOnRails
[14:35:20] KorriX: Hello! I have polymorphism related question
[14:35:28] loc22: has joined #RubyOnRails
[14:35:38] KorriX: In my template i have a = render @user.profile
[14:35:58] KorriX: and user profiles are polymorphic (It can be BuyerProfile or SellerProfile)
[14:36:11] KorriX: It's in my show template
[14:36:24] KorriX: And now I'd like to render different partial in edit template
[14:36:31] kitsuneyo: has joined #RubyOnRails
[14:36:35] KorriX: but still depending on the type of my profile
[14:36:58] KorriX: I'd tried = render @user.profile, action: :edit - but it doesn't seem to work
[14:40:09] Papierkorb: Happy Safe-Heaven-No-More day to all europeans!
[14:40:36] arup_r: has joined #RubyOnRails
[14:41:05] mdel: has joined #RubyOnRails
[14:41:42] annlewis: has joined #RubyOnRails
[14:42:34] KorriX: any ideas?
[14:42:37] comrad: has joined #RubyOnRails
[14:43:47] Scientz: has left #RubyOnRails: ()
[14:43:51] tubbo: KorriX: i don't think `render @object` extends to the edit view
[14:44:04] tubbo: so not sure you can do that without providing the path to the partial
[14:44:10] Scient: has joined #RubyOnRails
[14:44:47] KorriX: tubbo: So I need to explicite match on profile_type? that's lame
[14:45:09] chills42: has joined #RubyOnRails
[14:45:22] havenwood: has joined #RubyOnRails
[14:45:59] tubbo: KorriX: well, every active_record model is also an active_model, which has this module called ActiveModel::Naming included in every class. so there's a method on both the class and instance called `model_name` that you can use to get the name of the model in different ways
[14:46:43] tubbo: you could use that model_name object to get the collection variant, which you could then use in your string to render: http://api.rubyonrails.org/classes/ActiveModel/Name.html
[14:46:47] arup_r: `render @object` will take to the show action
[14:46:58] tubbo: = render "#{@user.profile.model_name.collection}/edit" might work
[14:48:38] spiman_: has joined #RubyOnRails
[14:54:23] DmitryBochkarev: has joined #RubyOnRails
[14:58:42] annlewis: has joined #RubyOnRails
[14:59:35] Cache_Money: has joined #RubyOnRails
[15:00:22] mlangenberg: has joined #RubyOnRails
[15:02:06] Cache_Money: Is there any way I can wrap this `<h3 class="title logo-font"><span class="text-default">Example</span>.com</h3>` in a `link_to` tag?
[15:02:41] tsujp: has joined #RubyOnRails
[15:03:20] tubbo: Cache_Money: link_to takes a block
[15:03:30] Cache_Money: tubbo: ahh, okay
[15:03:32] Klumben: has joined #RubyOnRails
[15:04:16] Cache_Money: tubbo: Does this look right: `<%= link_to root_path do %><h3 class="title logo-font"><span class="text-default">Example</span>.com</h3><% end %>`?
[15:05:19] treehug88: has joined #RubyOnRails
[15:07:11] rromanch_: has joined #RubyOnRails
[15:07:21] rushed: has joined #RubyOnRails
[15:07:23] kshah: has joined #RubyOnRails
[15:07:59] tubbo: Cache_Money: you can definitely do it that way
[15:08:05] tubbo: Cache_Money: yeah that looks right
[15:08:16] Cache_Money: sweet, thanks
[15:08:17] kitsuneyo: has joined #RubyOnRails
[15:08:39] kshah: where is a good place to stick initialization code for when you???re running the code base daemonize or with a rake task but not say using a generator or the console?
[15:09:19] kshah: or really, only daemonized, I don???t have a rackup file setup yet, I haven???t launched, but perhaps config.ru then?
[15:09:46] rushed: has joined #RubyOnRails
[15:10:29] A124: has joined #RubyOnRails
[15:10:59] Fire-Dragon-DoL: has joined #RubyOnRails
[15:13:00] tubbo: kshah: config/initializers are only run on the initial app load
[15:13:58] Macaveli: has joined #RubyOnRails
[15:14:30] kshah: tubbo: yes, and they are run when I execute rails commands, which is what I don???t want
[15:14:59] kshah: I *only* want to execute the block of code if the app is going to serve requests
[15:15:59] tubbo: kshah: you could do it in a before_action method
[15:16:08] kshah: never mind
[15:16:11] yardenbar: has joined #RubyOnRails
[15:16:28] kshah: I???m warming a cache, I???ll do it in config.ru
[15:16:34] tubbo: kshah: your request doesn't make sense. :P
[15:18:13] rromanch_: has joined #RubyOnRails
[15:19:34] Guest53: has joined #RubyOnRails
[15:20:40] diegoviola: has joined #RubyOnRails
[15:20:54] artto: has joined #RubyOnRails
[15:21:49] gambl0re: has joined #RubyOnRails
[15:21:57] kitsuneyo: has joined #RubyOnRails
[15:22:02] sonofdirt: has joined #RubyOnRails
[15:22:03] hueston: has joined #RubyOnRails
[15:22:31] hueston: any rails developers from around southampton area in the UK?
[15:22:54] rushed: hueston: probably quite a few~
[15:22:58] The_Phoenix: has joined #RubyOnRails
[15:23:27] d5sx43: has joined #RubyOnRails
[15:23:36] hueston: any here? aha
[15:23:43] diegoviola: has joined #RubyOnRails
[15:24:24] rushed: hueston: you're hoping to find someone from a paticular geographic area at a random time in a global chatroom?
[15:24:42] kitsuneyo: hueston, i'm in manchester... not that close really
[15:24:48] hueston: rushed, worth a shot
[15:24:56] defsdoor: Birmingham here - closer ;)
[15:26:11] hueston: horrendously vague question here but... what is the going rate roughly for someone to do me a fast prototype of a PTC site?
[15:26:32] hueston: not including the UI and UX stuff
[15:27:01] yardenbar: has joined #RubyOnRails
[15:27:21] hueston: user clicks an ad and get paid for it
[15:27:30] hueston: but the site takes a vut
[15:27:59] rushed: hueston: maybe go do like... anything else~
[15:28:35] defsdoor: you talking your own ad service or just a drop in ?
[15:28:51] hueston: rushed, nice to see you've attempted to answer the question
[15:29:05] defsdoor: because a drop in is like 10 minutes of cutnpaste code
[15:29:10] dllama: has joined #RubyOnRails
[15:29:15] hueston: defsdoor, a site that a user will sign in to and click ads from
[15:29:47] defsdoor: you mean a click farm ?
[15:29:55] hueston: not a new idea
[15:29:56] defsdoor: good luck with that
[15:30:13] hueston: but i need a prototype of one
[15:30:35] defsdoor: people far cleverer than you or I have spent far more than we will ever dream of deploying counter measures to identify click farmers
[15:31:07] rushed: hueston: as a species we're already overworking the clicking on ads problem, and you're wallowing around in the scum end of that ecosystem... seriously go do anything else :)
[15:32:51] hueston: ok, so ignoring the methods of identifying the cheaters to the system
[15:33:12] hueston: i guess thats not a hard thing to put together
[15:33:33] kitsuneyo: how do i fix this: "xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun"
[15:33:41] kitsuneyo: when using git from terminal
[15:33:57] kitsuneyo: i just updated to el capitan, guess this problem could be related
[15:34:22] willardg: has joined #RubyOnRails
[15:34:32] appcademics: has joined #RubyOnRails
[15:35:24] shinnya: has joined #RubyOnRails
[15:35:41] tubbo: kitsuneyo: you probably have to reinstall xcode command line tools
[15:37:59] antgel: has joined #RubyOnRails
[15:38:43] _djbkd: has joined #RubyOnRails
[15:38:59] r0x0rZ: has joined #RubyOnRails
[15:39:40] mehwork: how do you make it so you don't have to 'rbenv rehash' every time you install a new command in osx? It's not even just gems, i have to do it after even commands i brew install?
[15:39:57] disgrntld: has joined #RubyOnRails
[15:40:02] Guest53: has joined #RubyOnRails
[15:42:40] kitsuneyo: has joined #RubyOnRails
[15:43:11] blackmesa: has joined #RubyOnRails
[15:43:14] mices: has joined #RubyOnRails
[15:45:34] mices: if my view has no head where do i put the stylesheet link tag do i have to add a head to the view?
[15:46:02] dideler: has joined #RubyOnRails
[15:46:05] jxpx777: has joined #RubyOnRails
[15:46:07] mices: the page is already gonna have a head from main application layout
[15:46:09] andatche: has joined #RubyOnRails
[15:46:35] rushed: mices: why do you need another stylesheet link tag?
[15:48:49] mices: originally i assumed the stylesheet link tags weren't needed for my views, then i questioned it, now i'm back to it
[15:49:25] mices: but my stylesheet effect isn't working i'm trying to set all images to the same width so i don't have to edit them in photoshop anymore
[15:50:06] mices: so in my stylesheet i just put an img{ width: 288 } but that doesn't seem to be working
[15:50:09] rushed: mices: generally there is just a link to the main stylesheet in the layout, all your css will be pulled into that
[15:50:12] tubbo: mices: that's not gonna work how you think...the images will be slightly stretched or blurred based on the dimensions of the monitor. it really is best to edit them in photoshop.
[15:50:40] tubbo: mices: that's also not how width is expressed in CSS. check out MDN (do NOT look at w3schools) for proper CSS documentation.
[15:50:56] mices: i can photoshop them just for resolution 72dpi at the resolution 1pt = 1 pixel
[15:51:35] mices: so then i know what size i'm displaying ... should work? not sure
[15:51:38] xcv: has joined #RubyOnRails
[15:52:13] rushed: mices: photoshop works with pixels
[15:52:52] mices: sorry i just needed to add px to my width values
[15:53:08] mices: someone on the web said i could leave them out he was wrong
[15:53:28] Peg-leg: has joined #RubyOnRails
[15:53:30] mices: rushed: i have photoshop 7
[15:53:38] rushed: mices: so?
[15:53:42] mices: it only has points and picas but not pixels
[15:53:45] inanepenguin: has joined #RubyOnRails
[15:53:50] rushed: mices: you are confused
[15:53:57] tubbo: it definitely does have pixels
[15:54:10] mices: photoshop->image->image size
[15:54:19] Peg-leg: has joined #RubyOnRails
[15:55:01] mices: the word pixels only appears in resolution not under width or height
[15:55:51] tubbo: mices: i thought photoshop had a different name for it
[15:55:53] tubbo: might be points?
[15:55:58] Peg-leg: has joined #RubyOnRails
[15:56:02] tubbo: old photoshop that is
[15:56:26] mices: it spilled over into my layout though
[15:56:51] tubbo: mices: you ever use Sketch? a lot of folks here at my job are liking it.
[15:57:06] mices: i dunno what it is
[15:57:12] tubbo: cheaper than photoshop and more focused on just web UX
[15:57:23] tubbo: http://www.sketchapp.com/
[15:57:51] kitsuneyo: stupid non-rails question - why does terminal always say i have mail? where is it getting this from?
[15:57:58] tubbo: kitsuneyo: your Maildir
[15:58:03] Scriptonaut: has joined #RubyOnRails
[15:58:27] kitsuneyo: but i don't have any new mail
[15:58:36] tubbo: kitsuneyo: something (probably cron) dropped a mail in there saying there was an error. you been using crontab recently/
[15:58:55] pawnbox: has joined #RubyOnRails
[15:59:25] DmitryBochkarev: has joined #RubyOnRails
[15:59:32] annlewis: has joined #RubyOnRails
[16:00:28] herbst: has joined #RubyOnRails
[16:00:49] kitsuneyo: it's an undelivered mail notification from march
[16:03:19] krz: has joined #RubyOnRails
[16:03:56] riotjones: has joined #RubyOnRails
[16:03:56] mehwork: how do you make it so index actions are routed to by default? So i can just go to /foo rather than /foo/index ?
[16:04:29] rushed: mehwork: are you using resources? that is the default
[16:06:11] towski_: has joined #RubyOnRails
[16:08:21] mices: you dont have to make it that way it already is
[16:09:01] mices: unless ...
[16:10:27] metalic: has joined #RubyOnRails
[16:12:10] htmldrum: has joined #RubyOnRails
[16:13:07] Lightsword: has joined #RubyOnRails
[16:14:01] Lytol: has joined #RubyOnRails
[16:16:56] mehwork: it's saying No route matches [GET] "/welcome" by default
[16:17:19] inanepenguin: has joined #RubyOnRails
[16:17:19] mehwork: even though i ran: rails g controller welcome index
[16:17:49] rushed: mehwork: rails g controller doesn't add any routes
[16:18:11] mehwork: rushed: it did though. It added get 'welcome/index
[16:18:46] [Butch]: has joined #RubyOnRails
[16:18:53] mehwork: do i have to make it get welcome#index instead
[16:19:20] mehwork: that didn't work
[16:19:50] symbol: has joined #RubyOnRails
[16:19:53] jerin: has joined #RubyOnRails
[16:19:56] mehwork: root 'welcome#index' makes it so going to http://myapp.dev shows the index controller fine though
[16:20:33] mehwork: but i want http://myapp.dev/welcome to do the same
[16:20:42] zhkirill: has joined #RubyOnRails
[16:20:45] xcv: has joined #RubyOnRails
[16:20:46] ritic: has joined #RubyOnRails
[16:21:08] mehwork: i'm using the Pow web server, so maybe it's the problem not rails?
[16:21:30] rushed: mehwork: get 'welcome' => 'welcome#index'
[16:21:46] rushed: mehwork: http://guides.rubyonrails.org/routing.html
[16:21:50] ritic: i've got a params.permit question if anyone is available...
[16:21:50] mehwork: nope, rails s said the same thing
[16:22:43] mehwork: that worked, thanks rushed
[16:22:57] patrick_star: has joined #RubyOnRails
[16:23:02] ericjphillips: has joined #RubyOnRails
[16:23:06] krisquigley: has joined #RubyOnRails
[16:23:21] pawnbox: has joined #RubyOnRails
[16:24:37] mehwork: so i guess i put that on top of the other route so i can go to both /welcome and still go to /welcome/index
[16:26:02] fragamus: has joined #RubyOnRails
[16:26:08] cschneid_: has joined #RubyOnRails
[16:26:20] dici: has joined #RubyOnRails
[16:26:30] mehwork: also i'm now reading that this is supposed to be better: resources :welcome
[16:26:49] SaKi_KnIn: has joined #RubyOnRails
[16:26:55] mehwork: and to not worry about making welcome/index work
[16:27:03] EminenceHC: has joined #RubyOnRails
[16:27:31] rushed: mehwork: "rushed: mehwork: are you using resources? that is the default"
[16:27:47] ericjphillips: has joined #RubyOnRails
[16:28:06] kitsuneyo: i'm just wondering, do you guys keep your gems up to date? or do you stick with a version you know works, in case something breaks?
[16:28:38] mehwork: rushed: i'm a noob and had no idea what that meant :p
[16:28:42] arup_r: has joined #RubyOnRails
[16:28:54] rushed: mehwork: "rushed: mehwork: http://guides.rubyonrails.org/routing.html"
[16:29:00] mehwork: i'm reading it, thanks
[16:29:54] mehwork: kitsuneyo: i think as with any web stack, most production servers keep their crap way out of date just so it 'works', even if there's security issues. Some people have more resources to experiment and keep things updated. IOW: it depends
[16:29:59] rushed: kitsuneyo: generally you need to dedicate some time to keeping things up to date in the rails ecosystem
[16:30:34] Maletor: has joined #RubyOnRails
[16:31:15] kitsuneyo: two good answers... i always try to keep up to date cos i like having the newest versions and i'm always prepared for things to break
[16:31:33] mehwork: web developers (if i'm generalizing) care more about up time than security. We're like "don't tell anyone the titanic just hit a glacier because they might jump overboard. Let's let them sink with the ship instead" as if that's somehow better
[16:31:35] kitsuneyo: i was just wondering if that's the right approach, i guess it's fine
[16:31:40] mehwork: but i digress
[16:31:45] User458764: has joined #RubyOnRails
[16:32:04] kitsuneyo: easy to believe, mehwork
[16:32:17] ngscheurich: has joined #RubyOnRails
[16:32:24] rushed: kitsuneyo: time will beat some of that out of you eventually, hopefully you don't swing too far to the other side :)
[16:32:56] jenrzzz: has joined #RubyOnRails
[16:33:06] kitsuneyo: probably, right now i'm still learning :)
[16:33:28] mehwork: actually, i blame (or praise) web develment managers more, since it's usually them making the call to update or not
[16:34:00] ellisTAA: has joined #RubyOnRails
[16:34:01] Pumukel: has joined #RubyOnRails
[16:34:01] mehwork: almost every boss i've worked for has said "let's not worry about that right now" to an entire team saying "think we should update"
[16:34:23] mehwork: apparently i don't know how to digress, let me try again
[16:34:52] jerin: has joined #RubyOnRails
[16:34:53] hardtail: has joined #RubyOnRails
[16:35:02] ritic: imo, you should be using the most current versions, testing them first locally, then stage, then roll to prod
[16:35:09] smathy: has joined #RubyOnRails
[16:35:20] mehwork: yeah, just like with anything
[16:35:30] glundgren: has joined #RubyOnRails
[16:35:40] glundgren: hey guys! how are you? :)
[16:35:46] ritic: the place i left is still using ruby 1.8.7 in prod
[16:35:49] nettoweb: has joined #RubyOnRails
[16:36:02] tubbo: lol ritic same
[16:36:04] mehwork: it's funny how people will update their web design constantly, to keep it up to date, meanwhile their backend is like 6 years old
[16:36:07] tubbo: so glad to get out of there
[16:36:15] glundgren: collection_check_boxes, someone knows how to persist the state if validation fails?
[16:36:32] glundgren: tried everything here, nothing works
[16:36:36] mehwork: lipstick on a pig
[16:36:37] tubbo: mehwork: what do you think generates more sales, an impeccably-engineeered backend system or a constantly-changing frontend?
[16:36:45] ritic: any have a moment for a strong params question?
[16:36:47] ellisTAA: when my users choose a time in a form, that time has a date with it ??? how do ii make it so there is no date, and i just get a time?
[16:36:58] mehwork: tubbo: it's startup mentality, save money while appearing relevant
[16:37:09] glundgren: EllisTAA: if ou pass only the hour, it assumes the current date
[16:37:13] tubbo: it's money-driven development :P
[16:37:16] A124: has joined #RubyOnRails
[16:37:17] mehwork: where 'saving' money = wasting in on stupid things
[16:37:26] ellisTAA: glundgren: well is there a way to only get the time?
[16:37:42] mehwork: like flying everyone to hawaii every 6 months
[16:37:49] ellisTAA: glundgren: because when i display the time, the date shows up
[16:37:58] tubbo: mehwork: wat? i wanna work for that company!
[16:38:02] glundgren: EllisTAA: value: date.strftime('%H:%m')
[16:38:12] BinaryMaster: has joined #RubyOnRails
[16:38:16] mehwork: tubbo: you can't, they ran out of money because people stopped funding them when they found out
[16:38:32] tubbo: well they had the right idea
[16:38:36] ellisTAA: glundgren: that???s weird i thought i wrote that??? thanks
[16:39:01] glundgren: collection_check_boxes, someone knows how to persist the state if validation fails?
[16:39:41] glundgren: it doesnt seem to have any way to persist the state of the checboxes
[16:39:45] glundgren: is that true?
[16:39:56] mehwork: tubbo: actually, breaking news. A chinese company is buying them. Bad news is they're converting it to a java shop
[16:40:25] The_Phoenix1: has joined #RubyOnRails
[16:40:25] fschuindt1: has joined #RubyOnRails
[16:40:47] tubbo: mehwork: eh, i'd deal with java if i could go to hawaii every 6 months
[16:40:56] tubbo: could be a lot worse, could be object pascal
[16:41:03] kitsuneyo: i'm using the countries gem to make a conditional country/state select form, and I think i know how to do it. but i wonder what is the point of the countries_select gem? why not jusy use countries? seems like everyone uses this gem.
[16:41:22] mehwork: tubbo: i didn't say where in Hawaii. For the sake of still appearing 'frugal', they're having everyone stay an hour from the beach in a bad part of town in a really slummy hotel.
[16:41:30] kitsuneyo: sorry, country_select
[16:41:59] glundgren: is it ok to make the question more than two times here?
[16:42:08] mehwork: yeah sorry glundgren
[16:42:19] zhkirill: has joined #RubyOnRails
[16:42:20] kitsuneyo: i'd still love to go to a crappy part of hawaii
[16:42:31] glundgren: mehwork: no probs, hehe
[16:42:36] glundgren: collection_check_boxes, someone knows how to persist the state if validation fails?
[16:43:11] smathy: kitsuneyo, it used to be part of Rails and was pulled out into a gem, people keep using it because habit.
[16:43:35] ellisTAA: anyone know why when i use time_select, the hour shows up on one line, then the minutes show up below the hour?
[16:43:59] pawnbox: has joined #RubyOnRails
[16:44:04] kitsuneyo: thanks smathy. if i want country and state then i can't use country_select can i? i gotta use countries... or carmen which i think is not being maintained any longer
[16:44:23] camilasan: has joined #RubyOnRails
[16:44:33] smathy: EllisTAA, CSS.
[16:44:41] kitsuneyo: nevermind, i know the answer
[16:44:47] smathy: kitsuneyo, correc :)
[16:45:04] kitsuneyo: gotta go, thanks for the chat and advice as always :D
[16:46:17] willardg: has joined #RubyOnRails
[16:46:31] ellisTAA: smathy: so the default is to show up on seperate lines?
[16:46:44] willardg: has joined #RubyOnRails
[16:46:52] smathy: EllisTAA, I don't think so, it'll depend on your CSS.
[16:47:19] mlangenberg: has joined #RubyOnRails
[16:47:30] lalalaaa: has joined #RubyOnRails
[16:48:26] Stuffness: has joined #RubyOnRails
[16:48:39] arup_r: glundgren: you got the answer ? :)
[16:49:05] inanepenguin: has joined #RubyOnRails
[16:49:05] glundgren: arup_r: do you kow how to do it?
[16:49:09] arup_r: well.. we have restore_attributes method.. check it out
[16:50:01] arup_r: so if validation fails.. restore it, and reload the page by doing redirect_to :back
[16:50:05] arup_r: or whatever
[16:50:07] glundgren: hmm, actually i have the params with the ids checked
[16:50:14] smathy: EllisTAA, so definitely no, the default is to just output <select> : <select>
[16:50:21] appcademics: has joined #RubyOnRails
[16:50:22] glundgren: arup_r: im using mongoid
[16:50:26] Technodrome: has joined #RubyOnRails
[16:50:47] fschuindt2: has joined #RubyOnRails
[16:51:04] glundgren: doesnt seem to have an option
[16:51:15] glundgren: to pass the state of the checkbox
[16:51:33] glundgren: its so wrong, that i think I am wrong, you know
[16:51:43] taylorwu: has joined #RubyOnRails
[16:52:07] arup_r: there is a way, but need to see how the page is getting loaded/requested from the server
[16:53:36] smathy: glundgren, the method you provide will be called to get an array of values, and the matching checkboxes will be checked.
[16:54:03] greengriminal: has joined #RubyOnRails
[16:55:35] zhkirill: has joined #RubyOnRails
[16:55:36] Shoutsid: has joined #RubyOnRails
[16:56:26] DmitryBochkarev: has joined #RubyOnRails
[16:56:26] glundgren: smathy, https://gist.github.com/glundgren/41a347eb49c48b7de0ea
[16:56:53] xcesariox: has joined #RubyOnRails
[16:57:42] lalalaaa: has joined #RubyOnRails
[16:58:22] xcesariox: has joined #RubyOnRails
[16:58:34] smathy: glundgren, right, so @dependent.dependent_id will be called, and the checkboxes and those with corresponding values will be checked.
[16:58:42] roshanavand: has joined #RubyOnRails
[16:58:46] Lincee: has joined #RubyOnRails
[16:58:48] rakm: has joined #RubyOnRails
[16:59:24] Lytol: has joined #RubyOnRails
[16:59:27] glundgren: smathy: i didnt get it :/ where i write it?
[17:00:08] smathy: glundgren, I'm not telling you what to write, I'm explaining the issue here.
[17:00:18] annlewis: has joined #RubyOnRails
[17:00:35] The_Phoenix: has joined #RubyOnRails
[17:01:10] fschuindt3: has joined #RubyOnRails
[17:01:21] dllama1: has joined #RubyOnRails
[17:02:06] hephaestus_rg: has joined #RubyOnRails
[17:04:17] smathy: glundgren, read the docs http://devdocs.io/rails/actionview/helpers/formoptionshelper#method-i-collection_check_boxes - it says: "The value returned from calling method on the instance object will be selected."
[17:04:47] riotjones: has joined #RubyOnRails
[17:06:00] fschuindt4: has joined #RubyOnRails
[17:06:58] ericjphillips: has joined #RubyOnRails
[17:08:27] petricore: has joined #RubyOnRails
[17:09:19] roshanavand: has joined #RubyOnRails
[17:09:21] sanjayu: has joined #RubyOnRails
[17:10:30] arooni: has joined #RubyOnRails
[17:10:38] roshanavand: has joined #RubyOnRails
[17:11:28] Guest53: has joined #RubyOnRails
[17:11:58] dideler13: has joined #RubyOnRails
[17:12:03] Stancez: has joined #RubyOnRails
[17:12:17] artto: has joined #RubyOnRails
[17:13:20] jerin: has joined #RubyOnRails
[17:14:03] roshanavand: has joined #RubyOnRails
[17:14:33] jerin: If I'm creating an API with token based authentication with rails, is it okay for query requests to be GET?
[17:15:13] smathy: jerin, as long as they also check the token.
[17:16:04] triptec: has joined #RubyOnRails
[17:16:21] C0L0R: has joined #RubyOnRails
[17:16:28] diego4: has joined #RubyOnRails
[17:16:52] moeabdol: has joined #RubyOnRails
[17:16:59] jerin: 'they' refers to?
[17:17:38] smathy: You methods handling your GET requests.
[17:17:49] a1fa: how do you prevent active-record from going into infinitive .save loop? i have a a model, that needs to re-save the record after save, with some massaging.
[17:19:07] tubbo: a1fa: why not just do whatever you're gonna do before_save rather than after_save, and let the save() method actually handle, you know, saving :)
[17:19:13] krisquigley: has joined #RubyOnRails
[17:19:26] diego4: has joined #RubyOnRails
[17:19:37] a1fa: tubbo: but if before_save calls another .save to the same record, am I asking for trouble?
[17:19:54] tubbo: a1fa: yeah, i mean what sense does that make right?
[17:19:55] smathy: a1fa, but don't call the other save, just update the attribute and *the* save will save the record.
[17:20:03] a1fa: i got it
[17:20:11] rubyonrailed: has joined #RubyOnRails
[17:20:14] diego4: has joined #RubyOnRails
[17:20:37] a1fa: hm.. may be tricky, because i am calling the same function from another model to update this model as well
[17:21:34] tubbo: a1fa: !gist the code you're working with
[17:21:34] helpa: a1fa: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[17:23:18] a1fa: rhizome: i had to google that.. :(
[17:23:26] jahpereira: has joined #RubyOnRails
[17:24:06] ellisTAA: is there a way to find the time based on the zone with Time?
[17:24:08] moeabdol: has joined #RubyOnRails
[17:24:35] jahpereira: I have a rather ???trivial??? question which I can???t seem to solve
[17:25:03] smathy: EllisTAA, Time.current
[17:25:07] jahpereira: I am using jsonb type for one of my column???s type and it returns this to my view: {"vehicle_category"=>{"name"=>"Category", "value"=>"Ligeiro Particular"}}
[17:25:26] jahpereira: but no matter what I do, I can???t seem to find the way to retrieve the value ???Category???
[17:25:26] jtb__: has joined #RubyOnRails
[17:25:27] ellisTAA: smathy: but i want to find the time in etz or ptz
[17:25:38] smathy: EllisTAA, Time.now
[17:25:41] ellisTAA: can i just pass in the time zone? i can???t find anything on line
[17:25:50] smathy: Oh, I see what you're talking about.
[17:25:51] symbol: has joined #RubyOnRails
[17:26:06] jahpereira: the column's name is covariates so I expected risk.covariates["vehicle_category"]["name"] to retrieve "Category" but it returns nil error
[17:26:32] jahpereira: however risk.covariates[???vehicle_category???] retrieves {"name"=>"Category", "value"=>"Ligeiro Particular"} as expected
[17:26:38] jahpereira: can anyone point me out in the right direction please?
[17:27:27] jhn: has joined #RubyOnRails
[17:27:27] smathy: EllisTAA, http://devdocs.io/rails/dateandtime/zones#method-i-in_time_zone
[17:28:30] jahpereira: has left #RubyOnRails: ()
[17:28:30] TheNet: has joined #RubyOnRails
[17:28:30] blackmesa: has joined #RubyOnRails
[17:28:51] jahpereira: has joined #RubyOnRails
[17:29:20] jahpereira: what do u think?
[17:29:31] arup_r: I am reading it.. :)
[17:29:47] CDunce: has joined #RubyOnRails
[17:30:10] n008f4g_: has joined #RubyOnRails
[17:30:34] smathy: jahpereira, !gist your code and console session showing this nil error.
[17:30:34] helpa: jahpereira: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[17:30:40] a1fa: tubbo: i just moved function call to the controller, after successful update; that did it for me
[17:30:43] arup_r: yes.. and migration too
[17:31:07] ellisTAA: smathy: cool thanks. so when i set Time.zone = ???Hawaii??? why is that when i run Time.now it gives me my actual time instead of hawaiis time?
[17:31:49] jahpereira: I am afraid there is not much to show
[17:32:02] smathy: EllisTAA, because that's how it works.
[17:32:52] ellisTAA: smathy: thanks
[17:32:55] jahpereira: basically what I would like to validate with you guys is whether {"vehicle_category"=>{"name"=>"Category", "value"=>"Ligeiro Particular"}} seems good (it is stored in the database so I guess it was validated by rails)
[17:33:56] jahpereira: in the database there are no ???=>??? but ???:??? instead
[17:34:06] ritic: i've got a model Profile with:
[17:34:08] mlangenberg: has joined #RubyOnRails
[17:34:23] jahpereira: but when I print in the view Rails converts ???:??? to ???=>???
[17:34:26] ritic: has_many :children, :class_name => 'Profile', :foreign_key => 'parent_id', :dependent => :destroy
[17:34:26] ritic: belongs_to :parent, :class_name => 'Profile'
[17:35:01] dllama: has joined #RubyOnRails
[17:35:03] ritic: each has a guid column
[17:35:09] jahpereira: so my question: what type is {"vehicle_category"=>{"name"=>"Category", "value"=>"Ligeiro Particular"}} ? A hash? A mixture of hash and json?
[17:35:22] otherj: has joined #RubyOnRails
[17:35:39] jahpereira: so that I can find a way to google how to get the ???name??? value
[17:35:41] smathy: jahpereira, in order to answer all your questions we need to see your code and/or console session. We have no idea what that {"vehicle_category"=>{"name"=>"Category", "value"=>"Ligeiro Particular"}} is, it's just text here in IRC, and your comment suggests that it doesn't represent hash as it appears to be.
[17:35:43] arup_r: jahpereira: => is Ruby thing, in DB it is a JSON
[17:35:45] ritic: i have the guid for the parent, but each is linked by the "parent_id"
[17:35:53] arup_r: so the syntax is ok
[17:36:05] ritic: how do i query via activerecord with the parent_guid?
[17:36:26] ritic: without using straight sql
[17:36:34] arup_r: It might happen also your column is not JSONB .. a text field :)
[17:36:43] FCser: has joined #RubyOnRails
[17:37:06] arup_r: ritic: show models.. and what association you have
[17:37:51] ritic: single model 'Profile' with parent and children associations via 'parent_id'
[17:38:28] jahpereira: smathy: I can paste to gist but believe me when I say that the effort to paste everything there will not hold positive value since it probably really is something trivial
[17:38:35] ritic: arup_r: posted actual association lines above..
[17:38:44] cnk: has joined #RubyOnRails
[17:38:47] Pharaoh2: has joined #RubyOnRails
[17:39:14] RockLee: has joined #RubyOnRails
[17:39:24] htmldrum: has joined #RubyOnRails
[17:39:30] EminenceHC: has joined #RubyOnRails
[17:39:34] ritic: arup_r: ideally, what i'd like to do is "where(:parent_guid => 'PARENT_GUID')"
[17:39:35] andersoldahl: has joined #RubyOnRails
[17:39:39] jahpereira: I just inserted a value in my table which has 1 column names ???covariates??? and I inserted this value { a: { b: ???value1??? , c: ???value2??? } }
[17:39:41] arup_r: parent.children.where(..)
[17:39:44] ritic: is that possible?
[17:40:17] arup_r: try in the console.. and see. But possible
[17:40:19] yaymukund: has joined #RubyOnRails
[17:40:21] jahpereira: exactle like that without apostrophes in any of the keys
[17:40:33] rubyonra_: has joined #RubyOnRails
[17:40:53] ritic: arup_r: what i meant is is this possible: "where(:parent_guid => 'PARENT_GUID')"?
[17:40:57] arup_r: jahpereira: show the examples you ujust tried in console using a gist
[17:41:17] arup_r: in which model the column belongs to ?
[17:41:21] RockLee: has joined #RubyOnRails
[17:41:27] ritic: arup_r: what would i need to do in the model to do that?
[17:41:29] youngbaks: has joined #RubyOnRails
[17:41:45] arup_r: can you do one thing..?
[17:41:51] nhhagen: has joined #RubyOnRails
[17:42:12] arup_r: open console and and type.. Parent.column_names and Child.column_names
[17:42:31] smathy: jahpereira, well if it's exactly like that then the ??? and ??? quotes probably messed something up.
[17:42:32] arup_r: and let me show what fields are where
[17:43:19] nhhagen: has joined #RubyOnRails
[17:43:36] mlangenberg: has joined #RubyOnRails
[17:43:43] havenwood: has joined #RubyOnRails
[17:44:13] Technodrome: is there any good rails cms that is mature?
[17:44:19] jahpereira: smathy: https://gist.github.com/jahpereira/4cf97b3a5fa853da62da
[17:45:25] jahpereira: so basically risks.covariates[???a???] shows this { ???b??? => ???value1??? , ???c??? => ???value2??? }
[17:45:27] ktchup: has joined #RubyOnRails
[17:45:53] smathy: jahpereira, a good start, and now add the console session showing that risk.covariates["vehicle_category"]["name"] doesn't work.
[17:46:06] KinderSpiel: has joined #RubyOnRails
[17:46:23] smathy: jahpereira, risks.covariates will be undefined method, because covariates needs to be on an individual risk, not the collection of risks
[17:46:23] otherj: anyone know of a gem that helps determine if things fall in an arbitary time segment? like "records created between some date and a year from them on an anual bassis"
[17:46:26] jahpereira: but risks.covariates[???a???][???b???] displays ???undefined method `[]' for nil:NilClass???
[17:46:36] jahpereira: yes yes sorry
[17:46:38] jahpereira: I meant risk
[17:46:49] smathy: jahpereira, yeah, which is why I keep asking for the actual console session.
[17:46:50] jahpereira: as you can see in my gist I used risk (singular)
[17:47:23] ktchup: has joined #RubyOnRails
[17:47:26] rhizome: otherj: isn't that math? like statistics?
[17:47:34] smathy: jahpereira, you are a human being, transposition errors are to be expected, so we need those minimized by you running actual code in an actual rails console, and then copying/pasting that console session into your gist.
[17:47:49] jahpereira: by console session you mean the raise error? stack trace?
[17:47:50] ritic: parent.attributes.keys => ["id", "name", "created_at", "updated_at", "type", "guid", "parent_id"]
[17:47:50] ritic: child.attributes.keys => ["id", "name", "created_at", "updated_at", "type", "guid", "parent_id"]
[17:48:06] ritic: arup_r: ^^
[17:48:14] otherj: I would guess more like accounting. the goal would sort of be like "records created between january 15 and a year from then every year". almost like a fiscal year idea i guess?
[17:48:26] smathy: jahpereira, no, I mean run `rails console` and grab a risk object like: risk = Risk.first and then run the code you say gives you the nil.
[17:48:34] mlangenberg: has joined #RubyOnRails
[17:48:44] ritic: arup_r: they're the same. the only difference is that for the parent, parent_id is null
[17:48:48] rhizome: otherj: that sounds different
[17:48:52] jahpereira: let me try that
[17:48:56] andersoldahl: has joined #RubyOnRails
[17:49:16] ritic: arup_r: for the child, parent_id is the integer id of the parent
[17:49:45] jenrzzz: has joined #RubyOnRails
[17:50:11] smathy: otherj, it's not really complex enough to require a gem for, segmenting your data by date is a very simple process.
[17:50:16] ritic: arup_r: i'm wanting to make parent_guid available to search on
[17:50:22] qejk: has joined #RubyOnRails
[17:50:24] ellisTAA: irb is saying zone is an undefined method for Time class ???
[17:50:33] otherj: ok. well I'm sort of struggling to even explain it :P
[17:50:56] jahpereira: strange enough
[17:51:09] otherj: I guess I'm really just tying to figure out how to specify a sort of 'fiscal year' and then figure out stuff based on the current period
[17:51:19] jahpereira: in console it returns ???Category??? has expected or in the example it returns ???value1???
[17:51:25] otherj: seems difficult to google unless I want to find out about menstruation apps
[17:51:47] jahpereira: but in my view it returns an error
[17:51:52] jahpereira: ok now I am seriously confused
[17:51:54] simplyianm: has joined #RubyOnRails
[17:51:57] jahpereira: I runned the exact same code
[17:52:02] havenwood: has joined #RubyOnRails
[17:52:19] chouhoul_: has joined #RubyOnRails
[17:52:41] jahpereira: got it to work
[17:53:39] cac: has joined #RubyOnRails
[17:54:05] ellisTAA: Does anyone else get ???zone is not a method for time class??? when they run Time.zone = 'Hawaii'
[17:54:38] jahpereira: thank you guys
[17:54:46] jahpereira: it had nothing to do with json
[17:55:04] jahpereira: I missed an unless risk.covariates.blank? statemente
[17:55:14] jahpereira: because some risks do not have covariates
[17:55:26] jahpereira: thus returning nil
[17:57:08] tubbo: EllisTAA: i think it needs to be Time.new.zone
[17:57:20] blackmesa: has joined #RubyOnRails
[17:57:34] chouhoulis: has joined #RubyOnRails
[17:57:38] baweaver: has joined #RubyOnRails
[17:58:35] baweaver: has joined #RubyOnRails
[17:59:24] ellisTAA: tubbo: that didn???t work, but thanks
[17:59:44] inanepenguin: has joined #RubyOnRails
[17:59:45] tubbo: EllisTAA: are you using this within a rails app or just a ruby app?
[17:59:48] tubbo: ruby program*
[18:00:13] tubbo: EllisTAA: if ActiveSupport isn't loaded, you won't be able to use Time.zone
[18:00:49] ellisTAA: tubbo: oh damn thanks
[18:01:13] FailBit: I have never needed app code to know the client timezone
[18:01:24] FailBit: I let the JS take care of that :V
[18:01:48] FailBit: but yeah I can see why that might be a problem
[18:02:59] umgrosscol: has joined #RubyOnRails
[18:04:09] symbol: has joined #RubyOnRails
[18:04:24] agit0: has joined #RubyOnRails
[18:05:23] havenn: has joined #RubyOnRails
[18:05:32] riotjones: has joined #RubyOnRails
[18:07:03] andersoldahl: has joined #RubyOnRails
[18:08:31] baweaver: has joined #RubyOnRails
[18:09:04] safety_cut: has joined #RubyOnRails
[18:09:13] User458764: has joined #RubyOnRails
[18:09:59] tubbo: yeah the way you're supposed to do it is store everything as UTC
[18:14:41] FailBit: which I do
[18:14:47] FailBit: so it's not a problem
[18:16:03] smathy: jahpereira, great to hear, and we often find this happens - just in the process of preparing a gist people discover their own error.
[18:17:35] bricker: has joined #RubyOnRails
[18:17:38] jahpereira: smathy: cool
[18:18:22] tsujp: has joined #RubyOnRails
[18:19:02] smathy: tubbo, FailBit, I use clients' timezones on the server all the time for doing things like sending emails at the time of the day they're more likely to see them arrive.
[18:19:20] tsujp: hey guys I have a fairly complex query on a database and if it returns no result I need to then make another query, how can I write this without using the complex query twice?
[18:19:32] smathy: (but, I don't ask non Rails questions in Rails IRC channels, that's *MY* secret to success)
[18:19:35] nzst: has joined #RubyOnRails
[18:19:43] tsujp: if complex query A is empty then run complex query B, anyone know a nice way of writing that?
[18:19:47] smathy: tsujp, !code please
[18:19:47] helpa: tsujp: We cannot help you with your problem if you don't show us your code. Please put it on http://gist.github.com and give us the URL so we can see it.
[18:19:59] FailBit: @@class_vars are evil
[18:20:26] nzst: Hi, when is rails 5 slated to release?
[18:20:37] rhizome: nzst: in the future
[18:20:52] FailBit: Eventually???
[18:21:37] tsujp: smathy https://gist.github.com/tsujp/1b997008c5ed40a78954
[18:21:50] nzst: I don't get why there are over 500 open pull requests https://github.com/rails/rails/pulls , that seems like a lot
[18:21:52] arup_r: ritic: You sloved it ?
[18:22:01] arup_r: I was away..
[18:22:08] baweaver: it's a big project.
[18:22:27] nzst: i mean, there are some from 2012
[18:22:56] FailBit: tsujp: IIRC do not really want to use #empty? on a query
[18:23:07] baweaver: it's a big project.
[18:23:14] pwnd_nfsw: has joined #RubyOnRails
[18:23:17] tsujp: FailBit what's best o use then?
[18:24:12] `based_pdev`: has joined #RubyOnRails
[18:24:40] giantoctopus: has joined #RubyOnRails
[18:24:46] bricker: FailBit: ActiveRecord will do the smart thing and just run a count query, if you call empty(), blank?(), etc.
[18:24:49] ellisTAA: how do i look at just a time???s hour and minute? i don???t want to take the date into consideration
[18:24:59] Oog: has joined #RubyOnRails
[18:25:01] tsujp: Amended. Do you know a prettier way of writing what's in my gist FailBit ?
[18:25:12] FailBit: I assumed it might, bricker, but wasn't sure
[18:25:13] rubyonra_: has joined #RubyOnRails
[18:25:17] FailBit: best to be safe
[18:25:20] baweaver: EllisTAA: what have you tried?
[18:25:20] smathy: FailBit, .count and .empty? do the same thing when called on a relation.
[18:25:22] bricker: FailBit: true dat
[18:25:30] smathy: Oh, sorry, bricker's already on the case.
[18:25:39] bricker: ACTION puts on detective hat
[18:25:40] FailBit: tsujp: you might need to get into some fancy query strings
[18:25:40] smathy: .empty? is being safe IMHO
[18:25:52] fschuindt4: has joined #RubyOnRails
[18:26:23] tsujp: so count == 0 and .empty? are equal here
[18:26:40] baweaver: EllisTAA: like reading into the DateTime docs
[18:26:54] baweaver: for methods that look suspiciously like what you just mentioned
[18:27:13] ellisTAA: baweaver: cool thanks
[18:27:28] sankaber: has joined #RubyOnRails
[18:27:35] baweaver: EllisTAA: read the docs, a lot of what you want to know will be more readily available there
[18:27:41] simplyianm: has joined #RubyOnRails
[18:27:58] yaymukund: has joined #RubyOnRails
[18:27:59] smathy: tsujp, not really sure what you're after here, I just added a comment to your gist showing how I'd do it, using the `presence` method: https://gist.github.com/tsujp/1b997008c5ed40a78954#gistcomment-1589959
[18:28:13] smathy: tsujp, it doesn't make your query any less complex (not that it's complex now really).
[18:29:06] roshanavand: has joined #RubyOnRails
[18:29:21] xblade: has joined #RubyOnRails
[18:29:24] smathy: tsujp, using .presence *will* prevent a second `COUNT` call to your DB though.
[18:29:36] ericjphillips: has joined #RubyOnRails
[18:30:35] tsujp: oh this is cool, so bascially its just checking if the value is not nil, and if it is nil it will run the latter
[18:30:47] crdpink: has joined #RubyOnRails
[18:30:47] artisanIndia: has joined #RubyOnRails
[18:30:50] tsujp: i take it using .empty instead of presence wouldn't stop the second count?
[18:31:00] smathy: tsujp, not nil, .blank? - but yes.
[18:31:10] jhn: has joined #RubyOnRails
[18:31:13] artisanIndia: I am starting to learn RoR please suggest a good tutorial website
[18:31:14] smathy: tsujp, no, .empty? will make a COUNT query.
[18:31:39] tsujp: i worded it badly that's what I meant heh 2:31am here really feeling it
[18:31:47] tsujp: excellent thank you smaty :)
[18:31:50] crdpink: has joined #RubyOnRails
[18:32:11] smathy: tsujp, .presence uses .blank? which (despite bricker's comment above) doesn't use SQL, it just does a to_a.blank?
[18:32:13] baweaver: artisanIndia: where have you looked?
[18:32:25] artisanIndia: rails official website
[18:32:29] artisanIndia: but not very clear
[18:32:39] smathy: tsujp, you're welcome.
[18:32:40] baweaver: how much have you searched?
[18:33:09] inoter: has joined #RubyOnRails
[18:33:12] baweaver: and what are you searching for?
[18:33:22] baweaver: ACTION has Lionell Richie stuck in his head now...
[18:33:24] platzhirsch: has left #RubyOnRails: ()
[18:33:35] arup_r: artisanIndia: https://www.railstutorial.org/book
[18:33:39] artisanIndia: starting from routing to controllers models
[18:33:56] davispuh: has joined #RubyOnRails
[18:34:15] smathy: Non-universal opinion ^
[18:34:47] smathy: artisanIndia, you found this page on the official site? http://rubyonrails.org/documentation/
[18:34:53] simplyianm: has joined #RubyOnRails
[18:35:13] artisanIndia: ruby on rails 2nd editiion written by Michael hartl is for which version of rails ?
[18:35:14] rromanch_: has joined #RubyOnRails
[18:35:27] beingjohnm: I'm having some difficulty with Wicked Wizard and using post to access the create method of the wizard controller. I'm getting the error: "No route matches {:action=>"show", :controller=>"after_signup", :id=>nil}". Anybody have any experience with Wicked Wizard or has seen a tutorial for using the create method? (There is one on the gem's github page but that is for creating an object over multiple steps.
[18:35:29] EminenceHC: has joined #RubyOnRails
[18:35:36] chouhoulis: has joined #RubyOnRails
[18:35:43] fschuindt: has joined #RubyOnRails
[18:36:13] baweaver: artisanIndia: It would benefit you to read and find out.
[18:36:40] artisanIndia: the latest version of ror is 4.2 right ?
[18:36:41] baweaver: many questions are answered in the act of trying, searching, and reading.
[18:37:52] baweaver: that, and you will find that members tend to ignore people that ask questions that can be answered by the above methods.
[18:37:57] chouhoulis: has joined #RubyOnRails
[18:38:08] greengriminal: has joined #RubyOnRails
[18:38:26] appcademics: has joined #RubyOnRails
[18:38:28] idd2d: has joined #RubyOnRails
[18:38:42] mlangenberg: has joined #RubyOnRails
[18:39:29] arup_r: beingjohnm: What is that? any gem ?
[18:39:48] idd2d: has joined #RubyOnRails
[18:40:38] beingjohnm: arup_r: yeah, a gem: https://github.com/schneems/wicked
[18:40:48] smathy: beingjohnm, no clue about Wicked Wizard, but based on the controller/action you're getting the error on, it would seem like a redirect after the successful create (signup) but that redirect code isn't correctly providing the created instance or id.
[18:40:57] Guest53: has joined #RubyOnRails
[18:41:36] EminenceHC: has joined #RubyOnRails
[18:41:40] tsujp: smathy i do have one more question. it would be bad practice to use a do block (I doubt it would even work) with that .presence || syntax you gave me right? updating the gist as an example
[18:42:03] baweaver: either that or remember to follow the README when it says to add a route for it
[18:42:08] baweaver: beingjohnm: ^
[18:42:21] baweaver: https://github.com/schneems/wicked#how
[18:42:34] beingjohnm: smathy: in the console I'm not seeing the database insert statement but am seeing the data from the post
[18:43:27] beingjohnm: baweaver: I do have that route in there :) but I do wonder if there is another route command needed. Or maybe it is as smathy says.
[18:43:41] baweaver: probably, and making sure
[18:43:51] smathy: beingjohnm, in your create action do you have `render_wizard` or `render_wizard @your_object` ?
[18:44:06] Jasaka: has joined #RubyOnRails
[18:44:10] beingjohnm: smathy: I do
[18:44:20] smathy: beingjohnm, that was an either-or question.
[18:44:51] beingjohnm: smathy: I have 'render_wizard @user' at the end of the create action
[18:45:34] smathy: tsujp, your gist update makes no sense to me, it's not clear what you're trying to do.
[18:45:43] tsujp: one sec ill update it again
[18:45:44] fschuindt1: has joined #RubyOnRails
[18:45:47] smathy: beingjohnm, did you restart your rails server after adding the route?
[18:45:49] beingjohnm: everything works with the update action via put but when I change the form to post (and thus do the create action) I get the error
[18:45:54] beingjohnm: smathy: I did restart
[18:45:55] smathy: beingjohnm, and/or try stopping spring too.
[18:46:03] rushed: has joined #RubyOnRails
[18:46:31] smathy: beingjohnm, !gist your controller code and the full error you're seeing.
[18:46:31] helpa: beingjohnm: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[18:46:37] ellisTAA: i???m trying to change the time of an object that i???m creating ??? but for some reason it wont change ??? i heard time is immutable but i still think this should work https://gist.github.com/ellismarte/82d706519a3a480c80b6#file-create-rb-L6-L8
[18:46:53] based_pdev: has joined #RubyOnRails
[18:46:59] tsujp: done smathy
[18:47:30] kadoppe: has joined #RubyOnRails
[18:48:08] havenwood: has joined #RubyOnRails
[18:49:32] smathy: tsujp, are you just guessing at syntax there?
[18:49:36] acti0nman: has joined #RubyOnRails
[18:49:47] SteenJobs: has joined #RubyOnRails
[18:49:55] tsujp: purely for demonstration that one method or the other has to run smathy
[18:50:14] rushed: EllisTAA: why do you think it wont change?
[18:50:35] smathy: tsujp, that didn't clarify what I was asking.
[18:50:41] ellisTAA: rushed: is that a socratic question?
[18:50:45] tsujp: yes I am guessing smathy
[18:50:46] isjaylee: has joined #RubyOnRails
[18:50:49] beingjohnm: smathy: https://gist.github.com/willjohnson/a1331c2ca3430967c229
[18:50:59] rushed: EllisTAA: lol, no
[18:51:15] ellisTAA: rushed: well when i check the obect in my console it is just a new time object
[18:51:29] ellisTAA: rushed: so it == 2000-01-01 01:00:00 UTC
[18:51:39] ellisTAA: when it should equal something completely different
[18:51:40] ngscheur1: has joined #RubyOnRails
[18:51:41] smathy: tsujp, ok understood, so I can't even tell what you're trying to do there.
[18:51:53] rushed: EllisTAA: expand on why you believe it should
[18:52:03] FCser: has joined #RubyOnRails
[18:52:16] jerin: what kind of auth does devise_token_auth provide by default?
[18:52:19] tsujp: smathy well ive since realised that I will either be returning the result of that query or returning a hash if the first is empty
[18:52:19] rushed: EllisTAA: preferably with a gist showing the log :)
[18:52:21] isjaylee: anyone have experience using java libraries with jruby in rails?
[18:52:23] ellisTAA: rushed: i expect it to equal 2015-10-24 20:00:00 -0700
[18:52:37] tsujp: smathy so return_query.presence? || return_hash_from_query
[18:52:47] rushed: EllisTAA: sure, but prove that you executed a code path that should result in that :)
[18:52:49] tsujp: I cannot figure out how to do the hash since the construction of it is rather long
[18:52:55] Coldblackice_: has joined #RubyOnRails
[18:53:13] cornerma1: has joined #RubyOnRails
[18:53:38] ellisTAA: rushed: https://gist.github.com/ellismarte/82d706519a3a480c80b6#file-create-rb-L6-L8
[18:53:39] jobewan: has joined #RubyOnRails
[18:54:20] rushed: EllisTAA: you already gisted that, without a log there is no way to know if you even tried to save it or what happened :)
[18:54:36] Jasaka: has joined #RubyOnRails
[18:54:37] smathy: tsujp, ok, so what's clear to me is that you need to learn more Ruby.
[18:54:50] smathy: tsujp, or, at the very least, stick to ruby that you know/understand.
[18:55:01] tsujp: smathy i think that's best for now
[18:55:29] xcv: has joined #RubyOnRails
[18:57:14] Jasaka: has joined #RubyOnRails
[18:57:34] chills42: has joined #RubyOnRails
[18:59:03] dikaio: has joined #RubyOnRails
[18:59:26] ellisTAA: rushed: i have no idea. i checked the object after i saved and before i saved, and it says the time is == to what i want it to be
[19:00:30] smathy: Comment of the week: "I heard time is immutable but..." :)
[19:00:39] ellisTAA: smathy: lol
[19:00:39] cac: has joined #RubyOnRails
[19:00:51] ellisTAA: smathy: so i can???t change the time of an object??
[19:01:06] banister: has joined #RubyOnRails
[19:01:10] smathy: Yeah you can, it was just a funny snippet when isolated from the rest of your context.
[19:01:25] krisquigley: has joined #RubyOnRails
[19:01:48] ellisTAA: smathy: do u know why my object isn???t save the new time??
[19:02:14] smathy: Like rushed, I'm waiting for your promised logs.
[19:02:46] EminenceHC: has joined #RubyOnRails
[19:04:03] dionysus69: has joined #RubyOnRails
[19:04:53] ellisTAA: https://gist.github.com/ellismarte/e614394d0195986e189d
[19:06:22] riotjones: has joined #RubyOnRails
[19:06:56] rushed: EllisTAA: time was saved as 2015-10-29 01:00:00.000000 in that log
[19:08:30] rushed: EllisTAA: assuming that just happened if you open a console and check Interview.find(118).time it should match
[19:08:35] riotjones: has joined #RubyOnRails
[19:09:04] ellisTAA: rushed: that???s the weird thing, it isn???t
[19:09:14] w0rd-driven: has joined #RubyOnRails
[19:09:14] smathy: EllisTAA, !gist-usage - for next time PLEASE add files to existing gists, it's a huge PITA to be jumping all around.
[19:09:14] helpa: EllisTAA: How to use Gist properly: https://github.com/radar/guides/blob/master/using-gist.markdown
[19:09:31] rushed: EllisTAA: what do you mean it isn't?
[19:09:33] ellisTAA: derp my bad
[19:09:56] ellisTAA: When I run Interview.last.time it == time: "2000-01-01 01:00:00"
[19:10:00] andersoldahl: has joined #RubyOnRails
[19:10:09] rushed: EllisTAA: what is Interview.find(118).time ?
[19:10:29] isjaylee: has left #RubyOnRails: ()
[19:10:31] xblade: has joined #RubyOnRails
[19:11:14] rushed: EllisTAA: what DB, what kind of field is time?
[19:11:41] ellisTAA: it???s a time type
[19:12:23] based_pdev_: has joined #RubyOnRails
[19:13:02] rushed: EllisTAA: time or timestamp? you appear to be trying to save date + time which doesn't sound right if it's really just a time
[19:13:18] rushed: EllisTAA: so why are you trying to save date + time?
[19:13:47] smathy: EllisTAA, add your db/schema.rb and your Interview model to your gist,
[19:14:54] seaworthy: has joined #RubyOnRails
[19:15:06] seaworthy: hi, how do i chain rails c commands ?
[19:15:23] seaworthy: like user = User.last && user.save
[19:15:27] seaworthy: does nto work
[19:15:50] smathy: seaworthy, !didntwork
[19:15:50] helpa: seaworthy: What "didn't work"? Did your server not start? Did your computer explode? Did your webpage turn bright pink? Did your client not pay your bill on time? You may have to be more specific. A Gist (http://gist.github.com) of the code that doesn't work (and the error you are getting) will be helpful.
[19:16:27] beingjohnm: smathy: I can see you are busy but did you see the gist that I posted?
[19:16:27] simplyianm: has joined #RubyOnRails
[19:16:33] rushed: seaworthy: (user = User.last) && user.save
[19:16:40] rushed: seaworthy: order of operations ftw~
[19:16:41] cac: has joined #RubyOnRails
[19:16:43] smathy: Ruin all my fun.
[19:17:15] seaworthy: i have 4 commands
[19:17:19] smathy: Sorry beingjohnm, I didn't notice, looking now.
[19:18:02] beingjohnm: smathy: thanks. I really appreciate your help.
[19:18:09] victortyau: has joined #RubyOnRails
[19:18:12] ngscheurich: has joined #RubyOnRails
[19:18:51] w0rd-driven: has joined #RubyOnRails
[19:20:36] seaworthy: how do i chain 4 commands?
[19:21:30] smathy: beingjohnm, which line do you get the `No route matches [POST] "/after_signup/checking_account"` error on?
[19:21:43] jerin: has joined #RubyOnRails
[19:22:05] rushed: has joined #RubyOnRails
[19:22:12] smathy: seaworthy, !gist your console session showing what you're doing, and explain what you're expecting.
[19:22:12] helpa: seaworthy: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[19:22:37] beingjohnm: smathy: when I get that error it does not reference a line.
[19:22:46] seaworthy: https://bpaste.net/show/9ec1cea2c84b
[19:22:52] seaworthy: need to chain these 4 commands
[19:23:33] nettoweb: has joined #RubyOnRails
[19:23:56] smathy: seaworthy, I assume you mean 6 commands, but whatever. So when you said that you need to chain them, why? What are you trying to do here?
[19:24:19] seaworthy: paster then into my rails c
[19:24:24] seaworthy: to clear the tokens
[19:24:50] seaworthy: you know rails c
[19:24:56] seaworthy: where you can browse the models
[19:25:15] rhizome: just for the last user? are you sure this is a thing you need to spend time on?
[19:25:26] smathy: Yes, when I asked you before to gist your console, it was this "rails c" that I was talking about there.
[19:26:02] smathy: seaworthy, ok, so you think you need to chain these commands because why, because you want a single line to paste into a rails console?
[19:26:14] rushed: seaworthy: User.last.tap{ |u| %w'auth_code access_token refresh_token token_expires_at'.each{ |t| u.send("paypal_#{t}=", nil)} }.save
[19:26:54] rushed: you spelled awesome wrong~
[19:28:22] seaworthy: rushed: checking
[19:28:37] darkxploit: has joined #RubyOnRails
[19:28:38] rushed: seaworthy: I eagerly await your judgement!
[19:28:57] rhizome: pins and needles
[19:29:10] seaworthy: bravo maestro
[19:29:22] ktchup: has joined #RubyOnRails
[19:29:27] Pupeno: has joined #RubyOnRails
[19:30:11] rushed: seaworthy: also, if you just want to combine multiple lines use a semi-colon between~
[19:30:37] simkessy: has joined #RubyOnRails
[19:31:28] arup_r: rushed: hi~
[19:31:59] rromanchuk: has joined #RubyOnRails
[19:32:31] yfeldblum: has joined #RubyOnRails
[19:32:34] seaworthy: thats what i wanted
[19:33:28] smathy: beingjohnm, sorry, nothing stands out. I think you need a wicked expert here.
[19:33:47] beingjohnm: smathy: just updated the wiki with rake routes and a comment
[19:34:13] beingjohnm: smathy: thanks for taking a look. I'll try to find a wicked expert.
[19:34:14] EminenceHC: has joined #RubyOnRails
[19:34:25] baweaver: has joined #RubyOnRails
[19:34:49] smathy: beingjohnm, only thing I think is odd is that you're doing the steps inside the create action, all the wicked examples show it in the show action. I imagine that the link helpers are only going to make GET requests or something.
[19:35:01] jenrzzz: has joined #RubyOnRails
[19:35:09] smathy: OMG, great troll rushed.
[19:35:47] smathy: Well, I hope that User.last.tap... crap was a troll.
[19:36:14] arup_r: any way, I have a question. Why in the Gemfile we group gems for diff environment ?
[19:36:28] arup_r: if I do `bundle install` it installs also
[19:36:31] smathy: arup_r, so gems we don't want out in production aren't.
[19:36:32] alienaut: has joined #RubyOnRails
[19:36:34] arup_r: installs all
[19:36:39] beingjohnm: smathy: one of the examples (about a third of the way down the page) shows steps in the update action which I also use and works. Just can't get it to work with post and a create action.
[19:36:47] smathy: arup_r, yes it does.
[19:36:59] siddart: has joined #RubyOnRails
[19:37:20] arup_r: so I need to explicitly mention bundle please install production gems. development gems.. etc
[19:37:24] mrbubbles: has joined #RubyOnRails
[19:37:30] arup_r: bundler**
[19:39:16] beingjohnm: smathy: I guess I could work around this and just put my account creation logic inside the update action...
[19:39:17] rromanch_: has joined #RubyOnRails
[19:39:30] rushed: arup_r: usually deploy does something like... bundle install --without development test (more options)
[19:39:58] greengriminal: has joined #RubyOnRails
[19:39:59] tubbo: arup_r: in production, most people will not install gems in the development & test group. however, you can totally install them if you want to...Bundler.require will make sure not to actually require them in your app unless you're in the right Rails.env
[19:40:03] arup_r: o i see. I had a wrong assumptions.. That got cleared now
[19:40:05] htmldrum: has joined #RubyOnRails
[19:40:20] hephaestus_rg: has joined #RubyOnRails
[19:40:25] smathy: beingjohnm, yeah I saw that, so do you have something like: `form_for @user, :url => wizard_path` in your view ?
[19:40:42] willardg: has joined #RubyOnRails
[19:40:57] arup_r: tubbo: and rushed~ thanks
[19:41:03] beingjohnm: smathy: yeah.
[19:41:13] roshanavand: has joined #RubyOnRails
[19:41:34] beingjohnm: smathy: Just tested the workaround and it will work. HOURS wasted.
[19:41:34] ellisTAA: I need to allow a user to select time, date, and timezone for the time field. can someone say what form_for method i???d use to do this
[19:41:52] smathy: beingjohnm, and what URL does that produce?
[19:41:54] beingjohnm: smathy: oh well. Thank you very much for your help.
[19:42:00] smathy: beingjohnm, ok, cool :)
[19:42:21] beingjohnm: smathy: the url that it says there was no route for :) "http://192.168.1.121:3000/after_signup/checking_account"
[19:42:23] smathy: EllisTAA, there's not a single form_for method for all that.
[19:43:34] smathy: beingjohnm, yeah, gotcha, I'd have expected it to create something else, like /after_signup?step=checking_account - I'm not sure how the "step" is communicated back to the controller.
[19:43:49] smathy: beingjohnm, but anyway, good you got a workaround :)
[19:47:25] lxsameer: has joined #RubyOnRails
[19:47:25] lxsameer: has joined #RubyOnRails
[19:48:21] User4587_: has joined #RubyOnRails
[19:49:41] ellisTAA: for some reason when my objects get saved to my db, all times change ??? anyone know why this would happen?
[19:50:39] rushed: EllisTAA: are you still trying to save date + time strings into time only columns?
[19:51:14] havenwood: has joined #RubyOnRails
[19:51:18] ellisTAA: rushed: i don???t think they are strings
[19:51:43] rushed: EllisTAA: are you still trying to save date + time into time only columns?
[19:52:18] ellisTAA: rushed: don???t all times contain a date?
[19:52:19] ellisTAA: https://gist.github.com/ellismarte/833f871ec7d611c01bfa
[19:53:33] ellisTAA: ill change it to datetime
[19:56:00] ellisTAA: rushed: thanks
[19:56:50] rushed: EllisTAA: no, not all times contain dates, specifically postgres times do not http://www.postgresql.org/docs/9.4/static/datatype-datetime.html
[19:58:11] arooni: has joined #RubyOnRails
[19:58:33] giantoctopus: has joined #RubyOnRails
[19:58:40] smathy: EllisTAA, Rails records times in your DB as UTC, so adjusts them from the timezone they're in to UTC on write, and then it sets them on read to your app's Time.zone
[19:58:45] Guest53: has joined #RubyOnRails
[19:59:06] chipotle: has joined #RubyOnRails
[19:59:22] xcv: has joined #RubyOnRails
[19:59:22] |T_T|: has joined #RubyOnRails
[19:59:29] ellisTAA: smathy: jesus
[20:00:15] Lytol: has joined #RubyOnRails
[20:01:17] smathy: EllisTAA, storing in UTC is actually almost always what you really want to happen (but a lot of people don't realize that).
[20:01:23] rromanch_: has joined #RubyOnRails
[20:01:25] smathy: EllisTAA, so, what are you actually trying to do here?
[20:02:37] ellisTAA: smathy: so when i fill in my form and say 2:00 am for time, it saves it as 9:00 ???
[20:03:37] ellisTAA: why won???t it just save as 2 am
[20:03:59] rushed: EllisTAA: 9 UTC likely *is* 2am
[20:04:04] rushed: EllisTAA: (for you)
[20:04:18] smathy: EllisTAA, so, you don't want to answer my question?
[20:04:26] roshanavand: has joined #RubyOnRails
[20:04:51] ellisTAA: i???m trying to get users to create events, then later, if those events have passed i want to perform some cron job
[20:05:33] yaymukund: has joined #RubyOnRails
[20:05:50] smathy: EllisTAA, right, so you DEFINITELY want the times stored as UTC then, otherwise you won't be able to tell when those events have passed.
[20:06:06] baweaver: has joined #RubyOnRails
[20:06:09] ktchup: has joined #RubyOnRails
[20:06:35] sdwrage: has joined #RubyOnRails
[20:06:38] smathy: EllisTAA, so, are all your users in the same timezone, or are they going to be all over the place?
[20:06:56] ellisTAA: smathy: ok then so when i display those events on my site, i just want to change them to the appropriate time zone in the view?
[20:07:11] ellisTAA: smathy: i???m assuming theyll be in various parts of the US
[20:07:46] Shoutsid: has joined #RubyOnRails
[20:08:18] smathy: EllisTAA, ok, great. So are you happy for them to manage their own timezone? Ie. they pick it either every time they create an event, or they pick it for their user profile and manage it themselves if it changes?
[20:08:30] ellisTAA: smathy: yeah
[20:08:35] ellisTAA: smathy: for every event
[20:08:53] arup_r: What is the difference between flash.discard and flash.clear
[20:09:06] arup_r: http://api.rubyonrails.org/classes/ActionDispatch/Flash/FlashHash.html#method-i-delete
[20:09:19] riotjones: has joined #RubyOnRails
[20:09:23] arup_r: basically I know clear... But #discard confusing me
[20:09:27] Pupeno: has joined #RubyOnRails
[20:10:15] rushed: arup_r: https://github.com/rails/rails/blob/6dd0dc3e7217f8af7877c5831b3d8816d156f21e/actionpack/lib/action_dispatch/middleware/flash.rb#L209
[20:11:10] arup_r: I saw the source..
[20:11:29] simplyianm: has joined #RubyOnRails
[20:11:31] arup_r: #clear is doing basically Hash#clear..
[20:11:34] arup_r: that is ok
[20:12:00] arup_r: #discard is discarding either all keys or the given key
[20:12:14] inanepenguin: has joined #RubyOnRails
[20:12:14] arup_r: So, both are clearing right?
[20:12:46] rushed: arup_r: clear is clear, discard is "Marks the entire flash or a single flash entry to be discarded by the end of the current action"
[20:13:16] nettoweb: has joined #RubyOnRails
[20:13:19] arup_r: end of current action means.. after rendering the view.. right?
[20:13:22] rushed: arup_r: is there something you're trying to do with the flash that isn't working?
[20:13:36] arup_r: Yes, looking for a correct method..
[20:13:49] _djbkd: has joined #RubyOnRails
[20:14:02] arup_r: actually.. I want to discard/delete some keys while showing them in the view.
[20:14:28] arup_r: but discard/delete wouldn't allow me to chain ...
[20:14:40] rushed: arup_r: chain?
[20:15:18] arup_r: https://gist.github.com/aruprakshit/f23956488da929a18478
[20:15:23] Radar: GOOD MORNING
[20:15:36] arup_r: so from there.. I want to drop a key.. don't want to show that..
[20:15:48] Radar: Why do you want to drop a flash value in a view?
[20:15:51] arup_r: Ah. I see .. I can use #select method
[20:15:58] arup_r: Because of devise
[20:17:08] Palsson: has joined #RubyOnRails
[20:17:49] arup_r: Radar: when timedout it shows in a view also `true` https://github.com/plataformatec/devise/blob/3e87489c5b967b7dc2b79877a72bf2a126f1ca42/lib/devise/failure_app.rb#L99
[20:18:00] arup_r: That is why I will drop it
[20:18:54] darkxploit: has joined #RubyOnRails
[20:19:29] arup_r: 2 key comes when timed out.. and this one is annoying and not needed.. other key and value is sufficient
[20:20:49] arup_r: Anyway I wrote it like for now: - flash.tap { |f| f.delete("timedout") }.each do |key, value|
[20:21:05] arup_r: Later, if there are more I will use #select
[20:21:40] cac: has joined #RubyOnRails
[20:22:37] alienaut_: has joined #RubyOnRails
[20:23:20] simplyianm: has joined #RubyOnRails
[20:23:45] arup_r: but that discard things .. I didn't get yet
[20:23:55] mices: has left #RubyOnRails: ()
[20:23:55] rhizome: guh mozilla
[20:24:21] paulcsmith_: has joined #RubyOnRails
[20:25:08] Limix: has joined #RubyOnRails
[20:25:57] willardg: has joined #RubyOnRails
[20:26:33] appcademics: has joined #RubyOnRails
[20:27:50] artisanIndia: has left #RubyOnRails: ("Konversation terminated!")
[20:28:04] EminenceHC: has joined #RubyOnRails
[20:28:09] Libor: has joined #RubyOnRails
[20:28:20] KinderSpiel: what are you guys using on the frontend?
[20:29:07] arup_r: P is what ?
[20:29:20] Radar: KinderSpiel: please be more specific
[20:29:53] Intii: has joined #RubyOnRails
[20:30:33] sdwrage: has joined #RubyOnRails
[20:30:41] KinderSpiel: radar: what frameworks are you using or would advise for an MVP
[20:30:51] Radar: KinderSpiel: Rails is good
[20:30:58] baweaver: minimum viable product
[20:31:10] KinderSpiel: I was saying coices on the frontend
[20:31:11] universa1: has joined #RubyOnRails
[20:31:14] KinderSpiel: rails is good
[20:31:15] baweaver: Go ask in the Django channel
[20:31:22] baweaver: they'll say Django
[20:31:23] Intii: hey everyone is it possible to have a virtual model for a report I want to generate but this virtual model belongs to an actual model?
[20:31:31] ngscheurich: has joined #RubyOnRails
[20:31:41] KinderSpiel: only problem is the frontend is a bit of a choose your own solution
[20:31:43] baweaver: Intii: Look into Single Table Inheritance
[20:31:48] Libor: has left #RubyOnRails: ()
[20:31:55] baweaver: Rails comes with a built in frontend
[20:32:02] smathy: EllisTAA, sorry, called away. You worked it out now?
[20:32:03] baweaver: one I would suggest not deviating from without good reason
[20:32:23] KinderSpiel: stay with ERB?
[20:32:41] smathy: Intii, a belongs_to requires a foreign key.
[20:32:41] KinderSpiel: baweaver is that what you mean
[20:32:42] ellisTAA: smathy: yeah i figured it out ^^ thanks for the help, and now the whole utc default thing makes sense
[20:33:00] baweaver: you mean templating engine then
[20:33:08] baweaver: ERB, HAML, SLIM, etc
[20:33:16] smathy: EllisTAA, ok cool, so you're parsing the incoming times with something like: Time.use_zone(@user.zone) { Time.zone.parse params[:datetime_string] } ?
[20:33:42] ellisTAA: smathy: i???m formatting it in my view like this: <p><%= interview.time.in_time_zone(interview.time_zone).strftime("%H:%M:%S") %></p>
[20:33:55] RockLee: has joined #RubyOnRails
[20:34:00] KinderSpiel: thanks for the correction baweaver
[20:34:25] baweaver: ERB is faster
[20:34:27] dici: i'm having a weird issue. in a view template when i do <%= var = '' %><%= (var == '' ? 'nope' : var %> it outputs, as I would expect, "nope" . But when 'var' is from active record and would output nothing with <%= var %> it suddenly outputs stuff
[20:34:29] Intii: baweaver: Okay, I just did a quick read on it and it looks like I can just do something like EmployeeRevenue (virtual model/doesn't exist in DB) < Employee (model that exists in db)?
[20:34:58] Intii: Okay thanks!
[20:35:02] KinderSpiel: I???d go with ERB
[20:35:18] jvanbaarsen: has joined #RubyOnRails
[20:35:36] KinderSpiel: but if I want to make something else in javascript, do I just throu jquery there and work it?
[20:35:38] KinderSpiel: is that how guys are doing it?
[20:35:56] KinderSpiel: I haven???t done a lot of frontend, mostly backend stuff
[20:36:04] waseem_: dici: What is the actual code?
[20:36:08] smathy: EllisTAA, ok cool, that's the display side of it, I was talking about the writing side of it.
[20:36:16] inanepenguin: has joined #RubyOnRails
[20:36:19] baweaver: KinderSpiel: remember we're not all guys here.
[20:36:25] dici: waseem_: <td><%= link_to (sp.comment == '' ? sp.comment : sp.comment), edit_switch_port_path(sp), remote: true %></td>
[20:36:32] baweaver: you put javascript in javascript files
[20:36:36] ellisTAA: smathy: oh yeah i guess i???m just saving it in utc
[20:36:43] waseem_: dici: Can you gist the whole template?
[20:36:46] waseem_: dici: !gist
[20:36:46] helpa: dici: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[20:36:55] KinderSpiel: isn???t guys gender neutral? sry bout that
[20:37:00] skroon_: has joined #RubyOnRails
[20:37:03] smathy: EllisTAA, yeah, but you need to manage the offset.
[20:37:13] ellisTAA: smathy: what does that mean?
[20:37:23] smathy: EllisTAA, Rails will assume that the times sent to it are in whatever Time.zone the app is set to.
[20:37:34] Guest36: has joined #RubyOnRails
[20:37:35] smathy: EllisTAA, and it will make the appropriate offset changes to store as UTC.
[20:37:40] tvw: has joined #RubyOnRails
[20:38:01] smathy: EllisTAA, so this won't match the offset of the user's timezone. You need to do this manually as I explained above.
[20:38:34] SteenJobs: has joined #RubyOnRails
[20:38:39] smathy: EllisTAA, ie. Time.use_zone(params[:time_zone]) { Time.zone.parse params[:datetime_string] } - or something like that.
[20:38:52] dici: waseem_: <td><%= link_to (sp.comment == '' ? 'new' : sp.comment), edit_switch_port_path(sp), remote: true %></td>
[20:38:55] dici: this is the actualcode
[20:39:09] ellisTAA: smathy: oh ok cool thanks for that
[20:39:10] dici: I'm gonna gist it
[20:39:15] ellisTAA: smathy: ill update it
[20:39:41] simplyianm: has joined #RubyOnRails
[20:40:02] smathy: EllisTAA, you can also do it the other way around, wait for Rails to (wrongly) convert the incoming string to a local time, and then change that to UTC based on the user's timezone like: ActiveSupport::TimeZone.new(params[:timezone]).local_to_utc(interview.time) But I prefer doing it the first way.
[20:40:24] baweaver: glundgren: hm?
[20:40:26] glundgren: baweaver, theres girls here too? really?
[20:40:28] Kilo`byte: has joined #RubyOnRails
[20:40:49] smathy: glundgren, mostly women, but of course.
[20:40:54] baweaver: ...that's hard to believe?
[20:40:58] borislav: has joined #RubyOnRails
[20:41:04] borkdude: has joined #RubyOnRails
[20:41:05] glundgren: baweaver, im being sarcastic
[20:41:31] smathy: glundgren, was there a point you were trying to make?
[20:41:40] ellisTAA: smathy: so do i call use_zone, pass it the time zone, then pass it the existing Time object, or do i create a new object in the block?
[20:41:51] dici: @waseem_: https://gist.github.com/anonymous/5cf41529cc1a38c03703 This is the partial template. Funny thing is, if i replace "(sp.comment == '' ? 'new comment' : sp.comment)" with just "sp.comment" it outputs nothing. but with the conditional it outputs something like "/switch_ports/2/edit"
[20:42:12] glundgren: sure, political correctness is something totally unecessary
[20:42:40] smathy: glundgren, ok, thanks for your opinion.
[20:42:44] Ergo: has joined #RubyOnRails
[20:42:47] glundgren: youre welcome :)
[20:43:08] smathy: glundgren, hopefully you agree that others are welcome to their too.
[20:43:20] glundgren: smathy, absolutely
[20:43:21] Radar: glundgren: lemme guess, straight white male, probably single?
[20:43:29] smathy: EllisTAA, not sure what you're asking there.
[20:43:55] Brando753-o_O_o: has joined #RubyOnRails
[20:43:56] smathy: EllisTAA, I think it's just time for you to take all that code and start fiddling
[20:43:57] Radar: glundgren: http://logs.ryanbigg.com/ruby-offtopic?date=2015-09-21#4154683
[20:43:57] Radar: glundgren: Please don't bring that shit in here, k?
[20:43:59] glundgren: net split is a signal from god against feminazi
[20:44:11] ChanServ: +o baweaver
[20:44:24] smathy: EllisTAA, the goal is to get the attribute stored in memory in the user's timezone, and then Rails will do the right thing when saving it to the DB.
[20:44:39] smathy: EllisTAA, then to convert it on the read and then Rails will do the right thing when displaying it.
[20:44:45] ellisTAA: smathy: https://gist.github.com/ellismarte/b6a3cd9da40204403a0b#file-create-rb-L7-L8
[20:44:51] ellisTAA: smathy: for sure ill try it out
[20:44:56] Radar: +q glundgren!*@*
[20:45:01] Radar: I did ask you.
[20:45:16] armyriad: has joined #RubyOnRails
[20:45:17] ChanServ: -o baweaver
[20:45:44] AntiSpamMeta: has joined #RubyOnRails
[20:45:50] jozan: has joined #RubyOnRails
[20:45:54] mlangenberg: has joined #RubyOnRails
[20:46:16] TDJACR: has joined #RubyOnRails
[20:46:16] LBRapid_: has joined #RubyOnRails
[20:46:16] fedexo: has joined #RubyOnRails
[20:46:16] universa1: has joined #RubyOnRails
[20:46:16] |T_T|: has joined #RubyOnRails
[20:46:16] crdpink: has joined #RubyOnRails
[20:46:16] rubyonra_: has joined #RubyOnRails
[20:46:16] pwnd_nfsw: has joined #RubyOnRails
[20:46:16] triptec: has joined #RubyOnRails
[20:46:16] Klumben: has joined #RubyOnRails
[20:46:16] quazimod1: has joined #RubyOnRails
[20:46:16] mostlybadfly: has joined #RubyOnRails
[20:46:16] CheckYourSix: has joined #RubyOnRails
[20:46:16] robotbrain: has joined #RubyOnRails
[20:46:16] cball: has joined #RubyOnRails
[20:46:16] nickenchuggets: has joined #RubyOnRails
[20:46:17] penguinpowernz: has joined #RubyOnRails
[20:46:17] Contigi: has joined #RubyOnRails
[20:46:17] corioliss: has joined #RubyOnRails
[20:46:17] arathald: has joined #RubyOnRails
[20:46:17] Avon: has joined #RubyOnRails
[20:46:17] ZucchiniZe: has joined #RubyOnRails
[20:46:17] Didac: has joined #RubyOnRails
[20:46:17] skullcrasher: has joined #RubyOnRails
[20:46:17] iooner: has joined #RubyOnRails
[20:46:17] ltd: has joined #RubyOnRails
[20:46:17] xMopxShell: has joined #RubyOnRails
[20:46:17] hendricius: has joined #RubyOnRails
[20:46:17] bphogan: has joined #RubyOnRails
[20:46:17] Voxxit: has joined #RubyOnRails
[20:46:17] many: has joined #RubyOnRails
[20:46:17] Emily: has joined #RubyOnRails
[20:46:17] calleerlandsson: has joined #RubyOnRails
[20:46:17] ewilliam: has joined #RubyOnRails
[20:46:17] kapowaz: has joined #RubyOnRails
[20:46:17] nickfausnight: has joined #RubyOnRails
[20:46:17] krainboltgreene: has joined #RubyOnRails
[20:46:17] MiracleBlue: has joined #RubyOnRails
[20:46:17] FastJack: has joined #RubyOnRails
[20:46:17] nibbo: has joined #RubyOnRails
[20:46:17] sfr^: has joined #RubyOnRails
[20:46:17] jhass: has joined #RubyOnRails
[20:46:17] herenow: has joined #RubyOnRails
[20:46:17] terrellt: has joined #RubyOnRails
[20:46:18] aguynamedben: has joined #RubyOnRails
[20:46:18] DarkBushido: has joined #RubyOnRails
[20:46:18] Shidash: has joined #RubyOnRails
[20:46:18] george2: has joined #RubyOnRails
[20:46:18] kiki_lamb: has joined #RubyOnRails
[20:46:18] fluxsource: has joined #RubyOnRails
[20:46:18] skakri: has joined #RubyOnRails
[20:46:18] tskogberg: has joined #RubyOnRails
[20:46:18] abracadaniel: has joined #RubyOnRails
[20:46:51] epochwolf: has joined #RubyOnRails
[20:47:00] asi_: has joined #RubyOnRails
[20:47:06] lsone: has joined #RubyOnRails
[20:47:06] waseem_: dici: In case sp.comment is empty, it will create an anchor tag but its link text will be empty. And because of that browser does not show anything.
[20:47:09] iooner: has joined #RubyOnRails
[20:47:10] fedexo: has joined #RubyOnRails
[20:47:17] TDJACR: has joined #RubyOnRails
[20:47:19] waseem_: dici: That's when you just use sp.comment.
[20:47:20] sfr^: has joined #RubyOnRails
[20:47:20] abracadaniel: has joined #RubyOnRails
[20:47:35] Contigi: has joined #RubyOnRails
[20:47:38] xMopxShell: has joined #RubyOnRails
[20:47:39] CheckYourSix: has joined #RubyOnRails
[20:47:59] rushed: has joined #RubyOnRails
[20:48:04] dici: waseem_: thanks, I'll see what I can do to get the desired result.
[20:48:08] AntiSpamMeta: has joined #RubyOnRails
[20:48:45] ellisTAA: smathy: i think it makes more sense to just save everything in utc, then convert it to time zone in the view, doesn???t it?
[20:48:58] Didac: has joined #RubyOnRails
[20:49:07] naftilos76: has joined #RubyOnRails
[20:49:28] dici: waseem_: with "sp.comment.to_s.empty?" it works, thanks a lot! :)
[20:49:46] istrasci: has joined #RubyOnRails
[20:49:54] workmad3: has joined #RubyOnRails
[20:50:25] cschneid: has joined #RubyOnRails
[20:50:40] AntiSpamMeta: has joined #RubyOnRails
[20:50:45] istrasci: In my config/application.rb, I'm setting a value from a yaml file. If the value is nil or the key doesn't exist in the yaml file, I want to display a message and kill the Rails server. How can I do this?
[20:50:50] Klumben: has joined #RubyOnRails
[20:51:19] arup_r: I didn't get the answer..
[20:51:33] smathy: EllisTAA, absolutely, which is what I was saying above.
[20:51:48] sdwrage: has joined #RubyOnRails
[20:51:59] ellisTAA: smathy: must have gotten confused
[20:52:02] smathy: EllisTAA, there are two sides to this, the write and the read. You need special handling for both.
[20:52:37] smathy: EllisTAA, when the user submits their time to you it's just a string, like "2015-10-06 14:52" - this is my current local time.
[20:52:42] ellisTAA: smathy: but it converts it to utc by default, so why do i need to fiddle with it?
[20:53:47] smathy: EllisTAA, well, because by default your application will convert that to UTC based on its own timezone, not on your user's timezone.
[20:54:14] smathy: EllisTAA, so if your server thinks it's in UTC timezone, then it'll save my "2015-10-06 14:52" as "2015-10-06 14:52 UTC"
[20:54:42] IanV0rn2341: has joined #RubyOnRails
[20:54:51] htmldrum: has joined #RubyOnRails
[20:55:46] tubbo: hey fellas, i'm trying to allow image uploads through my JSON API with Base64, however, i'm having some trouble when integrating JSON generated by encode_json from PHP
[20:56:13] chouhoul_: has joined #RubyOnRails
[20:56:31] rhizome: define 'some trouble' gist your code GOSH
[20:56:32] smathy: EllisTAA, if your server is set to Pacific time, then it'll save that with a 7 hour offset, whereas my timezone is (currently) a 6 hour offset, so that's what "2015-10-06 14:52" *should* be processed with in order too be saved in the correct UTC.
[20:56:42] epochwolf|vps: has joined #RubyOnRails
[20:56:54] ellisTAA: smathy: god damn
[20:57:11] ellisTAA: smathy: thanks for the heads up
[20:57:17] smathy: EllisTAA, so basically you need to tell Rails which timezone the incoming string should be parsed in.
[20:57:28] willardg: has joined #RubyOnRails
[20:57:55] smathy: EllisTAA, so, if I was your user, I'm going to send you two things, I'll send you { time: "2015-10-06 14:52", timezone: "Mountain Time (US & Canada)" }
[20:58:03] ellisTAA: has anyone used whatever gem with aws? does it work
[20:58:22] waseem_: istrasci: I think you should try exit.
[20:59:04] smathy: EllisTAA, so then you're going to do: Time.use_zone(params[:timezone]) { Time.zone.parse params[:time] } and you'll get # => Tue, 06 Oct 2015 14:52:00 MDT -06:00
[20:59:06] istrasci: Yeah, that seems to work. Ha! Thanks.
[20:59:07] zrl: has joined #RubyOnRails
[20:59:09] EminenceHC: has joined #RubyOnRails
[20:59:12] smathy: EllisTAA, see how it's tagged with MDT?
[20:59:21] jessemcgilallen: has joined #RubyOnRails
[20:59:28] Shoutsid: has joined #RubyOnRails
[20:59:34] smathy: EllisTAA, that means Rails will be able to make the right adjustment when it saves it to the DB as UTC.
[20:59:35] tubbo: rhizome: https://gist.github.com/tubbo/18fd5ff0095e090d7a11 is what i got here. it's never equal
[20:59:36] marr: has joined #RubyOnRails
[20:59:39] ellisTAA: smathy: got it so i would write something like Time.new = and then what you wrote
[21:00:46] ZucchiniZe: has joined #RubyOnRails
[21:00:54] smathy: EllisTAA, well, more like @event.time =
[21:01:59] tubbo: rhizome: the *actual* code, of course, is an API controller...that part isn't relevant because i can reproduce the problem in that small test file
[21:02:16] krisquigley: has joined #RubyOnRails
[21:02:32] yaymukund: has joined #RubyOnRails
[21:03:14] Fire-Dra_: has joined #RubyOnRails
[21:03:22] willardg: has joined #RubyOnRails
[21:03:49] Shoutsid: has joined #RubyOnRails
[21:04:27] ellisTAA: smathy: when i user Time.use_zone, it saves it in the time zone i specify not utc ???
[21:04:38] jenrzzz: has joined #RubyOnRails
[21:04:47] sdwrage: has joined #RubyOnRails
[21:06:16] istrasci: has left #RubyOnRails: ()
[21:07:05] smathy: Rails will ALWAYS ALWAYS ALWAYS convert to UTC before saving to the DB. The only thing that confuses people is that if the time object isn't in the right timezone to begin with then the conversion to UTC will be the wrong offset.
[21:07:40] mehwork: in rails4 do you not have to specify url: articles_path in <%= form_for :article do |f| %> anymore? rake routes says it's still POSTing to articles#create
[21:07:52] mehwork: my rails4 tutorial says to do that but the routes look the same either way
[21:09:30] rhizome: tubbo: hmm, conversion differences jump out at me
[21:09:59] dopie: has joined #RubyOnRails
[21:10:12] riotjones: has joined #RubyOnRails
[21:11:05] riotjones: has joined #RubyOnRails
[21:11:28] siddart: has joined #RubyOnRails
[21:11:31] inanepenguin: has joined #RubyOnRails
[21:12:32] Lightsword_: has joined #RubyOnRails
[21:13:08] Guest53: has joined #RubyOnRails
[21:15:31] craysiii: has joined #RubyOnRails
[21:16:17] wethu: has joined #RubyOnRails
[21:19:04] EminenceHC: has joined #RubyOnRails
[21:19:27] smathy: mehwork, no you don't.
[21:19:31] stamina: has joined #RubyOnRails
[21:19:44] andersoldahl: has joined #RubyOnRails
[21:19:50] smathy: mehwork, form_for works out which path and method to use based on whether @article is persisted? or not.
[21:20:43] mehwork: it seems to, but i called it :article not @article
[21:21:20] mehwork: i just wish http://guides.rubyonrails.org/form_helpers.html said what rails version it was for, clearly not 4
[21:21:41] smathy: mehwork, FWIW, I think it always did that, definitely in Rails 2.3 it did it.
[21:22:39] mehwork: even the rails4 tutorial for Dash says to add url:. I guess i just have to take tutorials with a grain of salt. I'm sure it works either way but some tutorial writers don't know all the shortcuts
[21:22:54] smathy: mehwork, the symbol is mapped to the instance variable of the same name, that's why you are able to access the attribute methods in the field helpers.
[21:23:49] smathy: mehwork, I generally find you get what you pay for with tutorials. The books that actually cost money are far superior in my experience.
[21:24:41] jessemcgilallen: has joined #RubyOnRails
[21:24:47] rushed: has joined #RubyOnRails
[21:25:51] mehwork: idk, even my book 'the rails 4 way' says to use url:
[21:27:04] rhizome: it's probably the least magical advice, so ok for books/tutes
[21:27:09] beauby: has joined #RubyOnRails
[21:27:16] jocuman: has joined #RubyOnRails
[21:28:09] mehwork: agile web development in rails 4 doesn't sem to say to use url:. Might be a better book. (i'm at the book store, might buy it)
[21:29:01] yfeldblum: has joined #RubyOnRails
[21:29:18] Pupeno: has joined #RubyOnRails
[21:31:33] willardg: has joined #RubyOnRails
[21:31:40] blackmesa: has joined #RubyOnRails
[21:33:54] Oog: has joined #RubyOnRails
[21:34:18] jenrzzz: has joined #RubyOnRails
[21:34:29] Radar: mehwork: Rails 4 in Action is the book you should be buying :P
[21:34:39] dopie: has joined #RubyOnRails
[21:34:59] FailBit: I used to buy programming books
[21:35:00] Radar: mehwork: I have a blog post which explains the form_for helper: http://ryanbigg.com/2012/03/polymorphic-routes/
[21:35:12] FailBit: then I took an arr???
[21:35:14] FailBit: ACTION gets shot
[21:35:16] Radar: FailBit: And now you're just so great at programming you don't need them? :D
[21:35:31] renegadeandy: has joined #RubyOnRails
[21:35:42] craysiii: the last programming book i bought was the pragmatic programmer
[21:36:00] mehwork: of course it's the one book they don't have
[21:36:16] Radar: mehwork: of course they don't :D
[21:36:21] Radar: mehwork: You *could* order it in?
[21:36:31] renegadeandy: if ruby how can i return one value or another on one line?
[21:36:37] mehwork: i'll amazon it
[21:36:44] craysiii: you could use a ternary operator
[21:36:52] craysiii: condition ? true : false
[21:36:53] mehwork: i need to learn rails right, i hate bad habits
[21:36:59] mehwork: they never go away
[21:37:03] renegadeandy: craysiii: thanks
[21:37:42] ericjphillips: has joined #RubyOnRails
[21:38:14] Pupeno: has joined #RubyOnRails
[21:39:14] renegadeandy: craysiii: !get_formatted_date return "Today" : return Date.today.to_formatted_s(:long_ordinal) -- not working. get_formatted_date is a boolean
[21:39:49] Radar: renegadeandy: get_formatted_date ? Date.today.to_formatted_s(:long_ordinal) : "Today"
[21:40:11] renegadeandy: do i not need to say return before each result?
[21:41:06] Radar: returns are implied in Ruby if it's the last instruction.
[21:42:03] Radar: renegadeandy: https://gist.github.com/radar/00eb5355f0f23c96a4a8
[21:42:11] renegadeandy: Radar: its not the last instruction...
[21:42:38] renegadeandy: Radar: this is in the middle of a larger method
[21:42:52] Radar: renegadeandy: ...
[21:42:59] Radar: renegadeandy: how many times do I need to remind you to show us the full context?
[21:43:17] baweaver: has joined #RubyOnRails
[21:44:19] renegadeandy: Radar: https://gist.github.com/renegadeandy/8eac8ac87e0babe5886c
[21:44:24] renegadeandy: highlighted lines with ##
[21:44:43] Radar: You don't need brackets or "then" when using if
[21:45:04] Radar: In that case, you'll want to put just one return at the start of the line
[21:45:14] Radar: https://gist.github.com/renegadeandy/8eac8ac87e0babe5886c#file-example-rb-L5
[21:45:19] Radar: Here you can use Time.currentt
[21:46:37] hueston: has joined #RubyOnRails
[21:47:20] renegadeandy: let me try that :)
[21:48:37] renegadeandy: Radar: what is the differnece between using DateTime.now and Time.current? Why is one better than the other?
[21:49:00] Radar: DateTime will get the system's time. Time.current will get the time in the currently-configured Rails application's timezone.
[21:49:06] User458764: has joined #RubyOnRails
[21:51:13] jocuman: has joined #RubyOnRails
[21:51:21] smathy: mehwork, AWDwR is still the best tutorial I've read (although I haven't read Rails 4 In Action and have a lot of respect for its author ;)
[21:51:31] krisquigley: has joined #RubyOnRails
[21:53:04] User4587_: has joined #RubyOnRails
[21:54:01] renegadeandy: Could somebody please give me a hand with this sorting question, I am struggling to work out a simple way to achieve this : https://gist.github.com/renegadeandy/c963036732e31f61d6c7
[21:56:07] Radar: renegadeandy: You just want the next 7 days?
[21:56:30] craysiii: rails should have special methods to do what you want, provided you are using a datetime i believe.
[21:56:47] craysiii: but i will yield to radar
[21:56:53] Radar: days.where("whatever_your_time_field_is_called > ? AND < ?", Time.current, 7.days.from_now)
[21:57:20] Radar: Or with https://github.com/radar/by_star: days.between(Time.current, 7.days.from_now, field: "whatever_your_time_field_is_called")
[21:57:39] baweaver: also days.where(time_field: Time.current..7.days.from_now)
[21:57:43] baweaver: ranges work.
[21:57:47] slash_nick: that's the one ^
[21:57:48] Radar: baweaver: point
[21:57:52] Radar: I always forget about that :)
[21:57:57] Radar: Back in my day....
[21:58:00] slash_nick: Radar: coming from the old days, that happens
[21:58:07] baweaver: DateTime works, Time doesn't
[21:58:10] renegadeandy: Hang on, my time field is storing an int , 0--7
[21:58:12] baweaver: be wary of that annoying one though
[21:58:12] Oog: has joined #RubyOnRails
[21:58:24] Radar: renegadeandy: Uh, why?
[21:58:26] renegadeandy: representing the day
[21:58:35] Radar: renegadeandy: So an event can happen weekly?
[21:58:39] Radar: can only*
[21:58:47] Radar: baweaver: next 7 days
[21:58:53] Radar: Tuesday -> Monday
[21:58:54] baweaver: though that'll be all types of brittle
[21:58:56] Radar: Or Wednesday -> Tuesday
[21:59:42] wldcordeiro: has joined #RubyOnRails
[21:59:45] renegadeandy: if you re-read my text here L https://gist.github.com/renegadeandy/c963036732e31f61d6c7
[21:59:52] Oog: under http://guides.rubyonrails.org/association_basics.html#updating-the-schema 3.3.2 - https://gist.github.com/anonymous/f4ac86da8ba7295a2375 shouldnt CreateAssembliesPartsJoinTable have a unique index on [:assembly_id, : part_id] ?
[22:00:09] baweaver: ([*0..6] * 2)[day + 7]
[22:00:20] gopz: has joined #RubyOnRails
[22:00:44] renegadeandy: baweaver: can you explain it a bit, or pop it into my gist?
[22:01:25] workmad3: has joined #RubyOnRails
[22:02:04] baweaver: ([*0..6] * 2)[0 + 6] % 7 -> 6
[22:04:22] renegadeandy: baweaver: Can you help explain it to me based upon my days collection?
[22:04:27] renegadeandy: https://gist.github.com/renegadeandy/c963036732e31f61d6c7
[22:04:49] baweaver: what do you think it's doing?
[22:04:53] willardg: has joined #RubyOnRails
[22:04:59] Technodrome: has joined #RubyOnRails
[22:05:18] roshanavand: has joined #RubyOnRails
[22:07:54] Pharaoh2: has joined #RubyOnRails
[22:07:56] bap1313: has joined #RubyOnRails
[22:08:47] workmad3: has joined #RubyOnRails
[22:09:11] darrencauthon: has joined #RubyOnRails
[22:10:05] zhkirill: has joined #RubyOnRails
[22:10:07] renegadeandy: baweaver: i cannot see how it fits into my question, if the completed syntax was there, i might be able to reverse engineer to understand it
[22:10:25] baweaver: let's step through it then
[22:10:36] baweaver: ([*0..6] * 2)[0 + 6] % 7 -> 6
[22:10:40] WillAmes: has joined #RubyOnRails
[22:10:48] baweaver: this is a trick used for substrings as well
[22:10:59] baweaver: ([*0..6] * 2)
[22:11:02] baweaver: what does this do?
[22:11:26] baweaver: well, I'd rewrite it as [*0..6,*0..6]
[22:11:40] renegadeandy: it creates 2 arrays of 0-6
[22:11:55] riotjones: has joined #RubyOnRails
[22:12:07] baweaver: [0,1,2,3,4,5,6,0,1,2,3,4,5,6]
[22:12:07] renegadeandy: 1 array from 0 - 6 2 times
[22:12:15] appcademics: has joined #RubyOnRails
[22:12:23] craysiii: its not efficient enough :P
[22:12:26] baweaver: then you're getting your day (M -> 0) + 6
[22:12:27] craysiii: we can go further
[22:12:48] baweaver: which is effectively doing what?
[22:13:15] renegadeandy: getting an array index?
[22:13:30] baweaver: what's significant about 6?
[22:13:44] renegadeandy: its a weeks worth of indices?
[22:14:15] simplyia_: has joined #RubyOnRails
[22:14:17] jhn: has joined #RubyOnRails
[22:14:25] baweaver: so you want to get Monday -> Sunday, Sunday -> Saturday
[22:14:59] baweaver: it's basically making a cycle to check, then % 7 is finding what day it is
[22:15:20] renegadeandy: baweaver: if days contained "2, 5, 6" and we are on day "3" I want it to return 5, 6, 2
[22:15:23] Guest123456666: has joined #RubyOnRails
[22:15:50] renegadeandy: baweaver: or i want to sort my active record collection into 5, 6, 2
[22:15:51] havenn: has joined #RubyOnRails
[22:16:15] baweaver: not sure if sql can sort like that.
[22:16:24] renegadeandy: i could do it some other way...
[22:16:32] renegadeandy: i dont really mind how its done
[22:16:46] mary5030: has joined #RubyOnRails
[22:17:18] renegadeandy: i think your solution is for a slightly different problem though
[22:17:28] renegadeandy: my problem is a sorting based problem
[22:17:31] charliesome: has joined #RubyOnRails
[22:17:57] sar1nk: has joined #RubyOnRails
[22:18:10] sayan_: has joined #RubyOnRails
[22:19:11] rhizome: sort on yday
[22:19:14] inanepenguin: has joined #RubyOnRails
[22:19:37] Motoservo: has joined #RubyOnRails
[22:20:11] sayan___: has joined #RubyOnRails
[22:20:31] renegadeandy: This may be a clearer description of the problem https://gist.github.com/renegadeandy/c963036732e31f61d6c7
[22:20:35] Shoutsid: has joined #RubyOnRails
[22:20:56] pydave6367: has joined #RubyOnRails
[22:21:04] rickmasta: has joined #RubyOnRails
[22:21:05] Prira: has joined #RubyOnRails
[22:21:53] craysiii: i don't think you can accomplish what you want with activerecord or raw sql
[22:22:32] bonhoeffer: has joined #RubyOnRails
[22:23:01] ArTiSTiX: has joined #RubyOnRails
[22:23:45] renegadeandy: craysiii: that aimed at my question?
[22:24:00] renegadeandy: difficult huh?
[22:24:01] shinobi_: has joined #RubyOnRails
[22:24:22] kapowaz: has joined #RubyOnRails
[22:24:36] ellisTAA: i want to run some function every 30 minutes, i???m planning on using the whenever gem, but i???m not sure if i should use a rake task or if i can just call the method? does anyone have any suggestions?
[22:24:37] slash_nick: baweaver: renegadeandy : curious... .where(daything: [0,1,2,3,4,5,6]), rotating that array by today's N (N=0 on monday or whatever)
[22:24:38] greengriminal: has joined #RubyOnRails
[22:24:44] rhizome: renegadeandy: makes no sense
[22:24:47] shinobi_: has joined #RubyOnRails
[22:25:01] slash_nick: i have a feeling that's foolish to suggest :)
[22:25:04] simplyianm: has joined #RubyOnRails
[22:25:04] craysiii: is there a reason you want to store days of the week as ints?
[22:25:09] shinobi_: has joined #RubyOnRails
[22:25:23] craysiii: can you show us a greater context in which this will be used?
[22:25:36] craysiii: otherwise, like rhizome said, it really makes no sense
[22:26:09] hueston: has joined #RubyOnRails
[22:26:45] codezomb: has joined #RubyOnRails
[22:26:59] appcademics: has joined #RubyOnRails
[22:27:47] krainboltgreene: has joined #RubyOnRails
[22:27:49] codezomb: When using <Model>.connection.execute(sql), is there a way to convert arrays (from postgres using array_agg) which come back as strings, into actual arrays?
[22:28:08] codezomb: for example, my result comes back with `{4,3,2}`
[22:28:27] renegadeandy: craysiii: https://gist.github.com/renegadeandy/c963036732e31f61d6c7
[22:28:39] renegadeandy: I have a schedule object, which has many days.
[22:28:45] chouhoulis: has joined #RubyOnRails
[22:28:54] judetucker: has joined #RubyOnRails
[22:28:54] renegadeandy: and I need to find the next date the schedule contains
[22:28:56] rhizome: codezomb: try .scan
[22:29:16] renegadeandy: with the get_next_date method
[22:29:27] craysiii: okay so schedule has_many :days, is days a datetime, a date, or a custom model with an int attribute?
[22:30:05] renegadeandy: custom model currently looking like this :https://gist.github.com/renegadeandy/c963036732e31f61d6c7
[22:30:40] Pazician: has joined #RubyOnRails
[22:32:06] willardg: has joined #RubyOnRails
[22:33:49] machty: has joined #RubyOnRails
[22:34:01] craysiii: honestly the way it looks now, i think you need to re-think your solution. needs more normalization
[22:34:17] renegadeandy: craysiii: :'( really?
[22:34:34] craysiii: a day shouldn't rely on it's ID to determine the day of the week, it should be a seperate attribute
[22:34:56] renegadeandy: I was really hoping for a way to do this. Its not relying on its ID?
[22:34:58] Radar: ACTION looks in, sees this is still going.
[22:35:00] craysiii: otherwise, you can only have 7 day instances before it breaks your sorting algorithm
[22:35:19] craysiii: how are you determining which day of the week it is?
[22:35:28] willardg: has joined #RubyOnRails
[22:35:31] renegadeandy: DateTime.today.wday
[22:35:39] craysiii: nono, i mean the stored date on the model
[22:35:50] renegadeandy: oh, i call the wday method
[22:35:51] craysiii: to denote monday, tuesday
[22:35:57] havenwood: has joined #RubyOnRails
[22:36:21] Pharaoh2: has joined #RubyOnRails
[22:37:26] Spami: has joined #RubyOnRails
[22:37:46] FailBit: rspec is horrifyingly obtuse and ridiculous
[22:37:49] FailBit: never again
[22:37:50] slash_nick: it can be done :)
[22:38:01] lacrosse: has joined #RubyOnRails
[22:38:05] simplyianm: has joined #RubyOnRails
[22:38:15] craysiii: okay, why don't you give a seperate index for each day, to know which order it goes in in regards to the event?
[22:38:22] tallmocha: has joined #RubyOnRails
[22:38:31] craysiii: er schedule i mean
[22:39:01] rhizome: can anybody explain it in english yet?
[22:39:06] Spami: has joined #RubyOnRails
[22:39:21] craysiii: how is rspec obtuse?
[22:39:27] rachellc: has joined #RubyOnRails
[22:39:31] rhizome: i meant the other thing
[22:39:57] ellisTAA: ive never deleted my logs before. how often should i be doing this? once a week?
[22:40:09] renegadeandy: craysiii: not quite following you. A schedule can include any days of the week. It might include tuesday's and thursdays'. If today is wednesday, then the get_next_date should return to me the DateTime.tomorrow, if today was friday, it should return next tuesday. That is the job of this method
[22:41:08] renegadeandy: So its really as simple as, sorting the days collection, starting at the current day of the week as the first index
[22:41:20] renegadeandy: or the next closest day of the week included in the schedule
[22:41:38] craysiii: its not "really as simple as" otherwise you wouldn't be asking :)
[22:41:49] slash_nick: renegadeandy: take this article: http://sqlandme.com/2013/11/18/sql-server-custom-sorting-in-order-by-clause/, #find_by_sql, and something like `0.upto(6).to_a.rotate(Time.now.day)`, all together to make it work
[22:42:25] slash_nick: when 6 then 0, when 0 then 1, when 1 then 0...
[22:42:40] renegadeandy: craysiii: i totally agree, but logically, its simple.
[22:42:49] renegadeandy: craysiii: do you think slash_nick 's suggestion will work?
[22:42:59] craysiii: why are you storing a datetime as a string and then converting back to datetime?
[22:43:07] smathy: EllisTAA, totally up to you, many people do them daily, many others do them weekly, some do them at a size threshold, and others a combination of all of the above.
[22:43:16] craysiii: i dunno, try it.
[22:43:25] smathy: FailBit, agreed.
[22:43:30] slash_nick: renegadeandy: i know i could write it to work... but i wanna hang out with my wife :)
[22:43:48] rhizome: nerd traitor
[22:44:05] Shoutsid: has joined #RubyOnRails
[22:44:08] smathy: ...and all the effort in learning rspec has precisely one application.
[22:44:11] renegadeandy: craysiii: im not converting back to DateTime, i only care about the day, and there is not object in ruby which handles just the day, so I had to make it myself
[22:44:14] moeabdol: has joined #RubyOnRails
[22:44:20] Radar: Oh, I realised I had the answer to this already somewhere in my brain.
[22:44:21] renegadeandy: slash_nick: so you think this would work?
[22:44:27] zhkirill: has joined #RubyOnRails
[22:44:27] Radar: ACTION finds the right method
[22:44:43] slash_nick: renegadeandy: you just need to produce the string you'll pass to "find_by_sql" dynamically... producing the case statement for your sql `order by`
[22:44:58] bonhoeffer: has joined #RubyOnRails
[22:45:04] jenrzzz: has joined #RubyOnRails
[22:45:10] Radar: renegadeandy: (0..6).to_a.rotate(Time.now.wday)
[22:45:15] Radar: That is the order of the days to fetch from your database.
[22:45:18] slash_nick: renegadeandy: you are trying to query for Foos, where those with a day of 1 will come first on 1day... day 2 will come first on 2day, right?
[22:45:26] Radar: Today is Wednesday here, which is wday==3, so that shows as: [3, 4, 5, 6, 0, 1, 2]
[22:45:26] jessemcgilallen: has joined #RubyOnRails
[22:45:35] slash_nick: ACTION highfives Radar 
[22:45:41] Radar: You can then query your database for each ... event? matching the day of the week
[22:45:53] Radar: Event.where(day: day), 7 times, one for each day
[22:45:59] ellisTAA: smathy: do i empty it manually or do i have to write some script to empty it?
[22:46:09] zhkirill: has joined #RubyOnRails
[22:46:12] smathy: EllisTAA, google logrotate
[22:46:13] slash_nick: Radar: close... the rotate method is right on, but i think you can do it in one query
[22:46:19] renegadeandy: Radar: that is a very simple, lovely way to do this :)!
[22:46:22] ellisTAA: smathy: cool
[22:46:22] Radar: slash_nick: Even get them returned in the right order?
[22:46:28] craysiii: i think you could just use activerecord if you give each Day a schedule_index. Then you could do something like days = days.where("day > today").order("schedule_index ASC")
[22:46:31] havenwood: kyrylo: i hope so
[22:46:36] Radar: slash_nick: That's what I'm concerned about: it will return them in the wrong order and then you'll need to split them in Ruby.
[22:46:41] smathy: EllisTAA, more than likely, it's already running daily on your server and you just have to drop a config into /etc/logrotate.d or something.
[22:46:46] Radar: slash_nick: I can't think of a way to do it one query right now
[22:47:01] renegadeandy: Im going to use Radar's solution! Its great! Thanks craysiii and slash_nick
[22:47:02] slash_nick: Radar: this is how http://sqlandme.com/2013/11/18/sql-server-custom-sorting-in-order-by-clause/
[22:47:09] baweaver: has joined #RubyOnRails
[22:47:21] smathy: EllisTAA, I assume you're talking about production, if you're talking about dev - just periodically: rm log/*
[22:47:28] Radar: I would rather 7 queries :P
[22:47:40] ellisTAA: smathy: thanks
[22:47:44] bruno-: has joined #RubyOnRails
[22:47:58] Radar: I only learned about the rotate method 2 months ago and it just twigged that's what renegadeandy is looking for
[22:48:01] slash_nick: Radar: lol! eh, maybe... depends on how large our connection pool is
[22:49:48] renegadeandy: Radar: me too, its perfect! Thank you!
[22:50:04] havenn: has joined #RubyOnRails
[22:50:53] sanjayu: has joined #RubyOnRails
[22:50:59] meshugga: has joined #RubyOnRails
[22:51:14] inanepenguin: has joined #RubyOnRails
[22:51:23] slash_nick: Radar: str = "select id,daything from foos order by case ";(0..6).to_a.rotate(Time.now.wday).each_with_index {|e,i| str += "when #{e} then #{i} "}; str + "else daything"
[22:51:33] craysiii: that is so ugly
[22:51:35] slash_nick: renegadeandy: "select id,daything from foos order by case when 2 then 0 when 3 then 1 when 4 then 2 when 5 then 3 when 6 then 4 when 0 then 5 when 1 then 6 else daything" ^
[22:52:03] craysiii: this could be fixed so easily by adding a schedule_index, and then you could use pure activerecord.
[22:52:04] renegadeandy: slash_nick: im just not smart enough to follow thatt
[22:52:24] acti0nman: has joined #RubyOnRails
[22:52:29] renegadeandy: craysiii: i don't think that would work, the days are not indexed in any partiuclar static order, it is dynamic
[22:52:36] slash_nick: ugly to you... beautiful to a psql DB nearing it's max connection count
[22:52:44] renegadeandy: slash_nick: LOL!
[22:53:40] craysiii: renegadeandy thats why you would adjust the indices if you're inserting in between two days.
[22:53:44] slash_nick: renegadeandy: that feature is meant to allow you to do things like... i dunno, sort by color, but treat "blue" just like "cyan"
[22:54:12] slash_nick: renegadeandy: i just used it for your problem... which is actually pretty similar
[22:54:33] smathy: Nice slash_nick
[22:55:18] craysiii: it totally would work but whatever
[22:55:31] meshugga: where do i have to look to find out how sessions are serialized/marshalled?
[22:55:39] smathy: Should write a `case` method for AR that takes a hash.
[22:55:42] meshugga: i can't seem to find it
[22:56:00] meshugga: (also, i'm not that great with ruby)
[22:56:01] slash_nick: smathy: that'd clear my need for #each_with_index
[22:56:26] smathy: ...or I suppose it'd be arel really, you want to shove it into an order or wherever you wanted it.
[22:56:53] slash_nick: yeah, sql's case statements aren't limited to just `order by` clauses, right?
[22:57:08] smathy: Nope, can be very useful in many places.
[22:57:56] bobbobbins: has joined #RubyOnRails
[22:58:17] lxkm__: has joined #RubyOnRails
[22:58:19] smathy: meshugga, this has some details: http://guides.rubyonrails.org/action_controller_overview.html#session
[22:58:27] slash_nick: i think AR oughta have it... #order(0: 1, 1: 2, 2: 3, 3: 4, 4: 5, 6: 0)... that should use `order by case`... smathy what's the DSL for the "else" of the case?
[22:59:18] slash_nick: #order(:colname, "ASC", {0: 1, 1: 2, 2: 3, 3: 4, 4: 5, 6: 0})
[23:01:12] meshugga: smathy: thanks a bunch!
[23:01:20] slash_nick: i'd actually be surprised if arel didn't already support it, smathy
[23:02:46] smathy: meshugga, but each store does its own marshaling, so you really have to check in whichever store you're suing.
[23:03:15] smathy: slash_nick, just the :else member of the hash?
[23:03:34] smathy: slash_nick, I just checked and it gives CASE statements as the example of complex queries requiring SqlLiteral :)
[23:03:39] slash_nick: smathy: what if "else" is a value in the string column you're sorting on?
[23:03:49] slash_nick: smathy: link?
[23:04:17] slash_nick: elsewhere i linked to an arel issue asking about support for cases
[23:04:20] smathy: slash_nick, https://github.com/rails/arel - near the bottom.
[23:04:33] smathy: slash_nick, and you're right re :else, so it'd have to be a key called Arel::Else or something.
[23:05:37] ellisTAA: has joined #RubyOnRails
[23:05:51] smathy: Arel::Case.new( 0: 1, 1: 2, 2: 3, Arel::Else => Float::INFINITY )
[23:06:28] smathy: I reckon!
[23:07:01] andersoldahl: has joined #RubyOnRails
[23:07:51] artto: has joined #RubyOnRails
[23:07:53] slash_nick: except... Arel::Else => 'colname'
[23:08:19] inanepenguin: has joined #RubyOnRails
[23:08:19] slash_nick: oh... my syntax was off earlier
[23:08:44] slash_nick: str = "select id,daything from foos order by case ";(0..6).to_a.rotate(Time.now.wday).each_with_index {|e,i| str += "when daything = #{e} then #{i} "}; str + "else daything"
[23:09:42] ericjphillips: has joined #RubyOnRails
[23:10:13] Meow-J: has joined #RubyOnRails
[23:10:21] terrellt: It's been too long - how to benchmark what parts of a method are taking the longest from the console?
[23:10:36] terrellt: Something like a method call graph you'd get from new relic, but from the console.
[23:10:45] terrellt: (Really it's from rspec, but same idea)
[23:10:46] smathy: Each key would have to also be able to be an arel node, so you could have: Arel::Case.new( t[:foo].lt(0) => "negative", t[:foo].gt(0) => "positive", Arel::Else => "zero" )
[23:10:47] SteenJobs: has joined #RubyOnRails
[23:12:20] smathy: terrellt, ruby-prof ?
[23:12:27] terrellt: smathy++ That'll do it
[23:12:34] sypheren: has joined #RubyOnRails
[23:12:35] iamdevnul: has joined #RubyOnRails
[23:12:43] riotjones: has joined #RubyOnRails
[23:13:37] riotjones: has joined #RubyOnRails
[23:15:14] Shoutsid: has joined #RubyOnRails
[23:15:19] Lloyd: has joined #RubyOnRails
[23:15:27] quazimodo: has joined #RubyOnRails
[23:15:29] quazimod1: has joined #RubyOnRails
[23:15:40] craysiii: if i remove a column in migration#down, does the index to the column automatically get removed as well?
[23:15:48] ellisTAA: im trying to use the whenever gem, but i???m not seeing anything ouput into the /log/development.log, can someone take a look at my code https://gist.github.com/ellismarte/4f2f926386083850bfd6
[23:16:02] highcup: has joined #RubyOnRails
[23:16:39] craysiii: Ellis did you update whenever using the command line and then restart your cron service?
[23:16:50] DukeDave: has joined #RubyOnRails
[23:17:09] ellisTAA: craysiii: i ran whenever -i
[23:17:13] EminenceHC: has joined #RubyOnRails
[23:17:15] ellisTAA: then restarted the server
[23:17:42] artto: has joined #RubyOnRails
[23:17:43] bendangelo: has joined #RubyOnRails
[23:18:05] diegoviola: has joined #RubyOnRails
[23:18:14] Hosh: has joined #RubyOnRails
[23:18:15] craysiii: the web server or the cron service?
[23:18:29] ellisTAA: restarted the local web server
[23:18:37] ellisTAA: not sure how to restart the cron service .. looking now
[23:18:39] ebryn: has joined #RubyOnRails
[23:18:42] craysiii: http://stackoverflow.com/questions/7548730/cron-job-not-working-in-whenever-gem
[23:19:09] sonofdirt: has joined #RubyOnRails
[23:19:46] newton: has joined #RubyOnRails
[23:19:46] rushed: EllisTAA: whenever has capistrano integration, should be take care of on deploy (if you're not using cap maybe find out what the equilivant integration helper is for your method)
[23:20:10] rushed: EllisTAA: ^ need to require 'whenever/capistrano' in your Capfile (Cap3) or deploy (2)
[23:20:37] joaomdmoura: has joined #RubyOnRails
[23:22:40] Technodrome: has joined #RubyOnRails
[23:22:40] MrPunkin: has joined #RubyOnRails
[23:23:12] FailBit: Is it acceptable to say that I want to shoot whoever invented rspec
[23:23:19] MrPunkin: has left #RubyOnRails: ()
[23:23:24] Ropeney: has joined #RubyOnRails
[23:23:57] craysiii: no. guns are bad. stabbing is okay though.
[23:24:17] baweaver: has joined #RubyOnRails
[23:24:55] slash_nick: so, affix bayonettes
[23:25:53] chancancode_: has joined #RubyOnRails
[23:26:04] shwoodard: has joined #RubyOnRails
[23:26:20] jglover: has joined #RubyOnRails
[23:26:31] Iacobus: has joined #RubyOnRails
[23:26:35] jglover: for some reason, every time I want to edit code in a helper or css file I have to kill my server, and then do a rake assets:clean
[23:26:39] jglover: this just started today
[23:27:05] kumavis: has joined #RubyOnRails
[23:27:19] jglover: any ideas? this is horrible
[23:27:19] slash_nick: such violence... shooting, stabbing, killing
[23:27:30] smathy: craysiii, yes.
[23:28:11] smathy: jglover, is something generating assets automatically for you?
[23:28:24] slash_nick: jglover: you talking about in your dev environment?
[23:28:27] smathy: jglover, ie. generating static assets in public/ for you.
[23:28:33] rodfersou: has joined #RubyOnRails
[23:28:55] jglover: i have a source_maps folder here
[23:28:58] culturelabs: has joined #RubyOnRails
[23:28:59] jglover: that I keep having to delete
[23:29:13] amitchellbullard: has joined #RubyOnRails
[23:29:14] jglover: could that be it?
[23:31:53] zrl_: has joined #RubyOnRails
[23:32:16] jlpeters: has joined #RubyOnRails
[23:33:25] spastorino: has joined #RubyOnRails
[23:33:41] xcv: has joined #RubyOnRails
[23:34:14] ericjphillips1: has joined #RubyOnRails
[23:34:31] ericjphillips1: has left #RubyOnRails: ()
[23:35:28] rromanch_: has joined #RubyOnRails
[23:36:21] hck89: has joined #RubyOnRails
[23:37:28] nickfausnight: has joined #RubyOnRails
[23:39:44] HAL2328_: has joined #RubyOnRails
[23:39:46] yfeldblum: has joined #RubyOnRails
[23:42:48] Pharaoh2: has joined #RubyOnRails
[23:44:48] craysiii: do i have to pass a block to a format in respond_to?
[23:45:09] FailBit: respond_to do |format|
[23:45:11] FailBit: format.html
[23:45:16] FailBit: is perfectly fine
[23:45:21] craysiii: okay sweet :)
[23:45:23] FailBit: in most cases that just means implicit render
[23:46:00] SteenJobs: has joined #RubyOnRails
[23:46:17] craysiii: so if it's in a destroy controller method, that means i should redirect the html, right? since there is no destroy view
[23:46:23] craysiii: well destroy get method.
[23:46:33] chouhoulis: has joined #RubyOnRails
[23:46:45] FailBit: format.html { redirect_to things_path }
[23:49:13] rushed: has joined #RubyOnRails
[23:50:28] banister: has joined #RubyOnRails
[23:50:29] inanepenguin: has joined #RubyOnRails
[23:53:05] one_zero: has joined #RubyOnRails
[23:53:50] User458764: has joined #RubyOnRails
[23:54:17] manfrin_: has joined #RubyOnRails
[23:56:53] andersoldahl: has joined #RubyOnRails
[23:58:20] sevenseacat: has joined #RubyOnRails