« Back to channel list

#RubyOnRails - 07 June 2016

« Back 1 day Forward 1 day »
[00:00:30] ekinmur: has joined #RubyOnRails
[00:00:35] blackhuey: has joined #RubyOnRails
[00:02:14] rogue_koder: has joined #RubyOnRails
[00:02:52] macsteps: has joined #RubyOnRails
[00:04:13] filter85: has joined #RubyOnRails
[00:04:36] Cache_Money: has joined #RubyOnRails
[00:05:55] jstransky: has joined #RubyOnRails
[00:06:13] Insti: has joined #RubyOnRails
[00:07:11] Insti: Will ActiveRecord normalize line endings? "\r\n" etc.
[00:07:28] sneakers: has joined #RubyOnRails
[00:07:47] Insti: or does it just save whatever it gets given and I need to normalize before I try to save my object.
[00:07:58] cnk: the latter
[00:08:04] cnk: it just saves what you give it
[00:08:23] triptec: has joined #RubyOnRails
[00:09:28] cnk: but chomp will trim new lines of any stripe
[00:09:37] Cache_Money: Is this the proper way to remove a column from my production database? I did a rake db:rollback, then deleted the migration, committed, pushed, cap production deploy...
[00:09:47] Insti: thanks cnk
[00:09:53] edwinvdgraaf: has joined #RubyOnRails
[00:10:15] cnk: Cache_Money: probably not
[00:10:24] cnk: was the column in your production db?
[00:10:33] cnk: if so, you need to make a migration that deletes it
[00:10:40] Cache_Money: cnk: yes it was
[00:10:54] cnk: rails g migration DeleteColumnNameFromTable
[00:11:02] cnk: that might even write it for you
[00:11:16] cnk: rails migrations got really good about guessing what you wanted from the name
[00:11:28] Cache_Money: cnk: After a couple days I've realized I needed it, created a migration to add it back, updated controllers/views... and now when I went to deploy I'm getting "ActiveRecord::StatementInvalid: PG::DuplicateColumn: ERROR:"
[00:11:45] cnk: yup - because it was never deleted
[00:11:48] Cache_Money: So, I'm not sure what's the appropriate way to proceed
[00:12:11] cnk: for this case, remove the migration that adds the column back
[00:12:47] cnk: and pat yourself on the back - your first error now turns out to be a feature
[00:13:19] Cache_Money: cnk: okay. But now there's no migration in source control where that column was created...
[00:14:08] cnk: I would reedit the migration you edited to remove it
[00:14:26] cnk: your git history will look a little odd - but your database will be fine
[00:14:36] Axilla: has joined #RubyOnRails
[00:14:39] Cache_Money: cnk: you mean the original migration that I deleted (that created the column)?
[00:14:49] Rodya_: has joined #RubyOnRails
[00:14:56] Cache_Money: but it no longer exists
[00:15:03] cnk: with its same name and number - so your prod database knows about it
[00:15:12] cnk: it's in version control
[00:15:22] cnk: so recreate it from that info
[00:15:30] Cache_Money: I'll give that a try. Thanks!
[00:15:48] cnk: so if it had been 0034_add_foo_to_bar, recreate that - with the same filename
[00:16:29] cnk: Rails has recorded that it applied 0034 (or actually the timestamp that was in the name - dating myself, I used rails when they just numbered the migrations)
[00:16:54] cnk: so you want to keep the timestamp + name for your recreated migration file
[00:20:31] mikecmpbll: has joined #RubyOnRails
[00:22:04] quazimodo: has joined #RubyOnRails
[00:22:21] Cache_Money: cnk: Sweet, that worked! So, if I ever have a column on the production db I need to write another migration to remove it, right? Unless I never pushed that migration to production, then I can just do a rake db:rollback and delete the migration?
[00:22:28] Wolland: has joined #RubyOnRails
[00:22:41] cnk: exactly
[00:23:06] cnk: you can edit migrations until you push to production - after that, you must write a new migration to make the change
[00:23:07] jancel: has joined #RubyOnRails
[00:24:17] Rodya_: has joined #RubyOnRails
[00:25:06] Cache_Money: cnk: makes sense, I should have known that. Thanks for the reminder :)
[00:25:38] refinerysource: has joined #RubyOnRails
[00:25:44] cnk: No prob. Glad you got it straightened out
[00:25:52] sypheren: has joined #RubyOnRails
[00:27:42] DoctorMonocular: has joined #RubyOnRails
[00:29:30] eljimmy: has joined #RubyOnRails
[00:29:32] centrx: has joined #RubyOnRails
[00:33:57] Rodya_: has joined #RubyOnRails
[00:34:33] tildes_: has joined #RubyOnRails
[00:36:54] Rodya_: has joined #RubyOnRails
[00:39:15] sumobob: has joined #RubyOnRails
[00:39:17] benlieb: has joined #RubyOnRails
[00:43:48] yfeldblum: has joined #RubyOnRails
[00:44:12] dblessing: has joined #RubyOnRails
[00:44:49] truenito: has joined #RubyOnRails
[00:45:08] yfeldblum: has joined #RubyOnRails
[00:46:00] Cache_Money1: has joined #RubyOnRails
[00:46:45] truenito: has joined #RubyOnRails
[00:47:53] mikecmpbll: has joined #RubyOnRails
[00:51:01] owenjones: has joined #RubyOnRails
[00:53:35] ElFerna: has joined #RubyOnRails
[00:54:44] jbb: has joined #RubyOnRails
[00:55:05] jbb: has joined #RubyOnRails
[00:55:43] jerikl: has joined #RubyOnRails
[00:57:23] sevenseacat: has joined #RubyOnRails
[01:00:51] Ropeney: has joined #RubyOnRails
[01:05:23] dblessing: has joined #RubyOnRails
[01:06:15] sumobob: has joined #RubyOnRails
[01:09:36] artto: has joined #RubyOnRails
[01:12:53] Alazoral: has joined #RubyOnRails
[01:21:43] moeabdol2: has joined #RubyOnRails
[01:23:10] Wolland: has joined #RubyOnRails
[01:32:04] jancel: has joined #RubyOnRails
[01:32:54] arBmind1: has joined #RubyOnRails
[01:34:39] flashpoint9: has joined #RubyOnRails
[01:35:19] DoctorMonocular: has joined #RubyOnRails
[01:44:10] dandaman: has joined #RubyOnRails
[01:44:23] emachnic: has joined #RubyOnRails
[01:44:40] ecksit: has joined #RubyOnRails
[01:47:54] dunpeal: has joined #RubyOnRails
[01:49:27] one_zero: has joined #RubyOnRails
[01:54:10] David_H__: has joined #RubyOnRails
[01:56:47] NeoHamled: When I deploy my Rails project to Heroku (after upgrading to 4.2 from 4.0) I’m now getting this error message: “You tried to define an association named transaction on the model WebPurchase, but this will conflict with a method transaction already defined by Active Record. Please choose a different association name.”
[01:57:06] NeoHamled: that’s a pretty straight-forward thing to fix, but I’m concerned… because I have not been getting that error when running locally
[01:57:49] NeoHamled: is there something obvious about running in development environment vs production that would be preventing me getting that error?
[01:57:55] FailBit: what's your prod schema
[01:58:26] blockchan: has joined #RubyOnRails
[01:58:27] NeoHamled: what specifically do you mean?
[01:59:05] NeoHamled: I don’t think there’s any difference in my schema between dev and prod
[01:59:20] FailBit: that message is implying that your prod schema has some weird column in it named transaction
[01:59:38] NeoHamled: and this particular association has been around since I first started the project years ago
[01:59:46] FailBit: that or there's a conditional association macro somewhere like has_one :transaction
[01:59:52] NeoHamled: it’s not really a weird column… belongs_to :transaction, class_name: "PaypalIpn"
[02:00:28] NeoHamled: the column in PG is “transaction_id integer”
[02:00:36] DoctorMonocular: has joined #RubyOnRails
[02:02:02] havenwood: NeoHamled: https://github.com/rails/rails/blob/4e115bfab7592843f431ff605e93df47ba2a6270/activerecord/lib/active_record/transactions.rb#L218-L221
[02:02:44] NeoHamled: thank you, I understand that we now have a transaction method on ActiveModel::Base because of this
[02:02:54] NeoHamled: and that I’ll need to change the name of my column
[02:03:43] NeoHamled: oh weird, okay
[02:04:13] NeoHamled: I should have guessed
[02:04:37] NeoHamled: the dev/prod difference is that model classes are loaded on-demand in dev, and up-front in prod
[02:04:45] NeoHamled: or I have it configured that way at least
[02:04:58] FailBit: that's how it's always been
[02:04:59] NeoHamled: so my tests were just not using WebPurchase
[02:07:29] Ericx2x: has joined #RubyOnRails
[02:11:55] NeoHamled: thanks y’all
[02:14:06] zave: has joined #RubyOnRails
[02:15:54] xibalba: has joined #RubyOnRails
[02:16:57] m_antis: has joined #RubyOnRails
[02:22:21] owenjones: I'm having an issue: I have a model with a HABTM association to my users table where during creation you can set 1 - many users, during editing you can add / remove users which already exist in the DB
[02:22:27] owenjones: in this example
[02:22:27] owenjones: https://gist.github.com/owengalenjones/bb594f4038658f0ec54800f607fa8c79
[02:22:36] FailBit: has left #RubyOnRails: ("WeeChat 0.4.2")
[02:22:40] owenjones: the create method works as expected, I can create a case with n users
[02:23:45] owenjones: but if I try and edit the case, and send the same HTTP request that the create method sees, Ill see weird results
[02:24:00] Wolland: has joined #RubyOnRails
[02:24:39] chipotle: Radar: any chance you are around?
[02:25:28] havenwood: chipotle: working on a Rails app?
[02:26:08] chipotle: havenwood: yes sir
[02:26:18] chipotle: i was going to go with nano for a static site
[02:26:18] sevenseacat: as clever as Radar is, I doubt you need him in particular to get help
[02:26:28] chipotle: but i think it's better to dive right into rails
[02:26:34] chipotle: no, i want to apologize to him, sevenseacat
[02:28:21] arooni-mobile: has joined #RubyOnRails
[02:29:13] arooni-mobile: has left #RubyOnRails: ()
[02:31:46] ur5us: has joined #RubyOnRails
[02:33:39] rakm: has joined #RubyOnRails
[02:35:06] macsteps: has joined #RubyOnRails
[02:38:35] Radar: chipotle: DM me if you want to apologise then
[02:38:41] Radar: chipotle: My client is always signed in
[02:46:22] Lewix: has joined #RubyOnRails
[02:47:55] sevenseacat: Lewix: !rule12
[02:47:55] helpa: Lewix: Do not PM members of the channel without first asking if that is OK.
[02:51:12] Ericx2x_: has joined #RubyOnRails
[02:52:01] Psyko: has joined #RubyOnRails
[02:57:36] macsteps: has joined #RubyOnRails
[03:00:19] chouhoulis: has joined #RubyOnRails
[03:02:39] mikecmpbll: has joined #RubyOnRails
[03:09:34] DoctorMonocular: has joined #RubyOnRails
[03:10:10] moeabdol2: has joined #RubyOnRails
[03:11:43] kali3: has joined #RubyOnRails
[03:12:25] owenjones: ok so I think I've solved my issue (potentially?) by moving from HABTM to: HABTMt however I now see an error Invalid single-table inheritance type: Admin is not a subclass of User which is weird because it should be:
[03:12:31] owenjones: irb(main):051:0* User.subclasses
[03:12:31] owenjones: => [Admin(id: integer,
[03:12:44] lightt: has joined #RubyOnRails
[03:13:44] pontiki: has joined #RubyOnRails
[03:13:46] braincrash: has joined #RubyOnRails
[03:16:49] Rodya_: has joined #RubyOnRails
[03:19:58] chouhoulis: has joined #RubyOnRails
[03:20:42] chouhoulis: has joined #RubyOnRails
[03:21:04] crdpink: has joined #RubyOnRails
[03:24:04] tycoon177: has joined #RubyOnRails
[03:24:10] tycoon177: Hi, I'm wondering how I would go about making sub-entries in a has_and_belongs_to polymorphic association. I am making a todo list and want tasks to be able to have subtasks to an arbitrary level.
[03:24:21] tycoon177: I have a list model that has many tasks as a task_holder and then the task model has a has_and_belongs_to_many :task_holder, polymorphic: true association
[03:25:00] Wolland: has joined #RubyOnRails
[03:26:59] quazimodo: has joined #RubyOnRails
[03:29:24] hous: has joined #RubyOnRails
[03:31:42] NeoHamled: has left #RubyOnRails: ()
[03:33:19] emachnic: has joined #RubyOnRails
[03:34:31] chouhoul_: has joined #RubyOnRails
[03:42:00] kali3: has left #RubyOnRails: ("Leaving")
[03:44:26] DanByc: has joined #RubyOnRails
[03:47:19] tildes_: has joined #RubyOnRails
[03:48:42] dunpeal: has joined #RubyOnRails
[03:49:43] mohsenjalalian: hello everyone i use rspec to text my model . I have with_options statements in my model validations . how can i write my test to handle it?
[03:58:38] AmiMoench: has joined #RubyOnRails
[04:00:48] Psyko: Hi guys i believe i cant put this in gist since i cant copy paste from my commandline, the site is running and no errors.
[04:00:48] Psyko: http://prntscr.com/bda8e7
[04:01:11] Psyko: but it says its a routing error?
[04:01:40] weaksauce: has joined #RubyOnRails
[04:04:16] phredus: has joined #RubyOnRails
[04:04:43] sevenseacat: seems straightforward
[04:05:02] sevenseacat: no errors, except for the one I screenshotted :P
[04:05:17] sevenseacat: Psyko: what do you expect to happen there?
[04:05:54] Psyko: sorry was thinking alot
[04:05:58] Psyko: i think i got it
[04:06:02] Psyko: sorry again
[04:06:14] djbkd: has joined #RubyOnRails
[04:16:15] David_H_Smith: has joined #RubyOnRails
[04:17:34] grassass: has joined #RubyOnRails
[04:18:40] k3rn31: has joined #RubyOnRails
[04:22:21] chouhoulis: has joined #RubyOnRails
[04:23:25] DragonPunch: has joined #RubyOnRails
[04:25:43] Wolland: has joined #RubyOnRails
[04:27:54] emachnic: has joined #RubyOnRails
[04:32:47] chouhoulis: has joined #RubyOnRails
[04:34:55] Coldblackice: has joined #RubyOnRails
[04:36:41] lightt: has joined #RubyOnRails
[04:38:35] duncannz: has joined #RubyOnRails
[04:40:57] moeabdol2: has joined #RubyOnRails
[04:43:14] jayc0b0: has joined #RubyOnRails
[04:43:20] JesseH: has joined #RubyOnRails
[04:43:37] workmad3: has joined #RubyOnRails
[04:43:42] maxx88: has left #RubyOnRails: ()
[04:49:15] yatish27_: has joined #RubyOnRails
[04:51:24] pawnbox: has joined #RubyOnRails
[04:51:30] macsteps: has joined #RubyOnRails
[04:58:32] Leepoff: has joined #RubyOnRails
[05:01:31] hahuang61: has joined #RubyOnRails
[05:05:24] alfiemax: has joined #RubyOnRails
[05:07:32] agent_white: has joined #RubyOnRails
[05:11:23] jancel: has joined #RubyOnRails
[05:17:07] David_H_Smith: has joined #RubyOnRails
[05:17:50] lightt: has joined #RubyOnRails
[05:18:06] pawnbox: has joined #RubyOnRails
[05:19:17] dionysus69: has joined #RubyOnRails
[05:20:14] kknight: has joined #RubyOnRails
[05:21:16] kknight: while making rails app tab button is working for firefox but not for other browser why?
[05:22:19] emachnic: has joined #RubyOnRails
[05:22:41] kknight: is there anyone?
[05:22:48] wd40s: has joined #RubyOnRails
[05:23:02] blockchan: has joined #RubyOnRails
[05:23:22] kknight: has joined #RubyOnRails
[05:23:36] roamingdog: has joined #RubyOnRails
[05:24:44] njero: has joined #RubyOnRails
[05:25:26] spyder55: has joined #RubyOnRails
[05:32:48] kknight: has joined #RubyOnRails
[05:35:11] raunicolae: has joined #RubyOnRails
[05:37:41] learner: has joined #RubyOnRails
[05:37:54] learner: hey guys can i ask questions regarding rvm here too?
[05:38:21] roamingdog: just ask, don't ask to ask eh
[05:38:27] learner: I want to create a gemset but still use the rails and bundler in the default gemset to install the gemset
[05:38:32] harai: has joined #RubyOnRails
[05:38:39] learner: does that make sense?
[05:38:44] roamingdog: learner: sounds unlikely actually
[05:39:14] learner: i want to have a project specific gemset, but not have to reinstall one rails and bundler per project
[05:39:17] jas02: has joined #RubyOnRails
[05:39:36] sevenseacat: what does having a project-specific gemset achieve?
[05:39:44] roamingdog: afaik rvm doesn't do that, unless it's changed greatly since i used it
[05:40:02] learner: sevenseacat: keeps gem versions of projects separate
[05:40:11] sevenseacat: I never understood the reasoning behind gemsets
[05:40:19] sevenseacat: learner: but what is the benefit of that?
[05:40:49] roamingdog: learner: does not bundler keep everything as separate as needed?
[05:40:53] kknight: sevenseacat: will you please solve my issue
[05:41:12] learner: sevenseacat: say I fix the gem version of a certain gem in a project, then I'd be able to freely keep that version until i'm ready to move to a new version, without it affecting other projects
[05:41:22] sevenseacat: you can do that anyway
[05:41:37] Cohedrin: has joined #RubyOnRails
[05:41:37] sevenseacat: a Gemfile in one project has nothing to do with any other projects
[05:41:42] learner: not with a shared gemset with all projects
[05:41:52] sevenseacat: you can have more than one version of a gem installed
[05:41:59] learner: it all installs in the same gemset
[05:42:02] kknight: I am making rails app, there are many editable fields where tab button works fine in firefox but not on safari or chrome?
[05:42:44] roamingdog: learner: i know a lot of tutorials are out there now saying rvm is the 'way', but you really don't need it.
[05:42:50] kknight: sevenseacat: I have posted my question..
[05:42:54] sevenseacat: rvm is fine, but gemsets are pointless
[05:43:18] roamingdog: sevenseacat: most people use rvm so they can have gemsets don't you think?
[05:43:40] sevenseacat: I would think it's for the easy ruby installation and switching, but I don't know, I haven't used it in years
[05:43:55] roamingdog: me neither. chruby
[05:44:02] ur5us: has joined #RubyOnRails
[05:44:27] sevenseacat: kknight: thats not nearly enough information to know a) what you're talking about or b) how to help you fix it.
[05:45:21] Radar: kknight: !rule0
[05:45:21] helpa: kknight: 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. Put the code on https://gist.github.com and then give us the HTTP link to the Gist.
[05:45:26] roamingdog: ruby-install, chruby makes things so easy
[05:45:27] Radar: kknight: !rule3
[05:45:27] helpa: kknight: 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.
[05:46:03] rvanlieshout: has joined #RubyOnRails
[05:46:26] kknight: tab button is also used to move one field to another field, its works fine in firefox but not for another browser
[05:46:36] sevenseacat: on what code?
[05:46:46] kknight: Radar: how do i know where this error come?
[05:46:54] Radar: kknight: !ncnh
[05:46:54] helpa: kknight: If you don't provide any code, it becomes really difficult for us to help you. Providing code to reproduce the problem increases your chances of getting great, accurate help immensely.
[05:47:02] Radar: kknight: Final time I'll ask for it.
[05:47:30] roamingdog: no code no help, like it
[05:49:01] kgrz: has joined #RubyOnRails
[05:49:03] roamingdog: Radar: use vim? no point at all, just curious
[05:49:14] Radar: roamingdog: no.
[05:49:18] sevenseacat: probably more of a specific ruby question, but here goes. how can I stub out method calls on a specific object? eg. I have `context = Dashboard::CalculationContext.new(selected_month - 1.month, user)` and I want to override a method call like `context.days_tied_up_in_inventory` to return a predefined figure
[05:49:20] Radar: Sublime Text 3 for lyfe
[05:49:36] sevenseacat: not in tests, in actual code
[05:49:39] roamingdog: there's a 3??! let me at it!
[05:51:31] Dimik: has joined #RubyOnRails
[05:52:41] flashpoint9: has joined #RubyOnRails
[05:55:01] sevenseacat: nvm I might just subclass the context and override what I need
[05:55:46] kknight: Radar: https://gist.github.com/aj07/eec3b47fdb5d09b2130dcfb40a698b50
[05:56:00] kknight: sevenseacat: Please check https://gist.github.com/aj07/eec3b47fdb5d09b2130dcfb40a698b50
[05:56:17] Radar: ACTION passes
[05:56:27] Radar: I don't want to read through 105 lines of code at the moment. I thought it would be easier.
[05:56:41] roamingdog: actually, i am probably using sublime test 3, use it for texty things like invoices, not for code
[05:56:55] kknight: There DO I needed to write tabindex on line no. 9
[05:57:13] harfangk: has joined #RubyOnRails
[05:57:31] kknight: Radar: I have seen simialar issue on http://stackoverflow.com/questions/772677/tab-order-in-a-rails-app
[05:58:18] raunicolae: has left #RubyOnRails: ("Once you know what it is you want to be true, instinct is a very useful device for enabling you to know that it is")
[05:58:21] Oog: has joined #RubyOnRails
[05:58:24] roamingdog: kknight: sorry, what's the issue? tab index not working the same in different browsers?
[05:58:51] macsteps: has joined #RubyOnRails
[05:59:00] kknight: roamingdog yes its not working in chrome and safari
[05:59:09] darutoko: has joined #RubyOnRails
[05:59:13] Radar: kknight: Can you reproduce the issue in a new app?
[05:59:24] roamingdog: kknight: with minimal code
[06:00:24] kknight: Do i need to make new app for solving this bug?
[06:00:55] sevenseacat: to demonstrate to us what it is, yes
[06:00:55] roamingdog: kknight: most (i dare say) devs would not balk at the thought of creating a 'new' app to find the source of an error
[06:00:56] hahuang61: has joined #RubyOnRails
[06:01:09] roamingdog: isolation is key
[06:01:20] djbkd: has joined #RubyOnRails
[06:01:21] kknight: roamingdog isolation?
[06:01:31] sevenseacat: otherwise, if you want to change the tab order on a page, yes you have to set it, which you haven't in your code
[06:02:21] moeabdol2: has joined #RubyOnRails
[06:06:49] David_H_Smith: has joined #RubyOnRails
[06:07:49] mikecmpbll: has joined #RubyOnRails
[06:11:35] ensyde__: has joined #RubyOnRails
[06:16:32] owenjones: has joined #RubyOnRails
[06:20:49] hahuang61: has joined #RubyOnRails
[06:26:14] lxsameer: has joined #RubyOnRails
[06:29:46] refinerysource: has joined #RubyOnRails
[06:30:41] apotry: has joined #RubyOnRails
[06:33:16] lightt: has joined #RubyOnRails
[06:35:34] Oog: has joined #RubyOnRails
[06:36:03] gingray: has joined #RubyOnRails
[06:37:05] siaw23: has joined #RubyOnRails
[06:42:06] Pazician: has joined #RubyOnRails
[06:42:21] bachmann: has joined #RubyOnRails
[06:50:03] jstransky: has joined #RubyOnRails
[06:53:45] aganov: has joined #RubyOnRails
[06:57:16] AimlessRAven: has joined #RubyOnRails
[06:57:26] AimlessRAven: how to find in jquery input label text i have $inputChecked = $form.find("input[name='order[product_id]']:checked")
[06:57:33] AimlessRAven: and wanna find this input label text
[07:00:20] jancel: has joined #RubyOnRails
[07:11:36] arBmind: has joined #RubyOnRails
[07:11:55] Oog: has joined #RubyOnRails
[07:12:07] mohsenjalalian: hello everyone i use rspec to test my model . I have with_options statements in my model validations . how can i write my test to handle it?
[07:14:49] DoctorMonocular: has joined #RubyOnRails
[07:15:45] Macaveli: has joined #RubyOnRails
[07:16:51] blockchan: has joined #RubyOnRails
[07:20:47] Spami: has joined #RubyOnRails
[07:22:34] AzaToth: has joined #RubyOnRails
[07:23:54] jnoob22: has joined #RubyOnRails
[07:23:55] jnoob22: has joined #RubyOnRails
[07:24:22] truenito: has joined #RubyOnRails
[07:29:37] mdw: has joined #RubyOnRails
[07:29:57] k3rn31: has joined #RubyOnRails
[07:30:04] gamov: has joined #RubyOnRails
[07:30:21] MEATCHICKEN: has joined #RubyOnRails
[07:30:27] mikecmpbll: has joined #RubyOnRails
[07:31:11] refinerysource: has joined #RubyOnRails
[07:31:24] antgel: has joined #RubyOnRails
[07:31:28] gamov: Hello guys. I noticed ARecord aliases table name if it detects same table names in a submitted subquery. This behavior is a bit erratic. Anybody kowns how to disable it?
[07:32:22] gingray: has joined #RubyOnRails
[07:40:16] pawnbox: has joined #RubyOnRails
[07:41:24] rbr: gamov: can you show us an example?
[07:41:29] netzfisch: has joined #RubyOnRails
[07:41:39] gamov: yes, let me set up a gist
[07:42:22] mikecmpbll: has joined #RubyOnRails
[07:42:40] SteenJobs: has joined #RubyOnRails
[07:46:53] kknight: has joined #RubyOnRails
[07:48:47] gamov: rbr: https://gist.github.com/gamov/184249a3328bcfa333ae3fc7ba3ad9de
[07:48:54] defsdoor: has joined #RubyOnRails
[07:49:16] gamov: see my comments
[07:50:10] scepticulous: has joined #RubyOnRails
[07:50:30] moeabdol2: has joined #RubyOnRails
[07:52:06] emilkarl: has joined #RubyOnRails
[07:54:47] gamov: I must add that I use the gem ransack which doesn’t seem aware of the aliasing that AR does. If I join manually, it works (my column is properly aliased). However, since there are parenthesis, we should need the aliasing...
[07:54:56] browndawg: has joined #RubyOnRails
[07:55:55] jas02: has joined #RubyOnRails
[07:56:19] browndawg: To test that /users returns a list of all user ids, I create a bunch of users and then match against those ids. For some reason those records don't vanish in the next test run. Could someone take a look at my users_spec.rb - https://pastee.org/kem3w.
[07:56:42] browndawg: like the users created in the last test run are still there in the test db on the next run
[07:56:50] browndawg: what am I doing wrong?
[07:57:49] artto: has joined #RubyOnRails
[07:59:46] mikecmpbll: has joined #RubyOnRails
[08:00:19] jsrn: has joined #RubyOnRails
[08:01:26] mohsenjalalian: hello everyone i use rspec to test my model . I have with_options statements in my model validations . how can i write my test to handle it?
[08:01:34] adre: has joined #RubyOnRails
[08:01:51] snowy: has joined #RubyOnRails
[08:04:41] Jenzo: has joined #RubyOnRails
[08:04:58] harfangk: has joined #RubyOnRails
[08:05:40] moeabdol2: has joined #RubyOnRails
[08:07:01] emilkarl: Anyone using capistrano with sidekiq and have had the problem that sidekiq does not restart on deploy? I get an error whn trying to kill the sidekiq process. Check line 6 and 7 here: https://gist.github.com/emilkarl/6eaa56b94ce8a52f98361b0a4ed72d18
[08:09:51] Ergo: has joined #RubyOnRails
[08:12:52] msyvich: has joined #RubyOnRails
[08:12:57] artto: has joined #RubyOnRails
[08:13:42] rvanlieshout: emilkarl: try to run it manually
[08:13:53] rvanlieshout: see what error it presents
[08:13:53] emilkarl: now I did not get the error
[08:14:05] emilkarl: seems to be working
[08:14:27] emilkarl: after I removed a sidekiq.pid file in the same dir. there were sidekiq.pid och sidekiq-0.pid
[08:14:32] Ergo^: has joined #RubyOnRails
[08:17:37] lessless: has joined #RubyOnRails
[08:18:12] degree_of_separa: has joined #RubyOnRails
[08:19:09] degree_of_separa: Hello, I want to implement degree of separation for my project, like the linkedin, how do I got about it? Anyone?
[08:23:59] chrissonar: has joined #RubyOnRails
[08:25:49] srinidhi: has joined #RubyOnRails
[08:27:15] owenjones: has joined #RubyOnRails
[08:27:31] artto: has joined #RubyOnRails
[08:28:03] moeabdol: has joined #RubyOnRails
[08:31:48] rbr: gamov: how are you generating that query?
[08:32:11] refinerysource: has joined #RubyOnRails
[08:39:10] degree_of_separa: rbr, can you help me with implementing degree of separation like the linkedin ?
[08:40:01] tildes: has joined #RubyOnRails
[08:41:41] tjbiddle: has joined #RubyOnRails
[08:42:20] mark_66: has joined #RubyOnRails
[08:44:28] tjbiddle: Hey all. Running into an error with my precompiler "V8::Error: Unexpected token punc" seems the issue here (http://stackoverflow.com/a/32534114/1125714) seems to be my issue. However I have this *all* over my JS code and the precompiler doesn't give me a line number. Is there a way to debug this better?
[08:45:01] soroot: has joined #RubyOnRails
[08:48:15] gamov: rbr: I create the subquery as a ar relation then I manually INNER JOIN it with the main query (which is also a ar relation). Do I answer the question?
[08:48:31] artto: has joined #RubyOnRails
[08:50:02] pawnbox: has joined #RubyOnRails
[08:51:16] GarethAdams: has joined #RubyOnRails
[08:52:13] Circuit8: has joined #RubyOnRails
[08:54:08] marr: has joined #RubyOnRails
[08:57:46] DTZUBDUB: has joined #RubyOnRails
[08:58:02] Dro: has joined #RubyOnRails
[09:01:39] quazimodo: has joined #RubyOnRails
[09:04:27] atm0sphere: has joined #RubyOnRails
[09:05:11] soroot: has joined #RubyOnRails
[09:05:50] mwlang: has joined #RubyOnRails
[09:05:54] atm0sphere: here I want to get accept date of today or of future not past , how can i do that https://gist.github.com/aj07/54db84129929577fde58f23c2c282441
[09:06:18] arBmind: has joined #RubyOnRails
[09:07:46] atm0sphere: has joined #RubyOnRails
[09:07:55] snowy: has joined #RubyOnRails
[09:09:08] soroot: has joined #RubyOnRails
[09:09:42] atm0sphere: https://gist.github.com/aj07/54db84129929577fde58f23c2c282441
[09:09:49] Olipro: has joined #RubyOnRails
[09:12:35] atm0sphere: has joined #RubyOnRails
[09:14:27] soroot: has joined #RubyOnRails
[09:17:37] edwinvdgraaf: has joined #RubyOnRails
[09:18:30] lxsameer: has joined #RubyOnRails
[09:18:33] moep: has joined #RubyOnRails
[09:19:50] soroot: has joined #RubyOnRails
[09:20:02] Tempesta: has joined #RubyOnRails
[09:20:53] duderonomy: has joined #RubyOnRails
[09:21:22] soroot: has joined #RubyOnRails
[09:22:30] phredus: has joined #RubyOnRails
[09:25:19] tennis: has joined #RubyOnRails
[09:29:42] Moeh: has joined #RubyOnRails
[09:31:04] GarethAdams: has joined #RubyOnRails
[09:32:47] refinerysource: has joined #RubyOnRails
[09:33:09] sarink: has joined #RubyOnRails
[09:34:20] alfiemax: has joined #RubyOnRails
[09:40:26] weckl: has joined #RubyOnRails
[09:45:08] Ergo: has joined #RubyOnRails
[09:46:02] Helheim: has joined #RubyOnRails
[09:46:48] soroot: has joined #RubyOnRails
[09:48:00] rbr: gamov: in complex queries like that i sometimes .to_sql the AR-relation to correctly merge it in another
[09:49:17] rbr: I'm not saying it is good practise but it helped me reduce complexity while still using AR-functionality
[09:49:18] gamov: rbr: yes, that’s what I do too for the subquery but Rails ‘sees’ the table names in the subquery String!
[09:49:30] gamov: rbr: yep, totally agree
[09:49:52] Macaveli: has joined #RubyOnRails
[09:51:41] rbr: gamov: Hmm that sounds odd, I'm not familiar with rails 'analyzing' the plain-SQL you are trying to merge. Doesn't make sense
[09:52:19] adaedra: has joined #RubyOnRails
[09:52:28] rbr: gamov: how are you merging those queries? Can you show some code?
[09:55:48] quazimodo: has joined #RubyOnRails
[09:57:55] Xentil: has joined #RubyOnRails
[09:57:55] yogeshrt: has joined #RubyOnRails
[09:57:56] nua_: has joined #RubyOnRails
[09:58:17] giantoctopus: has joined #RubyOnRails
[10:01:30] learner_: has joined #RubyOnRails
[10:03:01] gamov: rbr: I’ve added how I join the subquery (https://gist.github.com/gamov/184249a3328bcfa333ae3fc7ba3ad9de)
[10:04:03] norc: has joined #RubyOnRails
[10:09:04] lightt: has joined #RubyOnRails
[10:09:38] gamov: rbr: I’ve got to go. I’m running the debugger to see where the aliases get created. I’ll update the gist if you are intersted
[10:09:55] rbr: gamov: If you only run "accessible(ShippingItem).joins(shipment: :shipment_booking).to_a", what is the generated sql?
[10:10:04] rbr: gamov: Alright :)
[10:10:30] benlieb: has joined #RubyOnRails
[10:11:39] gamov: rbr: thanks for the help
[10:12:08] rbr: gamov: Well, for the attempt then. No problem
[10:16:20] srinidhi: has joined #RubyOnRails
[10:17:59] workmaster2n: has joined #RubyOnRails
[10:18:47] edwinvdgraaf: has joined #RubyOnRails
[10:18:55] artto: has joined #RubyOnRails
[10:21:42] msyvich: has joined #RubyOnRails
[10:23:13] arBmind1: has joined #RubyOnRails
[10:24:02] diegoaguilar: has joined #RubyOnRails
[10:28:24] Kedare: has joined #RubyOnRails
[10:28:45] sarink: has joined #RubyOnRails
[10:29:02] netzfisch: has joined #RubyOnRails
[10:30:21] lessless: has joined #RubyOnRails
[10:32:06] mohsenjalalian: has joined #RubyOnRails
[10:32:08] c355E3B: has joined #RubyOnRails
[10:32:13] maucar: has joined #RubyOnRails
[10:33:39] edwinvdgraaf: has joined #RubyOnRails
[10:35:38] agit0: has joined #RubyOnRails
[10:36:29] jancel: has joined #RubyOnRails
[10:42:17] lightt: has joined #RubyOnRails
[10:47:40] edwinvdg_: has joined #RubyOnRails
[10:48:26] alaing: has joined #RubyOnRails
[10:51:26] edwinvdgraaf: has joined #RubyOnRails
[10:53:49] Dro: has joined #RubyOnRails
[10:53:58] Dro: has joined #RubyOnRails
[10:54:05] rodfersou: has joined #RubyOnRails
[10:55:50] alfiemax: i've got a doubt, not completely related to rails as such. but please hear me out. this might be such a silly question too
[10:56:38] alfiemax: in a rails api app + android , for basic user authentication, we use email and password to make a user login
[10:56:54] netzfisch: has joined #RubyOnRails
[10:57:34] alfiemax: so, how can i do the same using facebook, when i login a user through facebook i get back the fbid of the user, in the android app. and i send back this id to the rails app with other info like email, name, profile pic, etc
[10:58:08] alfiemax: but then, during login, how do i authenticate the user at the rails api level? i know the app is authenticating the user and sending me back the fbid
[10:58:25] alfiemax: but isn't fbid a publicly known attribute?
[10:58:48] norc: alfiemax: Do you care about authorization or authentication?
[10:59:02] alfiemax: norc, authentication
[10:59:57] alfiemax: normally it's username + password, but with facebook?? fbId + <what would this be> ?
[11:00:14] norc: alfiemax: neither.
[11:01:01] harfangk: has joined #RubyOnRails
[11:01:21] dangerousdave: has joined #RubyOnRails
[11:03:59] rvanlieshout: with oauth you don't auth yourself
[11:04:02] rvanlieshout: so there is no data for that
[11:04:58] alfiemax: rvanlieshout, so when an android app gives me back just a fbid of the autheticated user(at the android app end) i should login the user and return the user object??
[11:05:25] njero: alfiemax, you can verify the fb token rt?
[11:05:39] njero: on the server side
[11:06:28] alfiemax: n_e_o, you mean the access token i get back from authenticating the user ?
[11:06:53] k3rn31: has joined #RubyOnRails
[11:07:15] alfiemax: that wouldn't be the same every time right? it would get refreshed since the lifetime of fb access tokens are limited
[11:08:03] njero: alfiemax, you don't have to keep token if you don't need direct access from server side.. keep fbid which is same
[11:08:14] njero: only use token to verify
[11:08:51] alfiemax: oh, you mean fetch the user info using the access token and confirm that the fbid matches??
[11:09:10] alfiemax: hmm, i guess that could work
[11:09:33] alfiemax: just wondering, what does everyone do in these kind of scenarios
[11:10:01] allcentu1: has joined #RubyOnRails
[11:10:29] njero: also token has a validity for around 60 days i think.
[11:10:49] alfiemax: yes thats right
[11:11:23] alfiemax: but that doesn't matter, because once its expired the android app would get logged out and reauthentication would be required
[11:11:31] lxsameer: has joined #RubyOnRails
[11:11:43] axxyhtrx: has joined #RubyOnRails
[11:13:44] yogeshrt: has joined #RubyOnRails
[11:14:46] njero: hm.. but wouldn't need user to see facebook app :P
[11:15:54] njero: actually it might, just skips the authorization page only.
[11:16:15] njero: google play signin does a better job on that :)
[11:16:28] alfiemax: yeah, that happens
[11:16:31] nua_: hi all; anyone good at unicorn could give me a hand ?
[11:16:54] alfiemax: but if the token is refreshed frequently that wouldnt happen
[11:17:15] alfiemax: even the facebook app gets looged out if not used for more than 60 days
[11:17:34] Circuit8: Hey guys, anyone know how I can create an ActiveRecord query so that I get all Categories that have at least one Fabric associated with them?
[11:18:46] alfiemax: Circuit8, `joins`
[11:19:17] alfiemax: Categories.joins(:fabrics)
[11:19:24] lightt: has joined #RubyOnRails
[11:20:25] yatish27: has joined #RubyOnRails
[11:21:35] yatish27: has joined #RubyOnRails
[11:23:21] Circuit8: alfiemax: Thanks :)
[11:24:27] nua_: hi all; i'm using unicorn as http server configured for 0s downtime. Everything seems to work fine when deploying a new code of my app but for my linked files which are not taken in count when they get modified before deploying. any suggestions? thx!
[11:25:42] edwinvdgraaf: has joined #RubyOnRails
[11:26:02] lessless: has joined #RubyOnRails
[11:27:01] norc: nua_: I do not understand what you mean. Are you using capistrano for deployment?
[11:27:06] rbaron: has joined #RubyOnRails
[11:27:11] edwinvdgraaf: has joined #RubyOnRails
[11:28:45] DTZUBDUB: has joined #RubyOnRails
[11:29:06] nua_: norc: yeah, I mean on hot reload of unicorn if I modified in the shared directory the database.yml for example then the new master of unicorn does not use this modified database.yml even tho in the current sym linked if I can config/database.yml I can see the latest modification
[11:29:35] nua_: if I cat*
[11:29:37] nua_: sorry for typos
[11:30:51] King_Rex: has joined #RubyOnRails
[11:30:59] norc: nua_: How are you restarting your unicorn exactly? Please gist your task that does this, and your unicorn.rb
[11:32:08] nua_: it works for a new rails code though
[11:32:41] nua_: I use USR2 signal then QUIT
[11:32:52] Pathfinder: has joined #RubyOnRails
[11:32:57] nua_: wait a sec for the gist
[11:35:32] nua_: https://gist.github.com/catuss-a/5058bd84c6a23949479e22c68ab3ed99
[11:35:44] nua_: https://gist.github.com/catuss-a/773768c226d8c2613d0e18827db1c624
[11:36:18] cabinB: has joined #RubyOnRails
[11:36:21] norc: nua_: You can attack multiple file to github gists by the way.
[11:36:52] nua_: ye i searched for it but didnt find this feature :D
[11:37:14] norc: nua_: https://gist.github.com/ << see the "Add file" on the bottom left hand of the screen?
[11:37:29] moeabdol: has joined #RubyOnRails
[11:38:12] nua_: https://gist.github.com/catuss-a/c48cf3a04e7c87402cd4b36479253078
[11:38:14] nua_: here we go
[11:38:19] nua_: not used to shared code :D
[11:40:06] ldnunes: has joined #RubyOnRails
[11:40:28] norc: nua_: Do you have a staging system to try things on?
[11:40:39] nua_: ye it's staging actually
[11:41:18] norc: nua_: Back when I set up my unicorn tasks I ended up manually signalling the master to verify the 0 downtime functionality
[11:42:03] nua_: 0 downtime works fine actually but for my configuration linked files which are not "reloaded"
[11:42:12] nua_: it looks like unicorn uses a cached version of them
[11:42:58] norc: nua_: It cant.
[11:43:50] cabinB: I have some nested attributes I need to sort: <%= f.fields_for :sales_activities do |ev| %>
[11:44:27] cabinB: what would I need to add to make the primary sort transaction_value and the next sort last_name and then employee_id?
[11:44:51] nua_: norc: cannot just reload (not hardcore restart) my app for configuration files ? O.o
[11:45:03] norc: nua_: Just entertain me. Signal the processes manually using kill.
[11:45:41] cabinB: btw using rails 4.x
[11:45:42] norc: nua_: No. Using this mechanism unicorn basically restarts everything entirely, except in a fashion that leaves no gaps of service.
[11:46:28] norc: nua_: USR2/QUIT effectively is the same as stopping the master/workers and starting fresh ones.
[11:47:00] norc: Which is why Im thinking that some part is not signalling the USR2 properly.
[11:47:11] centrx: has joined #RubyOnRails
[11:47:42] nua_: well apparentlé not since a hardcore restart load my new sym links but it does not when signaling unicorn with USR2/QUIT
[11:48:09] norc: nua_: Which is why I am asking you to signal unicorn by hand.
[11:48:22] norc: Use 'kill'
[11:48:47] GorillaApe: has joined #RubyOnRails
[11:49:15] edwinvdg_: has joined #RubyOnRails
[11:51:11] GorillaApe: I am having a problem that I dont know how to address. I am using spree commerce. At checkout they provide both shipping and billing address along with a checkbox if you want them to be cloned. In case you choose address to be cloned you get duplicate error messages one from each address class. Is there any way to cancel validations for one model if checkbox is checked?
[11:51:55] nua_: norc: https://gyazo.com/1827ea1b564624ba1a7adabeb397dfae
[11:52:07] nua_: sorry i don't know what you really want to see ^^
[11:52:30] nua_: so here it looks like pid changed, can notice the (old) master
[11:52:42] GorillaApe: https://github.com/spree/spree/blob/ee5d3919029c9816ca9c8492f40740b9a7971a93/core/app/models/spree/order.rb
[11:53:37] norc: nua_: make a change to a YAML file first, then signal using kill, and then see if the change was picked up
[11:53:54] norc: nua_: The point is to see if unicorn is working properly, or whether you are not signalling USR/QUIT properly.
[11:54:19] Bubo: has joined #RubyOnRails
[11:54:52] Bubo: How can I let my rails app run on my dev server in development mode
[11:54:55] nua_: norc: ok I'll change the unicorn conf to pop 4 workers instead of 2. sec
[11:54:58] Bubo: do I just rails s in a screen ?
[11:55:37] norc: nua_: if your unicorn.conf is linked then great.
[11:55:47] norc: Bubo: Correct.
[11:56:02] nua_: yeah it is
[11:56:13] norc: Bubo: (Assuming you do not have some part that exports a RAILS_ENV environment variable of coursE)
[11:56:41] rodferso1: has joined #RubyOnRails
[11:58:43] lightt: has joined #RubyOnRails
[11:58:45] nua_: norc: https://gyazo.com/20a594322a5f8b8d6fc27f90fd8c5008
[11:58:47] nua_: looks fine
[11:59:15] norc: nua_: Then your shell script is not signalling USR to unicorn.
[11:59:41] norc: ACTION shows nua_ the door to #bash .. it has a big sign that says "Here be dragons"
[12:00:11] edwinvdgraaf: has joined #RubyOnRails
[12:01:14] nua_: norc: https://gyazo.com/0340670c07880e0b5801420f3509af2d
[12:01:19] nua_: it actually does X.X
[12:01:40] nua_: I changed 4 to 2 workers
[12:02:15] jeffmess: has joined #RubyOnRails
[12:02:27] nua_: might come from capistrano conf :/
[12:02:46] nua_: but the deployment flow looks fine to me
[12:03:46] tvw: has joined #RubyOnRails
[12:04:46] soroot: has joined #RubyOnRails
[12:12:35] nua_: norc: ops apparently the modifications from another .yml are not picked up
[12:13:19] DTZUBDUB: has joined #RubyOnRails
[12:15:34] kgrz: has joined #RubyOnRails
[12:15:38] Dro: has joined #RubyOnRails
[12:17:39] lxsameer: has joined #RubyOnRails
[12:19:31] eljimmy: has joined #RubyOnRails
[12:19:36] refinerysource: has joined #RubyOnRails
[12:24:26] jancel: has joined #RubyOnRails
[12:24:47] yfeldblum: has joined #RubyOnRails
[12:26:43] norc: nua_: Do you mean manual modifications to the file and then manually sending SIGUSR2/SIGQUIT _
[12:30:07] flashpoint9: has joined #RubyOnRails
[12:30:44] nua_: norc: yeah
[12:31:08] nua_: I have a .rbenv-vars on my root app folder
[12:31:35] norc: nua_: what does your .rbenv-vars have to do with anything?
[12:31:37] nua_: if I change a value then send USR2 to unicorn it's still on the old value
[12:31:45] nua_: like cached O.o
[12:32:02] norc: nua_: Lets see if you can figure this one out yourself.
[12:32:04] nua_: cause it's a symbolic link
[12:32:09] nua_: to a shared folder
[12:32:16] flashpoint9: I got a question, I am building an app where I have an index which returns records which are rendered as html. I am adding a chart to the page and I want the chart to pull json data from another page (same object, same controller).
[12:32:39] norc: nua_: Are you making changes to environment variables that get interpolated into your yml files?
[12:32:59] flashpoint9: The html is already in the index method and the json data would also logically be index, what should I name the method that returns json?
[12:33:05] nua_: norc: yah
[12:33:08] universa1: flashpoint9: index ;)
[12:33:18] norc: nua_: the environment variable change is not picked up
[12:33:26] universa1: flashpoint9: the methods can return different content depending on the request format for example
[12:33:31] norc: nua_: So the process still sees the same environment variable
[12:33:51] flashpoint9: universa1: ah ok so use the index to return both
[12:33:53] norc: nua_: So we have now deduced it is rbenv related somehow. ;-)
[12:34:15] nua_: well let me try smth to confirm that 100%
[12:34:16] norc: nua_: Honestly I dont see the point of this silly environment variable/yml thing.
[12:34:19] universa1: flashpoint9: look for respond_to do |format| ...
[12:34:28] norc: nua_: Just write your usernames/passwords/secrets into your YML files directly.
[12:34:37] fmcgeough: has joined #RubyOnRails
[12:34:54] norc: Whether they lie in .rbenv-vars or database.yml makes absolutely no difference security wise. The opposite actually, because now you also have credentials in your environment for no real reason.
[12:35:10] lxsameer: has joined #RubyOnRails
[12:35:14] norc: And you must make sure that changes are picked up properly through rbenv.
[12:35:23] flashpoint9: universa1: ah, i actually did that in an old tutorial but forgot all about it, thanks so much!
[12:35:37] mohsenjalalian: has joined #RubyOnRails
[12:36:38] nua_: norc: the small diff is that you can add you yml files into your repo
[12:36:51] norc: nua_: you can also add your .rbenv-vars into your repo
[12:36:52] norc: what is your point?
[12:37:29] nua_: the point is a new dev who git clone the repo can run it without debugging the app
[12:37:39] nua_: well thats my point of view..
[12:37:51] norc: nua_: You have to tell a new dev how to configure things ANYWAY.
[12:37:59] norc: He needs to know what mechanism to use to set up databases.
[12:38:08] norc: You cant get around that bit.
[12:38:29] norc: All .rbenv-env does is make things more complicated.
[12:39:23] msyvich: has joined #RubyOnRails
[12:39:32] nua_: well it excludes all sensitive keys into one and unique file
[12:40:05] nua_: you can make news version on that file from a ui
[12:40:12] nua_: really easy
[12:40:23] nua_: heroku-like
[12:42:09] ftj: has joined #RubyOnRails
[12:43:07] soroot: has joined #RubyOnRails
[12:47:43] Axilla: has joined #RubyOnRails
[12:52:49] emilkarl: has joined #RubyOnRails
[12:54:03] emilkarl: is it possible to validate if a relationship can exists. I have a Group::has_many_and_belongs_to -> Users, where I would like to validate if the user is confirmed or not before it is possible to add?
[12:54:56] emilkarl: has_and_belongs_to_many*
[12:55:41] truenito: has joined #RubyOnRails
[12:57:16] truenito: has joined #RubyOnRails
[12:57:19] ElFerna: has joined #RubyOnRails
[12:57:30] tknz: has joined #RubyOnRails
[12:57:45] ramortegui: has joined #RubyOnRails
[12:58:16] chouhoulis: has joined #RubyOnRails
[12:58:18] nua_: emilkarl: user should have 0 groups if not valid I guess
[12:58:50] msyvich: has joined #RubyOnRails
[13:03:26] allcentu1: has joined #RubyOnRails
[13:03:52] emilkarl: Im thinking of something like this nua_ http://pastie.org/10867904
[13:04:00] pawnbox: has joined #RubyOnRails
[13:04:05] IFrank00: has joined #RubyOnRails
[13:04:24] IFrank004: has joined #RubyOnRails
[13:06:30] nua_: emilkarl: looks good
[13:07:58] nua_: emilkarl: but I would have done that user side though
[13:08:21] emilkarl: Ok, how do you mean? set the validation user side?
[13:09:08] yellow5: has joined #RubyOnRails
[13:10:40] nua_: emilkarl: yeah cause if a confirmed user in a group goes unconfirmed then your group is fucked up
[13:10:51] nua_: but I guess a user cannot go unconfirmed^^
[13:11:05] emilkarl: hmm that is a good point
[13:11:31] emilkarl: but I am thinking of adding a check on the and remove all groups from user when state changes.
[13:13:00] josemotanet: has joined #RubyOnRails
[13:14:32] nua_: emilkarl: pas compris :D
[13:16:41] terrabl: has joined #RubyOnRails
[13:17:10] Pathfinder: has joined #RubyOnRails
[13:17:39] aegis3121: has joined #RubyOnRails
[13:18:14] soule: has joined #RubyOnRails
[13:20:07] soule: Hi, am running a post request to a create method via jQuery, and while the log says "Rendered work_sessions/create.js.erb (0.1ms)" the JS isn't executed - any ideas?
[13:21:41] ramortegui: has joined #RubyOnRails
[13:23:04] kdough: has joined #RubyOnRails
[13:24:24] dcluna: has joined #RubyOnRails
[13:24:29] terrabl: Has anyone ever gotten a wrong number of arguments (2 for 1) error when including //= tree . in their application.js
[13:24:32] benlieb_: has joined #RubyOnRails
[13:24:57] fryguy: is there a ruby file in the tree? erb or haml or similar
[13:26:14] terrabl: no its all js and coffe
[13:26:42] soroot: has joined #RubyOnRails
[13:27:23] terrabl: oh I have always been doing require tree . rather than require_tree .
[13:29:23] chouhoulis: has joined #RubyOnRails
[13:29:31] syath: has joined #RubyOnRails
[13:29:33] emilkarl: nua_ seems to be working, but the record is saved anyway but the record will then always be invalid.
[13:30:02] soroot: has joined #RubyOnRails
[13:30:50] emilkarl: this might do the trick. before_add
[13:31:24] mdw: has joined #RubyOnRails
[13:32:02] wilsonc91: has joined #RubyOnRails
[13:32:15] mdw: has joined #RubyOnRails
[13:33:21] soule: So.. when I tried to make my .js.erb console.log, it wouldn't work, but editing the DOM worked.. huh
[13:33:29] soule: * i mean when i tried to make it alert()
[13:36:03] wilsonc91: I want to do something along the lines of Account.where(configuration_key: "au").map &:Store to get a list of stores based on a condition on the account, but map returns an array instead of an active record relation. Is there anyway to get an active record relation instead ?
[13:37:27] artto: has joined #RubyOnRails
[13:38:04] msyvich: has joined #RubyOnRails
[13:38:46] chouhoul_: has joined #RubyOnRails
[13:39:58] mohsenjalalian: hello how to use rspec to test a model that have numericality validation for a field?
[13:40:51] grassass: has joined #RubyOnRails
[13:43:12] tbuehlmann: mohsenjalalian: that functionality is tested by the rails framework itself, do you have reason to test it as well?
[13:43:13] rbr: wilsonc91: Is it a single condition you want the list for or should there be multiple lists?
[13:43:33] pawnbox: has joined #RubyOnRails
[13:43:47] wilsonc91: I need to pass it into something that expects an AR relationship
[13:44:50] mohsenjalalian: tbuehlmann: I wan to write a test for my model with rspec
[13:45:00] theunraveler: has joined #RubyOnRails
[13:46:08] Macaveli: has joined #RubyOnRails
[13:48:44] anjabergmann: has joined #RubyOnRails
[13:49:45] tbuehlmann: mohsenjalalian: in order to achieve what exactly?
[13:51:15] maxx88: has joined #RubyOnRails
[13:52:41] mohsenjalalian: tbuehlmann: test help to have a kind of document for my code and also help me to check my code
[13:52:43] snowy: has joined #RubyOnRails
[13:52:51] SteenJobs: has joined #RubyOnRails
[13:56:54] edwinvdgraaf: has joined #RubyOnRails
[13:57:15] tbuehlmann: mohsenjalalian: heh, I had hoped for the "documentation" answer, I personally think that's not a bad reason
[13:57:28] rbr: wilsonc91: How about Store.joins(:account).where(account: { configuration_key: 'au' }) ?
[13:57:56] tbuehlmann: well, I probably would add rspec-collection_matchers to the Gemfile and go with https://www.relishapp.com/rspec/rspec-rails/v/2-14/docs/model-specs/errors-on
[13:58:38] jhack: has joined #RubyOnRails
[14:00:32] jhack_: has joined #RubyOnRails
[14:01:38] terrabl: Hey this may be a basic question but can someone tell me the difference between the two below? find in the gist https://gist.github.com/terrabl/6347742e5eeb72ab8d8cc02490b7184e
[14:04:00] lightt: has joined #RubyOnRails
[14:04:25] lightt: has joined #RubyOnRails
[14:04:59] hd1: has joined #RubyOnRails
[14:05:37] morfeen: has joined #RubyOnRails
[14:05:41] GarethAdams_: has joined #RubyOnRails
[14:05:50] frem_: has joined #RubyOnRails
[14:06:06] siaw23: has joined #RubyOnRails
[14:06:38] hd1: has joined #RubyOnRails
[14:06:41] morfeen: whats the best resources to quickly get upto speed on Ruby and Rails? Im from a JS/Node background
[14:07:26] tsherman: has joined #RubyOnRails
[14:07:39] mohsenjalalian: tbuehlmann : thanks
[14:07:51] allcentu1: has joined #RubyOnRails
[14:08:24] hd1: has left #RubyOnRails: ()
[14:09:44] mdw: ACTION awake
[14:09:46] diegoviola: has joined #RubyOnRails
[14:09:56] mdw: has left #RubyOnRails: ("cya! http://www.somerobots.com")
[14:10:04] mdw: has joined #RubyOnRails
[14:10:14] terrabl: morfeen: http://guides.rubyonrails.org/getting_started.html https://www.youtube.com/watch?v=GY7Ps8fqGdc&list=PLGLfVvz_LVvSngZQwrhYXlPnJf1zYqghI
[14:10:33] mdw: hey rails team, I used the Rails GitHub repo in the latest Git Trident product images :-D
[14:10:34] mdw: http://somerobots.com
[14:10:35] panzi: has joined #RubyOnRails
[14:11:07] morfeen: terrabl: thanks
[14:11:17] panzi: When I serialize a model object to JSON I want to convert all IDs to strings, because they should be "back box" values in JavaScript, and not double precision floating point numbers. Is there a way to tell ActiveModel::Serializer to run all IDs through .to_s (if not nil)?
[14:11:34] macsteps: has joined #RubyOnRails
[14:11:48] pontiki: morfeen: take a look at http://theodinproject.com for a huge list of resources
[14:14:08] morfeen: pontiki: looks interesting.
[14:14:12] morfeen: thanks for the suggestion
[14:15:59] agent_white: has joined #RubyOnRails
[14:17:11] macsteps: has joined #RubyOnRails
[14:18:29] gingray: has joined #RubyOnRails
[14:22:43] chouhoulis: has joined #RubyOnRails
[14:25:32] k3rn31: has joined #RubyOnRails
[14:30:08] edwinvdgraaf: has joined #RubyOnRails
[14:30:33] smathy: has joined #RubyOnRails
[14:31:00] emachnic: has joined #RubyOnRails
[14:34:10] zave: has joined #RubyOnRails
[14:34:19] IFrank004: Im having this issue with a multi tenant app and sidekiq. https://gist.github.com/Frank004/796e41ea5b9d4fe85adbbafc3174e672
[14:34:27] IFrank004: https://cloud.githubusercontent.com/assets/7242689/15860362/bcf8f3ba-2c96-11e6-9582-b8b39eafc780.jpg
[14:34:39] dopamean_: has joined #RubyOnRails
[14:35:12] dopamean_: has joined #RubyOnRails
[14:35:39] IFrank004: As a multiteant app the jobs needs to know the schema there from
[14:35:47] msyvich: has joined #RubyOnRails
[14:35:58] emachnic: has joined #RubyOnRails
[14:36:02] lessless: has joined #RubyOnRails
[14:36:10] IFrank004: theres a gem call apartment-sidekiq but im getting the same result
[14:39:01] IFrank004: so I was trying it manual to see where is the problem. first thing is that I think that sidekiq with redis is not connecting to my pstgress db. The background jobs are new to me so any help on this will be very appreciated
[14:41:08] anjabergmann: has joined #RubyOnRails
[14:41:36] JesseH: has joined #RubyOnRails
[14:41:58] harai: has joined #RubyOnRails
[14:42:00] IFrank004: I add it a log trace if is of any help
[14:44:36] adavia: has joined #RubyOnRails
[14:45:40] franK004: has joined #RubyOnRails
[14:46:39] ketherah: has joined #RubyOnRails
[14:46:58] macsteps: has joined #RubyOnRails
[14:48:13] cd83x: has joined #RubyOnRails
[14:48:56] IFrank00: has joined #RubyOnRails
[14:53:28] arup_r: has joined #RubyOnRails
[14:57:11] Wolland: has joined #RubyOnRails
[14:59:20] truenito1: has joined #RubyOnRails
[15:01:29] yatish27: has joined #RubyOnRails
[15:02:43] qejk: has joined #RubyOnRails
[15:03:12] wd40s: has joined #RubyOnRails
[15:03:47] clandry94: has joined #RubyOnRails
[15:06:06] polishdub: has joined #RubyOnRails
[15:07:06] disgrntld: has joined #RubyOnRails
[15:07:18] M-shine: has joined #RubyOnRails
[15:07:58] prithaj: has joined #RubyOnRails
[15:08:19] cschneid: has joined #RubyOnRails
[15:10:59] xlegoman: has joined #RubyOnRails
[15:11:13] eserror_: has joined #RubyOnRails
[15:11:18] msyvich: has joined #RubyOnRails
[15:12:51] Ropeney: has joined #RubyOnRails
[15:17:26] Macaveli: Can anyone explain the difference between left and right output to me? Why is it formatted differentyl? Rails 3 vs Rails 4 or? http://i.imgur.com/n4FgjRx.jpg
[15:20:03] nua_: Macaveli:
[15:20:15] nua_: it's a gem
[15:20:18] nua_: on the right
[15:21:01] nua_: Macaveli: pry-rails i think
[15:21:32] daveomcd: I'm wanting to have a search box that will show results as a drop down from the search box as I'm typing the name -- is there a gem anyone knows that does this before I start making it?
[15:22:26] tildes_: has joined #RubyOnRails
[15:25:01] franK004: daveomcd, your looking for a auto result ?
[15:25:09] nua_: daveomcd: jquery-ui i think
[15:26:06] franK004: http://railscasts.com/episodes/399-autocomplete-search-terms
[15:26:42] franK004: daveomcd, check that episode of railscasts
[15:26:56] netzfisch: has joined #RubyOnRails
[15:32:45] edwinvdgraaf: has joined #RubyOnRails
[15:34:09] markfletcher: has joined #RubyOnRails
[15:35:19] markfletcher: has joined #RubyOnRails
[15:35:34] universa1: daveomcd: select2
[15:37:46] klekot: has joined #RubyOnRails
[15:40:53] edwinvdgraaf: has joined #RubyOnRails
[15:42:11] msyvich: has joined #RubyOnRails
[15:42:18] siaw23: i have a rails4 app.`rails s` gives me this error https://gist.github.com/siaw23/de72ba0370e3efa2dd228eb605996ac6 i’m not sure where to look or what to change. any help? this is my repo https://github.com/siaw23/lumendatabase
[15:43:56] Zarathu: siaw23: https://github.com/siaw23/lumendatabase/blob/rails4/app/models/notice.rb
[15:44:10] Zarathu: siaw23: your problem is in that file, and it's pretty obvious if you read the error message.
[15:49:10] Mohan: has joined #RubyOnRails
[15:49:47] edwinvdg_: has joined #RubyOnRails
[15:51:10] nua_: continue
[15:51:27] wmoxam: has left #RubyOnRails: ()
[15:51:46] yatish27: @siaw23 modify include: :topic
[15:51:53] yatish27: don't pass an array
[15:52:00] yatish27: in line 80 of notice.rb
[15:52:01] nua_: yatish27: let him struggle
[15:52:08] dcluna: has joined #RubyOnRails
[15:52:15] SteenJobs: has joined #RubyOnRails
[15:52:38] siaw23: yeah i’m struggling
[15:52:51] jhass: Guest34269: so, anything we can help with?
[15:53:14] yatish27: @siaw23 try the solution I provided
[15:53:28] davidw: has joined #RubyOnRails
[15:53:31] nua_: siaw23: Unknown key: :include. Valid keys are: :class_name, :anonymous_class ....
[15:53:35] nua_: it's clear
[15:55:08] myntcake: has joined #RubyOnRails
[15:55:09] whathappens: has joined #RubyOnRails
[16:00:36] Cohedrin: has joined #RubyOnRails
[16:00:42] markfletcher: has joined #RubyOnRails
[16:00:54] jancel: has joined #RubyOnRails
[16:02:09] siaw23: yatish27: include: :topic produces the same error
[16:02:35] siaw23: what i’m thinking is maybe `:include` has been replaced with something else?
[16:02:42] alfiemax: has joined #RubyOnRails
[16:03:40] markfletcher: has joined #RubyOnRails
[16:04:00] Macaveli: wrong channels
[16:06:16] yatish27: @siaw23 I guess include has been removed
[16:06:37] norc: has joined #RubyOnRails
[16:07:30] yatish27: @siaw23 http://apidock.com/rails/v4.2.1/ActiveRecord/Associations/ClassMethods/has_many include has been removed in 4
[16:08:41] zave: has joined #RubyOnRails
[16:08:52] siaw23: yatish27: i figured. i’m trying to find the new option name
[16:11:31] centrx: has joined #RubyOnRails
[16:13:40] mwlang: siaw23: Rails Guide: http://guides.rubyonrails.org/association_basics.html section: 4.1.3.2 includes
[16:18:57] Coldblackice: has joined #RubyOnRails
[16:21:24] DanByc: has joined #RubyOnRails
[16:21:28] David_H__: has joined #RubyOnRails
[16:21:43] markfletcher: has joined #RubyOnRails
[16:25:10] IFrank004: has joined #RubyOnRails
[16:25:49] rubyonrails635: has joined #RubyOnRails
[16:27:40] David_H_Smith: has joined #RubyOnRails
[16:28:06] IFrank00: has joined #RubyOnRails
[16:29:22] [Butch]: has joined #RubyOnRails
[16:29:51] jancel: has joined #RubyOnRails
[16:30:12] chouhoul_: has joined #RubyOnRails
[16:32:14] whathapp_: has joined #RubyOnRails
[16:33:04] rubycan: has joined #RubyOnRails
[16:33:09] whathapp_: has joined #RubyOnRails
[16:34:06] rubycan: does rails default to a locale?
[16:34:07] whathapp_: has joined #RubyOnRails
[16:34:58] rogue_koder: has joined #RubyOnRails
[16:39:23] diegoaguilar: has joined #RubyOnRails
[16:40:45] WilfredTheGreat: has joined #RubyOnRails
[16:44:46] sumobob: has joined #RubyOnRails
[16:46:05] manfrin: has joined #RubyOnRails
[16:49:12] whathappens: has joined #RubyOnRails
[16:49:26] kies: has joined #RubyOnRails
[16:49:46] sneakers: has joined #RubyOnRails
[16:54:17] gamov: has joined #RubyOnRails
[16:59:42] cnk: has joined #RubyOnRails
[17:01:31] aegis3121: has joined #RubyOnRails
[17:03:32] jhack: has joined #RubyOnRails
[17:04:37] djbkd: has joined #RubyOnRails
[17:04:52] rakm: has joined #RubyOnRails
[17:07:33] kies: has joined #RubyOnRails
[17:08:32] djbkd: has joined #RubyOnRails
[17:09:29] gremly_: has joined #RubyOnRails
[17:10:02] darkxploit: has joined #RubyOnRails
[17:10:05] gremly: has joined #RubyOnRails
[17:11:57] truenito: has joined #RubyOnRails
[17:12:31] kgrz: has joined #RubyOnRails
[17:12:35] wilsonc91: has joined #RubyOnRails
[17:13:21] urbanmonk: has joined #RubyOnRails
[17:16:33] hahuang61: has joined #RubyOnRails
[17:16:38] truenito: has joined #RubyOnRails
[17:16:45] Dimik: has joined #RubyOnRails
[17:20:47] sypheren: has joined #RubyOnRails
[17:21:33] choke: has joined #RubyOnRails
[17:22:56] AndroidLoverInSF: has joined #RubyOnRails
[17:23:13] rubyonrails572: has joined #RubyOnRails
[17:23:15] dcluna: has joined #RubyOnRails
[17:23:15] mwlang: hmmm…if I set a property in a FactoryGirl factory declaration, can’t I override that value by passing in my own? https://gist.github.com/mwlang/cb21749c26d31d65116500f31ebf7d83
[17:23:27] mwlang: rubycan: yes.
[17:23:42] mwlang: I18n.locale => :en
[17:24:11] mwlang: (for example)
[17:25:12] rubyonrails572: What would the easiest way to update data from a json feed into a database? I'd assume I could just put the process in a controller, but how would I call it? Would I just have a cron job run a view? Can I strictly just have a method run from a view?
[17:26:36] mwlang: rubycan: and you can change it in your config/application.rb by adding “config.i18n.default_locale = :da” and “config.i18n.available_locales = [:da, :en]” lines there to manage what the default is and available choices are, respectively.
[17:26:39] yellow5: has joined #RubyOnRails
[17:27:12] mikecmpbll: has joined #RubyOnRails
[17:28:01] shinnya: has joined #RubyOnRails
[17:28:24] mwlang: rubyonrails572: is the json feed calling an action on your controller or are you wanting a scheduled rake task that will fetch the json data from an external site?
[17:29:52] macsteps: has joined #RubyOnRails
[17:30:19] arup_r: has joined #RubyOnRails
[17:30:28] DragonPunch: has joined #RubyOnRails
[17:31:26] rubyonrails572: I'm fetching the data from a external site
[17:31:29] lxsameer: has joined #RubyOnRails
[17:31:56] rubyonrails572: I'm using HTTParty to get the json data which isn't a issue. I'm just trying to figure out how I would automate this.
[17:32:23] mwlang: rubyonrails572: then put it into a rake task.
[17:32:37] mwlang: rubyonrails572: and use the whenever gem to schdule running that rake task.
[17:33:21] mwlang: rubyonrails572: https://github.com/javan/whenever
[17:33:43] Cache_Money: has joined #RubyOnRails
[17:33:54] mwlang: assuming you’re not deploying to heroku, that is.
[17:33:54] SteenJobs: has joined #RubyOnRails
[17:34:58] aegis3121: has joined #RubyOnRails
[17:36:23] rubycan: i want to set the locale based on the logged in user, then adjust the datetime etc.
[17:37:16] agit0: has joined #RubyOnRails
[17:38:03] chipotle: has joined #RubyOnRails
[17:41:45] Zarathu: am I muted? o.O
[17:42:03] Zarathu: or can you read this
[17:42:43] DoctorMonocular: has joined #RubyOnRails
[17:43:01] cnk: Zarathu: we can hear you
[17:43:04] mwlang: Zarathu: I read you
[17:43:25] dblessing: has joined #RubyOnRails
[17:43:39] mwlang: I think something’s seriously lagging on the channel, though. Seems awfully darn quiet in this room for this time of day.
[17:44:02] antgel: has joined #RubyOnRails
[17:44:44] robbanp: has joined #RubyOnRails
[17:44:52] David_H_Smith: has joined #RubyOnRails
[17:47:00] harai: has joined #RubyOnRails
[17:47:12] mikecmpbll: has joined #RubyOnRails
[17:47:25] robbanp: Hi, I have this very hard problem with my rails app...It's a transaction system, and sometimes it creates double transactions. A transaction with the same ID is happening at the same time... within 2-3 sec
[17:47:45] robbanp: They have different IDs
[17:48:19] robbanp: No idea of how to debug or replicate the issue
[17:49:14] robbanp: Same DB ID but different Process.pid:s
[17:50:01] norc: robbanp, read what you just wrote, and consider how anyone without intimate knowledge of your application could possibly understand anything you just wrote.
[17:50:23] robbanp: Yeah I know
[17:50:43] robbanp: Sorry, not sure how to approach this.
[17:50:56] levifig: has joined #RubyOnRails
[17:52:36] norc: robbanp, how is the ID generated?
[17:53:03] adre: has joined #RubyOnRails
[17:53:14] robbanp: @norc It's a activerecord model, so the ID comes from the DB
[17:53:46] robbanp: norc: I also log the Process.pid, which are two different
[17:53:50] chouhoulis: has joined #RubyOnRails
[17:53:59] norc: robbanp, firstly, IDs do not magically appear.
[17:54:11] norc: robbanp, what database adapter are you using?
[17:54:19] robbanp: norc: Postgres
[17:55:04] norc: robbanp, gist the complete (dont remove anything) model
[17:55:30] robbanp: norc: i'ts big.. let me see if its not sensitive :)
[17:56:05] norc: robbanp, you can remove unrelated method definitions if you please, but include *all* hooks and method calls inside the class body.
[17:56:37] robbanp: norc: Sure, thanks alot!
[17:58:31] chipotle: has joined #RubyOnRails
[18:00:00] wilsonc91: has joined #RubyOnRails
[18:01:16] truenito: has joined #RubyOnRails
[18:03:21] yellow5: has joined #RubyOnRails
[18:04:05] flashpoint9: has joined #RubyOnRails
[18:04:47] norc: robbanp, so the code that gives users the transaction ID is relevant.
[18:05:26] robbanp: The object is create in a controller and is then given a ID
[18:06:08] robbanp: Then in a update action the object with id 123 is loaded and then used to execute a transaction
[18:06:45] replay: has joined #RubyOnRails
[18:06:50] norc: robbanp, right. And that code that hands out the ID must be faulty.
[18:06:51] robbanp: The update action seems to be called twice and the same transaction (123) is used from two different server processes
[18:07:18] robbanp: I'ts plain ActiveRecord so no magic there
[18:07:46] norc: robbanp, honestly, unless you can either provide a test case or pay an hourly fee for consultancy, Im not sure how you can be helped
[18:08:22] robbanp: Yeah I know, I could pay but this require some experience :/
[18:09:42] Moeh: has joined #RubyOnRails
[18:11:57] robbanp: Could be nginx/passenger, or clientside js, or race conditions in the code..
[18:12:01] macsteps: has joined #RubyOnRails
[18:13:38] kgrz: has joined #RubyOnRails
[18:15:54] edwinvdgraaf: has joined #RubyOnRails
[18:17:08] edwinvdgraaf: has joined #RubyOnRails
[18:18:10] glasz_: has joined #RubyOnRails
[18:18:13] urbanmonk: has joined #RubyOnRails
[18:20:05] context-: has joined #RubyOnRails
[18:20:22] glasz_: hi everyone. since the rules don't deny me doing so, i'll just drop https://github.com/jamii-Technologies/sms_kit.
[18:20:31] sleungcy: has joined #RubyOnRails
[18:20:51] glasz_: we released a first public gem minutes ago. maybe somebody can make use of it.
[18:21:22] allcentu1: has joined #RubyOnRails
[18:21:51] patrick_star: has joined #RubyOnRails
[18:23:04] cnk: glasz_: Cool! Now I just need a project that sends alerts
[18:23:41] audy: has joined #RubyOnRails
[18:24:24] blockchan: has joined #RubyOnRails
[18:24:29] flashpoint9: glasz_: looks neat
[18:25:02] jancel: has joined #RubyOnRails
[18:25:05] gingray: has joined #RubyOnRails
[18:25:18] flashpoint9: you're in germany?
[18:25:19] glasz_: cnk: i think the bundled providers present a limited choice when it comes to pricing. but everybody is welcome to put together providers for other sms gateways.
[18:25:26] glasz_: flashpoint9: yes.
[18:26:14] mdw: has joined #RubyOnRails
[18:26:21] flashpoint9: is there a big rails/ruby scene there?
[18:27:10] glasz_: flashpoint9: php scene is bigger from what i can see. because pricing, you know...
[18:27:35] flashpoint9: thats about the same around here though
[18:27:43] Pathfinder: Is that Jamii by any means derived from the Swahili word?
[18:28:15] glasz_: but there are bigger companies/startups betting on rails. eg sofatutor.com (disclosure: i once worked with them)
[18:28:15] dorje__: has joined #RubyOnRails
[18:28:52] glasz_: and, of course, jamii Technologies ;)
[18:29:42] glasz_: Pathfinder: yes.
[18:29:58] mohsenjalalian: has joined #RubyOnRails
[18:30:04] jenrzzz: has joined #RubyOnRails
[18:30:04] jenrzzz: has joined #RubyOnRails
[18:30:49] SteenJobs: has joined #RubyOnRails
[18:31:28] Pathfinder: Hehehe...at first I thought I had stumbled across a fellow countryman/woman
[18:31:40] glasz_: flashpoint: if you know 6wunderkinder, they bet on rails as well (at least 4 years ago afaik).
[18:32:05] glasz_: Pathfinder: we are all fellow countrypeople ;)
[18:32:20] dorje_: has joined #RubyOnRails
[18:35:21] AndroidLoverInSF: has joined #RubyOnRails
[18:37:22] qejk: has joined #RubyOnRails
[18:42:31] lxsameer: has joined #RubyOnRails
[18:44:01] mwlang: airbnb.com is a fairly recent startup that bet on rails and is quite large now.
[18:45:02] dionysus69: has joined #RubyOnRails
[18:46:19] wmoxam: has joined #RubyOnRails
[18:48:01] glasz_: mwlang: yeah, but they don't originate from germany :p
[18:48:12] rubycan: founder of scribd https://blog.jaredfriedman.com/2015/09/15/why-i-wouldnt-use-rails-for-a-new-company/
[18:48:34] rubycan: i was pretty surprised to read that
[18:48:44] rubycan: but I guess scaling has its challenges...
[18:48:54] wmoxam: I didn't know that node.js is a framework
[18:48:54] rubycan: most pple won't have that issue though
[18:49:03] wmoxam: I thought it was a language runtime :p
[18:49:23] rubycan: yeah nodejs ecosystem seems very fragmented at the moment
[18:49:56] wmoxam: the performance graph is exagerated ...
[18:50:07] terrabl: Could someone help me out in getting this imageNotes Javascript library into my rails project? https://github.com/waynegm/imgNotes
[18:50:21] terrabl: Or point me in the direction of something that can help me
[18:50:31] tbuehlmann: I'm okay with rails for new projects ¯\_(ツ)_/¯
[18:51:27] DTZUBDUB: has joined #RubyOnRails
[18:53:29] glasz_: terrabl: this should help? http://guides.rubyonrails.org/asset_pipeline.html#asset-organization
[18:53:58] glasz_: basically, put vendor assets into vendor/assets folder
[18:54:09] kgrz: has joined #RubyOnRails
[18:54:19] terrabl: How do I link to those then?
[18:54:24] terrabl: does reqquire_tree .
[18:54:28] terrabl: pick those up?
[18:54:34] glasz_: and "require" them as you usually do in your asset manifests
[18:55:17] glasz_: not particularly sure about require_tree. but "require imgNotes" should work.
[18:56:46] glasz_: if you need to link them directly, you'll need to add the file names of the files you need seperately into "config/initializers/assets.rb": Rails.application.config.assets.precompile += ['imgNote.css', 'imgNote.js']
[18:57:20] jstransky: has joined #RubyOnRails
[18:57:48] terrabl: What do you mean link them directly?
[18:58:03] glasz_: <script src="...">
[18:58:10] k3rn31: has joined #RubyOnRails
[18:58:23] ivanskie: has joined #RubyOnRails
[18:58:59] glasz_: <%= javascript_include_tag "imgNotes.js" %>
[18:59:15] wilsonc91: has joined #RubyOnRails
[18:59:19] terrabl: And that would go in my application.html.erb?
[19:00:23] glasz_: sounds about right. but will work anywhere into your html.
[19:00:32] glasz_: *in your html
[19:00:45] sk0r: has joined #RubyOnRails
[19:01:18] terrabl: Is it any different if its a .min.js file because it is unable to find that one
[19:01:50] tjohnson: has joined #RubyOnRails
[19:01:54] glasz_: don't put the minified version into your application. rails will minify files itself.
[19:02:06] DanByc: has joined #RubyOnRails
[19:02:24] terrabl: There isnt an unminified version in the library
[19:02:27] arBmind: has joined #RubyOnRails
[19:02:50] glasz_: sure there is: https://github.com/waynegm/imgNotes/blob/master/dist/imgNotes.js
[19:02:51] whathappens: has joined #RubyOnRails
[19:03:06] arup_r1: has joined #RubyOnRails
[19:03:29] jancel: has joined #RubyOnRails
[19:03:56] terrabl: oh im talkiong about jquery-mousewheel.min.js
[19:04:05] terrabl: It's having trouble finding that file
[19:04:21] glasz_: where did you put it?
[19:04:59] terrabl: I put jquery-mousewheel.min.js in vendor/assets/javascripts
[19:05:19] bitemyap1: has joined #RubyOnRails
[19:05:19] glasz_: how do you reference it?
[19:05:22] \13k: has joined #RubyOnRails
[19:05:29] waseem_: has joined #RubyOnRails
[19:05:40] dcope: has joined #RubyOnRails
[19:05:46] philtr: has joined #RubyOnRails
[19:06:01] jdcauley: has joined #RubyOnRails
[19:06:15] terrabl: <%= javascript_include_tag "jquery-mousewheel.min.js" %> in application.html.erb
[19:06:23] hobodave: has joined #RubyOnRails
[19:07:01] g3funk: has joined #RubyOnRails
[19:07:07] edwinvdg_: has joined #RubyOnRails
[19:07:33] glasz_: i see. try without the .js
[19:07:56] glasz_: did you add jquery-mousewheel.min to the precompile array?
[19:08:12] terrabl: Looks like it still didn't work.
[19:08:21] jenrzzz: has joined #RubyOnRails
[19:08:46] glasz_: have a look into config/initilizeres/assets.rb and add jquery-mousewheel.min to the precompile array.
[19:08:55] glasz_: and restart the server after that
[19:10:06] terrabl: Still couldnt find it
[19:11:49] whathappens: has joined #RubyOnRails
[19:11:55] glasz_: which rails version?
[19:12:16] daveomcd: is there a gem that will let me add a search box to my site that operates like google's search box. What I mean by that is it will suggest searches based on what is already typed in?
[19:12:48] glasz_: terrabl: i'll try with 4.2.6 and post the result
[19:13:17] terrabl: Sounds good. I just need something that will allow for users to post notes or comments on an image
[19:13:52] DanByc: has joined #RubyOnRails
[19:14:02] glasz_: doveomcd: i'd say you'll need to write that code yourself since the wanted behavior depends on data you have somewhere.
[19:15:03] daveomcd: glasz_, thanks
[19:18:52] manfrin: has joined #RubyOnRails
[19:19:15] smathy: has joined #RubyOnRails
[19:21:52] DoctorMonocular: has joined #RubyOnRails
[19:23:33] glasz_: terrabl: please get the non-minified versions of the libraries (https://github.com/jquery/jquery-mousewheel)
[19:24:15] terrabl: Is it the bundle.js or main.js?
[19:24:38] terrabl: nevermind im dumb
[19:25:32] dorje_: has joined #RubyOnRails
[19:26:17] terrabl: Now I'm just getting other errors
[19:26:41] terrabl: $.widget is not a function, Cannot read property 'track' of undefined, and $(...).imgNotes is not a function
[19:26:51] aerook_: has joined #RubyOnRails
[19:28:04] glasz_: terrabl: there you go. https://gist.github.com/glaszig/f33f20d81dbb4736c4aae33e06eafc70
[19:28:59] glasz_: this patch shows you the 3 simple changes made to have a "precompiled" vendor asset served by rails' asset pipeline.
[19:29:37] jstransky: has joined #RubyOnRails
[19:30:44] glasz_: it adds the asset file to the tree, configures rails to compile it (assets.rb) and loads it in the browser from the application layout template.
[19:30:46] siaw23: has joined #RubyOnRails
[19:31:21] terrabl: That wont fix the errors that I have I dont thibkt hough
[19:31:29] terrabl: I just tried it and i still have them
[19:33:49] glasz_: the "$.widget" error? it's missing dependent functionallity. i guess there's other libraries you need to load.
[19:34:31] lxsameer: has joined #RubyOnRails
[19:36:15] urbanmonk: has joined #RubyOnRails
[19:39:03] choke: has joined #RubyOnRails
[19:40:34] mdw7: has joined #RubyOnRails
[19:41:35] shortCircuit__: has joined #RubyOnRails
[19:43:04] David_H_Smith: has joined #RubyOnRails
[19:43:37] shortCircuit__: I had a question regarding rails catching .. I have never implemented one myself ..
[19:43:58] arup_r: has joined #RubyOnRails
[19:44:36] shortCircuit__: I have an autocomplete box .. where it sends requests (ajax) now I want to cache that result for say like 13 seconds ... I did something like this https://github.com/argentum47/location-share-web-app/blob/master/app/controllers/users_controller.rb#L13
[19:44:46] shortCircuit__: but this isn't correct is it?
[19:50:58] SteenJobs: hey guys - any idea where nginx has the code that moves config/nginx.conf’s contents to /etc/nginx/sites-available/?
[19:51:48] k1t: has joined #RubyOnRails
[19:52:04] mikecmpbll: has joined #RubyOnRails
[19:54:49] snowy: has joined #RubyOnRails
[19:54:56] kgrz: has joined #RubyOnRails
[19:54:57] centrx: has joined #RubyOnRails
[19:55:07] allcentu1: has joined #RubyOnRails
[19:55:40] manfrin_: has joined #RubyOnRails
[19:56:08] macsteps: has joined #RubyOnRails
[19:56:50] blackmesa: has joined #RubyOnRails
[19:57:05] truenito: has joined #RubyOnRails
[19:58:04] norc: SteenJobs, I wanted to buy a BMW, so I went to a Toyota shop.
[19:58:09] Malgorath: has joined #RubyOnRails
[19:58:17] mdw: has joined #RubyOnRails
[19:58:21] SteenJobs: i figured it out two seconds ago
[19:58:33] norc: Hope you caught my drift anyway.
[19:58:51] Malgorath: Are there any good books on Engines in Rails? I was looking at http://modular-rails.samurails.com/ and was wondering if anyone else has read it
[19:58:51] eljimmy: has joined #RubyOnRails
[19:58:57] cnk: SteenJobs: so what was copying it?
[19:59:21] SteenJobs: norc: haha i did
[19:59:23] bool_: has joined #RubyOnRails
[19:59:46] cnk: Malgorath: I haven't read that. Looks interesting
[20:00:02] SteenJobs: cnk: there was a symlink in the end…it just wasn’t created in any config files anywhere. it appears that the other dev created it on the server itself…i cd’d into sites-enabled, and ran ls -l
[20:00:08] cnk: for the mecanics of building engines, Valim's book was pretty good
[20:00:12] SteenJobs: cnk: lo and behold, it shows a symlink to config/nginx.conf
[20:00:15] norc: SteenJobs, you see - that is one of the plus points of being a regular slashdot reader. Car analogies everywhere.
[20:00:28] user2356: has joined #RubyOnRails
[20:00:35] SteenJobs: hahah hey man, i would take car analogies over any other analogies any day of the week
[20:00:45] cnk: https://pragprog.com/book/jvrails2/crafting-rails-4-applications
[20:02:21] Talltree: is there a resources for a scope?
[20:02:32] Malgorath: cnk: For someone that is realitvely green in RoR is that a good book to work from? I have R4IA already, though I have not read through it completely TBH
[20:03:08] user2356: I'm having trouble setting up a rails project on Cygwin. I get this No such file or directory error, even though the file exists. http://pastebin.com/fGEaH3mq
[20:03:48] user2356: Ok, then. http://pastie.org/10868374
[20:03:49] mikecmpbll: has joined #RubyOnRails
[20:04:18] arup_r: user2356: !gist is what we recommend
[20:04:18] helpa: user2356: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[20:04:51] cnk: Malgorath: for someone relatively green I wouldn't recommend trying to build everything with engines. It isn't the stock Rails way so you end up needing to know some stuff that isn't immediately obvious
[20:05:24] user2356: Ok, I'll use gist from now on, but does anyone know what's causing this error?
[20:05:40] yellow5: has joined #RubyOnRails
[20:05:53] Malgorath: cnk: Yeah, I probably need to take a weekend and just go the R4ia and finish it so I have a better grasp of RoR
[20:06:15] user2356: I'm wondering why it's looking for a .so file. Normally Windows (Cygwin) uses .dll instead.
[20:06:31] cnk: Malgorath: that's probalbly the best use of your time
[20:08:16] alfiemax: has joined #RubyOnRails
[20:09:10] jancel: has joined #RubyOnRails
[20:09:39] SteenJobs: norc: now that i need to have two separate nginx.conf for prod/staging, what do you think is the best way to do it…http://stackoverflow.com/a/28882274?
[20:09:55] SteenJobs: seems reasonable…just wanna get other perspectives first
[20:10:17] norc: SteenJobs, what difference do you have between staging and production?
[20:11:28] SteenJobs: well some of the directory paths are different because the staging server was set up with root/ because the other dev didn’t create an additional user, while prod is setup with deploy/ (deploy user)
[20:11:29] ur5us: has joined #RubyOnRails
[20:11:32] SteenJobs: also ssl stuff
[20:11:47] SteenJobs: but that’s mostly it
[20:12:14] SteenJobs: i guess you make a good point - alternatively i can just create a new user ‘deploy’ for staging
[20:12:23] k1t: anyone using rails as a backend for push notifications for 100k+ users?
[20:12:38] Talltree: i'm really unsure if this is possible or "normal", i have a model and controller and want to spread the results down to 4 paths, how would i do that correctly? something like localhost:3000/a/1 and localhost/b/2
[20:12:41] k1t: was curious how you set it up if so, been exploring options
[20:12:52] mwlang: k1t: nope. goliath for that. :-)
[20:13:39] k1t: This goliath looks neat
[20:13:46] arup_r: Talltree: I am still trying to understand ur question... spread results to 4 path means?
[20:14:20] arup_r: mwlang: u mean to use `Go` lang ? :)
[20:15:08] mwlang: Did we run out of one letter language names and now making up two-letter names?
[20:15:14] Talltree: arup_r, i'm kinda confused by pathing, i have 1 controller and 1 model currently, 1 field in that model can have 4 different values, and i want to "filter" by it.
[20:16:09] Talltree: the paths to each record should be going to each of those 4 categories
[20:16:13] arup_r: Talltree: can u say real business case that u have
[20:16:17] Talltree: or rather, one of those
[20:16:50] Talltree: a game character is on either europe asia useast or uswest as a realm
[20:17:12] Talltree: so the pathing should be for a character that is on europe something like localhost:3000/europe/1
[20:17:32] glasz_: Talltree: in routes.rb "get ':filter_value/:id' => 'controller#index'". in controller#index: '@result = model.where(field: params[:field_value])'.
[20:18:03] glasz_: @result = Model.find(params[:id]).where(field: params[:field_value])
[20:19:09] Talltree: you can use a params for a path?
[20:19:14] Talltree: i didnt know that
[20:19:29] Talltree: amazing, thank you
[20:19:45] glasz_: @result = Character.find(params[:id]).where(realm: params[:realm]) -- while routes.rb: get ':realm/:id' => 'characters#index'
[20:20:04] blockchan: has joined #RubyOnRails
[20:20:04] mwlang: Talltree: it’s called path segments in the Rails Guide on Routing.
[20:20:58] rodfersou: has joined #RubyOnRails
[20:21:59] Talltree: nwlang: thank you, i've been using scopes -> where stuff in the model ...
[20:21:59] hd1: has joined #RubyOnRails
[20:22:12] Talltree: thats not very DRY tho...
[20:23:15] norc: Talltree, params is just a method.
[20:23:30] norc: Or a call to a method to be precise.
[20:23:39] diegoaguilar: has joined #RubyOnRails
[20:24:24] glasz_: Talltree: scope would work well i think: scope :in_realm, -> (realm) { where realm: realm }
[20:24:24] glasz_: and then Character.find(id).in_realm(params[:realm])
[20:25:06] SteenJobs: ugh, the beauty of currenty being the only dev…i’ve been asked to read up on SEO and figure out what software/service to use for our site
[20:25:33] glasz_: you can solve seo with a software?
[20:25:37] Talltree: i understood that params in rails is something like the interaction or the information i hand over to rails, with the url with a form etc
[20:25:55] Malgorath: Is there a way to create a Rakefile from scratch? when I do rake rails:update:bin I'm warned about no Rakefile(which is not there) my reason for this is I have no bin/rails file to work with.
[20:25:59] Talltree: glasz_, saving that all to look at more closely
[20:26:17] norc: Malgorath, yes. Text editors prove to be a quite useful thing to create text files of any kind with.
[20:26:24] Talltree: long live random txt files on the desktop!
[20:26:33] SteenJobs: like some SaaS or whatnot that does the SEO config for you, or at least creates a mainstream interface. i don’t have the time to devote to learning SEO properly, nor do i have much of an interest really
[20:26:47] SteenJobs: but if anyone has any good resources for devs wanting to learn general SEO can you send them my way?
[20:27:04] Malgorath: norc: omg I never though of that. oh wait I was asking about what needs to be in a Rakefile not how to make them :p
[20:27:12] glasz_: Talltree: http://guides.rubyonrails.org/active_record_querying.html#passing-in-arguments
[20:27:18] norc: Malgorath, getting good answeres requires asking good questions.
[20:27:39] Talltree: glasz_, i know the argument stuff, i mean its working for a list atm, but not for the single records
[20:28:40] jhack: has joined #RubyOnRails
[20:29:19] blockchan: has joined #RubyOnRails
[20:29:19] glasz_: Talltree: scopes append sql WHERE conditions to your query. these work with single records just as fine. you just need enough conditions to to get only one record or query by index.
[20:29:36] truenito: has joined #RubyOnRails
[20:29:48] jhack_: has joined #RubyOnRails
[20:30:00] Talltree: i've been having issues with the correct routes i think
[20:30:09] dblessing: has joined #RubyOnRails
[20:30:52] Talltree: i just used resources till now, and from that to those "query routes" is a bigger jump then expected
[20:31:04] glasz_: steenjobs: i think there cannot be some sort of saas that solves your seo problems. seo is just some pseudo-science - basically just a bunch of good practices you need to apply to your website.
[20:31:48] glasz_: Talltree: yeah. when you diverge from the resource scheme it can get quite fancy ;)
[20:31:50] jstransky: has joined #RubyOnRails
[20:31:51] SteenJobs: ya - i mean except for the part where we have access to free SEO services because of the startup accelerator we’re in…so i was instructed specifically NOT to spend a lot of time reading up on it, but rather learn just enough to use one of these services
[20:33:18] glasz_: i don't know much but i do know that urls are pretty important (to google). have nice urls, no duplicate content.
[20:33:26] chopin: has joined #RubyOnRails
[20:34:48] maesitos: has joined #RubyOnRails
[20:35:23] macsteps: has joined #RubyOnRails
[20:36:01] maesitos: Hi is anybody outside of Spain that can help me out verifiying the output of geocoder just a moment?¿
[20:36:03] jenrzzz: has joined #RubyOnRails
[20:36:03] jenrzzz: has joined #RubyOnRails
[20:36:03] DanByc: hello all
[20:36:27] glasz_: maesitos: germany
[20:37:39] sami: has joined #RubyOnRails
[20:39:41] hd1: has joined #RubyOnRails
[20:43:05] chopin: I'm working with Unicorn for the first time and it's completely hung during boot. Any ideas for what I should check first?
[20:43:39] xploshioon: has joined #RubyOnRails
[20:45:31] agit0: has joined #RubyOnRails
[20:45:42] DanByc: Anyone ever have trouble with RSpec tests not completing because Firefox has an error when you try and run Selenium?
[20:46:02] epochwolf: DanByc: yeah, I've got 47 failures for "binary is missing"
[20:46:24] DanByc: unable to obtain stable firefox connection in 60 seconds (127.0.0.1:7055)
[20:46:27] epochwolf: because some contractor decided to swap out poltergiest for something else.
[20:46:44] DanByc: at least that's not your fault!
[20:46:56] epochwolf: I want to find where he lives and hit him with a rubber mallet.
[20:47:13] glasz_: i would go bonkers if somebody replaced poltergeist, i'm telling you.
[20:47:23] jnoob22: has joined #RubyOnRails
[20:47:29] DanByc: maybe he had a bone to pick with the company
[20:47:35] DanByc: throwing wrenches in the gears
[20:47:51] epochwolf: DanByc: no, he's an intern from one of those boot camps that we are paying $125/hr for.
[20:48:18] epochwolf: I'm like... fuck that, pay me $125/hr and let me work from home and I'll kick ass.
[20:48:23] glasz_: epochwolf: even more so.
[20:48:30] epochwolf: But no. I'm stuck in the office.
[20:48:34] DanByc: wow maybe I should go to a bootcamp
[20:48:51] epochwolf: DanByc: I'm pretty sure they are paying him $30k/yr
[20:48:52] glasz_: epochwolf: how big is your employer? make a case.
[20:49:23] epochwolf: glasz_: I'm the only in house dev and no budget for anything else.
[20:49:26] DanByc: Tim Ferriss wrote a bunch about how to approach working from home tactfully in his book "The 4 Hour Workweek"
[20:49:39] DanByc: You have to manipulate yourself out of the office
[20:49:42] epochwolf: DanByc: I would not call Tim tactful.
[20:50:06] epochwolf: This company doesn't believe in wifi because it's a security risk.
[20:50:18] DanByc: Lmao what isn't tactful about paying 3rd world companies to do your work for you /s
[20:50:19] epochwolf: And email is handled by an IBM mailframe with no support for TLS.
[20:50:35] glasz_: in that case, i'd go and unplug the router.
[20:50:57] epochwolf: glasz_: hey, they are paying me good money and I'm still living in Cincinnati, OH. :)
[20:51:10] epochwolf: And honestly, the office is chill.
[20:51:28] glasz_: it's a privilege not to live in sf or sth like that, imho.
[20:52:01] epochwolf: glasz_: I have something like 30+ people I can call friends and hang out with random days of the week.
[20:52:18] glasz_: that's good i guess
[20:52:22] epochwolf: That's worth more than any job.
[20:52:35] whathappens: has joined #RubyOnRails
[20:52:43] DanByc: I figured out my problem: simple gem update selenium-webdriver did the trick
[20:52:54] epochwolf: DanByc: yup.
[20:52:56] glasz_: well, at facebook or apple you could hang out all day and night with your friendworkers.
[20:52:57] DanByc: wondering why I need to update a gem I just installed though
[20:53:00] glasz_: workerfriends?
[20:53:06] whathapp_: has joined #RubyOnRails
[20:53:07] glasz_: forkerwriends?
[20:53:10] glasz_: whatever.
[20:53:30] epochwolf: glasz_: I'd rather hang out with my mechanic friend. Him and I are replacing the brakes on my truck tonight.
[20:53:51] glasz_: work-life-balance.
[20:54:01] glasz_: i'm gonna miss that as of next month, i guess.
[20:54:54] dblessing: has joined #RubyOnRails
[20:55:40] kgrz: has joined #RubyOnRails
[20:55:55] arup_r: so rails autoloads any files inside app/services/ but, it is not autloading files from subdirectories of services/ . Do I need to add it to auto_load path, I thought it is autloaded
[20:58:09] context: they 'are' if the code is properly namespaced as well
[20:59:11] arup_r: ok, don't know I need to restart the server to look the changes of files under app/services/another_dir
[20:59:31] arup_r: files from app/services/any_files.rb are ok
[21:00:31] glasz_: arup_r: your namespaces need to correspond to the directory structure, context was saying.
[21:00:32] sami: has joined #RubyOnRails
[21:00:35] emachnic_: has joined #RubyOnRails
[21:00:55] arup_r: I got his point.. checking that
[21:02:23] bruce_lee: has joined #RubyOnRails
[21:06:52] jwhite_909: has joined #RubyOnRails
[21:07:16] srinidhi: has joined #RubyOnRails
[21:08:30] sami: has joined #RubyOnRails
[21:08:31] workmad3: has joined #RubyOnRails
[21:11:44] alfiemax: has joined #RubyOnRails
[21:13:04] machty: is it possible in action cable to send back data to a particular connection?
[21:13:25] machty: e.g. i send "gimme x" to a channel action and it sends me "ack", and only sends it to me and no one els
[21:13:43] machty: i can't find the api for doing this that doesn't go through the Channel abstraction
[21:14:05] IFrank00: has joined #RubyOnRails
[21:14:07] IFrank004: has joined #RubyOnRails
[21:14:32] sami: has joined #RubyOnRails
[21:15:50] kdough: has joined #RubyOnRails
[21:16:29] yardenbar: has joined #RubyOnRails
[21:16:59] manfrin: has joined #RubyOnRails
[21:18:01] macsteps: has joined #RubyOnRails
[21:18:36] FCser: has joined #RubyOnRails
[21:20:02] DanByc: Does anyone here know why Firefox keeps refusing my selenium RSpec tests?
[21:20:06] DanByc: Errno::ECONNREFUSED:
[21:20:06] DanByc: Connection refused - connect(2) for "127.0.0.1" port 7055
[21:20:23] DanByc: I'm following the Rails 4 in Action tutorial
[21:20:52] machty: (resolved my actioncable issue: i can use `transmit({ lol: 'wat' })` in my Channel class)
[21:23:37] davidw: has joined #RubyOnRails
[21:28:35] jhack: has joined #RubyOnRails
[21:29:25] cnk: Do you have a server listening on port 7055?
[21:29:39] cnk: DanByc: ^
[21:30:04] cnk: your selenium tests probably expect something else to have spun up the server they are testing against
[21:31:24] dblessing: has joined #RubyOnRails
[21:31:56] zave: has joined #RubyOnRails
[21:34:49] neanderslob: has joined #RubyOnRails
[21:34:59] neanderslob_: has joined #RubyOnRails
[21:35:14] Darmani: Hey guys, I've been trying to build a messaging system for my forum app.
[21:35:15] Darmani: https://gist.github.com/mfifth/c3e9ac3f999c9124ae16b4d0c725e95c
[21:35:19] Darmani: How am I doing so far?
[21:36:16] neanderslob: has joined #RubyOnRails
[21:36:21] FCser: has joined #RubyOnRails
[21:38:41] whathappens: has joined #RubyOnRails
[21:39:57] DanByc: cnk are you saying I need to somehow start my rails server before the test is ran?
[21:40:47] cnk: if you can't see localhost:7055, neither can selenium
[21:41:47] DanByc: hmm. Would that mean I need to change the test to look for :3000?
[21:43:13] davidw: has joined #RubyOnRails
[21:43:43] quazimodo: has joined #RubyOnRails
[21:43:46] choke: has joined #RubyOnRails
[21:44:30] cnk: that's another option
[21:45:22] macsteps: has joined #RubyOnRails
[21:46:55] DanByc: I'm a little confused on how I would set up a server to listen for 7055. I'm following the "Rails 4 in Action" Tutorial, and so far it has been very in-depth. This section shows selenium working without any external configuration like that
[21:48:52] cnk: I don't know. For now, you can do `rails s -p 7055`
[21:49:38] cnk: or find where the test is making the request and set the url to look on port 3000
[21:49:38] whathappens: has joined #RubyOnRails
[21:50:23] diegoviola: has joined #RubyOnRails
[21:50:31] Darmani: what do you think so far? https://gist.github.com/mfifth/c3e9ac3f999c9124ae16b4d0c725e95c
[21:50:50] Ergo: has joined #RubyOnRails
[21:50:54] cnk: Darmani: I'm not a bro
[21:51:13] chouhoulis: has joined #RubyOnRails
[21:51:37] Darmani: cnk: Lol sorry?
[21:51:37] mdw: has joined #RubyOnRails
[21:51:49] cnk: Looks fine to me but I don't know much about your goal
[21:52:35] IFrank004: has joined #RubyOnRails
[21:52:36] IFrank00: has joined #RubyOnRails
[21:52:48] chouhoulis: has joined #RubyOnRails
[21:52:52] Darmani: cnk: Just a simple message system where you can see the message and who sent it.
[21:54:37] dblessing: has joined #RubyOnRails
[21:55:13] cnk: Looks good to me.
[21:55:33] IFrank004: has joined #RubyOnRails
[21:55:34] IFrank00: has joined #RubyOnRails
[21:55:44] cnk: If I was handed that code cold, I would be fine to maintain or extend it
[21:56:23] kgrz: has joined #RubyOnRails
[21:57:31] Darmani: cnk: Thanks! I'm having some issue with it though. The messages aren't relayed to the recipient. When I create a message it gets sent to myself instead of the user I want to send it to.
[21:58:30] cnk: I don't see anything that sends messages
[21:58:39] whathapp_: has joined #RubyOnRails
[21:59:10] cnk: at a guess, you have your models set up so that user.messages is retrieving messages you authored, not once where you are the recipient
[21:59:11] Darmani: cnk: What do you mean?
[21:59:35] cnk: I see nothing that 'relays messages'
[21:59:44] Darmani: cnk: yeah I think that might be what's happening.
[21:59:49] cnk: unless you mean that section in index.html with @user.messages
[22:00:10] cnk: show your models - specifically the relationship parts
[22:00:15] DanByc: awesome cnk thank you!
[22:00:33] dblessing: has joined #RubyOnRails
[22:01:55] Darmani: cnk: https://gist.github.com/mfifth/c3e9ac3f999c9124ae16b4d0c725e95c
[22:02:11] jenrzzz_: has joined #RubyOnRails
[22:02:23] FCser: has joined #RubyOnRails
[22:02:45] cnk: so you can change line 3 to has_many :messages, foreign_key: "recipient_id"
[22:03:01] cnk: and that will make index.html show messages TO you not FROM you
[22:03:31] cnk: you may need to make up 2 relationships - e.g. has_many :sent_messages, foreign_key: "author_id"
[22:03:48] cnk: so that you can get to both - messages from you and messages to you
[22:04:17] Darmani: cnk: So I need to make another migration with another column?
[22:04:28] jancel: has joined #RubyOnRails
[22:05:08] cnk: show messages class
[22:05:21] cnk: oh I see it
[22:05:43] cnk: validates :recipient, presence: true
[22:05:45] solars: has joined #RubyOnRails
[22:06:25] cnk: you probably wnat that named recipient_id - and then add a belongs_to :recipient, class_name: "User" to messages
[22:07:13] cnk: but play with it - I have been doing Django in my day job and they have fighting syntax for when you add _id and when not
[22:07:41] cnk: but you want relatiionships so that you can go from a user to the messages they sent - and to messages they receive
[22:07:54] cnk: and also go from Message to the sender and to the recipiet
[22:08:13] cnk: fire up rails console and play until you can get both ways
[22:08:24] Darmani: cnk: gotcha.
[22:08:31] eljimmy: has joined #RubyOnRails
[22:08:34] Darmani: cnk: thanks for your help captain ^^
[22:09:11] cnk: good job so far - just need a couple more association configs
[22:13:12] dblessing: has joined #RubyOnRails
[22:14:19] jnoob22: has joined #RubyOnRails
[22:14:19] jnoob22: has joined #RubyOnRails
[22:19:27] jenrzzz: has joined #RubyOnRails
[22:25:20] k3rn31: has joined #RubyOnRails
[22:25:48] tgeeky: I think I can safely assume that connection pooling doesn't work in windows, right? no threads, no connection pooling?
[22:27:47] owenjones: has joined #RubyOnRails
[22:28:04] emachnic: has joined #RubyOnRails
[22:29:35] havenwood: tgeeky: Windows has Threads! Maybe you're thinking Process forking?
[22:30:29] tgeeky: havenwood: right! silly me. Yes, I am.
[22:30:46] tgeeky: havenwood: and it has that too, but evidently nobody has recently really tackled the problem (the MSYS2 team is considering doing it again)
[22:30:58] tgeeky: havenwood: but thanks for the correction.
[22:31:03] tgeeky: now back to the original question.
[22:31:23] tgeeky: I want to speed up various tools used to import data to the database, but it takes a good 4-5 seconds every time I start the program to connect to the database
[22:31:51] havenwood: tgeeky: What Rack webserver are you using?
[22:31:52] flashpoint9: has joined #RubyOnRails
[22:32:06] tgeeky: havenwood: in this case, I'm not using any webserver, but right now webbrick.
[22:32:20] havenwood: tgeeky: Try Puma or Thin.
[22:32:21] tgeeky: I am just running shell scripts to migrate data using activerecord alone
[22:32:32] havenwood: tgeeky: Puma uses Threads and Thin is evented.
[22:32:47] tgeeky: although I guess I can calling the whole environment in my shell scripts, so maybe I could do with just calling the relevant parts
[22:32:52] chouhoulis: has joined #RubyOnRails
[22:32:59] chopin: has joined #RubyOnRails
[22:37:28] lightt: has joined #RubyOnRails
[22:39:07] AmiMoench: has joined #RubyOnRails
[22:40:46] manfrin: has joined #RubyOnRails
[22:41:16] DanByc: cnk I found out my problem with the port 7055 was actually an incompatibility between selenium and the newest version of FF. Reinstalled with an older version, it works flawlessly now.
[22:41:32] DanByc: very frustrating, but glad I know now!
[22:41:58] mehwork: has left #RubyOnRails: ()
[22:42:31] blackhuey: has joined #RubyOnRails
[22:44:50] benlieb: has joined #RubyOnRails
[22:44:59] lele: has joined #RubyOnRails
[22:45:52] Rodya_: has joined #RubyOnRails
[22:51:00] IFrank004: has joined #RubyOnRails
[22:51:01] IFrank00: has joined #RubyOnRails
[22:53:51] lele: has joined #RubyOnRails
[22:56:54] adavia: why does [commentable, Comment.new] works and not [commentable, commentable.comments.build]?
[22:57:11] kgrz: has joined #RubyOnRails
[22:58:54] sleungcy: Hi, is assigning an instance variable inside a class method considered bad practice?
[22:59:05] tgeeky: sleungcy: no
[22:59:19] tgeeky: sleungcy: it's the other way around that might be bad
[23:00:21] tgeeky: adavia: because commentable.comments.build requires params?
[23:00:34] tildes_: has joined #RubyOnRails
[23:00:44] lele: has joined #RubyOnRails
[23:00:54] sleungcy: is there anyway i can scan for these bad practice?
[23:00:56] tgeeky: adavia: both should work regardless
[23:01:08] adavia: not really
[23:01:25] tgeeky: sleungcy: you can use rubocop, which will scan for many, many 'bad practices'. Specifically the -lint parts.
[23:01:29] tgeeky: adavia: not really what?
[23:01:43] tgeeky: in general, [a,b] is just an array with the objects a and b.
[23:01:44] adavia: you dont need require params if you are building a form object
[23:01:54] tgeeky: adavia: well post some code brah, we can't see what you see
[23:03:01] tildes_: has joined #RubyOnRails
[23:05:31] IFrank00: has joined #RubyOnRails
[23:05:32] IFrank004: has joined #RubyOnRails
[23:05:33] crova: has joined #RubyOnRails
[23:05:35] jancel: has joined #RubyOnRails
[23:07:14] lele: has joined #RubyOnRails
[23:08:18] crova: greetings everyone ! I got an object "account" which is an json answer like :=> {"code"=>"success", "message"=>"Data retrieved", "data"=>[{"plan_type"=>"CREDIT_REC", "credits"=>384501, "credit_type"=>"Send Limit", "start_date"=>"2016-05-27"}] ### How can I find the value of "credits" for example?
[23:08:39] tgeeky: crova: account.data.credits
[23:09:03] crova: undefined method data
[23:09:36] tgeeky: crova: account.data[0].credits
[23:10:09] crova: tgeeky still the same answer NoMethodError: undefined method `data' for #<Hash:0x00000004d5e4f0>
[23:10:45] crova: i'm getting that answer from an api, not sure if it changes anything
[23:11:11] tgeeky: try pry-ing it open and see, I'd guess
[23:11:43] crdpink: has joined #RubyOnRails
[23:11:52] crova: not sure if I understand what you mean, sorry
[23:12:16] tgeeky: crova: try to find the object you recieve in the irb-replacement pry
[23:12:17] tgeeky: and inspect it
[23:12:49] chopin: has joined #RubyOnRails
[23:13:31] crova: I'll take a look on pry, didn't know it, thanks for the input
[23:13:53] dorje_: has joined #RubyOnRails
[23:13:58] hahuang61: has joined #RubyOnRails
[23:14:49] IFrank004: has joined #RubyOnRails
[23:14:53] kies: has joined #RubyOnRails
[23:14:54] IFrank00: has joined #RubyOnRails
[23:15:23] tgeeky: crova: i found it using pry
[23:15:31] tgeeky: blah['data'][0]['credits']
[23:15:48] tgeeky: that work?
[23:16:47] lele: has joined #RubyOnRails
[23:17:14] jhack: has joined #RubyOnRails
[23:19:20] owenjones: has joined #RubyOnRails
[23:20:15] crova: nice, it works perfectly man
[23:20:51] crova: i will definitely take a look on pry ;) thank you very much
[23:21:18] tgeeky: crova: it's quite nice. you can see where objects and classes get their methods, and browse them like a directory structure
[23:21:26] crova: would you know what the [0] is?
[23:21:38] tgeeky: crova: yeah, it's because "data" is actually a hash inside an array
[23:21:45] tgeeky: "data" => [{...}]
[23:21:58] tgeeky: so assuming the data takes the same shape, it will always be [0]
[23:22:23] crova: I've been messing with ruby and rails for couple of weeks, so i'm still getting to know all of this
[23:23:05] tgeeky: crova: you can access hashes and arrays with [], like [0] or ['data'], but when when you see [ ... ] it's an array, and when you see { ... } it's a hash
[23:23:33] JesseH: has joined #RubyOnRails
[23:23:50] crova: i'll take note of that info, i appreciate man
[23:25:12] refinerysource: has joined #RubyOnRails
[23:26:51] choke: any logical reason fixture_file_upload would constantly tell me the file isn't found? has something to do, i guess with fixture_path not being available in request specs though that's definitely set in my rails_helper.rb
[23:28:12] lightt: has joined #RubyOnRails
[23:28:56] k1t: has joined #RubyOnRails
[23:30:14] crova: tgeeky another one, if you don't mind: let's say i have one array with 4 hashes inside, "data" => [{a,b,c}, {1.2.3}, {e.f.g}, {4.5.6}]
[23:33:21] havenwood: >> {'data' => [{a: 1, b: 2, c: 3}, {1 => :a, 2 => :b, 3 => :ice_cream}]}.dig 'data', 1, 3
[23:33:32] havenwood: #=> :ice_cream
[23:34:05] havenwood: crova: #dig is only available on shiny new Rubies but it's handy
[23:34:47] havenwood: crova: ^ that's the Hash key '`data`' then the Array index `1` and finally the Hash key `3`.
[23:35:20] havenwood: crova: Alternatively you can method chain accessing the Hash, Array then Hash like: another_way['data'][1][3]
[23:35:50] chouhoulis: has joined #RubyOnRails
[23:35:52] GragHarker: has joined #RubyOnRails
[23:36:01] havenwood: crova: An advantage of #dig is that if an intermediate key or index is missing it won't blow up, it'll just return: nil
[23:36:33] crova: thats what i'm getting
[23:36:43] crova: nil, for every suggestion you gave me
[23:36:57] Rodya_: has joined #RubyOnRails
[23:37:06] havenwood: crova: Gist your actual data and what you've tried?
[23:37:56] lightt: has joined #RubyOnRails
[23:39:21] crova: havenwood https://gist.github.com/crova/220e2fca972e605bf31ba5383ea5bfa8
[23:39:54] crova: it would seem that i have #dig, but i have to take a look on that because i'm not familiar
[23:40:30] havenwood: crova: check: info.dig('data', 0).keys
[23:41:05] havenwood: crova: then try one of those keys as a third arg, like: info.dig('data', 0, 'credits')
[23:42:01] crova: thats pretty nice
[23:42:51] crova: but i don't see all of the keys
[23:42:59] dalbusch1t: has joined #RubyOnRails
[23:43:31] crova: ok, i got it
[23:43:51] crova: I appreciate, i'll be digging a lot, thtat's really usefull
[23:45:27] darkxploit: has joined #RubyOnRails
[23:48:24] quazimodo: has joined #RubyOnRails
[23:48:29] yfeldblum: has joined #RubyOnRails
[23:57:55] kgrz: has joined #RubyOnRails
[23:59:32] David_H_Smith: has joined #RubyOnRails
[23:59:55] edwinvdgraaf: has joined #RubyOnRails