« Back to channel list

#RubyOnRails - 29 October 2015

« Back 1 day Forward 1 day »
[00:00:03] sunya7a__: has joined #RubyOnRails
[00:00:19] raazdaan: has joined #RubyOnRails
[00:01:53] rickmasta: has joined #RubyOnRails
[00:02:33] sunya7a: has joined #RubyOnRails
[00:04:01] one_zero: has joined #RubyOnRails
[00:05:10] nya: has joined #RubyOnRails
[00:08:04] sevenseacat: has joined #RubyOnRails
[00:09:25] mices: bootstrap vs scss?
[00:09:58] Axilla: has joined #RubyOnRails
[00:10:01] chouhoulis: has joined #RubyOnRails
[00:10:14] mices: there's no bootstrap-scss gem only bootstrap-sass
[00:11:00] Papierkorb: oh, that. well, you can use SCSS in your app no problem.
[00:11:03] baweaver: you can't vs those.
[00:11:16] mozzarella: you know scss is just a different syntax, right?
[00:11:21] baweaver: vs implies they have the same function
[00:11:22] mozzarella: it's still sass
[00:12:04] mices: i'm using scss syntax not sass
[00:12:38] baweaver: it won't matter.
[00:12:50] mices: just name an scss file sass it's ok?
[00:13:06] Papierkorb: mices: just use bootstrap from your scss file.
[00:13:21] mices: ok sorry ty
[00:13:43] baweaver: you might want to just try it out next time.
[00:17:14] bonhoeffer: has joined #RubyOnRails
[00:18:49] superlou: has joined #RubyOnRails
[00:19:46] mices: ActionView::Template::Error (Invalid CSS after "...trap-sprockets"": expected selector or at-rule, was "@import "bootst..."
[00:20:32] sevenseacat: good to know.
[00:20:39] 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.
[00:21:00] mices: it's asking for something between @import "bootstrap-sprockets" and @import "bootstrap"
[00:21:09] mices: that's what it boils down to isn't it
[00:21:20] Contigi: has joined #RubyOnRails
[00:21:23] sevenseacat: yes, because thats not valid scss syntax.
[00:22:18] mices: https://gist.github.com/mices/e94541ce2f960afea70e
[00:22:59] sevenseacat: mices: what do lines in a css file end with?
[00:23:46] pydave6367: has joined #RubyOnRails
[00:23:49] boombadaroomba: Anyone have any good articles for writing strategies for oauth2?
[00:24:04] Radar: mices: https://gist.github.com/mices/e94541ce2f960afea70e#file-application-css-scss-L16-L17
[00:24:05] hardtail: has joined #RubyOnRails
[00:24:09] Radar: mices: You're SEMI right there.
[00:24:18] rhizome: boombadaroomba: nope, but i've done it for a simple one
[00:24:32] kitsuneyo: has joined #RubyOnRails
[00:24:46] boombadaroomba: rhizome, not as hard as I'm making it out to be?
[00:24:51] hardtail: g'day everyone
[00:24:59] rhizome: boombadaroomba: no, it is.
[00:25:17] boombadaroomba: rhizome, did you use an example such as twitter/facebook?
[00:25:33] kitsuneyo: so if i've got a yaml file with strings that are going to be inserted into an erb partial, can i interpolate stuff from the current scope?
[00:25:41] rhizome: that was the hardest part, finding an example small enough
[00:26:23] boombadaroomba: rhizome, what did you use?
[00:26:59] rhizome: woops, sorry. it was omniauth
[00:27:20] boombadaroomba: yeah,im using that too
[00:27:24] rhizome: https://github.com/rhizome/omniauth-discogs
[00:27:51] boombadaroomba: rhizome, i hope you dont min if I use this as reference
[00:27:57] rhizome: not at all
[00:28:11] rhizome: i think it's about as simple a flow as i've seen
[00:28:18] rhizome: two years ago anyway
[00:28:44] boombadaroomba: this is perfect. the example i was comparing mine to was 2-3x this length
[00:29:03] rhizome: yeah ppl go nuts, and oauth lets them
[00:29:08] SteenJobs: has joined #RubyOnRails
[00:29:19] boombadaroomba: yeah, trying to create my own for oauth2 for fitbit
[00:29:51] boombadaroomba: but thanks im going to sign off and get grinding
[00:30:03] boombadaroomba: see you guys tomorrow!
[00:30:06] workmad3: has joined #RubyOnRails
[00:31:56] mices: radar: ty
[00:32:49] kitsuneyo: has joined #RubyOnRails
[00:32:51] annlewis: has joined #RubyOnRails
[00:33:03] dideler: has joined #RubyOnRails
[00:34:36] craysiii: https://gist.github.com/craysiii/42c9b07e70ef375cc777 trying to see if i'm just dense or what. I can't seem to set an instance variable in my after_find callback
[00:35:33] sevenseacat: nasty. theres also no instance variables there.
[00:35:43] Radar: no attr_accessor?
[00:35:59] hardtail: Has anyone here used delayed_job gem with carrierwave_backgrounder gem and received this error while starting jobs on production? Errno::ENOENT: No such file or directory = /app/public/uploads/tmp/../..
[00:38:24] smathy: Hardtail, do you have that directory?
[00:39:06] Oog: has joined #RubyOnRails
[00:40:37] Oog: i have a model with a boolean active. model.active and model.active? work - what is the ?
[00:41:02] hardtail: Smathy, right up to the tmp directory yes
[00:41:30] mices: radar: Undefined mixin 'box_sizing'.
[00:41:49] Radar: mices: E_COME_ON_BRO
[00:41:59] pwnd_nsfw: has joined #RubyOnRails
[00:42:00] twilling: has joined #RubyOnRails
[00:42:18] smathy: craysiii, you have to specify after_find :your_method
[00:42:43] craysiii: thanks smathy
[00:43:01] craysiii: yes i needed attr_accessor, i need to refresh my plain ruby -.-
[00:44:15] rhizome: i have a simple reminder for that: "you can't just tack random stuff on"
[00:44:38] craysiii: im just used to being able to do that with python lol
[00:44:49] decaff_: has joined #RubyOnRails
[00:46:04] Elyx0: has joined #RubyOnRails
[00:46:45] decaff_: Is it possible to use one database for a django app and a rails app at the same time?
[00:46:54] smathy: decaff_, yes.
[00:47:19] baweaver: but you'd better play by Rails's rules
[00:47:24] baweaver: or good luck
[00:47:39] decaff_: smathy, do you know if there is a tool that will generate migrations based on the existing schema? I have an existing django db
[00:47:39] baweaver: though their dataset rules are pretty easy to map to
[00:48:00] baweaver: don't really need one.
[00:48:25] baweaver: for rails you just need to have id, and association_id for associations/joins
[00:48:39] decaff_: baweaver meh, yeah you don't exactly need one but django does have "inspectdb" which makes it really easy
[00:49:01] baweaver: couldn't say a parallel as I've never used it.
[00:49:17] decaff_: baweaver I may just do something different.
[00:49:29] startupality: has joined #RubyOnRails
[00:52:10] lacuna_: has joined #RubyOnRails
[00:53:24] smathy: decaff_, I assume you mean so you can setup your dev DB or something. Just get the schema using your DB tools, and import it.
[00:53:34] bricker: has joined #RubyOnRails
[00:56:59] decaff_: smathy I'm not quite used to the "rails" way of doing things. I guess I don't really need to have the migrations in the app now that I think of it. I could just configure the app to connect to the existing DB and then generate the models to go with the tables that already exist? http://stackoverflow.com/questions/938545/how-do-i-import-a-sql-schema-into-rails this seems to suggest that as long as the naming conventions are f
[00:56:59] decaff_: ollowed I should be good to go
[01:00:32] nya: has joined #RubyOnRails
[01:03:35] dmarr: how would i deal with 'undefined method `bugs_path'
[01:04:13] dmarr: i set up a specific route with get '/buglist/report', to: 'bug_list#report' but the Bug model doesn't have its own controller
[01:05:43] sevenseacat: where and why are you calling bugs_path ?
[01:05:54] sevenseacat: and what is bugs_path supposed to be?
[01:06:38] rgrmatt_: has joined #RubyOnRails
[01:07:19] Jasaka: has joined #RubyOnRails
[01:07:42] djellemah_: has joined #RubyOnRails
[01:08:12] dmarr: trying to build a form: = form_for :bugs do |f|
[01:09:21] darrencauthon: has joined #RubyOnRails
[01:09:53] dmarr: in the BugList controller: the report method has: @bug = Bug.new; render 'bug_list/report/index'
[01:10:32] blackhuey: has joined #RubyOnRails
[01:10:47] d34th4ck3r: has joined #RubyOnRails
[01:10:52] willardg: has joined #RubyOnRails
[01:13:42] jgpawletko: has joined #RubyOnRails
[01:13:49] l_tonz: has joined #RubyOnRails
[01:14:41] chills42: has joined #RubyOnRails
[01:15:04] nettoweb: has joined #RubyOnRails
[01:17:42] rshetty: has joined #RubyOnRails
[01:18:46] kitsuneyo: has joined #RubyOnRails
[01:21:15] sevenseacat: ok, so where is that form supposed to submit to
[01:22:41] beauby: has joined #RubyOnRails
[01:22:51] raazdaan: has joined #RubyOnRails
[01:24:00] qejk: has joined #RubyOnRails
[01:27:37] mag42c: has joined #RubyOnRails
[01:27:48] dmarr: i am going down the path now of adding a Bugs resources
[01:28:07] dmarr: and so I guess that would submit to BugsController#create
[01:29:08] Thomas-0725: has joined #RubyOnRails
[01:30:59] migrationhelp: has joined #RubyOnRails
[01:31:28] yogeshwar: has joined #RubyOnRails
[01:33:32] dmarr: so i my form_for(@bug) is rendering, and its using the action /bugs
[01:33:34] annlewis: has joined #RubyOnRails
[01:34:29] dmarr: in my Bug model it has a belongs_to :flow association, how would I get a list of all flows within that bug form?
[01:34:44] darrencauthon: has joined #RubyOnRails
[01:35:35] marahin: Hello. What's the best way to store decimal numbers (currency - oriented value) in MySQL? I am using bigdecimals in Rails, however it seems that MySQL rounds it up?
[01:36:11] dmarr: sevenseacat: I thought I'd be able to do something like = f.collection_select :bug, :flow_id, Flow.all, :id, :name
[01:36:28] sevenseacat: you don't need the first :bug
[01:37:17] sevenseacat: but the rest looks about right
[01:38:02] rubyonrailed: has joined #RubyOnRails
[01:43:27] lacrymology: has joined #RubyOnRails
[01:45:25] dopamean_: has joined #RubyOnRails
[01:45:25] quazimodo: has joined #RubyOnRails
[01:48:53] stardiviner: has joined #RubyOnRails
[01:49:05] pydave6367: has joined #RubyOnRails
[01:49:58] SamGerber: has joined #RubyOnRails
[01:51:19] ElFerna: has joined #RubyOnRails
[01:52:21] smathy: has joined #RubyOnRails
[01:54:07] rubyonrailed: has joined #RubyOnRails
[01:54:30] snurfery: has joined #RubyOnRails
[01:54:46] hughjasss: has joined #RubyOnRails
[01:55:52] Maletor: has joined #RubyOnRails
[02:00:28] ElFerna: has joined #RubyOnRails
[02:05:24] bonhoeffer: has joined #RubyOnRails
[02:05:37] l_tonz: has joined #RubyOnRails
[02:05:54] l_tonz: has joined #RubyOnRails
[02:12:22] nettoweb: has joined #RubyOnRails
[02:13:37] adam|: has left #RubyOnRails: ()
[02:15:56] ElFerna: has joined #RubyOnRails
[02:16:52] annlewis: has joined #RubyOnRails
[02:17:28] losvedir: has joined #RubyOnRails
[02:17:32] paradisaeidae: has joined #RubyOnRails
[02:17:50] mary5030: has joined #RubyOnRails
[02:19:58] mary5030: has joined #RubyOnRails
[02:21:25] Lightsword: has joined #RubyOnRails
[02:22:55] roxtrongo: has joined #RubyOnRails
[02:27:27] rickmasta: has joined #RubyOnRails
[02:29:38] m3_del: has joined #RubyOnRails
[02:30:36] mary5030: has joined #RubyOnRails
[02:31:14] ddv: has joined #RubyOnRails
[02:31:16] Maletor: has joined #RubyOnRails
[02:35:47] rshetty: has joined #RubyOnRails
[02:37:49] dmarr: what would be the correct label_tag here? https://gist.github.com/marr/57d32ccf33b89ef7590e
[02:38:06] dmarr: thanks for your help btw, getting rid of the @bug at the beginning was the fix
[02:39:34] sevenseacat: for :flow_id ?
[02:40:17] dmarr: i want to generate a label for that dropdown
[02:42:34] Radar: <%= f.label :flow_id %>
[02:43:03] DiCablo: has joined #RubyOnRails
[02:43:13] Maletor: has joined #RubyOnRails
[02:44:28] mices: how do i center a page (form)
[02:44:39] Aeyrix: That's a HTML issue tbh
[02:45:03] RegulationD: has joined #RubyOnRails
[02:45:43] DiCablo: has left #RubyOnRails: ()
[02:46:11] GnuYawk: has joined #RubyOnRails
[02:47:57] dmarr: mices: display: block; margin: 0 auto
[02:49:01] darrencauthon: has joined #RubyOnRails
[02:50:09] Radar: position: absolute; left: 650px
[02:52:47] dmarr: position: absolute; left: 50%; transform: translateX(-50%)
[02:53:06] sevenseacat: dmarr: oh, you're evil.
[02:53:06] moeabdol: has joined #RubyOnRails
[02:53:29] dmarr: heh. i do know some web stuff.. its not rails unfortunately
[02:54:11] dmarr: learning rails has gimped me so hard
[02:57:20] Bloomer: has joined #RubyOnRails
[02:57:28] baweaver: has joined #RubyOnRails
[02:57:36] sevenseacat: (the evil, not the gimping)
[02:58:12] Radar: ACTION had to look up "gimping"
[03:01:16] nya: has joined #RubyOnRails
[03:02:51] koprom: has joined #RubyOnRails
[03:02:56] CheckYourSix: has joined #RubyOnRails
[03:04:00] llinguini: has joined #RubyOnRails
[03:04:25] llinguini: what happened to #railsinstaller?
[03:04:52] llinguini: I have a stupid question
[03:05:12] DiCablo: has joined #RubyOnRails
[03:05:14] llinguini: where is the cmd with ROR executable located on windwos
[03:05:20] llinguini: cant seem to find it
[03:05:27] jenrzzz: has joined #RubyOnRails
[03:05:38] Radar: Time to install Linux then.
[03:07:41] sevenseacat: c:/Ruby<something> IIRC
[03:08:04] sevenseacat: theres a tickbox during installation to add ruby to your path variables
[03:08:05] rhizome: $GEM_HOME maybe
[03:08:42] benlieb: has joined #RubyOnRails
[03:10:17] skiz: has joined #RubyOnRails
[03:12:31] krz: has joined #RubyOnRails
[03:12:48] l_tonz: has joined #RubyOnRails
[03:13:09] roxtrongo: has joined #RubyOnRails
[03:15:42] gingray: has joined #RubyOnRails
[03:19:01] pawnbox: has joined #RubyOnRails
[03:19:30] nogic: has joined #RubyOnRails
[03:21:32] FungalRaincloud: has joined #RubyOnRails
[03:22:17] ellisTAA: has joined #RubyOnRails
[03:22:26] hmsimha_: has joined #RubyOnRails
[03:22:33] raazdaan: has joined #RubyOnRails
[03:24:47] segy: has joined #RubyOnRails
[03:24:52] DiCablo: has joined #RubyOnRails
[03:26:52] CBX: has joined #RubyOnRails
[03:27:22] arooni: has joined #RubyOnRails
[03:28:39] fedexo: has joined #RubyOnRails
[03:29:18] CCBX: has joined #RubyOnRails
[03:32:47] mordocai: has joined #RubyOnRails
[03:32:58] kp666: has joined #RubyOnRails
[03:35:02] ivanskie: has joined #RubyOnRails
[03:36:03] SteenJobs: has joined #RubyOnRails
[03:36:37] The_Phoenix: has joined #RubyOnRails
[03:38:16] dmarr: any idea how i'd add a class to the select generated with f.collection_select?
[03:40:22] dmarr: ah got it.. have to use that last hash
[03:41:32] mary5030: has joined #RubyOnRails
[03:44:37] rshetty: has joined #RubyOnRails
[03:50:33] rshetty: has joined #RubyOnRails
[03:52:44] m3_del: has joined #RubyOnRails
[03:56:16] Bloomer: If I need to upload image, I know I can use S3, but I wonder know anyway I can put same server but different folder?
[03:56:52] trco_: has joined #RubyOnRails
[03:57:01] Maletor: has joined #RubyOnRails
[03:58:00] trco: Hey there. So I am trying to call a Rails POST method and I am getting a CSRF error. How does my javascript application request the CSRF token from a Rails API?
[03:59:26] mordocai: has joined #RubyOnRails
[04:02:20] Radar: Bloomer: Look at using Paperclip.
[04:02:43] m3_del: has joined #RubyOnRails
[04:03:50] l_tonz: has joined #RubyOnRails
[04:07:05] rshetty: has joined #RubyOnRails
[04:08:10] l_tonz: has joined #RubyOnRails
[04:08:46] nya: has joined #RubyOnRails
[04:09:46] braincrash: has joined #RubyOnRails
[04:10:34] l_tonz: has joined #RubyOnRails
[04:11:11] Bloomer: Radar: thanks for reply, I know there is a paperclip but never use it before, so this can let me set a relative link to save image in same sserver?
[04:14:23] mices: how does new_password_reset_path get interpreted, what would the url look like
[04:15:03] mices: i would guess /password_reset/new
[04:15:35] Aeyrix: mices: You really, *really* need to try and solve your own problems or test things out before hitting up IRC.
[04:15:37] pawnbox: has joined #RubyOnRails
[04:15:48] Aeyrix: IRC shouldn't be your stage 1 port of call.
[04:19:26] Radar: Bloomer: !try
[04:19:26] helpa: Bloomer: Why don't you try it and find out for yourself?
[04:19:41] Bloomer: Just watch railscast and seems I can set path
[04:20:44] Bloomer: Thanks. I will figure it out by myself.
[04:25:20] nertzy: has joined #RubyOnRails
[04:25:40] yashinbasement: has joined #RubyOnRails
[04:27:12] SteenJobs: has joined #RubyOnRails
[04:29:23] m712: has joined #RubyOnRails
[04:30:51] craysiii: has joined #RubyOnRails
[04:31:42] capin: ohhh i think it's time for some rest :l
[04:33:53] mordocai: has joined #RubyOnRails
[04:37:28] d34th4ck3r: has joined #RubyOnRails
[04:37:37] darrencauthon: has joined #RubyOnRails
[04:37:55] duncannz: has joined #RubyOnRails
[04:39:08] rshetty: has joined #RubyOnRails
[04:39:08] rubyonrailed: has joined #RubyOnRails
[04:41:02] bmalum: has joined #RubyOnRails
[04:42:34] SteenJobs: has joined #RubyOnRails
[04:42:35] capin: trco did you ever solve your problem?
[04:45:49] RegulationD: has joined #RubyOnRails
[04:49:02] gaussblurinc1: has joined #RubyOnRails
[04:50:04] annlewis: has joined #RubyOnRails
[04:50:06] sarink: has joined #RubyOnRails
[04:54:10] pydave6367: has joined #RubyOnRails
[05:00:03] avash_: has joined #RubyOnRails
[05:05:49] Bloomer: It seems like can not have extension name like /login.api in routes file. Is any other way can do that like "post users/login.api" in route file or other place?
[05:07:22] sevenseacat: you don't have an api format, do you?
[05:07:43] sevenseacat: the final part after the . is typically for format, eg foo.html
[05:07:50] Radar: Why do you want that?
[05:07:55] Radar: Why not just /api/users/login?
[05:08:05] avash_: has joined #RubyOnRails
[05:09:08] Bloomer: yes, I know I can use /api/users/login, but just want to know anyway can do like /login.api.
[05:09:24] Radar: Seems like you're fighting Rails conventions :(
[05:09:36] Radar: get "/login.api", to: "controller#action"
[05:09:38] arathald: web conventions in general
[05:09:41] Radar: if you must break from conventions.
[05:09:46] Bloomer: Because I saw from php and java code they use /login.api in there code and as a beginner, i am just curious
[05:10:00] Radar: Just because it's done that way in Java and PHP doesn't mean it's a good idea.
[05:10:14] pawnbox: has joined #RubyOnRails
[05:10:16] Bloomer: I think so.
[05:10:16] Radar: In Rails applications, it's typically /api/<route>
[05:10:21] arathald: I work on a java stack, we don't do things like that. It's not a Java thing, it's someone doing silly things with their routing
[05:10:24] Radar: Or api.example.com/route
[05:10:25] Bloomer: Sorry for ask such stupid question
[05:10:33] Radar: It's not an .api extension on a file
[05:10:37] Radar: So it shouldn't be .api
[05:11:03] Bloomer: i will use /api/users/login,
[05:12:06] Bloomer: arathald: thanks for explaination
[05:12:54] cbernaut: has joined #RubyOnRails
[05:14:54] pydave6367: has joined #RubyOnRails
[05:17:18] nemo_: has joined #RubyOnRails
[05:17:50] pawnbox: has joined #RubyOnRails
[05:20:31] cbernaut: has left #RubyOnRails: ("Leaving")
[05:20:54] rshetty_: has joined #RubyOnRails
[05:22:42] slash_nick: has joined #RubyOnRails
[05:23:42] xcm: has joined #RubyOnRails
[05:25:02] towski_: has joined #RubyOnRails
[05:26:59] rshetty: has joined #RubyOnRails
[05:27:08] sarink: has joined #RubyOnRails
[05:27:41] lorn: has joined #RubyOnRails
[05:28:08] sparr: has joined #RubyOnRails
[05:28:49] cbernaut: has joined #RubyOnRails
[05:30:37] rshetty: has joined #RubyOnRails
[05:33:04] xcm: has joined #RubyOnRails
[05:33:27] rshetty: has joined #RubyOnRails
[05:33:57] towski_: has joined #RubyOnRails
[05:39:48] rshetty_: has joined #RubyOnRails
[05:42:42] dionysus69: has joined #RubyOnRails
[05:45:19] Maletor: has joined #RubyOnRails
[05:51:10] annlewis: has joined #RubyOnRails
[05:52:10] moeabdol: has joined #RubyOnRails
[05:55:15] lxsameer: has joined #RubyOnRails
[05:55:15] lxsameer: has joined #RubyOnRails
[05:58:57] rubyonrailed: has joined #RubyOnRails
[05:58:58] iamse7en: has joined #RubyOnRails
[06:00:03] gavit: how does one store secrets with capistrano, without it being in the git repository?
[06:00:47] arup_r: has joined #RubyOnRails
[06:01:10] Lytol: has joined #RubyOnRails
[06:05:01] Radar: gavit: You set it in your init script for your server.
[06:05:36] Radar: env SECRET_KEY_BASE=foo
[06:05:49] Radar: Alternatively, you can have config/secrets.yml on your server that you copy over on deploy.
[06:06:49] gavit: Radar: thanks
[06:07:20] tlarevo: has joined #RubyOnRails
[06:09:24] jenrzzz: has joined #RubyOnRails
[06:09:31] Oog: has joined #RubyOnRails
[06:09:38] roxtrongo: has joined #RubyOnRails
[06:10:53] Maletor: has joined #RubyOnRails
[06:11:08] Oog: in routes i have namespace :v2 do ... end - how do i make it look in a folder called something other than v2 for controllers?
[06:11:48] Radar: scope module: "NotV2", path: "v2"
[06:11:56] Radar: Warning: this will lead to confusion in devs.
[06:14:51] kerunaru: has joined #RubyOnRails
[06:14:57] l_tonz: has joined #RubyOnRails
[06:16:02] yogeshrt: has joined #RubyOnRails
[06:16:47] rshetty: has joined #RubyOnRails
[06:16:56] towski_: has joined #RubyOnRails
[06:17:26] pawnbox: has joined #RubyOnRails
[06:18:30] l_tonz: has joined #RubyOnRails
[06:20:36] mclee_: has joined #RubyOnRails
[06:21:37] l_tonz: has joined #RubyOnRails
[06:22:03] chrissonar: has joined #RubyOnRails
[06:22:44] gingray: has joined #RubyOnRails
[06:23:52] dhjondoh: has joined #RubyOnRails
[06:25:03] shibabu: has joined #RubyOnRails
[06:25:09] tlarevo: has joined #RubyOnRails
[06:25:13] rshetty: has joined #RubyOnRails
[06:27:27] rshetty: has joined #RubyOnRails
[06:28:27] nemo__: has joined #RubyOnRails
[06:29:54] rvanlieshout: has joined #RubyOnRails
[06:31:03] pawnbox: has joined #RubyOnRails
[06:31:44] gavit: when logged in on the server I can run 'env bundle' and 'which bundle', but capistrano complains: /usr/bin/env: bundle: No such file or directory
[06:31:57] gavit: am I looking for the wrong file?
[06:32:22] gavit: rvanlieshout: yes
[06:32:25] pawnbox: has joined #RubyOnRails
[06:32:36] sevenseacat: are you and your deploy user the same user
[06:32:44] gavit: guess I need to add require capistrano rvm then :)
[06:32:54] gavit: sevenseacat: 'we' are
[06:33:02] gavit: gonna try with the new added require
[06:33:31] rvanlieshout: add the capistrano rvm gem :)
[06:35:21] gavit: rvanlieshout: added that when my capfile complained for adding the require :), gonna deploy now
[06:35:25] gavit: or at least check
[06:35:47] gavit: so much magic going on with capistrano
[06:36:08] rvanlieshout: it's not really magic
[06:36:19] rvanlieshout: when you sign in using ssh using a login shell you load rvm
[06:36:21] gavit: rvanlieshout: cause you know the trick :P
[06:36:25] rvanlieshout: capistrano doesn't use a login shell
[06:36:32] rvanlieshout: so you have to prefix you commands using rvm use <version> do
[06:36:36] rvanlieshout: thats what that gem does
[06:37:14] gavit: rvanlieshout: that for the rvm part, I still dont know where capistrano figured out how to run bundle install, not sure if it will do a migrate for me etc :) I'll see in a bit
[06:39:35] l_tonz: has joined #RubyOnRails
[06:41:42] naftilos76: has joined #RubyOnRails
[06:46:04] rshetty: has joined #RubyOnRails
[06:46:46] DoubleMalt: has joined #RubyOnRails
[06:46:51] RegulationD: has joined #RubyOnRails
[06:47:19] yardenbar: has joined #RubyOnRails
[06:48:20] norc: has joined #RubyOnRails
[06:48:24] rshetty: has joined #RubyOnRails
[06:50:49] tagrudev: has joined #RubyOnRails
[06:51:06] yfeldblum: has joined #RubyOnRails
[06:51:57] annlewis: has joined #RubyOnRails
[06:52:17] SteenJobs: has joined #RubyOnRails
[06:52:36] yfeldblum: has joined #RubyOnRails
[06:53:16] rshetty_: has joined #RubyOnRails
[06:55:57] l_tonz: has joined #RubyOnRails
[06:56:11] gavit: rvanlieshout: sevenseacat: thanks for the help, busy fixing the errors I'm getting now. apparently I need postgresql94-devel etc too
[06:59:03] tlarevo: has joined #RubyOnRails
[07:00:33] njero: has joined #RubyOnRails
[07:00:36] kerunaru: has joined #RubyOnRails
[07:01:02] rvanlieshout: gavit: you'll need that one to compile the pg gem indeed
[07:03:42] annlewis: has joined #RubyOnRails
[07:05:56] rromanchuk: has joined #RubyOnRails
[07:06:33] pawnbox: has joined #RubyOnRails
[07:07:41] shpoont: has joined #RubyOnRails
[07:15:16] duncannz: has joined #RubyOnRails
[07:16:26] gavit: rvanlieshout: my gem install pg is working when trying it as user, with the exception of invalid option -f fivefish, but it fails with capistrano :(
[07:17:17] rshetty: has joined #RubyOnRails
[07:17:56] benlieb: has joined #RubyOnRails
[07:20:50] rvanlieshout: gavit: then run bundle install --deployment --without development test as the user to make some progress here
[07:22:49] gavit: does it fail because it cant find the -f fivefish?
[07:23:11] Stuffness: has joined #RubyOnRails
[07:23:14] norc: I have some link_to destroy actions. What is an elegant way to put the data { confirm: "message" } into an i18n translation?
[07:23:41] rvanlieshout: norc: confirm: t('.destroy_confirm') ?
[07:24:02] norc: rvanlieshout: I meant, is there some helper that already looks in a predefined path for this?
[07:24:52] rvanlieshout: you start your translation key with a .
[07:25:02] norc: rvanlieshout: Think we misunderstand each other. :)
[07:26:21] norc: I would expect something this to be wrapped inside de.activerecord
[07:26:23] dici: has joined #RubyOnRails
[07:26:49] rvanlieshout: it's not part of activerecord
[07:27:21] norc: A warning that destroying this resource could have some impact does not seem to be related to the view either imo
[07:27:30] norc: Or is it?
[07:27:51] rvanlieshout: it's the view that renders it
[07:27:59] rvanlieshout: so why wouldn't it be part of that particular view?
[07:28:17] norc: Model.human_attribute_name is rendered by views too
[07:28:37] rvanlieshout: true, but that's a property of the model
[07:28:46] norc: rvanlieshout: Well, I might have a link_to my_resource, method: delete in a couple views
[07:29:01] norc: The warning would be the same regardless
[07:29:02] srinidhi: has joined #RubyOnRails
[07:29:17] gavit: which gem doesnt give an answer, but gem seems to work...
[07:30:32] norc: rvanlieshout: But alright, I get what you mean.
[07:31:54] pawnbox: has joined #RubyOnRails
[07:32:51] User458764: has joined #RubyOnRails
[07:33:49] tetraktys: has joined #RubyOnRails
[07:33:58] darutoko: has joined #RubyOnRails
[07:35:17] gavit: rvanlieshout: /usr/local/rvm/rubies/ruby-2.2.2/bin/gem -v gives 2.4.8 is this 'normal'?
[07:35:48] gavit: nvm, its the version of gem, not of ruby
[07:38:43] arup_r: What you guys will suggest OP ? http://stackoverflow.com/questions/33408333/can-i-use-private-as-an-attribute-name
[07:39:59] tlarevo: has left #RubyOnRails: ()
[07:40:05] pawnbox: has joined #RubyOnRails
[07:41:02] rshetty: has joined #RubyOnRails
[07:43:17] rvanlieshout: arup_r: sure you can
[07:43:20] rvanlieshout: is_private is so java
[07:44:45] gavit: rvanlieshout: :'(
[07:45:11] arup_r: rvanlieshout: :) thanks
[07:45:21] arup_r: gavit: I gave you something.. ;)
[07:45:27] gavit: arup_r: :)
[07:45:38] nemo_: has joined #RubyOnRails
[07:45:52] gavit: rvanlieshout: private? :P
[07:46:27] Pumukel: has joined #RubyOnRails
[07:46:29] trautwein: has joined #RubyOnRails
[07:46:56] yogeshrt: has joined #RubyOnRails
[07:47:00] arup_r: ACTION thinks he should learn Java too
[07:47:21] rvanlieshout: arup_r: get good at one language, not average on multiple
[07:47:56] arup_r: ACTION changed his mindset and following rvanlieshout advise
[07:48:38] gavit: rvanlieshout: gem install rdoc-generator-fivefish
[07:48:53] gavit: solves the -f fivefish error
[07:49:03] kitsuneyo: has joined #RubyOnRails
[07:49:09] rvanlieshout: ok. haven't got that issue myself yet
[07:49:39] pawnbox: has joined #RubyOnRails
[07:50:23] gavit: starting to think that im using diff ruby versions/bundle etc
[07:52:19] aganov: has joined #RubyOnRails
[07:53:19] arBmind: has joined #RubyOnRails
[07:56:11] jas02: has joined #RubyOnRails
[07:57:39] _lazarevsky: has joined #RubyOnRails
[07:57:43] _lazarevsky: good morning all
[07:58:04] _lazarevsky: has any one of you ever used the rails' cache memory?
[07:58:19] _lazarevsky: one of the goals for the upcoming year is to reduce the load time to under 1 sec
[07:58:27] _lazarevsky: which I thought impossible but it is worth a shot
[07:58:38] _lazarevsky: so what I was thinking of doing is using DB caching
[07:58:41] rvanlieshout: have a look at redis
[07:58:48] boombadaroomba: has joined #RubyOnRails
[07:58:52] _lazarevsky: so that whenever the DB is updated, so is the cache
[07:58:59] _lazarevsky: and the reads only happen from the cache
[07:58:59] rhizome: russian doll caching too
[07:59:08] _lazarevsky: russian roll caching
[07:59:10] _lazarevsky: lemme look at that
[08:00:36] gavit: gonna zzz
[08:00:52] gavit: gotto wake up in 1
[08:01:33] _lazarevsky: rhizome: wow looks very promising
[08:01:39] _lazarevsky: rhizome: this is exactly what I've been looking for
[08:01:43] _lazarevsky: however I work with large sets of data
[08:01:58] rvanlieshout: _lazarevsky: define 'large'
[08:01:59] _lazarevsky: many cache will need to be written.. is that feasible?
[08:02:14] _lazarevsky: we've got like 3-4 projects currently in our system
[08:02:21] _lazarevsky: each project has 20 project teams
[08:02:49] _lazarevsky: 's like 80k caches right there
[08:03:15] rhizome: that's fine
[08:03:43] rhizome: i mean, everything works to a certain degree and then you look at other stuff. this is baked in and good for a lot.
[08:03:58] rhizome: there's no "is this all we'll ever need"
[08:04:10] _lazarevsky: rhizome: that's a good point
[08:04:38] _lazarevsky: it would be awesome if I can just go -> only cache Projects where status != deployed
[08:04:51] _lazarevsky: cuz there won't be more than 300 active projects at any given time
[08:05:02] notnoyyyyy: has joined #RubyOnRails
[08:06:25] dionysus69: has joined #RubyOnRails
[08:06:30] rhizome: i wouldn't worry about it
[08:07:23] _lazarevsky: well.. the cache I read is written on the disk
[08:07:32] _lazarevsky: so I would kind of worry about disk space running out eventually
[08:07:36] _lazarevsky: but this is exactly what I was looking for
[08:07:48] _lazarevsky: I'll go and research
[08:07:59] notnoyyyyy: has left #RubyOnRails: ()
[08:08:00] _lazarevsky: rvanlieshout: I have heard of redis though I've never used it. I will look into it as well
[08:08:01] notnoyyyyy: has joined #RubyOnRails
[08:09:18] annlewis: has joined #RubyOnRails
[08:09:18] rvanlieshout: redis is really awesome. we use it for all our projects
[08:10:15] l_tonz: has joined #RubyOnRails
[08:11:29] jenrzzz: has joined #RubyOnRails
[08:12:36] notnoyyyyy_: has joined #RubyOnRails
[08:13:22] _lazarevsky: rvanlieshout: what do you use it for?
[08:14:52] _lazarevsky: rvanlieshout: I've never done DB caching in my life
[08:15:01] _lazarevsky: rvanlieshout: could you give me a very basic example of how you use it for caching?
[08:15:15] _lazarevsky: could I use redis + russian roll caching?
[08:15:30] _lazarevsky: I'm not asking for any specifics or code samples, I just wanna know how I could combine the two
[08:15:36] rvanlieshout: Rails.cache.fetch('my_key', expires_in: 10.seconds) { Time.now }
[08:15:36] rshetty: has joined #RubyOnRails
[08:15:40] _lazarevsky: because caching 300 projects in memory on the server sounds rather worrying
[08:15:49] rvanlieshout: well.. it all depends on how much you cache
[08:15:56] rvanlieshout: a single cach entry is notlikely to be really really big
[08:16:04] _lazarevsky: we're talking 300 projects here
[08:16:07] rvanlieshout: and would it be a problem if that redis process consumes like 1 GB ofram?
[08:16:36] kitsuneyo: has joined #RubyOnRails
[08:16:53] _lazarevsky: rvanlieshout: well I could always use AWS's elasticache
[08:17:20] _lazarevsky: https://aws.amazon.com/elasticache/
[08:17:24] mosez: let memoizes the value within rspec. is there some alternative that doesn't memoize?
[08:17:33] _lazarevsky: rvanlieshout: seems like ElastiCache makes use of redis
[08:17:41] rvanlieshout: so why the additional layer?
[08:17:42] mosez: or should i just use @foo within before all?
[08:18:41] _3by8: has joined #RubyOnRails
[08:19:09] _3by8: Where are test mails sent in a test environment?
[08:19:11] sevenseacat: mosez: it sounds like you're trying to do something wrong. would you like help?
[08:19:17] sevenseacat: _3by8: they're not.
[08:19:24] _lazarevsky: rvanlieshout: I dont think I quite follow
[08:19:30] _lazarevsky: rvanlieshout: what do you mean "why the additional layer?"
[08:19:36] _3by8: sevenseacat: not even to a folder somewhere? How can I get them sent somewhere?
[08:19:51] _lazarevsky: rvanlieshout: so that I don't use my servers memory and use a highly optimised caching server instead?
[08:20:02] rvanlieshout: _lazarevsky: just use redis
[08:20:05] rvanlieshout: and see where you get from there
[08:20:06] _3by8: sevenseacat: lol, okay! I have to put the environment into production mode or something, right?
[08:20:09] arup_r: _3by8: what are you trying to do ?
[08:20:14] _lazarevsky: rvanlieshout: ok I will
[08:20:19] _3by8: arup_r: I just want to see the emails being sent so I can test account activation.
[08:20:21] sevenseacat: _3by8: it also sounds like you're trying to shoot yourself in the foot
[08:20:31] sevenseacat: _3by8: why do you want test for that? use development
[08:20:38] sevenseacat: use something like mailcatcher or letter opener
[08:20:41] _lazarevsky: rvanlieshout: a quick question if I may? So if I decide to implement russian doll caching
[08:20:52] _3by8: sevenseacat: I'm using action mailer
[08:20:55] _lazarevsky: will the changes the the models first get persisted to the DB which will then update the cache?
[08:20:55] arup_r: _3by8: You can use mailcather
[08:21:16] pawnbox: has joined #RubyOnRails
[08:21:17] _3by8: I'll use mailcatcher then, whatever that is. Thanks for the tip!
[08:21:19] arup_r: in dev env to see if mails are going or not or something else.
[08:21:39] edwinvdgraaf: has joined #RubyOnRails
[08:22:18] _3by8: Oh, my delivery_method is set to :test. I need to change that to something like smtp, don't I?
[08:22:41] sevenseacat: if you're in test, *no*.
[08:22:51] _3by8: That's in my development config.
[08:22:57] sevenseacat: read the docs.
[08:23:02] mosez: sevenseacat: within a lib i'm creating a file with Tempfile, within the specs i try to replace it with a regular file to know the path of it
[08:23:32] mosez: sevenseacat: i try to write specs for https://github.com/crowbar/crowbar-client/blob/master/lib/crowbar/client/util/editor.rb :)
[08:23:36] sevenseacat: okay, whats that got to do with an instance variable and a before all
[08:23:44] sevenseacat: before :all is *always* a code smell
[08:23:44] arBmind: has joined #RubyOnRails
[08:24:09] mosez: before each, sorry
[08:24:38] sevenseacat: and whats wrong with memoizing a variable?
[08:24:44] mosez: thought about something like this https://gist.github.com/tboerger/ffa43b6c38c5931d45ff
[08:24:54] mosez: i need to reset the file :)
[08:25:08] sevenseacat: whats that got to do with memoization?
[08:25:09] mosez: hum, maybe just reset it instead of creating and deleting
[08:25:54] nettoweb: has joined #RubyOnRails
[08:26:25] rvanlieshout: ok.. a bug in FileUtils.cp_r
[08:26:41] rvanlieshout: FileUtils.cp_r 'idml_file', 'somewhere else' corrupts my file
[08:27:27] rvanlieshout: but not on my local vagrant installation
[08:27:42] rvanlieshout: only that on the ci.. which is weird, cause it's a virtualbox puppet controller similar environment
[08:28:08] shibabu: has joined #RubyOnRails
[08:28:21] big|bad|wolf: has joined #RubyOnRails
[08:30:38] norc: http://pastie.org/10515308 -- This link_to helper produces broken HTML whenever I use both a block *and* the i18n t() helper for the data => confirm. What am I doing wrong here?
[08:31:19] norc: Just removing the t alone fixes it.
[08:32:48] norc: Or is passing valid HTML into confirm a bad thing for a link_to helper?
[08:32:57] rvanlieshout: norc: why is that broken?
[08:33:05] rvanlieshout: the problem is dat it's missing a translation
[08:33:19] rvanlieshout: and missing translation reults in <span class="translation_missing"...</span>
[08:33:20] mosez: sevenseacat: i did it different... i'm just setting a Tempfile with let :)
[08:33:28] rvanlieshout: that's now directly used as an attribute value for your a
[08:33:31] rvanlieshout: which makes weird html
[08:33:36] rvanlieshout: but only because the translation is missing
[08:33:44] notnoyyyyy: has joined #RubyOnRails
[08:36:58] ruurd: has joined #RubyOnRails
[08:38:30] rshetty: has joined #RubyOnRails
[08:40:50] rshetty: has joined #RubyOnRails
[08:41:06] shinenelson: has joined #RubyOnRails
[08:41:14] ivanskie: has joined #RubyOnRails
[08:43:13] mosez: sevenseacat: does that make sense to you? https://gist.github.com/tboerger/6c3182023428b4a967db :)
[08:43:30] solars: has joined #RubyOnRails
[08:45:04] dionysus69: has joined #RubyOnRails
[08:46:08] jahbrewski: has joined #RubyOnRails
[08:46:27] DoubleMalt: has joined #RubyOnRails
[08:47:37] RegulationD: has joined #RubyOnRails
[08:48:05] gaussblurinc1: has joined #RubyOnRails
[08:48:32] nemo_: has joined #RubyOnRails
[08:48:55] notnoyyyyy: has left #RubyOnRails: ()
[08:49:45] notnoyyyyy: has joined #RubyOnRails
[08:50:41] gingray: has joined #RubyOnRails
[08:52:23] wwalker: has joined #RubyOnRails
[08:56:06] Peg-leg: has joined #RubyOnRails
[08:56:46] duncannz: has joined #RubyOnRails
[08:57:09] startupality: has joined #RubyOnRails
[08:57:35] duncannz: has joined #RubyOnRails
[09:00:19] roxtrongo: has joined #RubyOnRails
[09:00:57] yashinbasement: has joined #RubyOnRails
[09:01:07] mark2: has joined #RubyOnRails
[09:01:41] beauby: has joined #RubyOnRails
[09:01:56] artto: has joined #RubyOnRails
[09:02:10] Ergo: has joined #RubyOnRails
[09:03:33] vdmo: has joined #RubyOnRails
[09:04:30] lipoqil: has joined #RubyOnRails
[09:05:22] kimegede: has joined #RubyOnRails
[09:07:41] violarium: has joined #RubyOnRails
[09:08:58] yaw: has joined #RubyOnRails
[09:09:22] Pupeno: has joined #RubyOnRails
[09:10:06] annlewis: has joined #RubyOnRails
[09:10:10] gingray: has joined #RubyOnRails
[09:10:12] jsrn_: has joined #RubyOnRails
[09:10:17] h7br1x: has joined #RubyOnRails
[09:10:59] AzaToth: has joined #RubyOnRails
[09:11:27] marr: has joined #RubyOnRails
[09:11:29] l_tonz: has joined #RubyOnRails
[09:13:00] h7br1x: Hey guys, how do I strip html in my view? For example, I have "<p>This String</p>" and I want it to be "This String"
[09:13:20] adre: has joined #RubyOnRails
[09:13:38] gavit: h7br1x: regex it?
[09:13:43] FailBit: gavit: wrong
[09:13:48] FailBit: regex can't match xml
[09:13:59] h7br1x: This is for an open graph meta tag in the show view btw.
[09:14:38] h7br1x: Is there an opposite of .html_safe
[09:14:46] gavit: FailBit: since when?
[09:15:00] weckl: has joined #RubyOnRails
[09:15:05] FailBit: since..forever?
[09:15:26] FailBit: reading from SO
[09:15:29] FailBit: "Regular expressions can only match regular languages but HTML is a context-free language. The only thing you can do with regexps on HTML is heuristics but that will not work on every condition."
[09:15:34] gavit: h7br1x: sanitize?
[09:15:57] h7br1x: gavit: I tried sanitize but it had no effect
[09:17:20] gavit: h7br1x: sanitize doesn't remove tags
[09:17:51] gavit: h7br1x: you can search and parse it though: http://www.nokogiri.org/tutorials/parsing_an_html_xml_document.html
[09:18:44] MartinElvar: has joined #RubyOnRails
[09:18:54] rshetty: has joined #RubyOnRails
[09:19:29] gavit: h7br1x: maybe we are misunderstanding you, what do you want exactly?
[09:19:41] g3funk: has joined #RubyOnRails
[09:19:51] arup_r: h7br1x: strip_tags "<p>This String</p>"
[09:19:54] gavit: www.h7br1x.com/ and you get 'hello world' without <html><body>?
[09:20:20] arup_r: h7br1x: try what I said
[09:20:21] one_zero_s: has joined #RubyOnRails
[09:21:17] h7br1x: arup_r that worked!
[09:21:27] h7br1x: Thank you.
[09:22:12] bmalum_: has joined #RubyOnRails
[09:22:36] rshetty: has joined #RubyOnRails
[09:24:26] mark2: has left #RubyOnRails: ()
[09:26:41] rshetty: has joined #RubyOnRails
[09:26:58] _lazarevsky: rvanlieshout: I just figured out something mate
[09:27:10] _lazarevsky: rvanlieshout: my app is hosted on 2 servers for redundency
[09:27:34] schu: has joined #RubyOnRails
[09:27:37] _lazarevsky: rvanlieshout: so that complicates matters greatly, as now I need to add a new layer in my architecture
[09:27:43] arBmind: has joined #RubyOnRails
[09:27:47] nfk|laptop: has joined #RubyOnRails
[09:27:49] rvanlieshout: _lazarevsky: or use sticky sessions by your load balancer
[09:28:10] _lazarevsky: sticky sessions?
[09:28:17] _lazarevsky: lemme google that
[09:28:20] gavit: stupid capistrano ;'(
[09:28:55] agit0: has joined #RubyOnRails
[09:29:08] h7br1x: gavit: If I had a dollar for every time I've said that...
[09:29:43] _lazarevsky: rvanlieshout: I don't understand how this solves my problem. Btw I read about sticky sessions
[09:29:48] _lazarevsky: rvanlieshout: I have 1 DB server
[09:29:52] _lazarevsky: and 2 app servers
[09:30:13] gavit: h7br1x: just give me 50 cents ;)
[09:30:52] rshetty: has joined #RubyOnRails
[09:30:56] arup_r: has joined #RubyOnRails
[09:30:57] Pupeno: has joined #RubyOnRails
[09:30:57] Pupeno: has joined #RubyOnRails
[09:31:35] gavit: /Users/gavit/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/sshkit-1.7.1/lib/sshkit/command.rb:95:in `exit_status=' <- does this indicate I am using rbenv instead of rvm?
[09:31:39] tetraktys: has joined #RubyOnRails
[09:31:47] h7br1x: _lazarevsky, what's the question again?
[09:32:18] _lazarevsky: h7br1x: I was wondering how I could use redis when my app is hosted on 2 servers for redundency
[09:32:25] sevenseacat: gavit: if you don't know whats on your own machine, I don't think I'd be so quick to blame capistrano for your problems.
[09:32:46] h7br1x: gavit: Yes.
[09:33:38] gavit: sevenseacat: I assumed local rbenv vs server rvm shouldnt matter
[09:34:16] dobri: has joined #RubyOnRails
[09:34:25] sevenseacat: the way you worded your question was as if you thought you were using rvm, but it turns out you're not
[09:35:10] sevenseacat: and if you have both, well, glhf sorting that shit out
[09:35:58] h7br1x: spoiler alert: It's a nightmare.
[09:42:20] kitsuneyo: has joined #RubyOnRails
[09:43:57] tvw: has joined #RubyOnRails
[09:44:55] stardiviner: has joined #RubyOnRails
[09:45:29] teclator: has joined #RubyOnRails
[09:45:40] pawnbox: has joined #RubyOnRails
[09:46:20] mdst: has joined #RubyOnRails
[09:46:23] swhitt: has joined #RubyOnRails
[09:46:38] cac: has joined #RubyOnRails
[09:46:52] dionysus70: has joined #RubyOnRails
[09:46:53] hyperdrive: has joined #RubyOnRails
[09:47:52] IceBear: has joined #RubyOnRails
[09:49:09] alaing: has joined #RubyOnRails
[09:49:57] vigintas: has joined #RubyOnRails
[09:50:04] jenrzzz: has joined #RubyOnRails
[09:50:07] alaing: has joined #RubyOnRails
[09:50:14] alaing: I have a string formated as "29/10/2015" how do I convert that into a Date object?
[09:50:26] tetraktys: has joined #RubyOnRails
[09:50:41] alaing: so this logic would pass if date == Date.today
[09:50:49] rvanlieshout: Date.parse("29/10/2015")
[09:51:10] alaing: thank you rvanlieshout :-)
[09:53:31] tlarevo: has joined #RubyOnRails
[09:56:38] rodfersou: has joined #RubyOnRails
[09:56:57] tlarevo: has joined #RubyOnRails
[09:57:41] jegade: has joined #RubyOnRails
[09:57:59] jegade: hi, how could i fix this issue? https://github.com/credativUK/redmine_image_clipboard_paste/issues/25
[09:57:59] shibabu: has joined #RubyOnRails
[10:00:22] dionysus69: has joined #RubyOnRails
[10:01:24] tlarevo: has joined #RubyOnRails
[10:01:47] ibouvousaime: has joined #RubyOnRails
[10:03:51] kitsuneyo: i'm trying to create an admin namespace for my devise users, so admin users can edit other users. i'm getting a routing error related to the update action on my admin/users_controller.rb
[10:04:01] kitsuneyo: i've put everything in a gist here: https://gist.github.com/kitsuneyo/1f5531f483064bf0ad3b
[10:04:06] kitsuneyo: can anyone help me out?
[10:04:58] beauby: has joined #RubyOnRails
[10:05:42] yogeshwar: has joined #RubyOnRails
[10:06:16] kitsuneyo: my admin/users/id/edit form works, but when i hit save i get a 500 error
[10:06:42] kitsuneyo: dev.log says ActionController::RoutingError (No route matches [PATCH] "/users/2"), which means i guess it's routing back to the main users controller
[10:07:04] ddv: kitsuneyo: because you're using the wrong path obviously, show your form_for
[10:07:20] ddv: kitsuneyo: change update_attributes to just update, it's shorter
[10:07:27] htmldrum: has joined #RubyOnRails
[10:07:35] kitsuneyo: ddv, it's in the gist
[10:07:55] tlarevo: has joined #RubyOnRails
[10:08:39] kitsuneyo: i've got form_for(@user), i guess that's the issue?
[10:08:42] ddv: kitsuneyo: [:admin, @user]
[10:08:43] jxs_: has joined #RubyOnRails
[10:08:47] ruurd: has joined #RubyOnRails
[10:08:50] ddv: kitsuneyo: yes
[10:10:04] kitsuneyo: ddv, not sure what you mean by [:admin, @user]
[10:10:10] ddv: kitsuneyo: User.where(role: %w(member pro editor)) read the ruby/ruby on rails style guides
[10:10:19] ddv: kitsuneyo: in the form_for
[10:10:28] bmalum: has joined #RubyOnRails
[10:10:28] tlarevo: has joined #RubyOnRails
[10:10:40] ddv: kitsuneyo: form_for([:admin, @user])
[10:10:51] annlewis: has joined #RubyOnRails
[10:11:45] kitsuneyo: ddv, thanks, it seems to be working although i need to set my authorisation up
[10:12:01] tlarevo: has joined #RubyOnRails
[10:12:07] kitsuneyo: ddv, role is an enum not a string
[10:12:27] l_tonz: has joined #RubyOnRails
[10:12:50] ddv: kitsuneyo: ?
[10:12:59] rshetty: has joined #RubyOnRails
[10:13:14] ddv: kitsuneyo: it's an array with 3 string elements
[10:14:42] jegade: has left #RubyOnRails: ()
[10:14:50] kitsuneyo: ddv, i'm almost done reading well-grounded rubyist and bought r4ia, just need to keep learning
[10:16:58] ddv: kitsuneyo: take al ook at the enumerize gem: https://github.com/brainspec/enumerize might come in handy
[10:18:21] kitsuneyo: ddv, what is the benefit of this? internationalization?
[10:18:31] ddv: kitsuneyo: that is just one feature of it
[10:18:42] pawnbox: has joined #RubyOnRails
[10:19:14] tlarevo_: has joined #RubyOnRails
[10:19:32] ddv: kitsuneyo: it will automatically add predicates and activerecord scopes for your enums
[10:19:34] kitsuneyo: right now i can already do user.admin?
[10:19:39] beauby: has joined #RubyOnRails
[10:20:21] kitsuneyo: i'll bookmark it and take a look when my setup falls short
[10:20:25] kitsuneyo: thanks for the help ddv
[10:20:26] rickmasta: has joined #RubyOnRails
[10:20:57] User458764: has joined #RubyOnRails
[10:21:00] tlarevo: has joined #RubyOnRails
[10:22:27] ddv: kitsuneyo: you could also add a before_action to set the user
[10:23:04] kitsuneyo: you mean to the controller? why do that, security?
[10:23:19] ddv: kitsuneyo: to dry up your controller
[10:23:33] kitsuneyo: ah ok, i've seen that i think
[10:23:51] tlarevo: has joined #RubyOnRails
[10:24:00] udiudi: has joined #RubyOnRails
[10:24:07] ddv: you're calling User.find(params[:id]) twice
[10:25:09] yaw: has joined #RubyOnRails
[10:25:25] ddv: kitsuneyo: in your routes change resources :users, :only => [:index, :show] to resources :users, only: [:index, :show]
[10:26:02] ddv: kitsuneyo: ditch erb for haml or something better
[10:26:13] tlarevo: has joined #RubyOnRails
[10:26:20] kitsuneyo: ddv, i heard about this thing called rubocop that helps you maintain style or something...
[10:26:28] kitsuneyo: i don't even know what haml is lol
[10:26:29] ddv: kitsuneyo: yes run rubocop
[10:26:53] ddv: or integrate it with your editor
[10:27:36] wethu: has joined #RubyOnRails
[10:28:12] kitsuneyo: i'm using atom, i guess i can take a look at that
[10:29:11] Ropeney: has joined #RubyOnRails
[10:29:17] ddv: kitsuneyo: look at byebug/pry also, with byebug you can step through the code like a debugger
[10:29:20] tlarevo: has joined #RubyOnRails
[10:30:14] kitsuneyo: has joined #RubyOnRails
[10:30:32] cabotto: has joined #RubyOnRails
[10:30:34] ldnunes: has joined #RubyOnRails
[10:30:43] tlarevo_: has joined #RubyOnRails
[10:32:49] kitsuneyo: has joined #RubyOnRails
[10:33:01] kitsuneyo: had to restart
[10:33:17] kitsuneyo: ddv, used byebug when doing rails tutorial
[10:33:27] ddv: kitsuneyo: cool ok
[10:36:02] kitsuneyo: i guess there are default rubocop settings that suggest a good style?
[10:38:52] rshetty: has joined #RubyOnRails
[10:39:55] arup_r: has joined #RubyOnRails
[10:41:48] matthewd: There are default rubocop settings that suggest *a* style.
[10:44:22] Pazician: has joined #RubyOnRails
[10:45:00] lacrymology: has joined #RubyOnRails
[10:46:38] tlarevo_: has joined #RubyOnRails
[10:46:56] artto: has joined #RubyOnRails
[10:48:32] RegulationD: has joined #RubyOnRails
[10:51:02] mikecmpbll: has joined #RubyOnRails
[10:51:16] cjk101010: has joined #RubyOnRails
[10:52:50] ibouvousaime: has joined #RubyOnRails
[10:53:22] pydave6367: has joined #RubyOnRails
[10:58:25] goldbug: has joined #RubyOnRails
[10:59:10] goldbug: If I want to display a particular form input only if a checkbox has been checked in the same form, is that something I can do with a simple_form? Or do I need some external logic to sort that out?
[10:59:58] Thomas-0725: has joined #RubyOnRails
[11:00:55] arup_r: goldbug: you need backend and frotend ( for live hide/show)
[11:01:28] norc: goldbug: Visibility is easily toggled with CSS. If you need it to be dynamic (respond to user toggling the checkbox) then you need to handle this in JavaScript.
[11:01:58] h7br1x: has joined #RubyOnRails
[11:02:02] ibouvousaime: has joined #RubyOnRails
[11:02:53] goldbug: Okay - so I can't dynamically use the :as => :hidden option in any way within the form itself?
[11:03:15] rvanlieshout: you can, but that won't get updated on click
[11:03:19] rvanlieshout: only after submission
[11:04:14] zpe: has joined #RubyOnRails
[11:06:27] annlewis: has joined #RubyOnRails
[11:06:36] Diabolik: how can i run this sql command in rails?
[11:06:37] Diabolik: https://gist.github.com/askl56/3c9b5506ff74fb70aa33
[11:06:47] Diabolik: when i wrap it in an execute block i get errors
[11:07:12] hughjasss: what errors?
[11:07:40] Diabolik: not errors but it just returns => #<PG::Result:0x007fdebe25b968 status=PGRES_TUPLES_OK ntuples=16805 nfields=9 cmd_tuples=16805>
[11:07:53] Diabolik: when i just want those orders stored in a variable
[11:08:51] Diabolik: https://gist.github.com/askl56/3c9b5506ff74fb70aa33
[11:08:54] Diabolik: that's the full function
[11:09:33] udiudi: has joined #RubyOnRails
[11:10:02] goldbug: Diabolik: Should you be trying to select "orders".* rather than just orders.*?
[11:10:45] ElFerna: has joined #RubyOnRails
[11:11:11] Diabolik: currently i have SELECT "orders".*
[11:11:22] Diabolik: what's the diff?
[11:11:48] hughjasss: the "", but i dont think thats your issue
[11:11:55] elaptics: has joined #RubyOnRails
[11:12:05] hughjasss: your getting an empty result set back right?
[11:12:22] goldbug: Double-quotes = text rather than a table reference.
[11:12:23] moeabdol1: has joined #RubyOnRails
[11:12:57] goldbug: It will throw a SQL error.
[11:13:00] Diabolik: its just returning
[11:13:25] rshetty: has joined #RubyOnRails
[11:13:32] Diabolik: https://gist.github.com/askl56/3c9b5506ff74fb70aa33
[11:13:41] Diabolik: commented the response
[11:14:06] l_tonz: has joined #RubyOnRails
[11:14:21] goldbug: (Oh mind you, you're using PG - so double-quotes should be fine.)
[11:14:22] hughjasss: i gotta run for a tick, im assuming it works in psql natively?
[11:14:42] hughjasss: i mean, it returns some record/s
[11:15:12] chills42: has joined #RubyOnRails
[11:15:44] big|bad|wolf: has joined #RubyOnRails
[11:16:04] ElFerna: has joined #RubyOnRails
[11:16:25] norc: Diabolik: Just btw, don't use IN. Just join it. Then you can simply do it with pure rails even.
[11:17:04] syath: has joined #RubyOnRails
[11:17:07] Diabolik: yes hughjasss it works in psql
[11:17:21] nightsh: has joined #RubyOnRails
[11:17:22] workmad3: Diabolik: try calling `results.to_a`... the results you have back look like they have 16000-ish results in (ntuples), you're just dealing with the result set currently, not the array of results
[11:18:08] Diabolik: still get same #<PG::Result:0x007fdebdb32038 status=PGRES_TUPLES_OK ntuples=16805 nfields=9 cmd_tuples=16805>
[11:18:20] workmad3: Diabolik: I'd also suggest that you either consistently quote your tables and fields, or don't quote them at all
[11:18:51] workmad3: quoting a single table name is a nice way to accidentally introduce errors
[11:18:52] krisquigley: has joined #RubyOnRails
[11:19:31] workmad3: Diabolik: so you did `results = <sql>; results.to_a` in your find method, quit and restarted your console session, and still get the same thing back?
[11:19:56] norc: Diabolik: Use #values to get all tuples.
[11:19:59] erbesharat: has joined #RubyOnRails
[11:20:09] workmad3: norc: ah, `values` :)
[11:20:20] workmad3: (I really should remember how to use the pg driver directly)
[11:20:20] Diabolik: ah thanks guys
[11:20:22] Diabolik: it works now
[11:20:31] rikkipitt: has joined #RubyOnRails
[11:20:44] nhhagen: has joined #RubyOnRails
[11:21:05] workmad3: Diabolik: out of curiosity, why are you doing this as a direct SQL query instead of using rails?
[11:22:12] norc: workmad3: Or make it a habit to simply check the docs if you are unsure as I did. :-P
[11:22:24] pawnbox: has joined #RubyOnRails
[11:22:26] workmad3: Diabolik: either with a join as norc suggested, or by using a subquery like `Order.where(id: <AR version of subquery>).order(id: :asc)`
[11:22:34] workmad3: norc: I do that after something doesn't work ;)
[11:23:13] workmad3: norc: and I'd expect something representing a collection to respond to `.to_a`, along with `.each` and other enumerable methods :)
[11:23:20] norc: workmad3: That super vs super() thing from yesterday showed me once again, that with all the subtle things that Ruby and gems bring, looking at the docs first can save a buttload of time. :)
[11:23:43] norc: workmad3: Well it does respond to #each properly
[11:24:27] erbesharat: has joined #RubyOnRails
[11:26:10] Cork: is there a way to get what attributes was changed in a record after .save have been called?
[11:27:27] norc: Cork: Does it have to be after save, or is a before_save callback fine?
[11:27:46] Cork: to be specific, it needs to be in after_commit
[11:28:01] Cork: so yes it can't be in before_save
[11:30:12] stamina: has joined #RubyOnRails
[11:30:18] quazimodo: has joined #RubyOnRails
[11:30:39] norc: Cork: Maybe you could utilize ActiveRecord::Dirty in an around callback?
[11:30:43] norc: It's just an idea
[11:31:00] kitsuneyo: has joined #RubyOnRails
[11:31:20] Cork: dirty is what makes hte normal _changed/.changed work if i remember correctly
[11:31:28] Cork: but it is reset when the record is saved
[11:31:28] kitsuneyo: rubocop reckons this is no good: class Admin::UsersController < ApplicationController
[11:31:36] Cork: how would i use it here?
[11:31:41] kitsuneyo: should nest instead
[11:31:56] Cork: not sure how a callback would help me
[11:32:15] norc: Cork: Oh! #previous_changes
[11:32:20] ruurd: has joined #RubyOnRails
[11:32:28] Cork: ACTION tries
[11:33:34] norc: Cork: http://api.rubyonrails.org/classes/ActiveModel/Dirty.html
[11:33:40] Cork: norc: perfect
[11:33:53] Cork: that is precisely what i was looking for
[11:33:55] norc: Oh. That is AM. But should be the same for AR.
[11:34:20] norc: Or no, that is it.
[11:34:36] norc: ACTION goes back to rubocoping
[11:34:52] cornerma1: has joined #RubyOnRails
[11:34:58] cac: has joined #RubyOnRails
[11:37:14] rickmasta: has joined #RubyOnRails
[11:39:35] Diabolik: what's the equivalent of find_each for an array?
[11:40:30] arup_r: Diabolik: Enumerable#each_slice
[11:40:47] yogeshrt: has joined #RubyOnRails
[11:40:48] Diabolik: can you do it using a batch_size?
[11:40:51] Diabolik: also arup_r check pm
[11:42:14] rikkipitt: hello everyone. I'm using delayed_job to run some long-ish checks on my database records with FuzzyMatch. Is there a way of globally caching the result of the FuzzyMatch setup object so it's shared between jobs to speed the fuzzy search up? Is this bad practice?
[11:42:24] gingray: has joined #RubyOnRails
[11:42:26] arup_r: No, find_each works with DB to pull records in batch.. and each_slice works with Array to yield mentined size elements inside a block
[11:43:23] cac: has joined #RubyOnRails
[11:43:56] Diabolik: workmad3 what would be the best way to process the results using something like find_each, except you can't use find_each on an array
[11:45:07] elaptics: has joined #RubyOnRails
[11:45:17] bbrowning_away: has joined #RubyOnRails
[11:49:12] EdwardIII: hmm what http status code would you return to say "this is an idempotent thing, so, your request is/was successful, but i haven't actually done anything this time as you've made the same request twice"?
[11:49:37] Icey: has joined #RubyOnRails
[11:49:37] Icey: has joined #RubyOnRails
[11:50:51] tbuehlmann: 200 or 202 maybe?
[11:50:54] jenrzzz: has joined #RubyOnRails
[11:51:44] EdwardIII: hrm well afaik 202 means "your request has been accepted, but it may not necessarily be done right now" and 200 just means generically "success"
[11:51:44] rvanlieshout: EdwardIII: just 200
[11:51:50] EdwardIII: i was thinking 201
[11:52:30] EdwardIII: rvanlieshout: i think it'd be nice to distuinguish between "it's been done, and done this time" and "it's been done before, i'm not going to do it again, but that's ok, it's not an error"
[11:54:06] EdwardIII: i guess really the proper approach is to say "201" the first time, "yes, you've said the order is paid, so i'm creating the successful order notification" and then "200" on subsequent times
[11:54:25] ruurd: has joined #RubyOnRails
[11:56:07] mices: <%= link_to "(forgot password)", new_password_resets_path %> undefined local variable or method `new_password_resets_path'
[11:57:13] rshetty: has joined #RubyOnRails
[11:57:17] Diabolik: mices do rake routes
[11:58:25] Icey: has joined #RubyOnRails
[11:59:37] mices: Diabolik: i don't mind adding routes but why didn't it say no route matches
[12:00:14] Diabolik: do rake routes and paste your output on gist
[12:00:43] mices: there's no routes for password_resets or anything for the password_resets controller
[12:00:46] mices: i have to add it
[12:00:51] Diabolik: are you using devise?
[12:01:05] mices: i don't know what devise is so probably not
[12:01:14] shibabu: has joined #RubyOnRails
[12:01:19] Icey: has joined #RubyOnRails
[12:01:21] Diabolik: check your gemfile
[12:01:32] ElFerna: has joined #RubyOnRails
[12:01:40] Icey: has joined #RubyOnRails
[12:02:23] mices: Diabolik: no, nothing like Devise in Gemfile
[12:03:12] Icey: has joined #RubyOnRails
[12:03:12] Icey: has joined #RubyOnRails
[12:03:16] kitsuneyo: has joined #RubyOnRails
[12:07:18] _lazarevsky: rvanlieshout: hey man. One more question.. does russian roll caching ONLY works with page fragments?
[12:07:33] _lazarevsky: rvanlieshout: cuz if that's the case then it's of no use to me because I use ember as my front-end framework :/
[12:07:58] _lazarevsky: I thought that Russian Doll Caching was a DB level caching but it turns out that it's actually a page caching mechanism
[12:08:06] _lazarevsky: rvanlieshout: can you or anyone else confirm that for me?
[12:08:15] atomical: has joined #RubyOnRails
[12:09:48] rvanlieshout: _lazarevsky: it just describes the cache key :)
[12:09:51] mosez: https://github.com/crowbar/crowbar-client/pull/16/files hooray... some initial poor refactoring and specs xD
[12:12:00] _lazarevsky: rvanlieshout: can you please elaborate?
[12:12:01] mosez: can we merge https://github.com/crowbar/crowbar-core/pull/95? the errors seem to be not relevant for this pr
[12:12:24] _lazarevsky: rvanlieshout: I've spent the past couplea hours trying to figure out how to set up redis within our internal architecture
[12:12:40] rvanlieshout: _lazarevsky: you store something in the cache with a key, so you can access it
[12:13:00] _lazarevsky: rvanlieshout: right. But this particular russian doll technique is of particular interest to me
[12:13:06] rvanlieshout: _lazarevsky: getting there
[12:13:18] rvanlieshout: _lazarevsky: so assume we would store something simple as product_name, when should that expire?
[12:13:31] _lazarevsky: as soon as the model changes
[12:13:40] nettoweb: has joined #RubyOnRails
[12:13:41] _lazarevsky: or as soon as that variable product_name has changed
[12:13:42] rvanlieshout: and we could then explicitly find caches we need to expire
[12:13:47] rvanlieshout: but that's an intensive operation
[12:13:49] annlewis: has joined #RubyOnRails
[12:14:01] rvanlieshout: so we could also make sure that the fact that the product has changed also implies that our cache key changes
[12:14:23] rvanlieshout: so cache key would be something like "product_#{product.id}_#{product.updated_at}"
[12:14:50] l_tonz: has joined #RubyOnRails
[12:14:51] _lazarevsky: correct.. I just assumed that rails does the internal book-keeping itself
[12:15:09] _lazarevsky: ie. whenever a model changes it automagically updates its cache in the cache store
[12:15:20] rvanlieshout: http://edgeguides.rubyonrails.org/caching_with_rails.html#russian-doll-caching
[12:15:23] rvanlieshout: it uses the updated_at
[12:16:44] rvanlieshout: so the cache is not updated when a model changes
[12:16:45] gavit: what does this mean: ERROR rbenv: 2.2.3p173 is not installed or not found in ~/.rbenv/versions/2.2.3p173 <- I have it installed and it is at that speciffic location :(
[12:16:51] rvanlieshout: but it's updated when it's fechted and was outdated
[12:17:09] EdwardIII: Diabolik: i added devise and it seems any routes underneath where i include the devise routes break heh - is that normal?
[12:17:13] gavit: well, without the part anyways
[12:17:30] _lazarevsky: so the way to implement russian doll caching is to add touch: true to all the dependencies of the objects we want to cache, no?
[12:17:35] gavit: but I get the same 'type' of error
[12:17:44] _lazarevsky: rvanlieshout: I've not been able to find a comprehensive tutorial on this
[12:17:45] cac: has joined #RubyOnRails
[12:17:52] kitsuneyo: has joined #RubyOnRails
[12:17:53] ruurd: has joined #RubyOnRails
[12:17:57] rvanlieshout: _lazarevsky: to implement is to just use cache product do
[12:18:05] _lazarevsky: the ones that I have are using trivial data and ALL use layout code
[12:18:10] _lazarevsky: I however, do not use rails layouts or views
[12:18:12] rvanlieshout: only you should know that if you want that cache block to be outdated, the product has to be updated
[12:18:27] _lazarevsky: I only server JSON to the front-end
[12:18:28] erbesharat: has joined #RubyOnRails
[12:18:41] _lazarevsky: that's what threw me off
[12:18:51] rvanlieshout: gist an example of an action that gets and serves the json
[12:19:02] _lazarevsky: oh I see what you mean
[12:19:04] _lazarevsky: it's a code-block
[12:19:14] _lazarevsky: let me gist one real quick
[12:19:17] _lazarevsky: rvanlieshout: thanks!
[12:19:34] FailBit: https://mobile.twitter.com/TheSoftwareDev/status/659099801871646720
[12:21:09] _lazarevsky: rvanlieshout: https://gist.github.com/anonymous/f2fc7f3b22abd9cc2b58 <- I then, in another action, call this method and return the returned projects as JSON
[12:21:11] gingray: has joined #RubyOnRails
[12:22:07] rvanlieshout: _lazarevsky: lemme convert that
[12:22:38] rvanlieshout: project_ids it not used in that method
[12:22:59] rvanlieshout: and this doesn't feel like a heavy method
[12:23:12] rvanlieshout: the thing is, how would we know cache for this is outdated?
[12:23:24] rvanlieshout: if any project, user_product or project_action changes?
[12:24:57] _lazarevsky: when its updated_at has changed
[12:25:01] _lazarevsky: according to the docs
[12:25:08] rvanlieshout: the docs are irrelevant
[12:25:09] _lazarevsky: and that I assume happens during the update phase
[12:25:10] rvanlieshout: it's applicatiuon specific
[12:25:14] rvanlieshout: if i would cache this
[12:25:19] rvanlieshout: when would it be expired?
[12:25:26] rvanlieshout: when would the info i gave you would be considered outdated
[12:25:47] kitsuneyo: "class Admin::UsersController < ApplicationController" <- what is Admin here if not a class? i mean it's a namespace, but if i wanted to split this line up so it's nested, what is Admin?
[12:26:12] _lazarevsky: rvanlieshout: when the project status has changed, or the user_project or project_actions have changed
[12:26:56] rvanlieshout: _lazarevsky: so you'll need to add the touch: true on the relationships to project for user_product and project_action
[12:27:02] rvanlieshout: so any mutation there touches the given project
[12:27:07] rvanlieshout: even a destroy action should update it
[12:27:17] rvanlieshout: then we can soly base it on the max(updated_at) for projects
[12:27:35] rvanlieshout: see the single line added to that gist
[12:28:50] rvanlieshout: added some enters just to see what happends in that method
[12:29:01] DylanJ: Why in rails 3.2 does an association with a join return instances of models which are read only? I haven't seen this before. Was this changed in Rails 4? Does returning readonly? => true instances make sense on a join?
[12:29:23] rvanlieshout: DylanJ: did you also change the .select?
[12:29:48] _lazarevsky: ok.. I guess I misunderstood what russian doll caching was! I thought it created a separate cache entry for each and every model such that if only a children of a project changed (and not the project itself), then only that cache is refreshed/rehydrated.. In actual fact it would appear that using this technique we're caching SQL queries
[12:29:52] DylanJ: i don't think so, i'll check the scopes this query is using though
[12:29:53] _lazarevsky: rvanlieshout: correct?
[12:30:01] Hazim: has joined #RubyOnRails
[12:30:09] rvanlieshout: _lazarevsky: you create cache entries for things that you need
[12:30:19] rvanlieshout: but include a time specific value in the key
[12:30:24] rvanlieshout: so you won't use it again when outdated
[12:30:31] rvanlieshout: important part is to add an expires_in
[12:30:36] rvanlieshout: so redis will eventually drop the entries
[12:30:51] _lazarevsky: I dont want it to expire unless the project or any of its children have changed
[12:31:05] _lazarevsky: and also, when does the cache get updated?
[12:31:07] ruurd: has joined #RubyOnRails
[12:31:11] DylanJ: rvanlieshout: ah. it's doing a fancy explicit sql join in one of the scopes. that would explain things.
[12:31:15] _lazarevsky: during the update phase or during the first fetch after an update?
[12:31:17] rvanlieshout: _lazarevsky: you don't update the cache
[12:31:17] DylanJ: nvm then ^
[12:31:22] rvanlieshout: you ignore it and fetch a new one
[12:31:44] _lazarevsky: so it's done during the first fetch after an update then?
[12:31:50] rvanlieshout: _lazarevsky: yes
[12:32:00] rvanlieshout: you don't prepopulate it
[12:32:09] artto: has joined #RubyOnRails
[12:32:13] _lazarevsky: you say ok cool gimme this record, see that the current cache holds stale data, updates it, serves the records and then serves it from the cache until changed
[12:32:16] _lazarevsky: ok I get it now
[12:32:22] _lazarevsky: that's beautiful :)
[12:32:29] rvanlieshout: _lazarevsky: that's not how it works
[12:32:45] rvanlieshout: you ask the cache for an entry dashboard_filer_201510291332
[12:32:54] rvanlieshout: that doesn't exist? then caculate and store
[12:33:01] _lazarevsky: that's what I was saying
[12:33:07] rvanlieshout: yeah, so the key changes
[12:33:13] rvanlieshout: that's why the expires is important
[12:34:18] youngbaks: has joined #RubyOnRails
[12:34:25] _lazarevsky: rvanlieshout: in the gist you're only checking the updated_at of the project records
[12:34:31] _lazarevsky: what if the updated_at of one of its children has changed?
[12:34:34] _lazarevsky: oh that's what touch is for aye?
[12:34:50] _lazarevsky: touch changes the updated_at of the Project records aye?
[12:34:56] _lazarevsky: omg, so simple - so genius
[12:35:06] _lazarevsky: can't believe this could actually solve my performance problems
[12:35:07] rvanlieshout: you don't want a super severe check to find out what key to use
[12:35:17] rvanlieshout: cause that would still not solve those performance issues
[12:35:23] rvanlieshout: but is this particular query slow?
[12:35:25] _lazarevsky: yeah I get that.. so simple.. I love it
[12:35:27] rvanlieshout: did you check indexes?
[12:35:43] _lazarevsky: the load time to my app is ~4 seconds
[12:35:52] _lazarevsky: we're based in South Africa and our server is hosted in Dublin
[12:36:05] _lazarevsky: we've just started serving the assets from a CDN which brought down the load time by a sec
[12:36:16] rvanlieshout: so how much would this even help?
[12:36:35] _lazarevsky: rvanlieshout: well the fact that I won't have to run lotsa queries on app load would help greatly
[12:36:52] rvanlieshout: it won't if those queries are fast
[12:36:58] rvanlieshout: i wouldn't expect this particular query to be slow
[12:37:07] _lazarevsky: rvanlieshout: well..
[12:37:15] rvanlieshout: and if this one is slow, check indexes
[12:37:34] _lazarevsky: we run lotsa queries
[12:37:41] _lazarevsky: this is just one query of the many we run for the dashboard
[12:37:51] _lazarevsky: I just used a simple query as an example
[12:38:05] _lazarevsky: rvanlieshout: could I share my code with you in prv
[12:38:09] rvanlieshout: you might also get back here with some slow queries
[12:38:16] _lazarevsky: of all the queries and actions performed during the loading of the dashboard
[12:38:19] rvanlieshout: i like sql challenges
[12:38:25] _lazarevsky: don't judge pls :)
[12:44:35] dionysus69: has joined #RubyOnRails
[12:44:46] ruurd: has joined #RubyOnRails
[12:47:39] dikaio: has joined #RubyOnRails
[12:47:40] jahbrewski: has joined #RubyOnRails
[12:47:41] tetraktys: has joined #RubyOnRails
[12:48:42] sevenseacat: has joined #RubyOnRails
[12:49:22] RegulationD: has joined #RubyOnRails
[12:53:43] northfurr: has joined #RubyOnRails
[12:53:52] banister: has joined #RubyOnRails
[12:55:58] dionysus69: has joined #RubyOnRails
[12:56:13] pawnbox: has joined #RubyOnRails
[12:56:51] ruurd: has joined #RubyOnRails
[12:57:03] n1lo: has joined #RubyOnRails
[12:57:32] jas02: has joined #RubyOnRails
[12:57:50] voker57: has joined #RubyOnRails
[12:59:07] northfurr: symbol vs string when rendering a view??? this just preference or are symbols better since they???re less memory?
[12:59:49] rvanlieshout: there are differences, but doubt that you'll notice them
[13:01:38] acti0nman: has joined #RubyOnRails
[13:02:38] h7br1x: has joined #RubyOnRails
[13:02:58] norc: northfurr: Imo use symbols to identify things, strings for anything else.
[13:05:30] bitkiller: has joined #RubyOnRails
[13:06:11] Elyx0: has joined #RubyOnRails
[13:07:49] Pazician: has joined #RubyOnRails
[13:09:33] spiman: has joined #RubyOnRails
[13:10:01] dionysus69: has joined #RubyOnRails
[13:10:28] jas02_: has joined #RubyOnRails
[13:10:34] sankaber: has joined #RubyOnRails
[13:10:37] spiman: hello, has anyone used rabl (json template engine for rails)? I have a rabl question that could potentially expand to ruby basics
[13:11:07] norc: spiman: Dont ask to ask, just present your problem and dont forget the gist.
[13:11:32] n1ck7: If I want to show content specific to a user, what would be the best construction of routing. user/{id}/topics, or topics/user/{id}?
[13:12:01] rvanlieshout: n1ck7: using route helpers
[13:12:09] rvanlieshout: user_topics_path(@user)
[13:12:16] rvanlieshout: which would result in users/123/topics
[13:12:38] nettoweb: guys, I need to have a url different of localhost to try facebook app (in my case im testing omniauth facebook)
[13:13:00] spiman: @nettoweb you can add http://localhost:<port> to the application settings
[13:13:08] n1ck7: rvanlieshout, Okay thanks, so it's definitely more appropriate to do this inside of the users_controller instead of the topics_controller?
[13:13:11] Guest53: has joined #RubyOnRails
[13:13:12] arup_r: n1ck7: first one
[13:13:54] spiman: so i'm using rabl for my json templates as in https://gist.github.com/spiman/2294c795f34de9970957
[13:13:59] rvanlieshout: n1ck7: no, nested resources will still just use the topics controller
[13:14:05] nettoweb: spiman yeag, Im using localhost:3000 but when try to login with facebook I get this error: must pass either a `code` (via URL or by an `fbsr_XXX` signed request cookie
[13:14:05] rvanlieshout: but you'll get a params[:user_id] for fweeeee
[13:14:18] Papierkorb: nettoweb: You'll need to use HTTPS to use OAuth2 with FB. They'll redirected to https:// no matter if you have that in your app settings or not
[13:14:24] treehug88: has joined #RubyOnRails
[13:14:31] n1ck7: rvanlieshout, Ah! thank you
[13:14:34] annlewis: has joined #RubyOnRails
[13:14:45] rvanlieshout: it doesn't use / access the users controller
[13:15:02] spiman: according to the documentation ( https://github.com/nesquena/rabl#conditions ) the if: and unless: options might be Symbol, Boolean or Proc
[13:15:08] DiCablo: has joined #RubyOnRails
[13:15:37] l_tonz: has joined #RubyOnRails
[13:15:38] Papierkorb: nettoweb: also, lvh.me resolves to 127.0.0.1, so you can use that if you want to. I on the other hand just have a bunch of foo.dev domains in my /etc/hosts file for that purpose
[13:15:40] spiman: how come in my gist in line #2 i can only pass a proc but in line #3 i can pass a lambda
[13:15:59] nettoweb: Papierkorb I can use https in localhost? if not, there is something I can do to test my "login with Facebook" in localhost?
[13:16:36] Papierkorb: nettoweb: you can, e.g. using the 'thin' gem: bundle exec thin -p 3000 --ssl
[13:16:56] Papierkorb: That'll use a untrusted, by automatically generated SSL cert by default for development purposes, and ONLY for those.
[13:17:06] Papierkorb: but automatically*
[13:17:58] nettoweb: Papierkorb I actually can use "login with facebook" in my app without https but this error Im getting when implementing with SDK... client-side
[13:18:25] Papierkorb: nettoweb: No idea what the JS SDK exactly does, I always use the server-side flow
[13:18:47] DiCablo: nettoweb i dont think so
[13:19:01] DiCablo: besides using ssl is always better
[13:19:07] notnoyyyyy: has joined #RubyOnRails
[13:19:14] Papierkorb: DiCablo: SSL on localhost works fine
[13:19:20] dopamean_: has joined #RubyOnRails
[13:19:28] nettoweb: Papierkorb Im using JS SDK for open a popup instead and whole page to authenticate with FB...Have you ever seen?
[13:19:42] Papierkorb: nettoweb: I know that it exists, but I'm not using their code ;)
[13:19:52] nettoweb: Papierkorb right
[13:20:17] nettoweb: DiCablo Do you think thee only way is starting thin as ssl?
[13:20:22] arBmind: has joined #RubyOnRails
[13:21:15] DiCablo: i guess so
[13:21:36] Papierkorb: You can hack webrick to do SSL as well, but it's not fun. I have a helper script for capybara scripts to run over SSL though if you need
[13:21:52] RandyT: has joined #RubyOnRails
[13:22:21] spiman: @nettoweb i'm using https://developers.facebook.com/docs/javascript in an angular app of mine and i have no problem authenticating via plain http in localhost.
[13:22:42] spiman: not sure if it applies to you though, just sayin
[13:22:44] nya: has joined #RubyOnRails
[13:23:04] nettoweb: I started but now Im getting Internal server error. I select one certificate and clicked and procced
[13:23:13] Papierkorb: spiman: seems to work if you're using the client-side flow for auth, the server-side flow requires you to use SSL it seems
[13:23:51] spiman: i thought nettoweb is referring to client-side auth
[13:23:59] ruurd: has joined #RubyOnRails
[13:24:07] nettoweb: spiman yes, client side
[13:24:25] spiman: so you're using the FB.login() /call?
[13:24:34] artto: has joined #RubyOnRails
[13:25:30] spiman: could you post a gist of your javascript call that produces the error?
[13:25:45] spiman: is it a plain login call or do you ask for another service?
[13:26:04] nettoweb: spiman Im doing like this: https://github.com/mkdynamic/omniauth-facebook/blob/master/example/app.rb#L23
[13:26:31] arBmind: has joined #RubyOnRails
[13:27:07] nettoweb: spiman https://gist.github.com/osnysantos/d64e7657baed25d298ee
[13:27:27] workmad3: has joined #RubyOnRails
[13:29:14] goldbug: What's the correct syntax to validate whether a property of an associated model is true? I'm trying this but the syntax is obviously wrong: validates :person, :inclusion => { :in => :person.is_composer }
[13:29:38] cac: has joined #RubyOnRails
[13:29:46] spiman: nettoweb: i'm using exactly the same thing successfully in an angular app via the ng-facebook service i'm checking the source code that handles the initialization, your problem might be there
[13:29:54] TDJACR: has joined #RubyOnRails
[13:30:01] mwlang: I???m using the draper gem to DRY my view templates and get rid of all logic in them. I???ve run into a situation where I need a second decorator within the view and this is how I implemented it: https://gist.github.com/mwlang/fe1519e66844a7739934#file-_item_normal-haml-L20 (see line #20).
[13:30:26] Guest53: has joined #RubyOnRails
[13:30:35] mwlang: My question: Is this the best way? I saw just now that Draper takes a context, but I can???t decide if going that route???s actually worth the extra effort and would improve what I did all that much.
[13:30:46] Macaveli: has joined #RubyOnRails
[13:30:59] dionysus69: has joined #RubyOnRails
[13:31:08] nettoweb: spiman I see some people saying I have to test with a "test user" from my app...
[13:31:18] nettoweb: actually Im using my own login (administrator)
[13:31:26] nettoweb: i dont know if have any problem with this
[13:32:07] spiman: if your user is registered in the facebook developers page as an admin you won't have a problem
[13:32:13] elaptics: mwlang: haven't used draper in a long time but I thought they changed it to auto-decorate related items too - or was an option you could specify to do so
[13:33:25] mwlang: elaptics: yeah, there???s that, but I???m not really decorating something related through AR associations. What I???m decorating here is a price calculator that takes an item and figures out the best price the customer is eligible for.
[13:33:35] nettoweb: spiman seems the cookie is not been created
[13:33:37] tbuehlmann: this? https://github.com/drapergem/draper#decorating-associated-objects
[13:33:40] tens0r: has joined #RubyOnRails
[13:33:41] gingray: has joined #RubyOnRails
[13:33:57] mrchris: has joined #RubyOnRails
[13:34:04] mrchris: Good morning
[13:34:05] elaptics: mwlang: oh I assumed that item.customer_prices was an AR association
[13:35:02] mwlang: elaptics: Ah. that???s actually pinpointing my concern a bit. I added that in order to create the price calculator within the context of the item, passing in the current user.
[13:35:10] mrchris: anyone here ever done a "with_all OR" query in ThinkingSphinx?
[13:35:10] elaptics: mwlang: in which case there's not much else you can do than what you're doing
[13:35:10] elaptics: mwlang: this is one of the reasons I moved away from draper
[13:35:30] elaptics: mwlang: Or you could just add it all into the decorator itself but that's where it gets a bit questionable as to responsibilities,etc
[13:35:50] mwlang: but now that I???m thinking about it???the :context bit may actually clear this up nicely.
[13:36:23] spiman: nettoweb: just noticed i'm using a test application in facebook
[13:37:14] mwlang: that is, item.decorate(context: {user: current_user}) and then within the ItemDecorator instantiate the calculator???.
[13:37:16] spiman: but since you're an administrator this shouldn't be a problem
[13:37:25] mices: my app complains that template layouts/mailer is missing, why does it think it's supposed to be present
[13:37:55] nettoweb: spiman me too, Im using a test app (sandbox) and here are the url setup: http://snag.gy/TWpA6.jpg
[13:38:22] mwlang: elaptics: yeah, responsibilities???it???s the first time I???m using decorators like this, so I wasn???t necessarily sure decorators should be responsible for mingling two loosely coupled objects.
[13:38:25] nettoweb: This is meant to work
[13:39:19] Peg-leg: has left #RubyOnRails: ()
[13:39:30] mwlang: elaptics: what did you move to using when you ditched draper?
[13:39:51] spiman: same setup except i don't have anything defined in app domains
[13:39:54] spiman: just the site url
[13:41:14] masscrx: has joined #RubyOnRails
[13:41:32] elaptics: mwlang: just home-grown presenter type objects
[13:41:40] spiman: https://gist.github.com/spiman/28e72473e41c7520af28 that's what i use, it uses an angular wrapper for the facebook object
[13:41:47] elaptics: mwlang: lately been considering them more as a general view-object
[13:42:45] n008f4g_: has joined #RubyOnRails
[13:42:56] masscrx: I have main app with several engines, and from one of engines I would like to create new "service" so create new database from schema, for example for customer1 will be "c_1_db" database, for customer 2 "c_2_db" and so on... schema is the same for all databases, what way should I go ?
[13:43:00] rshetty_: has joined #RubyOnRails
[13:44:14] masscrx: from engine level I will be managing these "services/databases"
[13:44:25] yogeshwar: has joined #RubyOnRails
[13:45:44] masscrx: so dynamically create config/database_suffix.yml or store all databases in one config file
[13:46:18] op84: has joined #RubyOnRails
[13:47:06] darrencauthon: has joined #RubyOnRails
[13:47:57] op84: hi there - i???m stuck with some route setup - http://pastebin.com/V73wrQxC maybe someone has an idea how to achive this
[13:48:39] elusiveother: has joined #RubyOnRails
[13:48:40] op84: http://pastie.org/private/y7qeehttbbr5icedjk6gq
[13:48:59] CanTonic: has joined #RubyOnRails
[13:49:33] Sigfrid: has joined #RubyOnRails
[13:50:17] spiman: nettoweb: check out these two, it's probably the cookie -- https://developers.facebook.com/docs/facebook-login/web and https://github.com/GoDisco/ngFacebook/blob/master/ngFacebook.js
[13:52:04] Guest53: has joined #RubyOnRails
[13:52:25] existensil: has joined #RubyOnRails
[13:52:26] jenrzzz: has joined #RubyOnRails
[13:52:26] goldbug: I'm searching for a way to require a certain condition of one object to be true before an entry can be made in an associated table. There must be an easy way to do this via a validation, no?
[13:54:19] mwlang: elaptics: same here, tho??? I???m kind of going in the reverse direction ??? towards trying draper. I tend to think Rails would be better served calling their architecture MVT (model, view, template) ??? enough of a shift in thinking what that ???view??? really is.
[13:55:02] mwlang: goldbug: if the validation on the parent object fails, the associated records won???t be inserted.
[13:55:10] mwlang: (or updated)
[13:55:38] mwlang: that is, if you???re relying on Rails??? nested attributes.
[13:57:01] l1meon: has joined #RubyOnRails
[13:57:15] nettoweb: spiman after some hours, this code worked for me: https://github.com/mkdynamic/omniauth-facebook/issues/165#issuecomment-62392822
[13:57:35] nettoweb: spiman so the problem was really the cookie
[13:57:40] yaw: has joined #RubyOnRails
[13:57:41] nettoweb: but I dont know why
[13:57:58] spiman: isn't the sdk supposed to do this automatically?
[13:58:19] CJKinni_: has joined #RubyOnRails
[13:59:57] raazdaan: has joined #RubyOnRails
[14:00:22] shinnya: has joined #RubyOnRails
[14:00:40] valeriansaliou: has joined #RubyOnRails
[14:00:52] valeriansaliou: has joined #RubyOnRails
[14:01:13] valeriansaliou: has joined #RubyOnRails
[14:02:35] HalcyonicStorm: has joined #RubyOnRails
[14:02:44] rshetty: has joined #RubyOnRails
[14:03:52] shibabu: has joined #RubyOnRails
[14:05:21] ibouvousaime: has joined #RubyOnRails
[14:05:21] goldbug: mwlang: The attribute in the parent object can be true or false, but a child can only exist when the attribute is true. If that makes sense.
[14:05:56] mwlang: goldbug: ah. yes, that makes sense.
[14:06:46] gavit: ACTION switched to rbenv completelu, on server and local :)
[14:07:24] nfk|laptop: has joined #RubyOnRails
[14:07:33] gavit: for some reason though my capistrano doesnt install 'missing gems' I need to install it as root :'(
[14:08:26] mwlang: goldbug: are you wanting to validate presence/absence of that child object based on the controlling attribute or are you wanting to conditionally insert and remove the association based on the controlling attribute?
[14:09:22] allenn: has joined #RubyOnRails
[14:12:08] gavit: hm, seems to work as user too, guess that it must be my capistrano congif
[14:12:10] mwlang: goldbug: I???ve got to go. I???d suggest reading through the conditional validations section of the guide here: http://guides.rubyonrails.org/active_record_validations.html#conditional-validation
[14:12:12] goldbug: mwlang: The latter. What it is is I've got a Person object (the parent). Some People are composers (Person.is_composer = true), and those People are allowed to be associated with a musical Period (Baroque, Classical, Romantic, etc). There is an intermediate object People_Person to connect them up. But I want it to be impossible to create an entry in People_Person where Person.is_composer
[14:12:23] goldbug: Ah bugger. Okay ta (:
[14:14:20] goldbug: Oh yeah, have seen that. It's only looking at conditions within the same model.
[14:14:24] cac: has joined #RubyOnRails
[14:15:04] sankaber: has joined #RubyOnRails
[14:15:21] annlewis: has joined #RubyOnRails
[14:15:32] mwlang: goldbug: you can still validate presence/absence of associations conditionally based on some condition.
[14:16:04] mwlang: goldbug: alternatively, add the validation to the people_person model that validates that the person.is_composer is true.
[14:16:24] elusiveother: has joined #RubyOnRails
[14:16:36] hardtail: has joined #RubyOnRails
[14:16:44] goldbug: That's what I'm trying to do (:
[14:17:00] hardtail: good day everyone
[14:17:10] spiman: has joined #RubyOnRails
[14:17:26] goldbug: I think it's something like this, but my syntax is wrong 'cos I'm a noob: validates :person, :inclusion => { :in => :person.is_composer }
[14:17:29] DiCablo: has joined #RubyOnRails
[14:17:52] mag42c: has joined #RubyOnRails
[14:17:52] yogeshrt: has joined #RubyOnRails
[14:18:05] hardtail: Would anyone be able to take a look at this http://stackoverflow.com/questions/33415034/carrierwave-backgrounder-and-delayed-job-not-working-on-heroku-no-such-file-or ? I am having difficulty with my worker processing image uploads on Heroku with Delayed_Job Gem.
[14:18:22] Ergo: has joined #RubyOnRails
[14:18:57] beauby: has joined #RubyOnRails
[14:22:48] gavit: if I run gem list I get pg, but my capistrano keeps failing :'(
[14:22:52] ldnunes: has joined #RubyOnRails
[14:23:59] mwlang: goldbug: on the people_person model: validates_with PersonIsComposer and then implement it: http://guides.rubyonrails.org/active_record_validations.html#performing-custom-validations
[14:24:14] chills42: has joined #RubyOnRails
[14:25:21] moeabdol1: has joined #RubyOnRails
[14:25:36] dopamean_: has joined #RubyOnRails
[14:26:22] dionysus69: has joined #RubyOnRails
[14:27:11] mwlang: elaptics: passing user as context actually ends up being the better option. Now my template looks like this: https://gist.github.com/mwlang/fe1519e66844a7739934
[14:27:31] chouhoulis: has joined #RubyOnRails
[14:27:55] CJKinni__: has joined #RubyOnRails
[14:28:19] mwlang: although responsibilities are somewhat stretched as it were, at least it???s all in the decorator models and easily covered under tests.
[14:28:24] mices: i didn't specify a layout for my mailer, and there is none, but rails is looking for it ... why?
[14:29:33] orolo: has joined #RubyOnRails
[14:30:56] imp4t: has joined #RubyOnRails
[14:33:03] mordocai: has joined #RubyOnRails
[14:33:42] goldbug: mwlang: You really think this is custom validation territory?
[14:34:17] jobewan: has joined #RubyOnRails
[14:34:47] tubbo: mices: when you run the mailer generator, i'm pretty sure it generates a mailer layout for you to use and defaults to that one. it's like a bare-bones layout that doesn't load in JS or CSS.
[14:35:23] chills42: has joined #RubyOnRails
[14:35:26] tubbo: mices: should be in app/views/layouts/mailer.html.whatever-templating-language-you-use-i-use-haml
[14:38:26] qejk: has joined #RubyOnRails
[14:39:27] ruurd: has joined #RubyOnRails
[14:41:37] masscrx: are there any alternatives for storing password besides ENV and pass in file like database.yml ?
[14:42:08] hardtail: anyone here used delayed_job gem with carrierwave_backgrounder on heroku?
[14:42:39] mices: tubbo: it's not there
[14:42:54] tubbo: mices: what version of rails are you using? that's a relatively recent thing
[14:42:55] mices: nothing for my mailer "UserMailer" in layouts
[14:43:12] jonee: has joined #RubyOnRails
[14:43:17] nickenchuggets: ActiveAdmin is nice
[14:43:21] tubbo: mices: as i said before, the file is called app/views/layouts/mailer.html, it won't be named user_admin or anything
[14:43:36] tubbo: nickenchuggets: </sarcasm>? :D
[14:43:52] nickenchuggets: it is actually nice
[14:43:56] mices: tubbo: 4.1.8
[14:44:09] nickenchuggets: a little difficult to configure, but, nice once it's all working
[14:44:26] rshetty: has joined #RubyOnRails
[14:45:10] goldbug: Sorry, this is really elementary stuff, but how can I return all members of a class that have a certain parameter=true?
[14:45:28] mices: tubbo: that's what rails is looking for layouts/mailer ... it's not there so it must be i created the mailer controller manually and never used the generator
[14:45:31] tubbo: yeah nickenchuggets it's pretty neat for a really small subset of uses. it's also really good when you start out with it, but over time you end up getting annoyed by how much shit you have to configure to do simple admin tasks that, had you written your admin to take more advantage of the niceities that rails provides, you might notice it's a bit easier to do "custom stuff"
[14:45:53] tubbo: nickenchuggets: we ran it successfully at a past job for a long time. it was an internal app that was really just an interface to an automated API
[14:45:56] bruno-: has joined #RubyOnRails
[14:46:27] gavit: if I do ldd nokogiri.so I get libruby.so.2.2 => not found, what does this mean?
[14:46:42] tubbo: mices: haha yeah that's definitely it. :P drink your damn kool-aid!
[14:46:43] nickenchuggets: well, I'm doing very simple things with it, just managing my portfolio website
[14:47:04] rshetty: has joined #RubyOnRails
[14:47:08] nickenchuggets: for simple things it has saved me quite a lot of time
[14:47:15] tubbo: mices: those generators exist so it's harder for most people to get into situations like this :)
[14:47:25] pawnbox: has joined #RubyOnRails
[14:47:56] tubbo: nickenchuggets: definitely. if it's like you + maybe 1 other person that needs to see it, AA is perfect.
[14:48:12] nickenchuggets: yeah, just my personal site
[14:48:29] nickenchuggets: I'm the only one who sees the admin side
[14:48:31] mices: tubbo: what would the generated layout have looked like please
[14:48:39] mices: i need html.erb and text
[14:49:05] tubbo: mices: you can just run the generator for your mailer again. it will generate the layout and you can just choose 'n' when it asks you to overwrite your mailer class.
[14:49:07] rgtk: has joined #RubyOnRails
[14:49:14] nickenchuggets: ActiveAdmin isn't exactly... complete
[14:49:23] podman: has joined #RubyOnRails
[14:49:42] tubbo: i've been thinking a lot about that topic, we could still use a solid admin gem for rails
[14:49:47] rshetty: has joined #RubyOnRails
[14:50:01] tubbo: once you build your front-end app you kinda have to repeat some work in the admin side, typically
[14:50:15] RegulationD: has joined #RubyOnRails
[14:50:27] mices: tubbo: ok i'll try, ty
[14:50:43] tubbo: right now i just have a set of actions, views and some JS that displays everything in tables and edits stuff/views details in modal dialogs. still uses ajax for a lot of things, but it's all served with HTML.
[14:51:08] tubbo: but they're all in app/views/admin, and i have an AdminController with CRUD views which are inherited by all of my admin controllers
[14:51:37] nickenchuggets: so you've made like, a base controller called AdminController?
[14:51:40] tubbo: so if i build a new model and i want to administer it, the bare-minimum i need to do is define the admin controller and strong params. all the actions are already written.
[14:51:51] Regulati_: has joined #RubyOnRails
[14:51:56] nickenchuggets: huh, that's kind of cool
[14:52:00] tubbo: but if i want to override, i can just define a view in app/views/posts/show.html.haml and that will override the existing template
[14:52:30] lindii_: has joined #RubyOnRails
[14:52:35] tubbo: yeah, like rails kind-of already does this. AA/RailsAdmin/et. al. reinvent the wheel in sooo many places
[14:53:00] nickenchuggets: very interesting
[14:53:18] elusiveother: has joined #RubyOnRails
[14:53:45] adaedra: you don't say.
[14:53:45] iamse7en: has joined #RubyOnRails
[14:54:12] tubbo: i know right
[14:54:19] elusiveother: adaedra, got the Register with nickserv in order to talk
[14:54:24] elusiveother: am registered with nickserv
[14:54:24] cac: has joined #RubyOnRails
[14:54:37] elusiveother: ACTION hugs NickServ
[14:54:46] adaedra: Are you sure you did right? I can't read what you say.
[14:54:55] kitsuneyo: has joined #RubyOnRails
[14:55:26] elusiveother: would get a "cannot send to channel"
[14:55:33] Jameser: has joined #RubyOnRails
[14:55:40] elusiveother: adaedra, do not blame services for illiteracy
[14:55:54] mices: tubbo: it doesn't create the mailer layout
[14:56:17] goldbug: Ah, there we go. This seems to work. validates :person, inclusion: { in: Person.where(is_composer: true) }
[14:57:10] iamse7en: I have dynamic inputs in an algorithm I use, that are retrieved via daily scraping (nokogiri). I had read that class variables could work, but is there a persistence issue there? Is it best I just create an Inputs table and store them there?
[14:57:12] amortimer: has joined #RubyOnRails
[14:57:50] mices: tubbo: i think you're mistaken about the generator creating the mailer layout
[14:58:26] tubbo: mices: hmm, well i am on rails 4.2 so that might be the difference.
[14:58:46] dhjondoh: has joined #RubyOnRails
[14:59:20] mices: tubbo: can you gist the default mailer layout files
[14:59:44] pixelhandler: has joined #RubyOnRails
[15:00:25] spiman: has joined #RubyOnRails
[15:00:32] tubbo: mices: my mailer layout is really basic (it's in haml though but i'm pretty sure you can translate) https://gist.github.com/tubbo/f274d951b612297b6d73
[15:00:56] tubbo: mices: sorry i
[15:02:39] smathy: has joined #RubyOnRails
[15:02:46] spiman: has joined #RubyOnRails
[15:03:02] czetter_: has joined #RubyOnRails
[15:03:50] tubbo: was confused...thought they had added that in the generator in 4.2
[15:04:20] czetter: has joined #RubyOnRails
[15:04:55] mclee_: has joined #RubyOnRails
[15:06:09] Fire-Dragon-DoL: has joined #RubyOnRails
[15:06:24] momomomomo_: has joined #RubyOnRails
[15:08:30] umgrosscol: has joined #RubyOnRails
[15:10:51] nogic: has joined #RubyOnRails
[15:11:43] UnMorenoBlanco1: has joined #RubyOnRails
[15:12:12] mag42c: has joined #RubyOnRails
[15:12:50] tubbo: lol spring-watcher-listen does not do anything for my damn project
[15:13:18] annlewis: has joined #RubyOnRails
[15:13:24] rshetty: has joined #RubyOnRails
[15:13:39] nertzy: has joined #RubyOnRails
[15:13:59] dvdchr: has joined #RubyOnRails
[15:15:11] momomomomo_: has joined #RubyOnRails
[15:15:41] MissionCritical: has joined #RubyOnRails
[15:15:51] mices: tubbo: i found the reference to layout in ApplicationMailer and took it out
[15:17:12] tubbo: mices: yeah that's a weirdness. you got any reason that you can't update to 4.2.x? 4.1 is a bit old and 4.2 has some nice improvements as well as speed increases
[15:17:38] disgrntld: has joined #RubyOnRails
[15:18:21] spiman: has joined #RubyOnRails
[15:20:03] krz: has joined #RubyOnRails
[15:24:58] dhjondoh: has joined #RubyOnRails
[15:25:12] ldnunes: has joined #RubyOnRails
[15:27:23] rshetty: has joined #RubyOnRails
[15:29:26] Pazician: has joined #RubyOnRails
[15:29:48] mary5030: has joined #RubyOnRails
[15:30:06] kerunaru: has joined #RubyOnRails
[15:30:10] mices: is deliver_now valid? UserMailer.account_activation(self).deliver_now
[15:30:48] mary5030: has joined #RubyOnRails
[15:30:57] notnoyyyyy: has joined #RubyOnRails
[15:31:59] mary5030: has joined #RubyOnRails
[15:32:06] mices: tubbo: 5 is out but i'm not gonna upgrade until i'm ready to go to war with my computer because it could take days or weeks
[15:32:37] mices: that's what i read so i'm not gonna just do it like it's gonna be done if a few
[15:32:40] gavit: mices: I still have an app thats in 3 :(
[15:32:43] arthurix: has joined #RubyOnRails
[15:32:46] tubbo: mices: 5 is not out. latest release is 4.2.4 https://github.com/rails/rails/releases
[15:33:05] mices: ok but i'm not gonna upgrade now
[15:33:06] tubbo: mices: i didn't have many issues upgrading from 4.1 to 4.2 when it came out.
[15:33:21] axl_: has joined #RubyOnRails
[15:33:24] tubbo: the 3->3.1 upgrade was pretty tough, as was 2.3->3 because it forced people onto a newer ruby
[15:33:29] jezeniel: has joined #RubyOnRails
[15:33:34] tubbo: but since then there haven't been any upgrades i can think of that were really that big of a deal
[15:33:52] mices: in UserMailer.account_activation(self).deliver_now is deliver_now valid?
[15:33:59] tubbo: notnoyyyyy: how could you
[15:34:05] tubbo: mices: sure why not
[15:34:14] tubbo: mices: might just be .deliver in 4.1
[15:34:31] workmad3: tubbo: the change in behaviour of `.all` and the removal of `.scoped` is a potential problem point of a rails 4.0 -> 4.1 transition
[15:34:32] mices: because i get undefined method
[15:34:39] IFrank00: has joined #RubyOnRails
[15:35:00] leifcr: has joined #RubyOnRails
[15:35:33] workmad3: mices: deliver_now is 4.2, as that introduced ActiveJob
[15:36:48] pawnbox: has joined #RubyOnRails
[15:37:01] workmad3: tubbo: 2.3->3 was also problematic because they changed a metric crap-ton of interfaces (like the entire AR query interface) :) 3.2->4.0 was a lot less problematic
[15:37:05] northfurr: has joined #RubyOnRails
[15:37:25] jezeniel: Hi guys, anybody can tell me what is this? i cannot google because i don't know the keyword to search. https://gist.github.com/jezenielzapanta/aa81b4361311e57bfffb
[15:37:29] dionysus69: has joined #RubyOnRails
[15:37:43] notnoyyyyy_: has joined #RubyOnRails
[15:38:22] btriley: has joined #RubyOnRails
[15:39:45] mrchris: Could someone take a look at this ThinkingSphinx question I have? http://stackoverflow.com/questions/33394874/thinkingsphinx-with-all-or-query
[15:41:09] arup_r: jezeniel: !g devise rubygem
[15:41:20] tubbo: mices: your questions would probably get faster answers if you thought critically about errors like that. asking me whether that method is valid is not going to give you any answers...because it is a valid method. if you get NoMethodErrors like that, think about what it's being called on. is it the object type you expect?
[15:42:02] tubbo: mices: if so, maybe you are using a newer (or older!) version of the library that has removed that method, and possibly replaced it with a new one
[15:42:16] IFrank00: need some logic help https://gist.github.com/Frank004/17a8890061e799ef4718
[15:42:28] tubbo: mices: for that, you need to consult the library's documentation for the version you're on, and you'll probably find a big old deprecation notice or at least something directing you.
[15:42:56] IFrank00: im trying to select only the users that have task in a project to send a email to them
[15:43:26] tubbo: IFrank00: i wonder if p.service_users.where.not(tasks: []) will work in this case
[15:43:34] tubbo: might not :P
[15:44:32] mices: tubbo: i found mention of rails 5.0 here: http://edgeguides.rubyonrails.org/upgrading_ruby_on_rails.html
[15:44:36] greengriminal: has joined #RubyOnRails
[15:45:03] bePolite: has joined #RubyOnRails
[15:45:22] matthewd: edgeguides is master
[15:45:25] tubbo: mices: notice the domain name there? 'edgeguides'? it's the guides of the current master of rails/rails
[15:45:34] tubbo: so that's typically a bit further in the future
[15:45:43] IFrank00: tubbo, works!! lol
[15:45:46] tubbo: IFrank00: nice
[15:46:06] IFrank00: p.service_users.joins(:tasks).where.not(tasks: [])
[15:46:43] bruno-: has joined #RubyOnRails
[15:48:41] Cache_Money: has joined #RubyOnRails
[15:49:25] roxtrongo: has joined #RubyOnRails
[15:50:54] bricker: has joined #RubyOnRails
[15:51:29] jezeniel: arup_r: i know it is devise, i am asking how to code that on my own for example..
[15:51:58] arup_r: no idea what you are asking
[15:53:18] pawnbox: has joined #RubyOnRails
[15:54:37] jezeniel: arup_r: for example i want some custom method `foo` other than `devise` on the gist.. how could i do that?
[15:55:56] tubbo: jezeniel: why would you want to?
[15:56:00] goldbug: Any obvious reason why this if/else/end condition in ERB isn't working? https://gist.github.com/classicgoldbug/c929173ef8065efc9877
[15:56:20] goldbug: (By not working I mean: syntax error.)
[15:56:55] tubbo: goldbug: <%= is going to return a string. you are not doing that.
[15:57:50] tubbo: jezeniel: i mean, a really easy way to do that would be to monkey-patch AR::Base after Devise is loaded, and just alias_method :something, :devise on the class level..
[15:57:57] tubbo: i just don't see the point or what benefit it gives you
[15:58:48] yogeshwar_: has joined #RubyOnRails
[15:58:49] jezeniel: tubbo: i just want to know how it works or what it is called..
[15:59:13] goldbug: tubbo: Oh yes. Knew it'd be something obvious like that. Thanks.
[15:59:38] tubbo: jezeniel: well it's actually just a class method that devise injected into ActiveRecord, you can define one yourself with `def self.devise()`
[15:59:47] ibouvousaime: has joined #RubyOnRails
[15:59:48] tubbo: and then you just call it in the class scope like `devise :whatever`
[16:00:18] tubbo: jezeniel: the documentation for ActiveSupport::Concern gives you some insight as to how this is developed.
[16:00:45] jezeniel: tubbo: thanks! that is what i was looking for, it is more like a ruby question not rails i think.
[16:01:08] tubbo: jezeniel: yeah i guess so :D but rails folks tend to use that style a lot as well, so it makes sense. just was hoping you weren't trying to do something insane with devise :D
[16:03:22] jezeniel: tubbo: i am not doing something crazy, i just want to know how it works or how to implement something like that from scratch.
[16:04:52] ritic: has joined #RubyOnRails
[16:05:20] r0bby_: has joined #RubyOnRails
[16:05:28] tenderlove: has joined #RubyOnRails
[16:05:54] agit0: has joined #RubyOnRails
[16:06:56] prettiestPony11: has joined #RubyOnRails
[16:07:06] mrtomme: has joined #RubyOnRails
[16:07:51] The_Phoenix: has joined #RubyOnRails
[16:08:19] banister: has joined #RubyOnRails
[16:09:07] moeabdol1: has joined #RubyOnRails
[16:12:03] towski_: has joined #RubyOnRails
[16:13:10] elusiveother: has joined #RubyOnRails
[16:13:25] jahbrewski: has joined #RubyOnRails
[16:14:07] UnMorenoBlanco1: has joined #RubyOnRails
[16:14:16] gavit: ExecJS allows me to pick from different runtimes, node.js being one of them. However I cannot find a way to 'use it', all I see are articles of how node.js is going to replace ror or why it can't
[16:15:40] tubbo: gavit: lol it's already happening!!!1
[16:15:44] GarethAdams: has joined #RubyOnRails
[16:15:53] arup_r: my `inherited` column can have `nil` or `false`.. it is a boolean field. I want to fetch not inherited permissions. but https://gist.github.com/aruprakshit/4392a31d0afa42074cd4 seems odd
[16:16:03] tubbo: gavit: it picks a runtime for you, if you have nodejs installed on linux it uses that. if you're running on OS X or Windows, you don't need it...they come pre-packaged with their own JS runtimes.
[16:16:11] arup_r: https://gist.github.com/aruprakshit/4392a31d0afa42074cd4#file-cosole-rb-L1 gives []
[16:16:19] tubbo: arup_r: nil or false is not boolean
[16:16:20] arup_r: which should be non empty...
[16:16:24] tubbo: well, it kinda is
[16:16:41] bmalum: has joined #RubyOnRails
[16:16:46] tubbo: arup_r: so what does 'inherited' actually mean? and how is it defined?
[16:16:52] tubbo: it's either going to be nil or false? that makes no sense at all.
[16:16:57] adaedra: true or false is boolean, if you add nil it's an optional boolean.
[16:17:00] arup_r: https://gist.github.com/aruprakshit/4392a31d0afa42074cd4#file-cosole-rb-L1
[16:17:11] arup_r: tubbo: it is a model atrribute
[16:17:17] arup_r: boolean field
[16:17:33] momomomomo_: has joined #RubyOnRails
[16:17:34] tubbo: arup_r: yeah i get that :P
[16:17:54] arup_r: yes, someone did not write default: false while wrote migration.. so it abosorbs nil also
[16:18:15] krz: has joined #RubyOnRails
[16:18:22] arup_r: now the point is, my query didn't give me what I ordered it to give
[16:18:28] big|bad|wolf: has joined #RubyOnRails
[16:18:56] safety_cut: has joined #RubyOnRails
[16:19:42] polishdub: has joined #RubyOnRails
[16:20:25] gavit: tubbo: what's happening? the 'using of node?
[16:21:13] [Butch]: has joined #RubyOnRails
[16:21:47] shibabu: has joined #RubyOnRails
[16:21:49] smathy: gavit, he was making a joke about node replacing RoR.
[16:22:07] cantonic_: has joined #RubyOnRails
[16:22:10] smathy: gavit, but his other comment is on point, OSX will take care of itself, and node is a great runtime to use on Linux.
[16:23:36] gavit: smathy: just tried installing it on my mac, it's stuck at 'install' :P so we'll see in a few
[16:23:42] gavit: gonna place it on server for now
[16:24:10] smathy: arup_r, your question seemed to get taken off track, I'm not clear on if you resolved it or not (and if not what the issue is).
[16:24:10] tubbo: gavit: you don't need to install it on your mac...like i just said
[16:24:11] arup_r: anyway, I will write a migration add default to false, and i'll update all null to false
[16:24:54] arup_r: smathy: Ok, I am trying to retrieve all permission for which boolean field inherited is not set true
[16:24:55] gavit: tubbo: I didn't understand that, also, why does this exist then: https://nodejs.org/dist/v4.2.1/node-v4.2.1.pkg
[16:25:05] arup_r: and my query didn't give me the result
[16:25:19] smathy: gavit, you mean why is node distributed for OSX?
[16:25:39] smathy: arup_r, oh right, because some of the rows were NULL?
[16:25:40] arup_r: because I am thing some records have nil values in it.. and that is making mess I feel so
[16:25:55] smathy: arup_r, yeah, your approach is the right one. Make false the default.
[16:26:00] arup_r: I am thinking now to fix it in root instead of hacking it
[16:26:06] jonee: has joined #RubyOnRails
[16:26:11] arup_r: yes.. thanks smathy
[16:26:38] Maletor: has joined #RubyOnRails
[16:27:33] smathy: I actually think it's a bug that the `boolean` field type in a Rails migration doesn't set the false default.
[16:27:47] arup_r: hum. you are true
[16:27:51] ivanskie: has joined #RubyOnRails
[16:28:01] arup_r: actually not a bug...
[16:28:14] pawnbox: has joined #RubyOnRails
[16:28:15] smathy: I think it is.
[16:28:17] arup_r: They just don't want to get rid of your business rule
[16:28:28] adaedra: smathy: depends if it's a nullable field.
[16:28:45] smathy: Especially because the predicate attribute methods will always conflate `nil` into `false` giving a false impression to an unwary user.
[16:29:01] arup_r: may be what should be the default value for a boolean field is BIG decision
[16:29:49] arup_r: may be may be.. not sure.. but having `nil` is nasty
[16:30:04] arup_r: see someone forgot to add it.. and I am now screwed up..
[16:30:52] kitsuneyo: has joined #RubyOnRails
[16:31:26] smathy: adaedra, you're suggesting that if you set it as `null:false` then Rails adds a `default:false` for you? That's not how I think it works.
[16:32:16] bookies: has joined #RubyOnRails
[16:32:30] adaedra: smathy: I'd guess that's the default database behavior then, i.e. reject if no value set.
[16:33:22] arup_r: google search engine is not working for me.. can I use this channel ?
[16:33:46] smathy: adaedra, yep. So as I was saying, I think it's a bug to allow a `boolean` type in a migration and NOT set a `null:false, default:false` for it.
[16:33:54] bookies: I am planning to update a Rails 3.2 app to Rails 4.2. I know that there are several resources online and articles, etc however have any of you have any personal experience. Is it doable? Did it give you hard time? Just want to understand if its going to take ages and if its better to create a new app from scratch.
[16:34:01] gavit: so apparently node is really just a binary... and here I am trying to figure out where the ./configure file is...
[16:34:17] tubbo: bookies: definitely doable.
[16:34:46] benlieb: has joined #RubyOnRails
[16:35:08] yogeshrt: has joined #RubyOnRails
[16:35:17] adaedra: smathy: I do not. This is in parallel to the default database behavior. You just have to know what the default implies. A nullable boolean is a perfectly sane thing and has its uses.
[16:35:31] bookies: tubbo: thank you. have you done it? did you use any specific guide?
[16:35:37] benlieb: has joined #RubyOnRails
[16:35:42] smathy: adaedra, how is it sane? A boolean, by definition, has just two states, true or false.
[16:36:03] lacuna: has joined #RubyOnRails
[16:36:11] smathy: adaedra, if they want to add it (which they did, it's an overlay over the native types present in DB engines) then they should have done it so it's actually a boolean.
[16:36:35] adaedra: smathy: like a nullable string. "" != nil (or SQL NULL).
[16:37:06] Bloomer: has joined #RubyOnRails
[16:38:40] lacuna_: has joined #RubyOnRails
[16:39:40] noodman: has joined #RubyOnRails
[16:39:59] matthewd: bookies: If it's a "modern" 3.2 app, it should be quite smooth; 4.0 was specifically intended to be a very gentle upgrade after the pain of 3.0
[16:40:26] Diabolik: where is the best place to advertise for a short term job posting?
[16:40:57] bookies: thank you matthewd. I get your point. I will need to check the structure as well.
[16:42:02] chouhoulis: has joined #RubyOnRails
[16:42:03] mices: i put a .gemrc file in my home directory with "gem: --no-ri --no-rdoc" but it doesn't make a difference, docs are still getting installed
[16:42:21] beauby: has joined #RubyOnRails
[16:42:48] nemo_: has joined #RubyOnRails
[16:43:41] pawnbox: has joined #RubyOnRails
[16:44:03] kitsuneyo: has joined #RubyOnRails
[16:44:52] pawnbox: has joined #RubyOnRails
[16:45:04] smathy: adaedra, that creates a lot fewer issues because in ruby `nil` doesn't equate to "" or any other valid string value, whereas `nil` equates to `false`
[16:45:37] bookies: has left #RubyOnRails: ()
[16:46:07] _djbkd: has joined #RubyOnRails
[16:46:13] smathy: Also boolean is not a native SQL type, so Rails is already adding magic on top of the SQL - it should go all the way and ensure only boolean values are stored in boolean attributes.
[16:46:35] nickenchuggets__: has joined #RubyOnRails
[16:46:46] adaedra: nil != false ??? anyway, it's a model/database default to allow a nil alternative whatever the type is, and booleans are no exceptions
[16:46:54] adaedra: mh, pg has a boolean iirc
[16:47:17] n1ck7: has joined #RubyOnRails
[16:47:42] bruno-: has joined #RubyOnRails
[16:48:55] tlarevo: has joined #RubyOnRails
[16:49:11] adaedra: yes, this is something that can bit you if you're not aware of it
[16:49:19] smathy: adaedra, sorry, I didn't add "...in a boolean context" - I'll make sure to dot all my 'i's from here on.
[16:49:40] pawnbox: has joined #RubyOnRails
[16:49:45] smathy: adaedra, and yes, pg and sqlite have boolean, mysql doesn't and various others do/don't.
[16:50:20] rakm: has joined #RubyOnRails
[16:50:26] smathy: adaedra, booleans should be an exception because of the `nil` being `false` **in a boolean context** (isn't that fun).
[16:50:40] adaedra: you can also say "falsy"
[16:50:50] smathy: adaedra, I mean the rot goes as far as the predicate getters that Rails provides returns an actual `false`
[16:51:10] IFrank00: I have some cron jobs in my app. Now im going to deploy to heroku. What do I need to do use the cron job that I setup with whenever on heroku
[16:51:15] smathy: *returns an actual `false` when the underlying DB value is NULL.
[16:52:34] safety_cut: has joined #RubyOnRails
[16:52:35] Motoservo: has joined #RubyOnRails
[16:52:51] arup_r: Can't I use Permission.where(inherited: nil).update_column(inherited: false) ? If I try, I am getting error as Nomethod error
[16:52:52] smathy: adaedra, look, if I have to add "in a boolean context" everywhere, then you need to elucidate your confusion a bit better than that.
[16:53:01] arup_r: undefined method `update_column' for #<Permission::ActiveRecord_Relation:0xc71ee20>
[16:53:12] nickenchuggets__: has left #RubyOnRails: ()
[16:53:14] arup_r: I always get confused with updat_*
[16:53:54] Jameser: has joined #RubyOnRails
[16:54:30] matthewd: arup_r: You're probably looking for Relation#update_all
[16:55:03] IFrank00: this my file https://gist.github.com/Frank004/bd87436147fa09e7f313
[16:55:35] arup_r: ** Permission.where(inherited: nil).update_column(:inherited, false)
[16:55:39] arup_r: matthewd: http://api.rubyonrails.org/classes/ActiveRecord/Persistence.html#method-i-update_column
[16:55:39] ibouvousaime: has joined #RubyOnRails
[16:55:43] arup_r: I see one here
[16:55:53] adaedra: smathy: I don't get where you get a false for a nil.
[16:56:07] smathy: adaedra, from the predicate methods.
[16:56:10] nemo__: has joined #RubyOnRails
[16:56:15] matthewd: arup_r: That's on the model, not a relation
[16:56:41] smathy: adaedra, f = Foo.create; f.confirmed #=> nil; f.confirmed? #=> false
[16:56:42] arup_r: matthewd: ok doc says Equivalent to update_columns(name => value).
[16:57:31] smathy: adaedra, I think it's then perfectly understandable when people introduce the: `Foo.where confirmed: false` bug
[16:57:49] adaedra: smathy: here you actually ask it to make it a boolean. If you need the nil value to mean something else, you have to use confirmed without the ?.
[16:58:15] beauby: has joined #RubyOnRails
[16:59:24] adaedra: This is a pitfall, ok, but I won't call it a bug.
[17:00:39] arup_r: matthewd: doc is correct for update_column ? Or I am incorrect ?
[17:00:53] arup_r: ok undefined method `update_columns' for #<Permission::ActiveRecord_Relation:0xcbd6788>
[17:01:10] arup_r: any way those method I can't use.. need to use something else
[17:02:11] smathy: adaedra, my point is that there's a broken API. Even using the attribute getter it's a trivial bug to introduce because `nil` is `false` in boolean contexts (which is where you use boolean attributes).
[17:02:37] smathy: A boolean API should return only true or false.
[17:02:52] yardenbar: has joined #RubyOnRails
[17:03:06] smathy: Anyway, we're getting nowhere here. Two different opinions, which is fine.
[17:04:20] arup_r: Permission.where(inherited: nil).update_attributes(inherited: false) didn't work to.. WTF
[17:04:26] arup_r: how to update smathy ?
[17:04:29] Fahrenhe17: has joined #RubyOnRails
[17:04:36] northfurr: has joined #RubyOnRails
[17:04:48] matthewd: arup_r: Didn't I just say update_all ? :/
[17:04:48] btriley: has joined #RubyOnRails
[17:04:59] arup_r: matthewd: tried
[17:05:07] arup_r: Permission.where(inherited: nil).update_columns(inherited: false)
[17:05:09] arup_r: same error
[17:05:15] matthewd: If you keep looking at the documentation for a different class and trying methods it mentions, you're doing to keep failing
[17:05:23] bePolite: has joined #RubyOnRails
[17:05:24] gavit: how does ror connect to the pgsql server by default? isnt it as localhost?
[17:05:27] btriley: has joined #RubyOnRails
[17:05:54] arup_r: hehe.. so with .where() we can't update ?
[17:05:55] IFrank00: Im looking at the doc on heroku and its say it won't use cron job. they use a schedule add-on but I need to run that task every month not daily or hourly
[17:06:04] arup_r: always need to go with update_all
[17:06:16] MartinElvar: has joined #RubyOnRails
[17:06:24] tlarevo: has left #RubyOnRails: ()
[17:06:28] matthewd: update should work too
[17:06:34] IFrank00: its theres another way of doing the cron jobs or other solution for running some task every month on the background
[17:06:50] bePolite: has joined #RubyOnRails
[17:06:52] jenrzzz: has joined #RubyOnRails
[17:06:57] arup_r: update is an aliad of update-attribute matthewd
[17:07:02] arup_r: so it wouldn't
[17:07:11] arup_r: pain with update_all ** it does not trigger Active Record callbacks or validations. **
[17:07:29] bricker: IFrank00: Run it daily but add a check to see if it's the first of the month
[17:07:41] rubyonrails099: has joined #RubyOnRails
[17:07:46] IFrank00: schedule some task with a background job sideq
[17:08:15] lacuna: has joined #RubyOnRails
[17:08:16] bePolite: has joined #RubyOnRails
[17:08:17] bePolite: has joined #RubyOnRails
[17:08:48] bricker: IFrank00: schedule it daily then add `return if Time.now.day != 1` as the first line of the task
[17:08:52] Papierkorb: btw sidekiq, have you all heard about sidekiq 4.0 now using ruby threads?
[17:09:01] matthewd: arup_r: There is an update on relation... but its API is a bit different in 4.2
[17:09:19] arup_r: doc link please matthewd
[17:09:23] Papierkorb: Am I the only one who uses libraries in jobs, which take time to compute stuff, and thus this change completely wreaks performance?
[17:09:35] bePolite: has joined #RubyOnRails
[17:09:45] matthewd: http://api.rubyonrails.org/classes/ActiveRecord/Relation.html#method-i-update
[17:09:48] IFrank00: bricked, but that will cost $$$ me running that code whit out using it?
[17:10:18] northfurr: has joined #RubyOnRails
[17:10:21] nickenchuggets: has joined #RubyOnRails
[17:10:38] bricker: IFrank00: I don't know, do they charge every time you run it?
[17:11:04] bePolite: has joined #RubyOnRails
[17:11:15] arup_r: matthewd: That wouldn't help me. I will go with update_all .. fu** other methods for now.. :/
[17:11:44] northfurr: any know a good way to convert erb to haml in vim?
[17:12:04] bricker: IFrank00: bummer :(
[17:12:12] lomex: has joined #RubyOnRails
[17:12:19] matthewd: arup_r: Yeah.. isn't that what you wanted anyway? That's the equivalent of update_column.
[17:12:28] IFrank00: I was think of using the sidekiq-scheduler
[17:12:33] Lingo: has joined #RubyOnRails
[17:12:33] bePolite: has joined #RubyOnRails
[17:12:40] arup_r: hum.. If yo know the context, I wanted that right now.. :D
[17:12:50] IFrank00: but I dont know if I can use that to run task every month
[17:13:00] bricker: don't think so
[17:13:23] Fahrenhe17: Hello, guys, i have a question. I render field for email with """<%= f.email_field :email, class: 'form-controll' %>""", in HTML, when email is wrong it appears and dont let me press button. How can i ignore this pop window? http://i.imgur.com/qXnPGZfs.jpg
[17:13:38] lacuna: has joined #RubyOnRails
[17:13:38] lacuna: has joined #RubyOnRails
[17:13:45] bePolite: has joined #RubyOnRails
[17:14:13] dikaio: has joined #RubyOnRails
[17:14:17] Papierkorb: Fahrenhe17: That's a feature of your browser, as email_field sets type='email' of the <input>
[17:14:34] ruurd: has joined #RubyOnRails
[17:14:34] Papierkorb: Fahrenhe17: just use a normal text input if that's not what you want
[17:14:58] bePolite: has joined #RubyOnRails
[17:15:15] baweaver: has joined #RubyOnRails
[17:16:02] Fahrenhe17: Papierkorb: ty very much
[17:16:35] Fahrenhe17: didnt ever seen that with gchrome, thouth its ror
[17:16:55] Fire-Dragon-DoL: has joined #RubyOnRails
[17:16:57] bePolite: has joined #RubyOnRails
[17:17:31] Papierkorb: Yeah, the user agent is free to do pretty much anything it wants. It may force the user to input a valid email address, it could integrate the users address book, or flat out ignore it and treat it as text input
[17:17:59] IFrank00: bricker, Im think of moving the cron job, to sidekiq and sidekiq scheduler , adding the whenever gem in sidekiq ??
[17:18:31] bricker: IFrank00: whenever gem just makes a crontab for you, if you don't have access to cron then it won't be useful
[17:19:10] IFrank00: bricked, yes your right awrrr im blind right now
[17:19:50] IFrank00: bricker, but i can do normal ruby code ???
[17:20:21] bricker: IFrank00: The only way I know to work around it is the way I explained
[17:20:30] CanTonic: has joined #RubyOnRails
[17:21:10] lomex: Guys, i'm having trouble installing json gem (required for rails) on windows 10. It just wont compile http://pastebin.com/4KfY613z
[17:21:27] erbesharat: has joined #RubyOnRails
[17:21:41] arup_r: lomex: That comes default with Ruby
[17:21:48] arup_r: why installing it ?
[17:21:55] lomex: When doing rails new it says its missing
[17:21:59] nemo_: has joined #RubyOnRails
[17:22:25] lacuna: has joined #RubyOnRails
[17:22:33] fryguy: lomex: not the advice you want to hear, but I'd really recommend running ruby on a platform other than windows
[17:22:47] lomex: Or it's not actually saying its missing rails new tells me its trying to install json 1.8.3 and fails on it. For same reason as if I do gem install...
[17:23:02] lomex: fryguy: I like that advice. But it doens't help me right now ;D
[17:23:03] IFrank00: bricker, that a over kill on the $$$$ :/
[17:23:43] baweaver: you need the build extensions
[17:24:01] lomex: baweaver: Are you talking to me? I installed the devkit
[17:24:07] ibouvousaime: has joined #RubyOnRails
[17:24:59] bricker: IFrank00: think outside the box, maybe you don't have to run a monthly task.
[17:25:26] baweaver: https://github.com/rubygems/rubygems/issues/977
[17:25:26] pixelhandler: has joined #RubyOnRails
[17:26:02] baweaver: http://stackoverflow.com/a/7780955/2872906
[17:26:16] lomex: baweaver: Yes I tried that downgrading and ran into a bunch of new errors. I was expected ruby and rails to be kind of stable on windows...
[17:26:19] baweaver: The Windows version is patchy at best.
[17:26:32] baweaver: then again windows for much of any dev work is a bad idea.
[17:26:44] adaedra: Except Windows dev.
[17:26:50] The_Phoenix: has joined #RubyOnRails
[17:26:57] IFrank00: bricked, what it does is every month generate the task for the current month so I need that feature :/
[17:27:28] tubbo: helo i am windows and your computer is inffected
[17:27:45] baweaver: I've used Windows to develop rails before
[17:27:53] baweaver: don't, it's way more pain than it's worth
[17:27:58] lomex: Maybe I should try an older version in general? Was using latest ruby
[17:28:05] orolo: has joined #RubyOnRails
[17:28:21] lomex: That's sad, because Windows is my favorite desktop OS.
[17:28:29] baweaver: Just get a virtual box, docker, vagrant or something
[17:28:38] lomex: I have a macbook though, does it work better on MacOS?
[17:28:39] baweaver: you don't need to have it as a host OS
[17:28:48] adaedra: lomex: should be better, yes
[17:28:52] baweaver: a lot of Rails devs I know use macs
[17:29:07] fmcgeough: has joined #RubyOnRails
[17:29:21] baweaver: Though I also use Debian and FreeBSD a lot too, just depends on what I want to get done.
[17:29:21] lomex: The last time I tried a traditional linux like ubuntu it was a pain in the a** just to get basic stuff running smooth
[17:29:26] n008f4g_: has joined #RubyOnRails
[17:31:04] lomex: What is the reason that ruby is not working good on windows? is it just gems not made for windows?
[17:32:20] baweaver: if 90%+ of the devs for a platform don't work on windows
[17:32:25] mozzarella: if you take the rails on windows route, I??suggest using chocolatey
[17:32:35] baweaver: do you think they check compatibility at all?
[17:33:23] Macaveli: has joined #RubyOnRails
[17:34:51] chills42: has joined #RubyOnRails
[17:36:04] lomex: Trying to install an older ruby version right now, maybe im gonna be successful with that
[17:36:36] adaedra: You can keep using ruby for Windows, but you're entering a world of pain.
[17:36:55] lacuna: has joined #RubyOnRails
[17:37:06] lomex: To be honest, I just wanted to dig into RoR a little deeper. I was doing a basic tutorial and it seems like it could be fun building some stuff with it
[17:37:16] lomex: Not going to use it professionally any soon
[17:37:51] pawnbox: has joined #RubyOnRails
[17:40:12] northfurr: has joined #RubyOnRails
[17:40:33] silas__: has joined #RubyOnRails
[17:40:48] nettoweb: has joined #RubyOnRails
[17:40:52] roxtrongo: has joined #RubyOnRails
[17:41:23] bmalum: has joined #RubyOnRails
[17:41:23] Cervajz: has joined #RubyOnRails
[17:42:21] mikecmpbll: has joined #RubyOnRails
[17:42:29] nemo_: has joined #RubyOnRails
[17:42:50] mozzarella: have I mentioned chocolatey? you should use chocolatey
[17:43:03] roxtrongo: has joined #RubyOnRails
[17:43:22] noodman: has joined #RubyOnRails
[17:43:25] adaedra: ???Chocolatey is offline for a bit of maintenance. Should be back soon.???
[17:43:37] adaedra: The one time I check it.
[17:43:39] lomex: I was about to test it too ;D
[17:43:45] tubbo: lomex: no offense, but this is going to be a common problem for you when you try to program anything that wasn't originally created at microsoft...
[17:43:53] tubbo: windows is only really good for developing windows and .NET apps
[17:44:30] lomex: tubbo: I understand that. I just expected ruby/ror to be popular enough to have atleast the basics working on windows ;-)
[17:44:37] dopie: has joined #RubyOnRails
[17:44:38] silas__: has joined #RubyOnRails
[17:44:43] lomex: I think it's time to get a new macbook and replace my desktop
[17:44:53] rhizome: you can use a VM
[17:45:02] rhizome: but macbooks are nice
[17:45:17] adaedra: lomex: it has basic working. Basic is the word here.
[17:45:22] tubbo: lomex: ruby can run on windows no problem, it's rails that doesn't run on windows
[17:45:41] tubbo: and that's because of a lot of rails dependencies that need some massaging/coaxing in order to function properly on windows
[17:45:41] zeknox: has joined #RubyOnRails
[17:45:47] tubbo: that's improving though
[17:45:49] mozzarella: it runs perfectly fine on windows
[17:45:51] rhizome: rails certainly runs on windows
[17:46:03] adaedra: rails run, but many libraries and tools doesn't or do poorly.
[17:46:18] Motoservo: has joined #RubyOnRails
[17:46:29] zeknox: how are you guys performing rspec tests with ActiveJob, ive read up on some examples, but my tests are invoking the sidekiq process which is for development mode and not test mode
[17:46:57] tubbo: zeknox: you have to set config.active_job.queue_adapter = :test in your test environment config
[17:47:17] zeknox: tubbo: that sounds like the ticket, thank you, will report back
[17:47:21] rhizome: https://www.google.com/search?q=activejob+testing
[17:47:34] rhizome: there's even a gem for rspec
[17:48:40] moeabdol1: has joined #RubyOnRails
[17:48:54] zeknox: tubbo: perfect, that solved my issue with tests throwing dev sidekiq tasks
[17:49:29] zeknox: rhizome: thanks, i did see that but what were the examples really testing other than a job was queued??? dont we want to test the code within the job itself?
[17:49:49] mustmodify: has joined #RubyOnRails
[17:50:15] rhizome: i have no idea, i don't use either
[17:50:45] lomex: What OS would you recommend me to run in a VM to try some RoR?
[17:50:56] lomex: I'm done with that shit on windows
[17:50:58] rhizome: zeknox: isn't the "within the job" part in some other class?
[17:51:52] zeknox: rhizome: yes, my jobs are a class
[17:52:28] tbuehlmann: lomex, I'm fine with ubuntu
[17:52:33] zeknox: rhizome: i think i see where your going with this, test it like so SomeJob.new.perform(*args)
[17:52:53] mices: what's the right syntax to install gem mysql2-0.4.1
[17:52:59] mices: gem install ...
[17:54:17] tubbo: mices: look it up
[17:54:26] tubbo: mices: rubygems.org/read/book/2
[17:57:38] gavit: an image located in App/assets/images/my_file.jpg <- how do I refer to this in production? image_tag image_url("my_file") doesnt seem to work :(
[17:57:55] lomex: tbuehlmann: Thanks
[17:58:33] sunya7a: in rails 4, if i make a call to something like myapp.com/api/regions what is the default format that request is handled at? I have set anything special in my routes file. from trying it out it seems to automatically pick json, but i want to make sure that it's not set somewhere that I'm not aware of
[17:58:52] sunya7a: I have *not* set anything special in my routes file
[17:59:38] ivanskie: has joined #RubyOnRails
[17:59:54] fryguy: sunya7a: it'll be html unless you are sending appropriate headers
[18:00:20] bruno-: has joined #RubyOnRails
[18:00:51] shpoont: has joined #RubyOnRails
[18:01:11] pawnbox: has joined #RubyOnRails
[18:01:12] sunya7a: fryguy: i'm trying this out with httprequester and I set the content type to some of the other values such as application/xml application/json in the request...but it always seems to recognize json regardless ... which makes me think there might be a fallback somehow?
[18:01:58] darrencauthon: has joined #RubyOnRails
[18:02:06] rhizome: what do you mean, "recognize?"
[18:02:19] fryguy: sunya7a: you'd have to inspect headers I guess. it shouldn't be sending content of a different content-type than you expect
[18:02:26] sunya7a: fryguy: i'm just trying to understand the behavior a bit more clearly...i was expecting it to fail if i pick applicaiton/xml and I don't have format.xml defined...but it responds anyway and spits out json
[18:02:39] towski_: has joined #RubyOnRails
[18:02:57] darrenca_: has joined #RubyOnRails
[18:03:05] rhizome: are you sure it's being received by the server as app/xml? it will say in your log.
[18:03:08] sunya7a: rhizome: meaning, i expected it to fail and spit out an error, but it is fine with it and returns json
[18:03:20] sunya7a: rhizome: let me double check
[18:05:23] sunya7a: rhizome: you are right...it is handling it as json...but why though? i thought the header content-type is supposed to define what to process it as...or am i wrong about that?
[18:05:57] rhizome: no, it's the Accepts: header
[18:06:12] alfie: has joined #RubyOnRails
[18:07:35] lacuna: has joined #RubyOnRails
[18:07:51] iloveitaly: has joined #RubyOnRails
[18:08:24] yogeshrt: has joined #RubyOnRails
[18:09:12] Motoservo: has joined #RubyOnRails
[18:09:33] zeknox: anyone know how i can run guard without the webserver running as well
[18:09:43] Guest53: has joined #RubyOnRails
[18:10:07] rhizome: i'm trying to think of how runnign guard would require the webserver to be running
[18:10:41] zeknox: rhizome: seems like the latest version of guard-rails runs webrick by default
[18:10:59] zeknox: rhizome: maybe its a combination of live-reload or something on my end
[18:11:16] tubbo: zeknox: guard-rails' whole job is to run the webserver :P
[18:11:22] rhizome: yes, it will take a dump if you have livereload in the mix
[18:11:34] srinidhi: has joined #RubyOnRails
[18:12:01] zeknox: alright, so what is the best way to use breakpoints with guard-rails, using pry / binding.pry doesn't seem to function properly with guard, whats the reccomended method
[18:12:54] rhizome: i have some notes somewhere reminding me to contribute a clear error message for this kind of livereload problem
[18:13:04] tubbo: zeknox: have you tried pry-remote?
[18:13:29] baweaver: has joined #RubyOnRails
[18:13:55] rhizome: i think it's just ECONNREFUSED or something opaque
[18:14:11] zeknox: tubbo: negative ghost-rider
[18:14:31] rhizome: anyway yeah, pry-remote, but even that is a bit of a drag
[18:16:06] mustmodify: has left #RubyOnRails: ()
[18:17:44] hardtail: does anyone here have experience with delayed_job on heroku?
[18:18:18] ruurd: has joined #RubyOnRails
[18:18:26] smathy: Hardtail, !used
[18:18:26] helpa: Hardtail: Don't ask "does anyone use <thing>?". It's better to just state your problem and if anyone has used <thing> they will most likely answer.
[18:18:38] Motoservo: has joined #RubyOnRails
[18:19:06] hardtail: stupid me, apologies. thanks Smathy
[18:19:45] vdmo: has joined #RubyOnRails
[18:20:48] pawnbox: has joined #RubyOnRails
[18:21:19] hardtail: my workers are failing to upload images on staging and I am not too sure how to troubleshoot this. it works locally. you can see all my code here if anyone has time to take a look. thank you - http://stackoverflow.com/questions/33415034/carrierwave-backgrounder-and-delayed-job-not-working-on-heroku-no-such-file-or
[18:23:01] rgtk: has joined #RubyOnRails
[18:25:36] chipotle: has joined #RubyOnRails
[18:29:05] _djbkd: has joined #RubyOnRails
[18:30:38] Motoservo: has joined #RubyOnRails
[18:31:08] gavit: meh, can't find a log for why my production environment fails ;(
[18:32:59] elusiveother: has joined #RubyOnRails
[18:33:40] FailBit: https://imgur.com/gallery/WDDH8wj
[18:33:42] IFrank00: has joined #RubyOnRails
[18:34:02] iamse7en: has joined #RubyOnRails
[18:35:13] pawnbox: has joined #RubyOnRails
[18:36:10] chills42: has joined #RubyOnRails
[18:36:12] jessemcgilallen: has joined #RubyOnRails
[18:37:27] colleenmcguckin: has joined #RubyOnRails
[18:37:38] Cervajz_: has joined #RubyOnRails
[18:37:55] yaw: has joined #RubyOnRails
[18:38:45] CanTonic: has joined #RubyOnRails
[18:39:15] kiki_lamb: How can I control whether ERB uses HTML escaping for special characters for a particular MIME type?
[18:39:57] kiki_lamb: I've registered text/richtext so that I can have .rtf.erb files, but it's trying to escape special characters as if this were HTML, I want to turn that escaping off.
[18:40:29] gavit: FailBit: I wonder if huffingtonpost will actually send a 'compensation' ;)
[18:40:39] FailBit: they'll just host it on their own cdn
[18:41:01] FailBit: on a more serious note I think the upfront cost of cloudfront is ridiculous
[18:41:27] towski_: has joined #RubyOnRails
[18:41:38] mclee_: has joined #RubyOnRails
[18:43:15] ss_much: has joined #RubyOnRails
[18:44:46] maxx88_: has joined #RubyOnRails
[18:46:43] gavit: FailBit: if its ridiculous they'll notice it in revenue
[18:47:01] gaussblurinc1: has joined #RubyOnRails
[18:47:27] tubbo: FailBit: AWS CloudFront?
[18:47:33] reuven: has joined #RubyOnRails
[18:47:47] rubyonrailed: has joined #RubyOnRails
[18:48:44] rubyonrailed: Is it possible to pass two values with a collection_select? `= f.collection_select :foo, @channels, :id, :name` I wan't to be able to access the `id` and `name` in my controller.
[18:50:58] maxx88_: has joined #RubyOnRails
[18:51:31] h7br1x: has joined #RubyOnRails
[18:52:09] tubbo: FailBit: my cloudfront charges are only $1.62...but that said my site(s) do not allow a large amount of users uploading content
[18:52:24] blue_fenix: has joined #RubyOnRails
[18:52:40] FailBit: how many users do you have, and how much content do you have
[18:53:07] tubbo: FailBit: not nearly as much as you. which is why i'm curious...is there some kind of breaking point where that CDN doesn't make financial sense anymore?
[18:53:18] FailBit: we used it years back
[18:53:22] FailBit: paid 2500/mo for our scale
[18:53:32] FailBit: cloudflare we pay a flat rate
[18:53:36] tubbo: FailBit: this is for my personal projects fwiw...at work, we use MaxCDN, and i think it's for the same reason.
[18:53:43] arup_r: rubyonrailed: hum. May be keep the option value as "<name>#<id>" and inside the controller split it and use it
[18:54:24] Papierkorb: FailBit: Sorry, is that for Cloudflare or AWS?
[18:54:30] craysiii: has joined #RubyOnRails
[18:54:48] FailBit: AWS was 2500/mo
[18:54:51] FailBit: cloudflare is 20
[18:54:54] FailBit: obvious choice is obvious
[18:54:57] Papierkorb: FailBit: Ah, wow
[18:55:14] reuven: has left #RubyOnRails: ("ERC (IRC client for Emacs 24.5.1)")
[18:55:33] tubbo: FailBit: do you still source content from S3?
[18:55:35] Papierkorb: Using it too for my stuff on the free tier. Faster image delivery for free. Can't complain.
[18:56:08] sarink: has joined #RubyOnRails
[18:56:11] FailBit: everything is hosted locally, the CDN url origin points to the server, and nginx has rules for that
[18:56:20] FailBit: derpicdn.net -> only reads on-disk files
[18:56:30] FailBit: camo.derpicdn.net -> only connects to dockerized camo server
[18:56:42] sarink: is there a way i can print the rails database config information from a shell?
[18:57:22] sarink: what i'm trying to do is write a pg_restore script (using heroku) to import staging data, but i need to pass the pg_restore command the username/password from rails (since it may be different on different devs' environments)
[18:57:38] tubbo: sarink: you can probably use Rails.config_for(:database)
[18:57:51] tubbo: it will return a hash of database configuration for the current envrionment
[18:57:57] sarink: tubbo: but i'm in a bash script, there's no "Rails"
[18:58:10] sarink: you'd have to be inside rails console to do that, right
[18:58:13] bmalum: has joined #RubyOnRails
[18:58:26] tubbo: sarink: yes. there are a few ways to do this.
[18:58:38] FailBit: tubbo: maxcdn would be unreasonble for us as well
[18:58:45] FailBit: since we push 500TB of content per month
[18:58:49] tubbo: sarink: but the real question is how are you going to parse whatever it gives you? do you think it might be easier to run pg_restore inside a Rake task or something?
[18:59:05] FailBit: >inb4 "holy shit wat"
[18:59:06] sarink: tubbo: that's a good idea
[18:59:13] tubbo: sarink: that way you could do like sh "pg_restore --user #{config[:username]}"
[18:59:17] tubbo: FailBit: haha
[18:59:42] FailBit: almost 200TB of html, and 500TB of images
[18:59:46] tubbo: FailBit: bronies ain't nothin to fuck wit
[18:59:57] FailBit: I think half the site is furries
[19:00:02] tubbo: FailBit: when you say "500TB of images", is that transfer?
[19:00:17] FailBit: there are only 2.7TB of images on disk currently
[19:00:35] tubbo: FailBit: you probably only have like 5 users, but your content keeps getting hotlinked on huffington post ;)
[19:00:41] Papierkorb: FailBit: are you imgur?
[19:00:51] tubbo: imgur is in the PB range by this point
[19:00:54] tubbo: if not higher
[19:01:14] tubbo: but yeah that makes sense
[19:01:23] tubbo: we don't have a single client at my job that has that much content. maybe GBs but not TBs
[19:01:39] colleenmcguckin: has joined #RubyOnRails
[19:01:55] FailBit: excuse me, that was df
[19:02:00] FailBit: we actually just have 1.7TB
[19:02:08] ibouvousaime: has joined #RubyOnRails
[19:02:10] FailBit: https://derpibooru.org/pony/how-big-is-your-pony-folder/post/1698575#post_1698575
[19:02:40] momomomomo: has joined #RubyOnRails
[19:03:08] craysiii: ive never felt more out of place than clicking that link
[19:03:40] Papierkorb: FailBit: Is that a rails app?
[19:03:57] FailBit: read the footer, and decide for yourself
[19:04:31] FailBit: "Powered by the booru-on-rails project - version 1.4.0-a3daf2b (dev)"
[19:04:47] Guest53: has joined #RubyOnRails
[19:05:12] northfurr: has joined #RubyOnRails
[19:05:47] Ergo: has joined #RubyOnRails
[19:06:14] lomex: has joined #RubyOnRails
[19:06:21] tubbo: "hey i got a great idea for a TV show"
[19:06:28] maxx88: failbit: derpibooru is awesome. my kids will love that site.
[19:06:29] tubbo: "you know sailor moon? what if it was horses?"
[19:07:04] lomex: by the way, I found a solution that works kind of okay for me now. I use vagrant to run my rails. I can have my files in a shared folder and access the webserver just as if it was running on my machine
[19:07:27] jenrzzz: has joined #RubyOnRails
[19:08:08] Motoservo: has joined #RubyOnRails
[19:08:09] lomex: so I can have all my files and my IDE on my Windows desktop and just run the server on the VM
[19:08:35] lomex: Thanks to whoever told me about vigrant its pretty cool
[19:08:52] Hazim: has joined #RubyOnRails
[19:08:58] tubbo: lomex: :) now that you grokked that you'll enjoy docker a lot more :D
[19:09:23] lomex: What do you think is better about docker?
[19:09:39] n1ck7: has joined #RubyOnRails
[19:09:58] tubbo: lomex: well for local development, you can potentially install a docker-machine to Vagrant and then use the docker CLI to build containers locally, push them to your VM, and access them like http://lomexrailsapp.docker
[19:10:09] tubbo: so you don't have to keep re-configuring or cloning VMs
[19:11:26] lomex: tbh I have no clue what you are talking about. I should have a look into docker first
[19:11:39] lomex: I thought of docker just as an alternative of vigrant
[19:11:49] big|bad|wolf: has joined #RubyOnRails
[19:13:23] Dbugger: has joined #RubyOnRails
[19:13:26] smathy: Actually sounds like vagrant is a better solution for that use case.
[19:13:57] Dbugger: When I do rake db:migrate I get an error saying "uninitialized constant Paperclip". Can anyone tell me why?
[19:14:01] tubbo: lomex: you will eventually. stick with vagrant until it doesn't work for you anymore (if that ever happens)
[19:14:10] tubbo: dbugger: paperclip isn't installed or required
[19:14:26] lomex: Yes but now you made me want to dig into docker too
[19:14:46] smathy: dbugger, !gist your Gemfile and Gemfile.lock
[19:14:46] helpa: dbugger: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[19:15:06] Dbugger: Silly me, I commented it out, trying to make it play nice with heroku and S3 :P
[19:16:05] lomex: So docker is like another way of provisioning in vagrant?
[19:16:41] momomomomo: has joined #RubyOnRails
[19:16:59] tubbo: lomex: no
[19:19:50] northfurr: has joined #RubyOnRails
[19:19:59] lomex: I don't really see the difference between docker images and vigrant boxes
[19:20:47] allcentury: has joined #RubyOnRails
[19:22:32] blackhuey: has joined #RubyOnRails
[19:22:38] adam12: has joined #RubyOnRails
[19:22:59] tubbo: lomex: you will, in time :)
[19:23:04] tubbo: once you learn more about vagrant and VMs
[19:23:12] tubbo: pros/cons/etc.
[19:24:01] lomex: As far as I got it now, vigrant is for setting up VMs and run them via some provider. And docker is more about having an isolated environment within the host system that is based on the host system kernel
[19:24:23] colleenmcguckin: has joined #RubyOnRails
[19:24:37] Aherin: has joined #RubyOnRails
[19:25:44] shinenelson: has joined #RubyOnRails
[19:25:57] Cervajz__: has joined #RubyOnRails
[19:25:58] yfeldblum: has joined #RubyOnRails
[19:26:18] momomomomo: has joined #RubyOnRails
[19:27:02] northfurr: has joined #RubyOnRails
[19:28:12] noodman: has joined #RubyOnRails
[19:32:26] lomex: Thanks for the info though. I am really happy with vigrant already ;D
[19:32:29] n1ck7: has joined #RubyOnRails
[19:33:09] baweaver: has joined #RubyOnRails
[19:33:09] Lightsword: has joined #RubyOnRails
[19:33:27] cabotto: has joined #RubyOnRails
[19:33:40] blackmesa: has joined #RubyOnRails
[19:33:43] lomex: I have another question, what is a decent javascript runtime to install? I have no experience with that kind of stuff at all
[19:34:56] cabotto: has joined #RubyOnRails
[19:35:21] Papierkorb: lomex: therubyracer just works??? and is pretty fast. Uses the V8 engine by Google.
[19:36:11] lomex: Oh, I installed nodejs now.
[19:36:25] Papierkorb: Ah thought you meant embedded into ruby
[19:36:47] moeabdol1: has joined #RubyOnRails
[19:36:53] lomex: rails server required me to provide one on that example project
[19:37:57] Papierkorb: correct. the nodejs back-end is ultra slow, but good enough for use with the asset pipeline I guess. It also uses V8, but for every JS invocation your server does (by default only while compiling assets afaik), a new node process is spun up
[19:38:11] nickenchuggets: mmm... yes... text-align: justify
[19:38:33] Papierkorb: If you need to run JS code for some reason on the server during a request, you should use another gem, e.g., therubyracer. There are others too, but never used them
[19:38:46] lomex: Papierkorb: So it does it once per start only right now?
[19:39:03] tubbo: Papierkorb: you don't need therubyracer for that, you can just use ExecJS and a local node.js installation
[19:39:16] tubbo: oh wait never mind :D
[19:39:23] tubbo: eh, i disagree with you on that one
[19:39:27] youngbaks: has joined #RubyOnRails
[19:39:57] tubbo: i think the nodejs backend is "faster" than therubyracer because i don't have to install libv8 locally :P
[19:40:10] Papierkorb: tubbo: it's much much slower. By magnitudes. I benched it.
[19:40:36] Papierkorb: tubbo: It starts a whole process for every invocation, instead of having a process-local V8 context
[19:40:39] lomex: What is the RoR example using that JavaScript engine even for?
[19:40:47] colleenmcguckin: has joined #RubyOnRails
[19:41:05] Papierkorb: lomex: CoffeeScript compiler, the SCSS stuff does too I think. Stuff for the asset pipeline
[19:41:11] tubbo: compiling assets takes a while regardless though
[19:41:16] tubbo: and i don't really care how long it takes
[19:41:26] Papierkorb: yup, and for that nodejs is fine
[19:41:34] tubbo: therubyracer is annoying to install
[19:41:40] tubbo: #1 cause of "hey tom come over here and look at this for me"
[19:41:48] Papierkorb: tubbo: mh? it's just a "gem 'therubyracer'" away?
[19:41:58] Papierkorb: For me at least
[19:42:02] tubbo: Papierkorb: until you can't compile the C extensions for libv8
[19:42:06] FailBit: "why does a ruby project require javascript"
[19:42:12] lomex: So CoffeeScript is part of that example? is CoffeeScript like the modern way to go instead of JS now?
[19:42:22] tubbo: lomex: not at all
[19:42:36] slash_nick: FailBit: form_for blah, blah blah remote: true
[19:42:47] tubbo: FailBit: it's not a "ruby project", it's a "web application"...
[19:42:48] Papierkorb: tubbo: it probably requires a C/C++ compiler suite among a bunch of development libraries, which you need anyway when doing ruby
[19:43:03] stannard_: has joined #RubyOnRails
[19:43:21] moeabdol1: has joined #RubyOnRails
[19:43:32] safety_cut: has joined #RubyOnRails
[19:44:07] Motoservo: has joined #RubyOnRails
[19:44:22] Papierkorb: tubbo: https://gist.github.com/Papierkorb/ec80fefe1d69c6918892#file-results with the nodejs backend it was slower than kramdown
[19:44:50] colleenmcguckin: has joined #RubyOnRails
[19:45:01] Papierkorb: When used with the files of that benchmark there
[19:45:10] tubbo: Papierkorb: yeah...sorta. basically it makes your app dependent on more dylibs that are in hard-coded locations, and if those dylibs change or the location changes (like if you upgrade nodejs or electron locally) it breaks.
[19:45:27] lomex: This Coffee/JS Stuff really confuses me
[19:45:39] FailBit: it shouldn't
[19:45:53] tubbo: lomex: don't worry about it, it's totally optional. coffeescript is nice, if you want to use it...you certainly don't need it.
[19:45:54] FailBit: coffee is available as a flavor of JS if you want it
[19:46:00] FailBit: you don't have to use it
[19:46:05] tubbo: CS is gonna be dead in a few years anyway
[19:46:18] tubbo: ES2015 baby
[19:46:22] Papierkorb: tubbo: maybe, but I'm running JS code as part of requests, so the trade off is worth it
[19:46:28] lomex: But how come rails server tries to compile that JS stuff (that i cant even really find in my project?)
[19:46:34] lacrymol1gy: has joined #RubyOnRails
[19:46:42] ruurd: has joined #RubyOnRails
[19:46:43] tubbo: Papierkorb: that definitely makes more sense.
[19:46:59] baweaver: has joined #RubyOnRails
[19:47:09] tubbo: Papierkorb: though i would have thought you might pass that to a shared node.js process of some sort :)
[19:47:15] tubbo: rather than use ExecJS
[19:48:14] Papierkorb: Oh I use ruby racer without execjs. benched it, for the same load, it's slightly slower. and the code looks pretty similar. also, I need to call ruby functions from JS, so execjs was not even possible after that
[19:48:19] tubbo: lomex: it's in app/assets/javascripts, and it just does that by default if you have coffee-rails in your project. it won't compile any JS if you just use bare JS.
[19:48:39] tubbo: Papierkorb: whoa, what are you doing? :D
[19:48:46] tubbo: seems interesting. or horrible.
[19:49:00] Papierkorb: tubbo: see the benchmark. rendering markdown on the server using the same library I use client-side.
[19:49:06] bmalum: has joined #RubyOnRails
[19:49:42] Papierkorb: tubbo: I either could duplicate code and work-around two markdown libraries quirks for client and server, or use what the client uses which is not abysmal slow and cope with JS for some lines of code.
[19:50:08] tubbo: ah i see Papierkorb
[19:50:16] Papierkorb: So I went with the JS stuff. If that ever gets a bottle-neck, I can just cache the rendered result.
[19:50:19] VeryBewitching: has joined #RubyOnRails
[19:50:21] tubbo: Papierkorb: or you could pass the raw source to an API endpoint and output HTML
[19:50:24] tubbo: just saying
[19:50:29] tubbo: no JS needed
[19:50:49] Macaveli: has joined #RubyOnRails
[19:51:07] colleenmcguckin: has joined #RubyOnRails
[19:51:57] Papierkorb: tubbo: the client-side pretty much just consumes the JSON API after the initial visit. Think of something like ReactJS. I render both on server (initially and for dumb clients always) and on the client. My target audience is famous with having mediocre network connection, so that renders that issue almost nil after the initial bigger download
[19:52:25] lomex: tubbo: How can I tell if coffee-rails is in my project?
[19:53:25] Papierkorb: lomex: it is by default
[19:53:33] Papierkorb: lomex: if you haven't messed with the Gemfile, it's in your project
[19:53:46] _djbkd: has joined #RubyOnRails
[19:53:50] agit0: has joined #RubyOnRails
[19:54:06] lomex: And as soon as its in the gemfile, it means its trying to compile coffeescript files?
[19:54:19] Papierkorb: basically yes
[19:54:30] tubbo: lomex: look at your Gemfile :)
[19:54:38] tubbo: lomex: similar to sass-rails or less-rails
[19:54:54] tubbo: Papierkorb: ember fastboot called, they want their idea back ;)
[19:55:11] tubbo: but yeah i like the approach
[19:55:28] lomex: I am just confused at what point is that compile process going to be triggers
[19:56:34] lomex: I mean the gem file only defines dependencies right? But should there be some file where its actually triggering the CS compiling?
[19:56:42] Papierkorb: tubbo: it's not the newest idea, but I also have ruby on the client. Thanks to Opal. So integrating JS libs is a pain, but also, their API isn't really ruby-esque. It's also my personal project, so it's not like the company is going bankrupt if I make a bad decision. Though, tbh, I don't think I'd do that for a commercial product.
[19:56:57] _djbkd: has joined #RubyOnRails
[19:57:22] Papierkorb: tubbo: the Volt framework does something similar, albeit more extreme
[19:57:47] tubbo: yeah it's a bit over-engineered
[19:58:02] tubbo: lomex: not sure what you're asking
[19:59:15] lomex: I mean, I only define that there is a dependency to the coffee-rails gem. But at what point is that gem actually actively used?
[20:00:12] hashpuppy: has joined #RubyOnRails
[20:02:06] cac: has joined #RubyOnRails
[20:02:18] lindii_: if i do @posts = Post.all @last_post = @posts.first am i doing two queries in the database or just the first where i retrieve all?
[20:02:28] Macaveli: has joined #RubyOnRails
[20:02:56] tvw: has joined #RubyOnRails
[20:03:01] chrislotix: has joined #RubyOnRails
[20:03:04] tubbo: lomex: i learned a lot by reading the source of the asset pipeline, sprockets: https://github.com/rails/sprockets, as well as coffee-rails: https://github.com/rails/coffee-rails
[20:03:25] lomex: tubbo: Yes I just found out about the asset pipeline. I didn't know that this was an essential part of RoR
[20:03:46] Guest53: has joined #RubyOnRails
[20:05:13] bruno-: has joined #RubyOnRails
[20:05:13] lomex: Thanks a lot tubbo
[20:06:00] tubbo: haha yeah
[20:06:03] tubbo: it's one of the big wins
[20:06:15] tubbo: lomex: that's kind-of what we've been talking about the whole time (execjs)
[20:06:19] bricker: (arguably)
[20:06:23] lacrymol1gy: has joined #RubyOnRails
[20:06:32] bricker: but I don't want to argue about it :)
[20:06:35] tubbo: it's only not a big win if you aren't smart enough to use it bricker
[20:06:38] lomex: tubbo: I am a complete noob to Ruby and Rails
[20:06:40] quazimodo: has joined #RubyOnRails
[20:06:51] bricker: tubbo: u dissin me m8
[20:06:55] tubbo: that said, there are better asset compilation tools out there...just not as easy to fit in with rails
[20:07:12] tubbo: lomex: yeah i know, just trying to help you connect the dots
[20:07:21] lomex: Yes I think I kind of got it now ;D
[20:07:21] tubbo: but what i was saying is that the JS shit is only necessary for the asset compilation step
[20:08:44] jenrzzz: has joined #RubyOnRails
[20:09:51] arthurix_: has joined #RubyOnRails
[20:10:19] nemo_: has joined #RubyOnRails
[20:10:40] Lightsword: has joined #RubyOnRails
[20:13:22] lindii_: if i do @posts = Post.all @last_post = @posts.first am i doing two queries in the database or just the first where i retrieve all?
[20:15:06] kadoppe: has joined #RubyOnRails
[20:16:14] fryguy: lindii_: 1 query. check out the development log as the code runs
[20:16:18] netzfisch: has joined #RubyOnRails
[20:16:54] lindii_: fryguy: well im seeing 2 queries
[20:17:01] tbuehlmann: lindii_, depends on the rails version you're using
[20:17:20] shpoont: has joined #RubyOnRails
[20:18:01] tbuehlmann: also, depends on the call order
[20:18:25] Synthmead: has joined #RubyOnRails
[20:19:05] shpoont: has joined #RubyOnRails
[20:19:14] cac: has joined #RubyOnRails
[20:19:21] tbuehlmann: once you load the relation, #first will use the loaded result (one query). if it's not loaded, it will be 2 queries
[20:19:45] tbuehlmann: earlier versions of rails returned an array for .all, rails 4.2 will return a relation
[20:20:50] lindii_: so if i do @posts = Post.all.order('created_at DESC') and @current_posts = @posts.limit(3).offset(1) this will be 2 right?
[20:20:51] tbuehlmann: you can either force loading by calling Post.all.load or get an array directly by calling Post.all.to_a
[20:21:43] tbuehlmann: that will be 2 queries when used somewhere, yeah
[20:22:18] lindii_: i see.. thought it would be querying in the same result
[20:22:44] tbuehlmann: but that's a rather simple second query
[20:23:15] lindii_: tbuehlmann: what do you mean
[20:23:49] rgtk: has joined #RubyOnRails
[20:24:53] tbuehlmann: @posts = Post.all.order('created_at DESC'); @current_posts = @posts.drop(1).first(3)
[20:24:57] arBmind: has joined #RubyOnRails
[20:25:53] tbuehlmann: we can rewrite that a little: @posts = Post.order(created_at: :desc); @current_posts = @posts.drop(1).first(3)
[20:27:24] lindii_: tbuehlmann: that makes one.. nice. But whats the diff here?
[20:27:26] Motoservo: has joined #RubyOnRails
[20:27:56] tbuehlmann: calling array methods on the relation loads it first
[20:28:29] cac: has joined #RubyOnRails
[20:28:30] tbuehlmann: calling relation methods (like where, limit, offset, ???) just changes the relation without loading it
[20:28:37] Guest53: has joined #RubyOnRails
[20:30:12] lindii_: tbuehlmann: i see. I guess these are things later on improve performance
[20:31:12] mmontecristo: has joined #RubyOnRails
[20:32:07] CanTonic: has joined #RubyOnRails
[20:32:17] lindii_: tbuehlmann: thanks!
[20:34:10] rgtk: has joined #RubyOnRails
[20:37:39] Z00t: has joined #RubyOnRails
[20:37:48] xm32x: has joined #RubyOnRails
[20:38:31] Radar: GOOD MORNING
[20:39:38] Papierkorb: OOOHHAAAYYYOOOO
[20:39:42] adaedra: IS IT CAPS LOCK DAY AGAIN?
[20:40:14] Radar: adaedra: no please remain calm
[20:40:38] Papierkorb: I MAY HAVE PRESsed it by accident. The previous sentence is false in this instance.
[20:40:41] adaedra: ???????, ???????????????????????
[20:41:27] glennfu: has joined #RubyOnRails
[20:42:21] Radar: This statement is a lie.
[20:42:30] arthurix: has joined #RubyOnRails
[20:42:42] disgrntld: has joined #RubyOnRails
[20:42:50] FailBit: *brain explodes*
[20:43:09] xm32x: has joined #RubyOnRails
[20:43:31] ngscheurich: has joined #RubyOnRails
[20:43:40] allcentury: has joined #RubyOnRails
[20:44:04] Motoservo: has joined #RubyOnRails
[20:44:21] bruno-: has joined #RubyOnRails
[20:44:40] adaedra: Just a bit.
[20:44:50] VeryBewitching: Radar: Ever read GEB?
[20:44:57] Radar: VeryBewitching: no
[20:45:09] rhizome: nobody reads it
[20:45:10] smathy: ACTION has
[20:45:11] Radar: I am worried my brain might have trouble coping with it.
[20:45:14] VeryBewitching: http://www.amazon.com/G%C3%B6del-Escher-Bach-Eternal-Golden/dp/0465026567
[20:45:26] rhizome: it's the most popular unread book ever
[20:45:27] stamina: has joined #RubyOnRails
[20:45:30] chills42: has joined #RubyOnRails
[20:45:33] VeryBewitching: It made me love paradox.
[20:45:43] VeryBewitching: "This statement is false." changed my life
[20:45:47] smathy: I read an ex-roommates - who hadn't read it.
[20:46:11] VeryBewitching: It is a bit of a head trip, I agree.
[20:46:53] Synthmead: is it possible to use check_box_tag to create an html tag without an ID?
[20:47:13] Radar: Synthmead: yes
[20:47:14] helpa: Next question, please!
[20:47:27] Synthmead: Radar: how?
[20:47:35] Radar: Synthmead: Please don't be greedy with the questions.
[20:47:38] Motoservo: has joined #RubyOnRails
[20:47:39] Radar: Let other people ask theirs.
[20:47:47] Coldblackice: has joined #RubyOnRails
[20:47:57] tuelz: has joined #RubyOnRails
[20:47:58] Radar: Synthmead: What have you tried?
[20:48:02] Papierkorb: Does someone in here know why German websites now also tell the user about using cookies? Has the britian cookie law leaked over here?
[20:48:10] Radar: Papierkorb: It's an EU law, iirc.
[20:48:40] Pumukel: has joined #RubyOnRails
[20:48:43] rhizome: i just checked my copy of GEB and i've been on page 44 for about 25 years
[20:48:54] tubbo: because germany is pedantic ;)
[20:48:56] Synthmead: Radar: check_box_tag(nil, 0, false) returns "<input type=\"checkbox\" id=\"\" value=\"0\" />"
[20:49:16] tubbo: i can't think of like any sites that don't use cookies
[20:49:26] Radar: Synthmead: <input type="checkbox" value="0">
[20:49:35] Synthmead: Radar: what rails version?
[20:49:39] Radar: Synthmead: Although I don't know why you'd want a checkbox without being able to reference it somehow.
[20:49:45] Radar: Synthmead: All of them. What I typed is basic HTML.
[20:49:46] agit0: has joined #RubyOnRails
[20:50:00] smathy: Papierkorb, definitely an EU law - which many people over-interpret.
[20:50:03] Radar: Why do you not want either an id attr or a name attr for this checkbox?
[20:50:37] Synthmead: Radar: I'm using JS events with other css selectors
[20:50:40] momomomomo: has joined #RubyOnRails
[20:50:55] Papierkorb: Radar: *reading* Apparently it's now mandated by Google if you're using AdSense or some of their other products on your webpage. The law seems to aim at advertisment cookies, and NOT those to e.g. handle the user session
[20:50:58] Radar: Synthmead: Then you could just write the checkbox using plain HTML.
[20:51:04] Radar: Papierkorb: fun fun
[20:51:14] Papierkorb: smathy: Do you have more information on that?
[20:51:46] Synthmead: Radar: I want to use check_box_tag. I'm passing other arguments to it (that would simply complicate the question with no benefit)
[20:51:53] helpa: Please do not use fake values, as they can be confusing or misleading. Sometimes both.
[20:52:01] Radar: I really do hate playing 20 questions with people.
[20:52:07] glennfu: Could someone explain to me why commenting out a line of code that doesn't even get run changes my variable values? https://gist.github.com/glennfu/7a2439486b6743306077
[20:52:12] Radar: Either ask your real question, or ask no question at all.
[20:52:14] Synthmead: Radar: using check_box_tag was my original requirement
[20:52:29] Radar: Synthmead: But you haven't sold me on why using it is a better idea than the input tag alternative.
[20:52:49] Radar: iirc, it is impossible to stop checkbox_tag from emitting an id attr.
[20:52:57] Radar: I'd need to look at the code to see what it's doing to find that out.
[20:53:01] Synthmead: Radar: I shouldn't need to. I asked a basic question where the solution would directly apply to my work :p
[20:53:06] cac: has joined #RubyOnRails
[20:53:06] helpa: https://gist.github.com/996779
[20:53:11] Radar: It's in the rules.
[20:53:12] 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.
[20:53:16] smathy: Papierkorb, best resource: http://ec.europa.eu/justice/data-protection/article-29/documentation/opinion-recommendation/files/2012/wp194_en.pdf
[20:53:33] helpa: NO FAKE CODE. If you're under an NDA, we cannot help you with your problem. Go hire a consultant.
[20:53:58] rhizome: there are subrules now
[20:54:33] glennfu: has left #RubyOnRails: ()
[20:54:37] Pumukel: has joined #RubyOnRails
[20:54:38] Radar: Synthmead: The code behind check_box_tag is relatively simple: https://github.com/rails/rails/blob/master/actionview/lib/action_view/helpers/form_tag_helper.rb#L372-L376
[20:54:39] glennfu: has joined #RubyOnRails
[20:54:48] glennfu: Could someone explain to me why commenting out a line of code that doesn't even get run changes my variable values? https://gist.github.com/glennfu/7a2439486b6743306077
[20:55:02] Radar: Synthmead: If you really didn't want an id attr, then define your own method with _mostly_ the same code.
[20:55:11] Radar: glennfu: !rule11
[20:55:11] helpa: glennfu: Do not repeat your question every 5 minutes expecting somebody to answer it. If you do not get a reply after the first time perhaps posting your question on StackOverflow (http://stackoverflow.com) would help you. Linking to the question in the channel after you've posted it is OK.
[20:55:11] Synthmead: Radar: then here: http://pastie.org/10516817. Now, can I create html without an ID using check_box_tag?
[20:55:12] htmldrum: has joined #RubyOnRails
[20:55:22] Radar: Synthmead: Just answered that.
[20:55:28] Synthmead: Radar: "no"?
[20:55:33] Radar: [07:55:03] <Radar> Synthmead: If you really didn't want an id attr, then define your own method with _mostly_ the same code.
[20:55:38] glennfu: argh sorry I kept getting "Error(404): #RubyOnRails Cannot send to channel" I thought my message didn't go through. My bad!
[20:55:42] Synthmead: Radar: that answer is no :p
[20:55:50] Radar: glennfu: np
[20:55:56] Radar: glennfu: You just needed a registered nick.
[20:56:16] glennfu: Yup! I did that so apparently I can talk now :) I guess I'll try my question at StackOverflow though
[20:56:48] Radar: glennfu: there's a lot of code to go through there and I don't have that much time.
[20:56:57] Radar: Do you have an app which reproduces this issue?
[20:57:05] Radar: A small reproducible example would be really handy for this sort of thing
[20:57:15] loechel: has joined #RubyOnRails
[20:57:19] glennfu: Radar: agreed, I'll either get it shorter or make it reproducable
[20:57:26] Radar: glennfu: thank you
[20:57:45] Papierkorb: Is it possible to not create a new session for a new user, but do so only on-demand? E.g., user visits my page. He gets no session, and thus no cookie. He decides do log in. Now, a session is created, and a Set-Cookie is sent to the user.
[20:58:11] Radar: Papierkorb: huh?
[20:59:45] glennfu: Radar: I think this is as short as I can get it: https://gist.github.com/glennfu/7a2439486b6743306077
[20:59:46] rgtk: has joined #RubyOnRails
[20:59:46] Papierkorb: smathy: Thanks for the link, good read. At first I thought it would be more of a legal text
[20:59:49] cac: has joined #RubyOnRails
[21:00:01] x-light: has joined #RubyOnRails
[21:00:16] rhizome: Papierkorb: that sounds like visiting a site, then logging in
[21:00:21] Radar: glennfu: https://gist.github.com/glennfu/7a2439486b6743306077#file-store_accessor_madness-rb-L8 you know the code inside the top of this if will never run?
[21:00:27] noodman: has joined #RubyOnRails
[21:00:33] rhizome: and yes, logging in is usually an "on demand" activity
[21:00:34] Papierkorb: Radar: Or, if I never set any session variables in a request, does the user get a cookie?
[21:00:53] Radar: Papierkorb: good question
[21:00:55] Papierkorb: rhizome: Yup. And as I understand it, the 'remember me' option is explicitly allowed.
[21:01:07] glennfu: Radar: I actually ran that very function in my console. It's not psuedocode.
[21:01:10] Radar: Papierkorb: I think yes due to the authenticity_token of Rails. I would need to investigate more.
[21:01:14] glennfu: Radar: so the "if false" is real
[21:01:30] Radar: glennfu: line 9 will never run
[21:01:47] Radar: And I think you're only showing me actual output, instead of expected output as well.
[21:01:55] Papierkorb: rhizome: I think a text like "You'll be logged in for two weeks (Learn more)." next to the login button should be enough.
[21:02:10] colleenmcguckin: has joined #RubyOnRails
[21:02:17] rhizome: i don't know your requirements, but that's what wikipedia has
[21:02:33] cac: has joined #RubyOnRails
[21:02:38] yaw: has joined #RubyOnRails
[21:02:39] Papierkorb: Radar: would be interesting to know about. Don't want to get sued into oblivion by some jackass lawyer who likes to kill of students' projects >_>;
[21:02:42] glennfu: Radar: Radar: On any other day I would completely agree with me. Here's an update where line #9 is commented out: https://gist.github.com/glennfu/7a2439486b6743306077
[21:03:19] rhizome: sued into oblivion for sessions?
[21:03:35] rhizome: never heard of such a risk
[21:03:37] Radar: glennfu: Oh fun. It's a local variable / method thing.
[21:03:38] glennfu: That shows the expected output as well. I don't understand how line #9, which does NOT get run, can change things... but it does
[21:03:50] Radar: glennfu: In the first instance, it's calling teaser_display, the method.
[21:03:56] Radar: glennfu: https://gist.github.com/glennfu/7a2439486b6743306077#file-store_accessor_madness-rb-L6 this is the "first instance"
[21:04:13] Radar: https://gist.github.com/glennfu/7a2439486b6743306077#file-store_accessor_madness-rb-L9 Ruby initializes the variable here, but does nothing with it because the if evaluates to false
[21:04:28] Radar: glennfu: you can do it in the console more simply: a = 1 if false
[21:04:31] Radar: will show nil
[21:04:36] Papierkorb: rhizome: me neither, but also not something I need to find out myself by that :|
[21:04:52] Radar: So later on when you're calling https://gist.github.com/glennfu/7a2439486b6743306077#file-store_accessor_madness-rb-L14 it's actually referring to the local variable, not to the method.
[21:04:58] rhizome: have you ever heard the saying, "don't borrow trouble?"
[21:05:58] glennfu: Radar: oh wow... ok I think I understand. So it's kind of like the implicit "else" is setting "teaser_display = nil". Is this because "teaser_display" is a dynamically defined method?
[21:06:16] Radar: glennfu: It's defined both as a method and a local variable in that context
[21:06:42] Radar: glennfu: when you refer to "teaser_display", Ruby will look for a variable with that name. If it can't find it, then it will look for a method with that name.
[21:06:58] Radar: glennfu: If you want to refer to the method _exactly_ then use teaser_display(). This disambiguates it to the Ruby interpreter.
[21:07:08] glennfu: If I add `def teaser_display; true; end` it "solves" my problem.
[21:07:10] Radar: glennfu: Or, you could name the local variable something different ;)
[21:07:45] glennfu: Radar: well the thing is, `teaser_display` is a getter and `teaser_display=` is a setter already. That's what `store_accessor :module_settings, :image_display, :teaser_display` at the top is supposed to do
[21:08:02] Radar: glennfu: If you want to refer to the setter, use self.teaser_display = val
[21:08:04] glennfu: in the `if false` block, I'm actually calling @model.teaser_display = false
[21:08:11] Radar: glennfu: teaser_display = value sets a local variable.
[21:08:18] Motoservo_: has joined #RubyOnRails
[21:08:53] glennfu: Radar: ahh of course! `self.teaser_display = false` is the best solution here I think. It just didn't occur to me there would be any ambiguity on a line of code that does not run
[21:09:11] glennfu: Thanks for clearing that up!!!
[21:09:46] Radar: Interesting little Ruby behaviour :)
[21:09:52] momomomomo: has joined #RubyOnRails
[21:09:52] glennfu: definitely
[21:10:43] glennfu: I feel like I should write a blog post but it's so awkward I wouldn't know what to call it. I like to title things what I would try to Google for them if I were looking for a solution. What would I call this? "Why is code that doesn't run changing things?" which is a terrible title
[21:10:58] Radar: I don't know what to call it either.
[21:11:11] Radar: It's one of those things that gets passed between Ruby developers
[21:11:18] glennfu: !makemeatitle
[21:11:32] Radar: Like, I only knew of it because I've been bitten by it before
[21:11:40] Radar: and the dev who taught me only knew of it because they've been bitten by it
[21:11:51] glennfu: sounds about right!!
[21:12:00] glennfu: I'll make a blog post anyway and just share it when relevant. Thanks again :)
[21:12:19] mary5030: has joined #RubyOnRails
[21:13:19] rgrmatt: has joined #RubyOnRails
[21:13:27] ruurd: has joined #RubyOnRails
[21:17:14] shpoont: has joined #RubyOnRails
[21:18:13] cac: has joined #RubyOnRails
[21:21:00] shpoont: has joined #RubyOnRails
[21:22:37] Motoservo: has joined #RubyOnRails
[21:25:01] cac: has joined #RubyOnRails
[21:25:17] shpoont: has joined #RubyOnRails
[21:26:16] yfeldblum: has joined #RubyOnRails
[21:27:22] Lightsword: has joined #RubyOnRails
[21:27:24] shpoont: has joined #RubyOnRails
[21:28:23] rgrmatt: has joined #RubyOnRails
[21:30:27] jessemcgilallen: has joined #RubyOnRails
[21:31:08] oscarb92: has joined #RubyOnRails
[21:31:33] momomomomo: has joined #RubyOnRails
[21:32:22] oscarb92: Hello, how can I compare a datetime I created with DateTime.new() with a datetime from a model?
[21:33:10] rhizome: oscarb92: the usual ruby ways. what are you trying?
[21:34:29] ritic: has joined #RubyOnRails
[21:34:31] oscarb92: rhizome: Model.where(stored_datetime: my_datetime) but it returns this error 'The conversion of a nvarchar data type to a datetime data type resulted in an out-of-range value'
[21:34:58] Motoservo: has joined #RubyOnRails
[21:35:20] rhizome: your db datetime is a string?
[21:35:44] oscarb92: rhizome: no, sorry that is the error I get when I try to format the datetime with strftime
[21:35:59] shpoont: has joined #RubyOnRails
[21:36:01] rhizome: i don't understand
[21:36:30] oscarb92: if i just pass the datetime no results are found (and it definitely should find matching data)
[21:36:46] Motoservo: has joined #RubyOnRails
[21:36:49] rhizome: is your db field actually a datetime data type?
[21:36:53] smathy: oscarb92, !gist an actual rails console session showing the problem, and add your db/schema.rb and the model in question too.
[21:36:53] helpa: oscarb92: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[21:37:04] cac: has joined #RubyOnRails
[21:37:21] oscarb92: smathy: yes.
[21:37:42] oscarb92: rhizome: it is a datetime
[21:40:04] oscarb92: rhizome: https://gist.github.com/OscarBastardo/b4d28088acdc9cf3c483
[21:41:49] rhizome: it's going to look for objects with that exact time
[21:42:23] ruurd: has joined #RubyOnRails
[21:44:22] Radar: what rhizome said
[21:45:08] bruno-: has joined #RubyOnRails
[21:45:36] cac: has joined #RubyOnRails
[21:47:16] gavit: my devise sign up works in dev, in production I get a We're sorry, but something went wrong. Where do I see the logs to analyze what went wrong?
[21:47:22] oscarb92: rhizome: yes, there are entries in the db that match de criteria
[21:47:25] Radar: gavit: Where is your server running?
[21:47:34] manfrin: has joined #RubyOnRails
[21:47:52] Motoservo: has joined #RubyOnRails
[21:47:59] yaw: has joined #RubyOnRails
[21:48:01] gavit: Radar: a vps
[21:48:22] Radar: gavit: Check logs/production.log
[21:50:19] gavit: Radar: [ 2015-10-29 16:08:21.0582 26269/7faeb052d7e0 age/Cor/CoreMain.cpp:794 ]: Disconnecting long-running connections for process 26380, application /home/gavit/public_html/hummingbirdsolutions/current
[21:50:20] cs44: has joined #RubyOnRails
[21:50:38] cs44: has left #RubyOnRails: ()
[21:50:42] Radar: Is that the only line in that file?
[21:50:51] gavit: this is in my error.log
[21:50:56] Thomas-0725: has joined #RubyOnRails
[21:51:00] Radar: > Radar says check logs/production.log
[21:51:04] Radar: > gavit checks error.log
[21:51:10] Radar: > Radar is extremely puzzled
[21:51:29] ellisTAA: has joined #RubyOnRails
[21:51:41] gavit: I'm still looking up where my log file is ^^ I deployed with capistrano
[21:51:53] ellisTAA: has joined #RubyOnRails
[21:53:37] ellisTAA: i didn???t install rspec rails until after i built most of my models and controllers. can i run something that will generate the appropriate spec files and folders for my controllers and models?
[21:53:44] gavit: Radar: found it: ActionView::Template::Error (Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true):
[21:54:31] rhizome: EllisTAA: you can run generate commands for them and decline to overwrite existing files
[21:54:59] ellisTAA: rhizome: itll ask me if i want to overwrite the files?
[21:55:23] rhizome: yes, or just skip them. i forget, but it won't clobber.
[21:55:24] lipoqil: has joined #RubyOnRails
[21:55:35] Radar: gavit: You'll need to set that in config/production.rb
[21:55:46] sankaber: has joined #RubyOnRails
[21:56:37] smathy: EllisTAA, I think you'll be disappointed at the rspec scaffold generators.
[21:56:47] rhizome: # test the truth
[21:57:03] agit0: has joined #RubyOnRails
[21:57:22] ellisTAA: rails generate rspec:model user & that seemed to work without asking me to overwrite files
[21:57:39] nogic: has joined #RubyOnRails
[21:58:25] gingray: has joined #RubyOnRails
[21:58:54] baweaver: has joined #RubyOnRails
[21:59:01] pydave6367: has joined #RubyOnRails
[21:59:15] yaw: has joined #RubyOnRails
[22:01:11] ruurd: has joined #RubyOnRails
[22:02:23] Lightsword_: has joined #RubyOnRails
[22:02:51] Thomas-0725: has joined #RubyOnRails
[22:03:10] manfrin: has joined #RubyOnRails
[22:03:32] reichni: has joined #RubyOnRails
[22:05:08] yfeldblum: has joined #RubyOnRails
[22:05:43] mikecmpbll: has joined #RubyOnRails
[22:06:14] northfurr: has joined #RubyOnRails
[22:06:18] Lightsword_: has joined #RubyOnRails
[22:08:34] bruno-: has joined #RubyOnRails
[22:09:50] siaW: has joined #RubyOnRails
[22:11:16] Motoservo: has joined #RubyOnRails
[22:11:31] siaW: when i run rspec in the terminal i get extrau stuff like paths that i don???t want. i want only the failing tests and avoid the extra junk. how do i do that? now my rspec command return something like https://gist.github.com/siaw23/c52c64a0e345eb2c995f
[22:11:45] siaW: i don???t want the /Users???. part.
[22:11:56] siaW: any idea how to get that done?
[22:13:16] gavit: guess that wasnt it :(
[22:13:52] smathy: siaw, it's called a backtrace or stacktrace, there's many options for configuring/filtering etc., might be best for you to google now that you know what it's called.
[22:14:49] FungalRaincloud: has joined #RubyOnRails
[22:15:23] Lightsword: has joined #RubyOnRails
[22:16:22] siaW: smathy: thank you!
[22:16:33] smathy: siaw, you're welcome.
[22:19:47] wethu: has joined #RubyOnRails
[22:19:54] Lightsword_: has joined #RubyOnRails
[22:20:36] iamse7en: has joined #RubyOnRails
[22:21:11] startupality: has joined #RubyOnRails
[22:22:10] tvw: has joined #RubyOnRails
[22:22:15] Lightsword: has joined #RubyOnRails
[22:23:07] gingray: has joined #RubyOnRails
[22:24:11] _djbkd: has joined #RubyOnRails
[22:26:45] umgrosscol: has joined #RubyOnRails
[22:26:49] rickmasta: has joined #RubyOnRails
[22:27:19] Motoservo: has joined #RubyOnRails
[22:27:22] cac: has joined #RubyOnRails
[22:27:27] lacuna_: has joined #RubyOnRails
[22:28:04] noodman_: has joined #RubyOnRails
[22:32:54] cac: has joined #RubyOnRails
[22:34:25] Motoservo: has joined #RubyOnRails
[22:36:50] MartinElvar: has joined #RubyOnRails
[22:37:01] MartinElvar: has joined #RubyOnRails
[22:37:39] arthurix_: has joined #RubyOnRails
[22:40:57] erich: has joined #RubyOnRails
[22:41:11] lacuna: has joined #RubyOnRails
[22:41:11] lacuna: has joined #RubyOnRails
[22:42:52] Motoservo: has joined #RubyOnRails
[22:43:27] Scriptonaut_: has left #RubyOnRails: ()
[22:44:45] ModusPwnens: has joined #RubyOnRails
[22:45:05] bonhoeffer: has joined #RubyOnRails
[22:45:20] ModusPwnens: Is there a reason why you would want to memoize your getters vs just initializing them once in your initialize method? Article I'm referencing: http://artsy.github.io/blog/2014/03/18/presenters-and-memoization-moving-logic-out-of-templates/
[22:46:27] lacuna: has joined #RubyOnRails
[22:47:33] matthewd: If it's slow enough to be worth memoizing, you probably don't want to do it if you turn out to not need it
[22:48:11] ModusPwnens: Yeah, but this is a presenter, so every single one of these instances will always be accessed.
[22:48:29] ModusPwnens: if you know that you will always access your instance variables, is there any value in memoization or lazy initialization?
[22:48:53] Lightsword: has joined #RubyOnRails
[22:49:51] Motoservo: has joined #RubyOnRails
[22:50:08] bonhoeffer: has joined #RubyOnRails
[22:51:01] Jasaka: has joined #RubyOnRails
[22:51:11] roxtrongo: has joined #RubyOnRails
[22:51:55] smathy: ModusPwnens, why do you want two different styles for objects you (know, for certain) you're going to use all the attributes of, and those you don't?
[22:52:00] rhizome: your desire to use an instance variable and the internals of the method that return that for you are not all that related
[22:52:05] tuelz: has joined #RubyOnRails
[22:52:09] smathy: ModusPwnens, why not just go with the memoization pattern, which works without downside for all situations?
[22:52:13] jocuman: has joined #RubyOnRails
[22:52:20] bonhoeffer: has joined #RubyOnRails
[22:54:43] pullcheezy: has joined #RubyOnRails
[22:55:07] ModusPwnens: has joined #RubyOnRails
[22:55:28] ModusPwnens: I always disconnect after receiving the first message. how odd.
[22:55:59] smathy: ModusPwnens, get a proper IRC client ftw
[22:56:20] ModusPwnens: smathy: Haha, Yeah. I use it enough I probably should...re: your question though, what do you mean by two different styles?
[22:56:52] smathy: ModusPwnens, memoization vs initializing during instantiation.
[22:57:03] quazimodo: has joined #RubyOnRails
[22:57:03] chipotle: has joined #RubyOnRails
[22:58:08] Motoservo: has joined #RubyOnRails
[22:58:26] ModusPwnens: smathy: Well, all our presenters will be using the same style. We are just trying to decide if we should do lazy initialization or do it all in the initialize method
[22:59:27] aaron: has joined #RubyOnRails
[22:59:56] lacuna: has joined #RubyOnRails
[22:59:56] lacuna: has joined #RubyOnRails
[23:00:16] smathy: ModusPwnens, right, but I assume you're not constructing your entire app out of presenters?
[23:00:29] ModusPwnens: No, there are all the other typical RoR components.
[23:00:32] smathy: ModusPwnens, so.... why use a different style to solve the same problem in different classes in your app?
[23:00:37] twilling: has joined #RubyOnRails
[23:00:47] smathy: ModusPwnens, ie. you'll want to use memoization in other classes, so why not use it everywhere.
[23:01:08] FailBit: is it true?
[23:01:16] FailBit: do ruby programmers care mostly about how their code looks?
[23:01:33] smathy: FailBit, no, they care most about which conferences are coming up.
[23:02:03] ModusPwnens: Well... I guess it's because we don't just have typical poros we are using besides these. Everything else is either a module we don't instantiate, or a model using ActiveX something, which is initialized using a hash
[23:02:40] _djbkd: has joined #RubyOnRails
[23:04:27] thams: has joined #RubyOnRails
[23:04:48] lomex: I can't believe I didn't know about vagrant before
[23:04:55] smathy: ModusPwnens, you've lost me, but I seem to have lost you too. To answer your first question, the reason is consistency because memoization will work virtually everywhere only ever doing the minimum amount of work when required.
[23:05:31] DiCablo: has joined #RubyOnRails
[23:08:13] Palsson: has joined #RubyOnRails
[23:08:24] Motoservo: has joined #RubyOnRails
[23:09:53] rodfersou: has joined #RubyOnRails
[23:11:25] Motoservo: has joined #RubyOnRails
[23:12:52] pydave6367: has joined #RubyOnRails
[23:14:23] darrencauthon: has joined #RubyOnRails
[23:16:35] Motoservo: has joined #RubyOnRails
[23:16:40] riotjones: has joined #RubyOnRails
[23:17:40] Lightsword: has joined #RubyOnRails
[23:20:03] FailBit: can I have devise join some stuff on the user model?
[23:20:16] macscam1: has joined #RubyOnRails
[23:21:01] tuelz: has joined #RubyOnRails
[23:21:39] RegulationD: has joined #RubyOnRails
[23:21:48] craysiii: what do you mean by join FailBit
[23:21:51] maxscam1: has joined #RubyOnRails
[23:22:13] FailBit: User.where(id: 291421).joins(:filters, :statistics, :roles)
[23:23:26] maxscam1: how can i see the reason for warden.authenticate! failing?
[23:23:37] rhizome: devise is just authentication, what you do in your controllers is up to you
[23:23:50] FailBit: okay but devise finds the current_user as well
[23:24:01] FailBit: where that happens seems not visible to AppController
[23:24:14] maxscam1: mine is a devise question too ...
[23:24:23] rhizome: @user = where(id: current_user.id)...
[23:24:56] rhizome: i think basically you have to create a new instance
[23:25:06] FailBit: then that defeats the whole point of eager loading in the first place
[23:25:11] dopamean_: has joined #RubyOnRails
[23:25:29] rhizome: well no, but there's also default_scope if you want to go down that route
[23:25:35] FailBit: I don't like default_scope
[23:25:45] FailBit: I've had very.. bad.. experiences with it in past times
[23:25:57] Ropeney: has joined #RubyOnRails
[23:26:26] craysiii: maxscam1 do you have flash variables in your views?
[23:26:46] maxscam1: craysiii this is json-only api
[23:27:09] pullcheezy: has joined #RubyOnRails
[23:27:14] sankaber: has joined #RubyOnRails
[23:27:44] Motoservo: has joined #RubyOnRails
[23:28:32] x-light: has joined #RubyOnRails
[23:29:03] rhizome: FailBit: https://github.com/plataformatec/devise/issues/938
[23:29:23] Lightsword: has joined #RubyOnRails
[23:29:45] craysiii: maxscam1 have you extended the Devise SessionsController?
[23:30:13] yfeldblum: has joined #RubyOnRails
[23:30:13] FailBit: the fact that that one guy doesn't know what a join is is killing me
[23:32:31] diggitydane: has joined #RubyOnRails
[23:33:24] diggitydane: I'm reading through some code, and someone has Array.include?(?=), what does the "?=" do? can't seem to find anything on it
[23:33:32] FailBit: it's a character literal
[23:33:40] FailBit: ?= is the same thing as '='
[23:33:51] FailBit: [1] pry(main)> ?=
[23:34:10] diggitydane: FailBit, thanks :)
[23:34:25] Pumukel: has joined #RubyOnRails
[23:36:27] craysiii: https://github.com/hassox/warden/blob/74162f2bf896b377472b6621ed1f6b40046525f4/lib/warden/strategies/base.rb im a bit confused, does warden itself not implement an authenticate! method?
[23:37:15] andatche: has joined #RubyOnRails
[23:38:27] maxscam1: craysiii: iit's called through devise(sessioncontroller create action) https://github.com/plataformatec/devise/blob/master/app/controllers/devise/sessions_controller.rb
[23:39:04] maxscam1: craysiii: warden does implement an authenticate! method but the source is all cryptic
[23:39:21] maxscam1: and its defined in may placesd
[23:42:57] alfie_max15: has joined #RubyOnRails
[23:44:24] EminenceHC: has joined #RubyOnRails
[23:47:08] Scriptonaut: has joined #RubyOnRails
[23:48:24] rgrmatt: has joined #RubyOnRails
[23:48:40] Scriptonaut: hey guys, when some code on my server runs DateTime.now.to_s, it's giving me time in utc, rather than the client's timezone (pacific). How can I make DateTime.now give me the time in the timezone of the client?
[23:48:48] pydave6367: has joined #RubyOnRails
[23:49:05] iamse7en: has joined #RubyOnRails
[23:49:40] fschuindt: has joined #RubyOnRails
[23:52:09] alfie_max15: You can use the browser-timezone-rails gem for that
[23:52:27] Scriptonaut: there's no builtin support?
[23:52:40] Scriptonaut: I was trying something like: DateTime.now.in_time_zone(DateTime.now.zone)
[23:52:49] Scriptonaut: but DateTime.now.zone returns an offset in hours
[23:53:34] montagesoftware: has joined #RubyOnRails
[23:53:52] alfie_max15: Ok. . Let me try to explain what happens there
[23:54:20] rgrmatt: has joined #RubyOnRails
[23:55:39] alfie_max15: DateTime.now returns the time in UTC as rails does that by default
[23:56:02] alfie_max15: Unless another timezone is set in application.rb
[23:56:23] Scriptonaut: ooh, Time.current.to_s works great
[23:56:55] adaedra: there should be a .localtime, too
[23:56:58] Scriptonaut: hrm, I am testing it locally though (same timezone)
[23:57:36] Scriptonaut: what is localtime
[23:57:53] alfie_max15: You can test it by changing your system timezone
[23:58:15] alfie_max15: As in development your system is the server