« Back to channel list

#RubyOnRails - 25 July 2015

« Back 1 day Forward 1 day »
[00:02:43] [H]unt3r: has joined #RubyOnRails
[00:04:26] vmarcetic: has joined #RubyOnRails
[00:07:53] debajit: smathy: that actually does not work
[00:08:07] debajit: smathy: It gives me a MissingTemplate error
[00:08:26] debajit: smathy: my controller actions simply calls a "render json" and does not have a view
[00:14:03] bruno-: has joined #RubyOnRails
[00:14:26] dopie: has joined #RubyOnRails
[00:15:18] jenrzzz: has joined #RubyOnRails
[00:18:50] qejk: has joined #RubyOnRails
[00:19:27] bruno-: has joined #RubyOnRails
[00:20:38] sarink: has joined #RubyOnRails
[00:22:34] hahuang65: has joined #RubyOnRails
[00:24:13] _utah_: has joined #RubyOnRails
[00:29:25] bronson: has joined #RubyOnRails
[00:30:04] bruno-: has joined #RubyOnRails
[00:30:13] workmad3: has joined #RubyOnRails
[00:30:32] Rubie: has joined #RubyOnRails
[00:31:04] bmurt: has joined #RubyOnRails
[00:32:08] hahuang65: has joined #RubyOnRails
[00:35:58] tuelz: has joined #RubyOnRails
[00:35:59] lemur: has joined #RubyOnRails
[00:36:20] smathy: debajit, !code if you need more help
[00:36:20] helpa: debajit: We cannot help you with your problem if you don't show us your code. Please put it on http://gist.github.com and give us the URL so we can see it.
[00:36:48] _utah_: has joined #RubyOnRails
[00:37:48] debajit: helpa: trying out one more thing. Will send code shortly if that doesn't work
[00:38:16] werelivinginthef: has joined #RubyOnRails
[00:40:31] bruno-: has joined #RubyOnRails
[00:41:53] ascarter: has joined #RubyOnRails
[00:46:12] debajit: smathy: This is what I ended up doing in the end: https://gist.github.com/debajit/40f51f15d82e1b23681e. It works. If you have a better solution, please let me know :)
[00:46:29] debajit: smathy: https://gist.github.com/debajit/40f51f15d82e1b23681e
[00:47:37] centrx: has joined #RubyOnRails
[00:49:18] hahuang65: has joined #RubyOnRails
[00:50:57] bruno-: has joined #RubyOnRails
[00:51:04] icaro: has joined #RubyOnRails
[00:51:08] eGGsha: has joined #RubyOnRails
[00:52:04] shock_one: has joined #RubyOnRails
[00:54:15] EminenceHC: has joined #RubyOnRails
[00:54:48] icaro: has joined #RubyOnRails
[00:56:27] bruno-: has joined #RubyOnRails
[00:58:20] smathy: JBuilder and Serializer have built in caching. Look it up.
[00:58:32] ledestin: has joined #RubyOnRails
[01:00:55] debajit: smathy: Yes, I'm using ActiveModel::Serializer, and I know it has built in caching, but I wasn't able to get it working for some reason. I'll give it another go
[01:01:27] twilling: has joined #RubyOnRails
[01:01:42] drale2k: has joined #RubyOnRails
[01:03:39] smathy: debajit, a protip for next time you ask something in here, ask your real question.
[01:05:34] hahuang65: has joined #RubyOnRails
[01:10:04] ascarter: has joined #RubyOnRails
[01:11:56] allcentury: has joined #RubyOnRails
[01:12:24] bhegel: has joined #RubyOnRails
[01:13:52] towski_: has joined #RubyOnRails
[01:16:09] gambl0re: has joined #RubyOnRails
[01:16:34] chills42: has joined #RubyOnRails
[01:16:55] bruno-: has joined #RubyOnRails
[01:17:22] webguynow: has joined #RubyOnRails
[01:21:18] tyl: has joined #RubyOnRails
[01:22:07] bronson: has joined #RubyOnRails
[01:22:12] bruno-: has joined #RubyOnRails
[01:25:39] stantonnet: has joined #RubyOnRails
[01:26:28] hahuang65: has joined #RubyOnRails
[01:27:37] michael_mbp: has joined #RubyOnRails
[01:30:09] noodman: has joined #RubyOnRails
[01:32:56] Mendenhall: has joined #RubyOnRails
[01:33:48] glenn: has joined #RubyOnRails
[01:35:07] michael_mbp: has joined #RubyOnRails
[01:36:56] lethjakman: has joined #RubyOnRails
[01:36:58] ephantmon: has joined #RubyOnRails
[01:37:37] chouhoulis: has joined #RubyOnRails
[01:38:42] lemur: has joined #RubyOnRails
[01:39:42] wethu: has joined #RubyOnRails
[01:42:20] tuelz: has joined #RubyOnRails
[01:42:54] IceyEC: has joined #RubyOnRails
[01:44:32] Cache_Money: has joined #RubyOnRails
[01:46:21] glenn: has joined #RubyOnRails
[01:49:09] hahuang65: has joined #RubyOnRails
[01:51:56] giowong: has joined #RubyOnRails
[01:53:21] nobitanobi: has joined #RubyOnRails
[02:00:41] tyl: has joined #RubyOnRails
[02:01:10] shanson: has joined #RubyOnRails
[02:01:55] chills42: has joined #RubyOnRails
[02:02:49] drale2k: has joined #RubyOnRails
[02:05:13] chouhoulis: has joined #RubyOnRails
[02:06:14] EminenceHC: has joined #RubyOnRails
[02:13:05] yfeldblum: has joined #RubyOnRails
[02:14:19] luckyruby: has joined #RubyOnRails
[02:15:18] bonhoeffer: has joined #RubyOnRails
[02:16:37] glenn: has joined #RubyOnRails
[02:19:52] glenn: has joined #RubyOnRails
[02:20:03] hahuang65: has joined #RubyOnRails
[02:20:53] workmad3: has joined #RubyOnRails
[02:27:20] chipotle: has joined #RubyOnRails
[02:27:46] lemur: has left #RubyOnRails: ()
[02:29:36] tyl: has joined #RubyOnRails
[02:33:51] Rubie: has joined #RubyOnRails
[02:34:05] gaboesquivel: has joined #RubyOnRails
[02:36:06] pothibo: has joined #RubyOnRails
[02:36:10] willywos: has joined #RubyOnRails
[02:38:15] djbkd: has joined #RubyOnRails
[02:42:39] hahuang65: has joined #RubyOnRails
[02:46:05] bronson: has joined #RubyOnRails
[02:46:17] CanTonic: has joined #RubyOnRails
[02:47:24] yfeldblum: has joined #RubyOnRails
[02:48:11] CanTonic: hello everybody
[02:49:22] IceyEC: has joined #RubyOnRails
[02:51:52] lethjakman: has joined #RubyOnRails
[02:53:31] CanTonic: I am in a small discussion with a colleague and I would like to have your opinion on something. I have a `Role` model with a constant `Role::NAME = %i(:admin, :moderator, :user)` and my colleague changed it to `Role::ROLE_NAMES = {admin: 'admin', moderator: 'moderator', user: 'user' }`.
[02:55:17] CanTonic: In my opinion the first solution is simpler and easier to deal with and I would like to keep it like it is. But my colleague said: "when I see in code something like do_stuff('admin') I can only assume that it's a role name. It's a magic string. When use do_stuff(ROLE_NAME[:admin]) I know exactly what's going on and I don't care how admin role represented actually.". I couldn't find much info about magic string conventions in Ruby
[02:56:44] CanTonic: so therefore I would be very happy about your opinion on it. Should the array of role names be changed into a hash with identical key and value?
[02:57:30] willywos: what if you use used instead a keyword argument?
[02:57:55] Guest18025: has left #RubyOnRails: ()
[02:58:11] michaeldeol: has joined #RubyOnRails
[02:59:09] bonhoeffer: has joined #RubyOnRails
[02:59:11] hahuang65: has joined #RubyOnRails
[02:59:44] silverdust: has joined #RubyOnRails
[03:01:50] duncannz: has joined #RubyOnRails
[03:01:50] PhantomSpank: has joined #RubyOnRails
[03:03:52] drale2k: has joined #RubyOnRails
[03:10:13] braincrash: has joined #RubyOnRails
[03:10:16] Pazician: has joined #RubyOnRails
[03:10:16] Pazician: has joined #RubyOnRails
[03:10:36] fighella: has joined #RubyOnRails
[03:11:39] luckyruby: When using turbolinks, should javascript_include_tag be in <head> or bottom of body?
[03:12:09] luckyruby: nm, should be in head
[03:12:17] luckyruby: https://github.com/rails/turbolinks#evaluating-script-tags
[03:13:46] hahuang65: has joined #RubyOnRails
[03:19:17] CanTonic: willywos: yeah, keyword arguments would be acceptable for me
[03:21:14] CanTonic: luckyruby: considering that turbolinks replaces the body and therefore its own include tag lets me guess that it should go into <head>, but I am not fully sure
[03:21:46] luckyruby: yea, I ended up with <%= javascript_include_tag "application", "data-turbolinks-eval" => false %> at bottom of body
[03:22:01] CanTonic: willywos: but would you agree that the Hash solution is bringing unnecessary complexity?
[03:22:19] chills42: has joined #RubyOnRails
[03:22:23] one_zero: has joined #RubyOnRails
[03:22:27] CanTonic: luckyruby: that works fine? good to know :)
[03:22:41] CanTonic: we have turned turbolinks off so far
[03:22:50] chills42: has joined #RubyOnRails
[03:22:52] willywos: yeah i think so, it's a little easier to understand
[03:24:25] iamse7en: has joined #RubyOnRails
[03:28:59] CanTonic: willywos: thank you :)
[03:30:18] one_zero_k: has joined #RubyOnRails
[03:32:23] dopie: has joined #RubyOnRails
[03:34:39] Peteykun: has joined #RubyOnRails
[03:35:14] Rubie: has joined #RubyOnRails
[03:36:24] baweaver: has joined #RubyOnRails
[03:38:20] nickenchuggets: has joined #RubyOnRails
[03:41:04] hahuang65: has joined #RubyOnRails
[03:41:49] bmurt: has joined #RubyOnRails
[03:43:46] rakm: has joined #RubyOnRails
[03:46:18] one_zero: has joined #RubyOnRails
[03:47:47] tuelz: has joined #RubyOnRails
[03:48:00] chills42: has joined #RubyOnRails
[03:49:23] kies^: has joined #RubyOnRails
[03:52:40] giowong: has joined #RubyOnRails
[03:52:52] bmurt: has joined #RubyOnRails
[03:54:21] RegulationD: has joined #RubyOnRails
[03:55:40] hahuang65: has joined #RubyOnRails
[03:57:58] jobewan: has joined #RubyOnRails
[03:58:39] CheckYourSix: has joined #RubyOnRails
[04:03:41] jonee: has joined #RubyOnRails
[04:04:19] n1lo: has joined #RubyOnRails
[04:04:34] konsolebox: has joined #RubyOnRails
[04:05:00] drale2k: has joined #RubyOnRails
[04:08:39] ncunningham: has joined #RubyOnRails
[04:09:48] workmad3: has joined #RubyOnRails
[04:11:24] chills42: has joined #RubyOnRails
[04:12:47] hahuang65: has joined #RubyOnRails
[04:14:25] wethu: has joined #RubyOnRails
[04:15:59] Peteykun: has left #RubyOnRails: ("Leaving")
[04:18:58] shyshy: has joined #RubyOnRails
[04:19:33] arup_r: has joined #RubyOnRails
[04:20:38] gaboesquivel: has joined #RubyOnRails
[04:21:26] yfeldblum: has joined #RubyOnRails
[04:22:33] drale2k: has joined #RubyOnRails
[04:23:32] yfeldblum: has joined #RubyOnRails
[04:25:36] giowong: has joined #RubyOnRails
[04:26:25] s2013: has joined #RubyOnRails
[04:27:28] hahuang65: has joined #RubyOnRails
[04:28:31] bobbobbins: has joined #RubyOnRails
[04:29:34] bricker: has joined #RubyOnRails
[04:31:01] SteenJobs: has joined #RubyOnRails
[04:31:12] webguynow: has joined #RubyOnRails
[04:31:26] chinmay_dd: has joined #RubyOnRails
[04:39:49] eggoez: has joined #RubyOnRails
[04:47:16] psmolen: has joined #RubyOnRails
[04:49:51] SteenJobs: has joined #RubyOnRails
[04:50:56] baweaver: has joined #RubyOnRails
[04:53:32] lxsameer: has joined #RubyOnRails
[04:53:32] lxsameer: has joined #RubyOnRails
[04:53:39] eggoez: has joined #RubyOnRails
[04:57:00] mary5030: has joined #RubyOnRails
[04:57:44] kies^: has joined #RubyOnRails
[05:01:07] hahuang65: has joined #RubyOnRails
[05:03:52] tuelz: has joined #RubyOnRails
[05:04:08] melonstorm: has joined #RubyOnRails
[05:04:37] riotjones: has joined #RubyOnRails
[05:07:58] sofy_arg: how can i render a partial to display some items in my navbar which is in application.html.erb in <%= render 'layouts/header' %>
[05:14:45] qejk: has joined #RubyOnRails
[05:16:40] hahuang65: has joined #RubyOnRails
[05:17:09] erich: has joined #RubyOnRails
[05:17:42] baweaver: has joined #RubyOnRails
[05:21:57] one_zero: has joined #RubyOnRails
[05:24:41] sameerynho: has joined #RubyOnRails
[05:30:12] sarink: has joined #RubyOnRails
[05:30:31] DoctorMonocular: has joined #RubyOnRails
[05:31:39] hahuang65: has joined #RubyOnRails
[05:33:19] lethjakman: has joined #RubyOnRails
[05:36:36] tejasmanohar: has joined #RubyOnRails
[05:37:37] luckyruby: sofy_arg: what's not working?
[05:38:37] shock_one: has joined #RubyOnRails
[05:42:10] vigasdeep: has joined #RubyOnRails
[05:42:41] sofy_arg: luckyruby: nothing.. im wondering how to do that
[05:42:44] mary5030: has joined #RubyOnRails
[05:42:52] tejasmanohar: has joined #RubyOnRails
[05:43:00] luckyruby: <%= render 'layouts/header' %>
[05:43:00] tejasmanohar: has left #RubyOnRails: ()
[05:43:06] tejasmanohar: has joined #RubyOnRails
[05:43:53] n1lo: has joined #RubyOnRails
[05:46:43] sofy_arg: luckyruby: and the controller to load @items?
[05:47:18] luckyruby: sofy_arg: I can't help you without actual code
[05:51:04] hahuang65: has joined #RubyOnRails
[05:54:26] kham: has joined #RubyOnRails
[05:56:38] GriffinHeart: has joined #RubyOnRails
[05:58:37] jenrzzz: has joined #RubyOnRails
[06:01:46] tvw: has joined #RubyOnRails
[06:02:51] blackhuey: has joined #RubyOnRails
[06:04:42] safeforge: has joined #RubyOnRails
[06:05:23] riotjones: has joined #RubyOnRails
[06:05:44] tejasmanohar: what databases are supported by the --database argument to rails new?
[06:06:04] jenrzzz_: has joined #RubyOnRails
[06:07:39] tejasmanohar: --database=redis?
[06:07:45] sevenseacat: has joined #RubyOnRails
[06:07:50] jonee: has joined #RubyOnRails
[06:08:17] kham: has joined #RubyOnRails
[06:08:59] jenrzzz: has joined #RubyOnRails
[06:09:02] tejasmanohar: moving to #ruby, close question here
[06:09:16] tejasmanohar: nvm, i'll keep this question here its more relevant
[06:09:28] tejasmanohar: `what databases are supported by the --database argument to rails new`
[06:11:25] ephantmon: has joined #RubyOnRails
[06:12:03] sevenseacat: the output of rails new --help will tell you
[06:13:50] earksiinni: has joined #RubyOnRails
[06:14:45] markholmes: has joined #RubyOnRails
[06:18:02] busterarm: has joined #RubyOnRails
[06:19:14] hahuang65: has joined #RubyOnRails
[06:21:00] jenrzzz: has joined #RubyOnRails
[06:21:16] PotatoChipz: has joined #RubyOnRails
[06:21:49] PotatoChipz: Hello!!! Is it possible for associated model to be updated after destroying the other model?
[06:22:50] doge__: updated how?
[06:23:34] PotatoChipz: Say, ModelB has_one ModelA record.... ModelA record is deleted... I want ModelB's status field to be updated....
[06:23:46] Rubie: has joined #RubyOnRails
[06:24:02] PotatoChipz: In short, I don't want it to be destroyed...rather I just want it to update one of its field.
[06:24:43] tejasmanohar: options: mysql/oracle/postgresql/sqlite3/frontbase/ibm_db/sqlserver/jdbcmysql/jdbcsqlite3/jdbcpostgresql/jdbc
[06:24:45] tejasmanohar: thanks, sevenseacat
[06:25:01] PotatoChipz: I'm thinking....maybe I should use callbacks? But maybe there's another way.
[06:25:10] Trynemjoel: has joined #RubyOnRails
[06:26:03] busterarm: you're deleting modela through a controller action, yeah?
[06:26:51] PotatoChipz: I'm deleting ModelA record through controller -- yup
[06:27:26] busterarm: yeah I'd probably put a call to a function in there that updates modelb through the deletion when modela is successfully destroyed
[06:28:03] busterarm: i think there's also before_destroy
[06:28:19] busterarm: but you want to avoid the callback
[06:29:12] doge__: there is after_destroy also
[06:30:38] PotatoChipz: Welp. If I use after_destroy or before_destroy, and ModelA is not the only model that has ModelB... I should also do the checking there? Like if it modelB then update, otherwise do nothing...
[06:30:47] busterarm: if you have autosave set true on the relation and you change the status field on the associated model then it will save the object automatically upon destroy
[06:31:53] PotatoChipz: Hmmmm autosave true... perhaps I should explore that
[06:32:03] busterarm: http://api.rubyonrails.org/classes/ActiveRecord/AutosaveAssociation.html
[06:33:17] hololeap: has joined #RubyOnRails
[06:34:04] PotatoChipz: Wait I did not get it haha. If I destroy the parent model, what happens to the associated model if I set it to autosave=true ?
[06:34:05] kham: has joined #RubyOnRails
[06:35:03] busterarm: it will save the associated model record with whatever rails has its values set to
[06:35:09] srinidhi: has joined #RubyOnRails
[06:37:58] PotatoChipz: busterarm "with whatever rails has its values set to"--can you tell me more about this?
[06:38:30] busterarm: well if you pulled the other model, you would still have to explicitly call save on it
[06:38:30] safeforge: has joined #RubyOnRails
[06:38:38] busterarm: that's all it saves you really
[06:39:12] busterarm: i can't see why to not just change the field through the association in your destroy controller action
[06:39:33] hahuang65: has joined #RubyOnRails
[06:40:01] tyl: has joined #RubyOnRails
[06:40:03] busterarm: @modelbinstance.modelaassociation.status =
[06:40:29] PotatoChipz: Ah well I'm trying a generic approach because several models are gonna do this. I don't want to do it all over my destroy action several times again
[06:41:42] jenrzzz: has joined #RubyOnRails
[06:41:46] busterarm: do you want to do it on all models associated with modelb?
[06:42:16] busterarm: use reflections
[06:43:09] Pazician: has joined #RubyOnRails
[06:43:18] GriffinHeart: has joined #RubyOnRails
[06:43:39] busterarm: you can get a hash or array of all associated models and just loop through them and make the change (if they're all the same column name you're changing)
[06:45:56] PotatoChipz: busterarm you mean through a callback right? I believe this can happen through a callback
[06:46:24] busterarm: well, you can call it in your destroy action
[06:47:30] GnuYawk: has joined #RubyOnRails
[06:47:30] GnuYawk: has joined #RubyOnRails
[06:47:57] PotatoChipz: Alright. Thanks!
[06:48:12] busterarm: i PMed you an example that I think should work but you should test it
[06:48:52] fighella: has joined #RubyOnRails
[06:48:54] busterarm: you can also limit the reflections to the specific type of association you want returned if you need that kind of granularity
[06:53:27] mary5030: has joined #RubyOnRails
[06:57:00] earksiinni: has joined #RubyOnRails
[07:04:36] tuelz: has joined #RubyOnRails
[07:06:24] Gnut: has joined #RubyOnRails
[07:07:14] Tinyyy: has joined #RubyOnRails
[07:07:57] mostlybadfly: has joined #RubyOnRails
[07:08:29] jonee: has joined #RubyOnRails
[07:11:09] Sylario: has joined #RubyOnRails
[07:12:04] darutoko: has joined #RubyOnRails
[07:13:44] hahuang65: has joined #RubyOnRails
[07:18:27] sarink: has joined #RubyOnRails
[07:19:08] Kilo`byte: has joined #RubyOnRails
[07:19:41] tejasmanohar: trying to decide what solution to use for jobs in rails
[07:20:04] tejasmanohar: a) if i have a job that needs to run every X minutes/hours, seems that `whenever` or `clockwork` would be ideal?
[07:21:10] EminenceHC: has joined #RubyOnRails
[07:22:15] GriffinHeart: has joined #RubyOnRails
[07:23:55] tejasmanohar: b) what if i have an array of items and i want to run X on item 1 and then give an Y minute gap and then run X on item 2 etc etc looping thru it
[07:24:15] tejasmanohar: the breaks are due to rate-limits
[07:24:42] tejasmanohar: should i just run one process that does that or setup job queues w/ sidekiq, resque, delayedjob, etc.? and how do i decide?
[07:26:58] sinkensabe: has joined #RubyOnRails
[07:27:30] jenrzzz: has joined #RubyOnRails
[07:27:31] Aeyrix: Hey does anyone here know about partial indexing with activerecord?
[07:28:44] hahuang65: has joined #RubyOnRails
[07:30:23] chinmay_dd: has joined #RubyOnRails
[07:33:52] jenrzzz_: has joined #RubyOnRails
[07:35:43] kh0d: has joined #RubyOnRails
[07:36:17] PhantomSpank: has joined #RubyOnRails
[07:36:43] nertzy: has joined #RubyOnRails
[07:36:51] brendan-: has joined #RubyOnRails
[07:38:35] Peteykun: has joined #RubyOnRails
[07:40:28] mikecmpbll: has joined #RubyOnRails
[07:42:34] fighella: has joined #RubyOnRails
[07:43:58] PotatoChipz: How can I get all the models that use a specific concern?
[07:45:28] sinkensabe: has joined #RubyOnRails
[07:46:59] naftilos76: has joined #RubyOnRails
[07:47:12] workmad3: has joined #RubyOnRails
[07:47:43] luckyruby: tejasmanohar: I usually use cron + rake task
[07:47:44] naftilos76: Hi, can anybody suggest a text editor with integrated terminal and file browsing for dev ror?
[07:49:08] luckyruby: naftilos76: what os?
[07:49:12] bin_005: has joined #RubyOnRails
[07:49:33] busterarm: you can do both through plugins for Sublime Text
[07:49:40] busterarm: but not everyone likes using Glue
[07:52:12] naftilos76: luckyruby, ubuntu 15.04 . I used kate in kde but i do not like installing half kde as dependencies :-)
[07:52:59] luckyruby: maybe vim with nerdtree
[07:53:20] naftilos76: I would prefer something with a GUI, sorry
[07:53:38] naftilos76: Isn't there anything like kate in gtk?
[07:54:20] luckyruby: maybe atom.io
[07:54:49] luckyruby: https://atom.io/packages/atom-terminal
[07:55:13] busterarm: very similar to sublime :)
[07:55:24] busterarm: open source but slower and crashes more
[07:55:41] RegulationD: has joined #RubyOnRails
[07:55:43] user1138: has joined #RubyOnRails
[07:58:09] dideler: has joined #RubyOnRails
[07:58:54] Olumayowa: has joined #RubyOnRails
[07:59:01] hahuang65: has joined #RubyOnRails
[07:59:08] Lightsword: has joined #RubyOnRails
[07:59:22] naftilos76: I am installing kate. Thanks guys
[08:03:51] eGGsha: has joined #RubyOnRails
[08:04:08] busterarm: has joined #RubyOnRails
[08:04:52] busterarm: has joined #RubyOnRails
[08:07:18] Mendenhall: has joined #RubyOnRails
[08:08:22] GriffinHeart: has joined #RubyOnRails
[08:09:45] kh0d: has joined #RubyOnRails
[08:11:42] busterarm: has joined #RubyOnRails
[08:13:01] dented42: has joined #RubyOnRails
[08:17:03] hahuang65: has joined #RubyOnRails
[08:17:07] busterarm: has joined #RubyOnRails
[08:17:20] bruno-: has joined #RubyOnRails
[08:22:45] bruno-: has joined #RubyOnRails
[08:27:27] Lightsword: has joined #RubyOnRails
[08:30:30] nofxx: has joined #RubyOnRails
[08:31:13] nofxx: there was gem that provides a kind of 'stats bar' in the bottom of the page, DB time, rendering time etc
[08:31:19] nofxx: anyone remember the name ?
[08:31:37] nofxx: could swear it was in github explore dev stuff
[08:31:51] hahuang65: has joined #RubyOnRails
[08:32:59] bruno-: has joined #RubyOnRails
[08:34:54] Tinyyy: has joined #RubyOnRails
[08:35:19] bradleyprice: has joined #RubyOnRails
[08:39:06] TomasAchmedovas: has joined #RubyOnRails
[08:40:45] AzaToth: has joined #RubyOnRails
[08:41:01] roolo: has joined #RubyOnRails
[08:42:10] elia: has joined #RubyOnRails
[08:42:46] markelite: has joined #RubyOnRails
[08:43:07] eGGsha: has joined #RubyOnRails
[08:45:25] shinnya: has joined #RubyOnRails
[08:48:30] TomasAchmedovas: has joined #RubyOnRails
[08:49:03] marr: has joined #RubyOnRails
[08:52:02] silverdust: I created a foreign key https://gist.github.com/bl4ckdu5t/df67df2d9893464e2bb4 and yet it tries to find notification.user_id when deleting based on dependent destroy
[08:52:07] The_Phoenix: has joined #RubyOnRails
[08:52:19] silverdust: What have I got wrong there?
[08:52:37] silverdust: shouldn't it look for notification.receiver_id instead ?
[08:56:53] busterarm: has joined #RubyOnRails
[08:57:01] krz: has joined #RubyOnRails
[08:57:02] lxsameer: has joined #RubyOnRails
[08:57:22] tjbiddle: has joined #RubyOnRails
[08:58:22] silverdust: I get PG::UndefinedColumn: ERROR: column notifications.user_id does not exist LINE 1: ...LECT "notifications".* FROM "notifications" WHERE "notificat... ^ : SELECT "notifications".* FROM "notifications" WHERE "notifications"."user_id" = $1
[09:00:11] busterarm: has joined #RubyOnRails
[09:02:44] hahuang65: has joined #RubyOnRails
[09:04:35] The_Phoenix1: has joined #RubyOnRails
[09:05:22] tuelz: has joined #RubyOnRails
[09:06:32] sarink: has joined #RubyOnRails
[09:07:09] lxsndl: has joined #RubyOnRails
[09:08:22] PhantomSpank: has joined #RubyOnRails
[09:09:14] cornerma1: has joined #RubyOnRails
[09:15:28] hahuang65: has joined #RubyOnRails
[09:16:21] DLSteve: has joined #RubyOnRails
[09:21:40] bmalum: has joined #RubyOnRails
[09:25:55] Dbugger: has joined #RubyOnRails
[09:27:56] TomasAchmedovas: has joined #RubyOnRails
[09:28:05] strcmp1: has joined #RubyOnRails
[09:29:58] hahuang65: has joined #RubyOnRails
[09:33:00] cac: has joined #RubyOnRails
[09:34:55] fighella: has joined #RubyOnRails
[09:35:32] cac: has joined #RubyOnRails
[09:35:53] workmad3: has joined #RubyOnRails
[09:35:57] joelataylor: has joined #RubyOnRails
[09:40:36] robbyoconnor: has joined #RubyOnRails
[09:43:45] zpe: has joined #RubyOnRails
[09:44:39] user1138: has joined #RubyOnRails
[09:45:21] stamina: has joined #RubyOnRails
[09:54:55] Trynemjoel: has joined #RubyOnRails
[09:55:37] ktchup: has joined #RubyOnRails
[09:55:48] Lightsword: has joined #RubyOnRails
[09:57:10] hahuang65: has joined #RubyOnRails
[09:59:49] Rubie: has joined #RubyOnRails
[10:01:12] FernandoBasso: has joined #RubyOnRails
[10:03:52] one_zero_p: has joined #RubyOnRails
[10:05:05] dell_some1: has joined #RubyOnRails
[10:05:40] kh0d: has joined #RubyOnRails
[10:05:54] porkchicharon: has joined #RubyOnRails
[10:06:05] romdi: has joined #RubyOnRails
[10:07:13] shock_one: has joined #RubyOnRails
[10:10:25] Trynemjoel: has joined #RubyOnRails
[10:13:31] dell_some1: has left #RubyOnRails: ("Ex-Chat")
[10:13:43] dell_some1: has joined #RubyOnRails
[10:14:41] dell_some1: has left #RubyOnRails: ("Ex-Chat")
[10:14:59] dell_some1: has joined #RubyOnRails
[10:15:22] dell_some1: testing ping
[10:17:38] Lightsword: has joined #RubyOnRails
[10:18:02] jonee: has joined #RubyOnRails
[10:18:09] porkchicharon: has left #RubyOnRails: ()
[10:20:06] Hobogrammer_: has joined #RubyOnRails
[10:21:06] tuelz: has joined #RubyOnRails
[10:25:08] michael_mbp: has joined #RubyOnRails
[10:27:14] Pazician: has joined #RubyOnRails
[10:27:14] Pazician: has joined #RubyOnRails
[10:27:33] ledestin: has joined #RubyOnRails
[10:28:55] cac: has joined #RubyOnRails
[10:33:51] vickleton: has joined #RubyOnRails
[10:35:56] hahuang65: has joined #RubyOnRails
[10:39:01] joelataylor: has joined #RubyOnRails
[10:40:07] jonee: has joined #RubyOnRails
[10:41:28] Trynemjoel: has joined #RubyOnRails
[10:48:20] DEA7TH: has joined #RubyOnRails
[10:54:17] hahuang65: has joined #RubyOnRails
[10:54:38] sarink: has joined #RubyOnRails
[10:57:14] Lightsword: has joined #RubyOnRails
[10:59:20] sarink: has joined #RubyOnRails
[11:00:35] chr5: has joined #RubyOnRails
[11:01:59] Trynemjoel: has joined #RubyOnRails
[11:03:41] jonee: has joined #RubyOnRails
[11:04:54] kh0d: has joined #RubyOnRails
[11:09:56] darutoko: has joined #RubyOnRails
[11:10:30] Trynemjoel: has joined #RubyOnRails
[11:11:23] arup_r: has joined #RubyOnRails
[11:11:35] hahuang65: has joined #RubyOnRails
[11:14:12] cac: has joined #RubyOnRails
[11:17:16] sarink: has joined #RubyOnRails
[11:17:32] ktchup: has joined #RubyOnRails
[11:18:32] TomasAchmedovas: has joined #RubyOnRails
[11:19:05] Pazician: has joined #RubyOnRails
[11:22:38] poli: has joined #RubyOnRails
[11:23:57] ktchup: has joined #RubyOnRails
[11:24:20] jonee: has joined #RubyOnRails
[11:24:39] workmad3: has joined #RubyOnRails
[11:31:34] rctneil: has joined #RubyOnRails
[11:32:22] aditya432: has joined #RubyOnRails
[11:34:09] sonali: has joined #RubyOnRails
[11:35:14] hahuang65: has joined #RubyOnRails
[11:35:19] rctneil: has joined #RubyOnRails
[11:36:52] tuelz: has joined #RubyOnRails
[11:36:57] sonali: has left #RubyOnRails: ()
[11:37:14] rctneil: has left #RubyOnRails: ()
[11:37:26] shock_one: has joined #RubyOnRails
[11:37:39] sg19: has joined #RubyOnRails
[11:37:41] rctneil: has joined #RubyOnRails
[11:40:36] sg19: Hi! I want to know if something like this is possible in rails routes: www.localhost:3000/:city/:business-:businesstype e.g. localhost:3000/newyork/school-private
[11:40:42] iateadonut: has joined #RubyOnRails
[11:41:01] iateadonut: from the irb shell is there a way i can reload the application or do i have to exit and restart the console when i make a change?
[11:42:25] RegulationD: has joined #RubyOnRails
[11:46:21] apeiros: iateadonut: I already told you the answer on #ruby
[11:46:48] tyl: has joined #RubyOnRails
[11:47:17] sg19: apeiros: do you have any clue to my question?
[11:47:38] apeiros: sg19: did you try it?
[11:47:46] helpa: Do not beg / plead with people to help you. This includes asking questions like "Any ideas?" after posting your original question.
[11:48:26] drale2k: has joined #RubyOnRails
[11:48:40] sg19: apeiros: yes but it didnt work. It just takes as :business parameter
[11:49:19] apeiros: well, no idea then either. I'd have to go and read the routing guide myself for that.
[11:49:34] apeiros: alternatively just process a :business_and_type param in your controller
[11:49:47] bronson: has joined #RubyOnRails
[11:50:07] KamalKaur: has joined #RubyOnRails
[11:52:46] ktchup: has joined #RubyOnRails
[11:53:16] drale2k: has joined #RubyOnRails
[11:54:41] apeiros: I'm tempted to enumerate !rule1 to 99 now :D
[11:55:04] iateadonut: i got this answer in #ruby: (08:33:59 PM) jhass: iateadonut: http://stackoverflow.com/a/10467597/2199687, and also the answer 'reload!'
[11:55:30] ledestin: has joined #RubyOnRails
[11:55:41] jhass: apeiros: /topic ;D
[11:56:03] apeiros: jhass: I actually know. doesn't make it less tempting :-p
[11:57:00] apeiros: iateadonut: re that SO answer: IMO just add 'pry-rails' to your gemfile and forget IRB exists.
[11:57:14] apeiros: (pry is an IRB replacement, IRB is what rails console is built on)
[11:57:31] chr5: hi Rails friends
[11:57:37] busterarm: has joined #RubyOnRails
[11:57:40] chr5: I am new in this channel
[11:58:38] naftilos76: has joined #RubyOnRails
[11:59:16] hahuang65: has joined #RubyOnRails
[11:59:44] chr5: I am graphic designer, and i learn web develop with rails
[12:00:08] chr5: i am developing my own project about a graphic designer community
[12:00:35] chr5: I need a persona that helps to finish this community app
[12:00:40] chr5: anybody interested?
[12:01:12] kh0d: has joined #RubyOnRails
[12:05:21] poli: has joined #RubyOnRails
[12:05:23] user1138: has joined #RubyOnRails
[12:05:47] carlos_: has joined #RubyOnRails
[12:10:45] iamse7en: has joined #RubyOnRails
[12:11:30] mary5030: has joined #RubyOnRails
[12:12:09] safeforge: has joined #RubyOnRails
[12:18:06] iateadonut: i was just about to do all the coding for you, chr5
[12:19:12] iateadonut: apeiros, there is no 'reload!' in pry - it just reloads all the time for you?
[12:19:13] busterarm: i already did it
[12:19:19] mary5030: has joined #RubyOnRails
[12:19:36] apeiros: iateadonut: reload! is rails console only
[12:19:58] apeiros: and even with pry-rails, you still start the rails console with `rails c` (or `rails console`)
[12:20:49] hahuang65: has joined #RubyOnRails
[12:20:51] Guest71556: has joined #RubyOnRails
[12:21:43] ktchup: has joined #RubyOnRails
[12:25:17] carlos__: has joined #RubyOnRails
[12:32:51] IceyEC: has joined #RubyOnRails
[12:33:51] gheegh: has joined #RubyOnRails
[12:33:55] mostlybadfly: has joined #RubyOnRails
[12:36:49] jottr: has joined #RubyOnRails
[12:37:37] tuelz: has joined #RubyOnRails
[12:37:38] kham: has joined #RubyOnRails
[12:38:03] davidheward_: has joined #RubyOnRails
[12:39:47] carlos__: rails developers around here?
[12:40:13] bruno-: has joined #RubyOnRails
[12:41:45] jottr_: has joined #RubyOnRails
[12:41:50] busterarm: like, rails core devs?
[12:42:39] jonee: has joined #RubyOnRails
[12:42:43] pontiki: morning channel
[12:42:50] iateadonut: i used rails g to generate a migration, and it doesn't look like it generated a model; should i just make a model myself, or is there a reason to do 'rail g model table'?
[12:43:29] sevenseacat: generating a plain migration wont generate a model for you
[12:43:35] sevenseacat: you probably want the model generator for that
[12:43:41] pontiki: iateadonut: you coulud just write the model bit yourself, though
[12:44:00] iateadonut: i mean to say, i have a migration for 'table' but not a model. won't rail g model also try to generate a new migration?
[12:44:08] pontiki: it will, yes
[12:44:14] sevenseacat: easy way to find out.
[12:44:28] pontiki: you definitely don't want two migrations, tho
[12:44:30] iateadonut: does it create any other files i need?
[12:44:41] iateadonut: or put something in autoload or something?
[12:44:56] busterarm: if you use the scaffolds you can do that, but generally you don't want to
[12:45:36] bruno-: has joined #RubyOnRails
[12:46:15] sevenseacat: if you're asking questions on this level, I definitely wouldnt recommend using scaffolds.
[12:47:08] gerep: has joined #RubyOnRails
[12:47:19] pontiki: OTOH, if you don't actually know what generates what, time to fire up a new rails app and try them all out
[12:47:27] sevenseacat: +1 to experimentation
[12:47:46] sevenseacat: its much more beneficial to try something out and see what it does, instead of just asking about it
[12:47:46] IceyEC: has joined #RubyOnRails
[12:48:45] busterarm: then we'd have like 5% of the questions
[12:49:17] pontiki: and we could talk about the footie
[12:49:53] nalley: has joined #RubyOnRails
[12:50:56] bruno-: has joined #RubyOnRails
[12:51:04] zuQe8: has joined #RubyOnRails
[12:51:35] hahuang65: has joined #RubyOnRails
[12:51:42] krz: has joined #RubyOnRails
[12:54:02] iateadonut: yeah, you're right.
[12:54:24] iateadonut: i haven't even initiated a git repo on this, so it'd be hard to tell what files were modified.
[12:54:30] antlong: has joined #RubyOnRails
[12:54:30] iateadonut: of course that takes all of 25 seconds.
[12:54:38] antlong: whats the best way to pull data out of librato for processing locally?
[12:55:43] iateadonut: ah... so it also creates tests for you. ruby's saying, "hint hint..."
[12:55:51] iateadonut: or test files anyway.
[12:55:52] sevenseacat: iateadonut: well it tells you what files its modifying when you run them :)
[12:55:55] sevenseacat: them being the generators
[12:56:26] iateadonut: is it common practice to put a blank line between blocks of code within a method?
[12:56:49] iateadonut: like if you have an if statement, would you put a blank line before and after it?
[12:56:49] sevenseacat: sure, when appropriate. everyone's tastes are different.
[12:57:38] pontiki: unless it's the entire body of the method, then no
[12:58:14] pontiki: or if it just doesn't look good to me at that point
[12:58:34] gerep: I have an this enum: enum description: [ :seller, :buyer ], using a check_box, how can I set it? I'm receiving description=>"1" from the form but I get the error message: '1' is not a valid description
[12:58:38] gerep: https://gist.github.com/anonymous/1eeaaf51c3f1bc76bcbe
[12:59:20] sevenseacat: you can set it by using either :seller or :buyer, not '1'
[13:00:15] kham: has joined #RubyOnRails
[13:02:29] pontiki: i've not used enums in forms, it's an interesting question
[13:02:50] jottr_: has joined #RubyOnRails
[13:03:29] Rubie: has joined #RubyOnRails
[13:04:01] gerep: sevenseacat, I'll do that, thanks :)
[13:04:15] gerep: sevenseacat, it was so obvious and I missed that ahahahaha
[13:05:41] pontiki: check_box doesn't seem like the right way to use it, though
[13:06:15] sevenseacat: indeed. check boxes are for multiple values.
[13:09:14] carlosd: has joined #RubyOnRails
[13:10:35] DaniG2k: has joined #RubyOnRails
[13:12:07] DaniG2k: does anyone know how to call a given model's before_save trigger from a gem?
[13:12:12] krz: has joined #RubyOnRails
[13:12:24] DaniG2k: I'm extending the model with ActiveRecordExtension
[13:12:41] DaniG2k: but I'm not sure how I'd intercept the before_save for any given model from my gem
[13:13:32] workmad3: has joined #RubyOnRails
[13:17:03] mikecmpb_: has joined #RubyOnRails
[13:18:05] bustrarm: has joined #RubyOnRails
[13:20:11] PhantomS_: has joined #RubyOnRails
[13:21:59] silverdust: has joined #RubyOnRails
[13:22:15] kham: has joined #RubyOnRails
[13:22:23] pipework: has joined #RubyOnRails
[13:23:09] hahuang65: has joined #RubyOnRails
[13:23:23] zpe: has joined #RubyOnRails
[13:24:16] merryfett: has joined #RubyOnRails
[13:24:19] shyshy: has joined #RubyOnRails
[13:24:26] zpe: has joined #RubyOnRails
[13:27:44] iamse7en: anyone pretty familiar with regex that could help me? I'm trying to have result accept .5 as well. http://rubular.com/r/77CbjRMZ2W
[13:28:39] Trynemjoel: has joined #RubyOnRails
[13:29:14] shyshy: has joined #RubyOnRails
[13:29:18] jhass: iamse7en: \d* ?
[13:29:39] iamse7en: thank you jhass. worked brilliantly!
[13:29:53] shock_one: has joined #RubyOnRails
[13:29:55] mary5030: has joined #RubyOnRails
[13:31:15] DaniG2k: has joined #RubyOnRails
[13:31:19] WillAmes: has joined #RubyOnRails
[13:31:23] erich: has joined #RubyOnRails
[13:31:47] DEA7TH: has joined #RubyOnRails
[13:31:54] DaniG2k: hello all, does anyone know how I can save the data from a model to a database from within a gem?
[13:32:05] ktchup: has joined #RubyOnRails
[13:32:06] DaniG2k: I'm intercepting the save method with ActiveSupport::Concern
[13:32:20] DaniG2k: using a before_save interceptor
[13:32:47] DaniG2k: and from here I'd like to add some data to a database in a certain format
[13:32:48] bradleyprice: has joined #RubyOnRails
[13:33:12] victortyau: has joined #RubyOnRails
[13:33:38] wethu: has joined #RubyOnRails
[13:33:45] wethu: has joined #RubyOnRails
[13:34:23] nettoweb: has joined #RubyOnRails
[13:36:47] bmalum: has joined #RubyOnRails
[13:37:20] shyshy: has joined #RubyOnRails
[13:38:21] tuelz: has joined #RubyOnRails
[13:38:46] jottr: has joined #RubyOnRails
[13:39:37] FernandoBasso: has joined #RubyOnRails
[13:39:46] sankaber: has joined #RubyOnRails
[13:41:23] balr0g: has joined #RubyOnRails
[13:42:46] drale2k: has joined #RubyOnRails
[13:45:23] hahuang65: has joined #RubyOnRails
[13:52:32] bonhoeffer: has joined #RubyOnRails
[13:58:23] bmurt: has joined #RubyOnRails
[13:59:42] Trynemjoel: has joined #RubyOnRails
[14:01:49] TomasAchmedovas: has joined #RubyOnRails
[14:02:36] jonee: has joined #RubyOnRails
[14:04:45] Rubie: has joined #RubyOnRails
[14:14:07] hahuang65: has joined #RubyOnRails
[14:19:05] twilling: has joined #RubyOnRails
[14:19:42] Pazician: has joined #RubyOnRails
[14:21:16] ktchup: has joined #RubyOnRails
[14:25:03] zpe: has joined #RubyOnRails
[14:26:23] JeramyRR: has joined #RubyOnRails
[14:29:17] nobitanobi: has joined #RubyOnRails
[14:31:08] gambl0re: has joined #RubyOnRails
[14:32:26] centrx: has joined #RubyOnRails
[14:32:35] charliesome: has joined #RubyOnRails
[14:34:50] bmurt: has joined #RubyOnRails
[14:35:02] hahuang65: has joined #RubyOnRails
[14:35:43] Trynemjoel: has joined #RubyOnRails
[14:35:50] artto: has joined #RubyOnRails
[14:39:24] tuelz: has joined #RubyOnRails
[14:41:36] DLSteve: has joined #RubyOnRails
[14:46:09] drale2k: has joined #RubyOnRails
[14:54:57] doodlehaus: has joined #RubyOnRails
[14:57:37] gaboesquivel: has joined #RubyOnRails
[14:57:45] arBmind: has joined #RubyOnRails
[14:58:06] artto: has joined #RubyOnRails
[14:58:24] Mendenhall: has joined #RubyOnRails
[14:58:44] uranther: has joined #RubyOnRails
[14:58:55] RegulationD: has joined #RubyOnRails
[15:01:01] hahuang65: has joined #RubyOnRails
[15:02:03] nickenchuggets: has joined #RubyOnRails
[15:02:13] workmad3: has joined #RubyOnRails
[15:03:45] shock_one: has joined #RubyOnRails
[15:06:40] ktchup: has joined #RubyOnRails
[15:07:09] shinnya: has joined #RubyOnRails
[15:12:13] n1lo: has joined #RubyOnRails
[15:13:00] mary5030: has joined #RubyOnRails
[15:14:29] microspino: has joined #RubyOnRails
[15:14:54] busterarm: has joined #RubyOnRails
[15:17:22] busterarm: has joined #RubyOnRails
[15:19:09] davidheward_: has joined #RubyOnRails
[15:19:33] mary5030: has joined #RubyOnRails
[15:19:36] jottr: has joined #RubyOnRails
[15:19:42] FernandoBasso: has joined #RubyOnRails
[15:21:27] hahuang65: has joined #RubyOnRails
[15:21:47] chipotle: has joined #RubyOnRails
[15:23:29] carlosd: has joined #RubyOnRails
[15:24:19] bmurt: has joined #RubyOnRails
[15:27:13] shock_one: has joined #RubyOnRails
[15:31:49] erich: has joined #RubyOnRails
[15:33:44] livathinos: has joined #RubyOnRails
[15:35:40] ktchup: has joined #RubyOnRails
[15:38:00] sofy_arg: has joined #RubyOnRails
[15:39:48] Trynemjoel: has joined #RubyOnRails
[15:40:14] sofy_arg: has left #RubyOnRails: ()
[15:40:45] krz: has joined #RubyOnRails
[15:43:54] Mendenhall: has joined #RubyOnRails
[15:45:45] charliesome: has joined #RubyOnRails
[15:46:10] victortyau: has joined #RubyOnRails
[15:46:57] hahuang65: has joined #RubyOnRails
[15:47:09] drale2k: has joined #RubyOnRails
[15:47:41] iamjarvo: has joined #RubyOnRails
[15:49:29] fighella: has joined #RubyOnRails
[15:50:16] yaw: has joined #RubyOnRails
[15:50:28] bonhoeffer: how do i understand bundle exec ??? I often don???t need to do that, but sometimes I do
[15:50:30] lindii_: has joined #RubyOnRails
[15:52:00] yaw: bonhoeffer it means use gems specified by this app. sort of an app context
[15:52:21] bonhoeffer: ok ??? why is it only occasionally a problem
[15:52:25] Tuxero: has joined #RubyOnRails
[15:52:44] yaw: like when?
[15:53:21] yaw: (btw I prefer binstubs. i.e. bin/rspec over bundle exec rspec)
[15:54:41] lethjakman: has joined #RubyOnRails
[15:55:09] bruno-: has joined #RubyOnRails
[15:55:50] mois3x: has joined #RubyOnRails
[15:57:55] DLSteve: has joined #RubyOnRails
[15:59:47] Jarboe: has joined #RubyOnRails
[16:00:34] bruno-: has joined #RubyOnRails
[16:01:18] ChadyG_: has joined #RubyOnRails
[16:03:01] devdazed: has joined #RubyOnRails
[16:06:02] bruno-: has joined #RubyOnRails
[16:09:12] hahuang65: has joined #RubyOnRails
[16:10:28] srinidhi: has joined #RubyOnRails
[16:13:29] kh0d: has joined #RubyOnRails
[16:15:35] idd2d_: has joined #RubyOnRails
[16:15:43] zorak8: has joined #RubyOnRails
[16:19:14] Lightsword: has joined #RubyOnRails
[16:19:15] sarink: has joined #RubyOnRails
[16:19:25] JeramyRR: has joined #RubyOnRails
[16:19:55] bmalum: has joined #RubyOnRails
[16:21:26] bruno-: has joined #RubyOnRails
[16:21:46] nalley: has joined #RubyOnRails
[16:22:09] kham: has joined #RubyOnRails
[16:22:15] Cache_Money: has joined #RubyOnRails
[16:24:06] PhantomSpank: has joined #RubyOnRails
[16:24:10] idd2d_: has joined #RubyOnRails
[16:26:44] zpe: has joined #RubyOnRails
[16:26:57] bruno-: has joined #RubyOnRails
[16:29:38] safeforge: has joined #RubyOnRails
[16:30:20] PhantomSpank: has joined #RubyOnRails
[16:32:19] bruno-: has joined #RubyOnRails
[16:33:07] shock_one: has joined #RubyOnRails
[16:34:11] Tuxero: has left #RubyOnRails: ()
[16:34:14] gerep: has joined #RubyOnRails
[16:34:20] skkeeper: has joined #RubyOnRails
[16:35:11] puddy: has joined #RubyOnRails
[16:36:32] chinmay_dd: has joined #RubyOnRails
[16:37:04] hashrocket: has joined #RubyOnRails
[16:37:47] bruno-: has joined #RubyOnRails
[16:39:47] lindii_: how can i use a collection like this in my _header.html.erb http://pastie.org/10311737
[16:39:55] chouhoulis: has joined #RubyOnRails
[16:42:12] pontiki: has left #RubyOnRails: (""Poets have been mysteriously silent on the subject of cheese" -- G.K.Chesterson")
[16:43:17] bruno-: has joined #RubyOnRails
[16:44:15] ledestin: has joined #RubyOnRails
[16:44:55] hahuang65: has joined #RubyOnRails
[16:44:55] safeforge: has joined #RubyOnRails
[16:46:23] kh0d: has joined #RubyOnRails
[16:47:44] alienaut: has joined #RubyOnRails
[16:47:45] drale2k: has joined #RubyOnRails
[16:48:07] l0oky: has joined #RubyOnRails
[16:48:47] ktchup: has joined #RubyOnRails
[16:48:53] Trynemjoel: has joined #RubyOnRails
[16:49:44] towski_: has joined #RubyOnRails
[16:51:12] workmad3: has joined #RubyOnRails
[16:51:51] puddy: is it good practice to do a require inside a rake task for a third party gem?
[16:53:18] Lightsword: has joined #RubyOnRails
[16:55:31] apeiros: puddy: IMO yes. other tasks don't suffer a performance penalty that way.
[17:00:57] arup_r: how would I include a file font-awesome.css in application.scss file ?
[17:03:53] waseem_: puddy: Yes, it's alright. Make sure to add that gem to your Gemfile.
[17:04:19] puddy: waseem_ & apeiros thanks for the vote of confidence, and yup, it has been added
[17:04:22] waseem_: puddy: And if it is used only in the rake task, you can also do a require: false for it.
[17:04:59] _lexjm: has joined #RubyOnRails
[17:06:28] doodlehaus: has joined #RubyOnRails
[17:06:56] bonhoeffer: has joined #RubyOnRails
[17:07:46] superlou: has joined #RubyOnRails
[17:08:19] arup_r: hints please.. if I do @import "awesome-font" inside the application.scss it is not including the file
[17:08:38] arup_r: so how to include the .css there... any help
[17:09:58] earthquake: has joined #RubyOnRails
[17:10:57] FunkyPajamas: has joined #RubyOnRails
[17:11:08] FunkyPajamas: Morning everyone.
[17:11:15] FunkyPajamas: Or afternoon depending on the timezone :)
[17:12:27] lindii_: morning here
[17:13:39] boxmein: has joined #RubyOnRails
[17:13:56] boxmein: I'll gnaw my head off
[17:14:04] boxmein: can anyone help me with this erorr
[17:14:10] boxmein: http://puu.sh/jctJE/81107dc9f9.txt
[17:14:16] boxmein: HasManyThroughAssociationNotFoundError
[17:14:19] Lightsword: has joined #RubyOnRails
[17:14:24] boxmein: points at https://github.com/boxmein/qdb/blob/voting/qdb.rb#L616 this line
[17:14:36] boxmein: and this is the schema https://github.com/boxmein/qdb/blob/voting/db/schema.rb
[17:14:51] iamjarvo: has joined #RubyOnRails
[17:15:26] Trynemjoel: has joined #RubyOnRails
[17:16:36] FunkyPajamas: Shouldn't you have in here -> https://github.com/boxmein/qdb/blob/voting/models/Vote.rb
[17:16:47] FunkyPajamas: Your relations defined?
[17:17:21] FunkyPajamas: I mean, Quote knows about Voters
[17:17:29] christiandsg: has joined #RubyOnRails
[17:17:45] FunkyPajamas: And Voters (Users) knows about Quote
[17:17:58] FunkyPajamas: But buth through Vote. Vote doesn't know about either.
[17:18:11] hahuang65: has joined #RubyOnRails
[17:18:23] boxmein: FunkyPajamas: honestly, I'm a huge beginner with this kind of relationing
[17:18:45] boxmein: FunkyPajamas: do I just add belongs_to to both sides?
[17:18:53] boxmein: FunkyPajamas: aka vote belongs to the quote and to the user
[17:18:59] FunkyPajamas: In Vote, right.
[17:19:13] FunkyPajamas: Vote belongs to Quote and User
[17:19:33] lindii_: how can i use a collection like this in my _header.html.erb http://pastie.org/10311737
[17:20:03] FunkyPajamas: I'm not 100% certain if you need to also alias User like "Voter" for Vote, in case it doesn't work right away.
[17:20:41] boxmein: FunkyPajamas: I'm secretly doing this in sinatra but since rails is a way bigger community based on the same active* libraries this seemed a more attractive place to ask
[17:21:05] boxmein: FunkyPajamas: I did a belongs_to in a migration, https://github.com/boxmein/qdb/blob/voting/db/migrate/20150618204856_add_votes.rb
[17:21:08] boxmein: FunkyPajamas: is this also necessary
[17:21:21] FunkyPajamas: :) that's fine, Sinatra's fun too
[17:21:26] Trynemjoel: has joined #RubyOnRails
[17:21:35] boxmein: rails seems too mvc-y for me :P
[17:21:43] boxmein: although what I do is still a mvc :P
[17:21:46] JeramyRR: has joined #RubyOnRails
[17:22:01] baweaver: has joined #RubyOnRails
[17:22:14] FernandoBasso: has joined #RubyOnRails
[17:22:20] FunkyPajamas: Well, let's take a look at the schema. I figured there's got to be a migration in there already.
[17:22:29] bradleyprice: has joined #RubyOnRails
[17:23:25] FunkyPajamas: Right, the fields are already in place as they should. You need to add the belongs_to to the *model*, not a new migration.
[17:23:46] imkj: has joined #RubyOnRails
[17:26:26] boxmein: FunkyPajamas: considering the other two models, should the models/Vote.rb look something like http://puu.sh/jcuDg/c85d11ebdb.txt
[17:30:49] jonee: has joined #RubyOnRails
[17:30:52] sarink: has joined #RubyOnRails
[17:31:53] FunkyPajamas: Let me check the schema
[17:33:14] FunkyPajamas: Hmmm, I'm iffy on the foreign_key, shouldn't it grab it by default given the names of the tables match?
[17:33:32] FunkyPajamas: AFAIK you have to specify the fk if you're not following naming convention
[17:33:42] boxmein: I don't think I am
[17:34:07] boxmein: FunkyPajamas: I'm not sure what the naming conventions are :P
[17:34:17] boxmein: FunkyPajamas: https://github.com/boxmein/qdb/blob/voting/models/User.rb#L11 https://github.com/boxmein/qdb/blob/voting/models/Quote.rb#L4
[17:35:10] TheNet: has joined #RubyOnRails
[17:35:16] FunkyPajamas: Right, but if you look at your schema -> https://github.com/boxmein/qdb/blob/voting/db/schema.rb
[17:35:53] FunkyPajamas: You'll see the field names in the votes relation are as they should, i.e. <reference>_id
[17:36:39] raboid: has joined #RubyOnRails
[17:36:40] FunkyPajamas: I would try the model as you sent it but without the foreign_key. Give it a spin. If it doesn't work then post the error and we'll go from there.
[17:36:47] FunkyPajamas: Sounds good? :)
[17:37:45] mloy: has joined #RubyOnRails
[17:37:53] boxmein: FunkyPajamas: ohh
[17:38:11] boxmein: FunkyPajamas: sounds great!
[17:38:17] gerep: has joined #RubyOnRails
[17:38:22] Rubie: has joined #RubyOnRails
[17:39:20] boxmein: FunkyPajamas: http://puu.sh/jcvjK/e69e6aab17.txt
[17:39:22] boxmein: FunkyPajamas: seems the same
[17:39:33] gerep: I need a help with English and a model name, if possible :) My model will store data about price quotation requests, in English, what could be the name for that model and database table?
[17:39:52] busterarm: quote/quotes
[17:40:16] busterarm: well, maybe
[17:40:33] gerep: busterarm, thanks, I thought about that but was afraid it would mean quotes like: quoting Einstein....
[17:40:36] busterarm: possibly inquiry
[17:40:46] busterarm: it's a request for a quote or a quote itself?
[17:41:16] busterarm: i might go with inquiry then, but that's super generic
[17:41:18] gerep: request for a quote, the user will create a list of items they need and send to some distributors
[17:41:35] gerep: busterarm, I'll go with inquiry :)
[17:41:41] gerep: thanks for your help =)
[17:41:44] busterarm: or just RFQ
[17:41:47] busterarm: which would be the industry term
[17:43:00] michaeldeol: has joined #RubyOnRails
[17:43:04] erichu: has joined #RubyOnRails
[17:43:15] tuelz: has joined #RubyOnRails
[17:43:26] lethjakman: has joined #RubyOnRails
[17:44:38] eggoez: has joined #RubyOnRails
[17:44:43] FunkyPajamas: That's odd. What does your model look like now?
[17:46:43] naftilos76: has joined #RubyOnRails
[17:50:40] boxmein: FunkyPajamas: was I supposed to also modify the schema?
[17:50:44] boxmein: FunkyPajamas: because I did not
[17:51:00] FunkyPajamas: No, no, just the model
[17:51:10] sarink: has joined #RubyOnRails
[17:51:14] FunkyPajamas: No migrations or anything
[17:51:16] FunkyPajamas: Just the model
[17:51:58] boxmein: FunkyPajamas: http://hastebin.com/xacazukotu.rb
[17:53:15] christiandsg: has joined #RubyOnRails
[17:55:24] hahuang65: has joined #RubyOnRails
[17:55:53] drale2k: has joined #RubyOnRails
[17:56:28] FunkyPajamas: Yeah, as I said, I'm not 100% certain on using aliases on a habtm through, so perhaps that could be causing the issue. I'm not sure if Sinatra supports "source" as an option for defining relations.
[17:57:03] FunkyPajamas: I mean, everything looks good to me except for that.
[17:57:21] FunkyPajamas: Does Sinatra have a console that you can use for testing?
[17:57:57] pixelhandler: has joined #RubyOnRails
[17:58:41] Mendenhall: has joined #RubyOnRails
[18:00:13] centrx: has joined #RubyOnRails
[18:00:51] Maletor: has joined #RubyOnRails
[18:00:57] FunkyPajamas: You still have to add the "has_many" for the "through" relation
[18:01:46] jottr: has joined #RubyOnRails
[18:02:24] lindii_: how can i use a collection like this in my _header.html.erb http://pastie.org/10311737
[18:02:30] FunkyPajamas: i.e. you need to add has_many :votes to User.rb and has_many :votes to Quote.rb
[18:02:39] FunkyPajamas: Check this out -> http://guides.rubyonrails.org/association_basics.html#the-has-many-through-association
[18:02:55] FunkyPajamas: Hey lindii, I'm sorry, can you please rephrase that? I don't understand what you're asking.
[18:02:56] nobitanobi: has joined #RubyOnRails
[18:03:02] boxmein: FunkyPajamas: :
[18:04:43] elia: has joined #RubyOnRails
[18:04:44] nobitanobi: has joined #RubyOnRails
[18:05:03] drale2k: has joined #RubyOnRails
[18:06:31] _djbkd: has joined #RubyOnRails
[18:07:29] boxmein: FunkyPajamas: that cleared the first error, the second error's message was clearer too and I added source: :user/:quote respectively, and now there's no errors related to the database!
[18:07:42] FunkyPajamas: Alright! *dances*
[18:07:43] boxmein: a strange Rack::Lint::LintError about a status being <100
[18:07:55] boxmein: but I think I'll handle it
[18:07:59] boxmein: FunkyPajamas: thanks a lot :D
[18:08:24] FunkyPajamas: Stick around, RoR/Sinatra is fun stuff.
[18:08:53] hahuang65: has joined #RubyOnRails
[18:09:42] christiandsg: has joined #RubyOnRails
[18:14:32] sumper: has joined #RubyOnRails
[18:15:29] SteenJobs: has joined #RubyOnRails
[18:20:06] boxmein: FunkyPajamas: related question to the errors, what is all that I need to do to wire up a new Vote object now?
[18:20:11] boxmein: FunkyPajamas: not sure if this is enough, https://github.com/boxmein/qdb/blob/voting/qdb.rb#L612-L619
[18:22:25] chinmay_dd: has joined #RubyOnRails
[18:22:58] paulmcquad: has joined #RubyOnRails
[18:23:39] sumper: has joined #RubyOnRails
[18:23:42] tyl: has joined #RubyOnRails
[18:23:45] jonee: has joined #RubyOnRails
[18:24:02] FunkyPajamas: 613 and 614 might cause issues if Sinatra also jumped on the "strong parameters" bandwagon (as I said, I'm not familiar with it). So you could try instead:
[18:24:16] FunkyPajamas: v.quote = quote
[18:24:25] FunkyPajamas: v.user = user
[18:24:31] FunkyPajamas: the rest looks fine
[18:24:32] bronson: has joined #RubyOnRails
[18:25:05] FunkyPajamas: If you're saving (615) and nothing is happening then try save! instead, since it'll throw errors.
[18:26:19] FunkyPajamas: btw, sorry for spamming the whole channel. How do I address a specific user without broadcasting to everyone? It's been a while since I've done IRC and all I can remember is a/s/l and /msg :P
[18:29:05] krz: i have a table with a column called full_name. value "Foo Bar". i also want to have a column that shares the same value, but in underscore, lowercase format. i.e. "foo_bar". what do you call this kind of column? a slug?
[18:29:09] krz: id_str?
[18:29:21] drale2k: has joined #RubyOnRails
[18:29:55] boxmein: FunkyPajamas: /query <username> should open up a new tab with a specific user
[18:30:13] centrx: krz, slug sounds good, if that's the purpose of it
[18:30:14] boxmein: FunkyPajamas: and /msg <username> <message...> should send just one private message
[18:30:58] FunkyPajamas: Nice, thanks!
[18:32:44] kham: has joined #RubyOnRails
[18:33:14] boxmein: FunkyPajamas: just poking again, wonder if I can validate uniqueness of a specific user/vote pair
[18:33:23] boxmein: FunkyPajamas: so an user can only vote once on a specific thing
[18:35:13] FunkyPajamas: Sorry, give me a few, I'm about to start a call.
[18:36:51] boxmein: sure thing
[18:38:58] bonhoeffer: has joined #RubyOnRails
[18:39:36] mrbubbles: has joined #RubyOnRails
[18:39:40] workmad3: has joined #RubyOnRails
[18:39:51] hahuang65: has joined #RubyOnRails
[18:44:21] lethjakman: has joined #RubyOnRails
[18:44:48] nickenchuggets: has joined #RubyOnRails
[18:45:24] RegulationD: has joined #RubyOnRails
[18:46:02] Trynemjoel: has joined #RubyOnRails
[18:48:30] idd2d_: has joined #RubyOnRails
[18:52:09] qejk: has joined #RubyOnRails
[18:52:13] FernandoBasso: has joined #RubyOnRails
[18:53:02] Trynemjoel: has joined #RubyOnRails
[18:54:41] paulmcquad: has left #RubyOnRails: ()
[18:56:18] dopie: has joined #RubyOnRails
[18:58:11] Guest66777: has left #RubyOnRails: ()
[18:59:25] doodlehaus: has joined #RubyOnRails
[18:59:39] silverdust: has joined #RubyOnRails
[18:59:45] iamjarvo: has joined #RubyOnRails
[18:59:46] IceyEC: has joined #RubyOnRails
[18:59:46] idd2d_: has joined #RubyOnRails
[19:00:08] drale2k: has joined #RubyOnRails
[19:00:41] elia: has joined #RubyOnRails
[19:01:42] christiandsg: has joined #RubyOnRails
[19:02:25] boxmein: if I have three models, user { has_many votes }, vote { belongs_to user, belongs_to quote }, quote { has_many votes }
[19:02:46] boxmein: wonder if I can check a vote for uniqueness in the ActiveRecord::Base derived class
[19:03:20] bruno-: has joined #RubyOnRails
[19:04:06] Fernando-Basso: has joined #RubyOnRails
[19:06:11] yfeldblum: has joined #RubyOnRails
[19:07:49] drale2k: has joined #RubyOnRails
[19:07:53] tbuehlmann: boxmein, sure, there is a uniqueness validation you can use
[19:07:56] shinnya: has joined #RubyOnRails
[19:08:13] boxmein: tbuehlmann: does validates :quote, uniqueness: { :scope => :user } look right
[19:08:25] carlosd: has joined #RubyOnRails
[19:08:38] boxmein: tbuehlmann: inside models/Vote.rb
[19:08:39] tbuehlmann: I'd have said scope: :user_id, but yes, that looks right
[19:08:49] busterarm: what's the relation between quote and user
[19:09:11] boxmein: busterarm: https://github.com/boxmein/qdb/tree/voting/models
[19:09:18] boxmein: busterarm: not sure what exactly you mean
[19:09:58] jottr: has joined #RubyOnRails
[19:10:08] busterarm: quote would need to have one user through votes for that scoped validation to work
[19:10:11] tbuehlmann: oh, you validate quote?
[19:10:11] hahuang65: has joined #RubyOnRails
[19:10:13] busterarm: i'll look at your code though
[19:10:28] tbuehlmann: I'll leave this one to busterarm, as I'm reading with just one eye
[19:10:41] busterarm: well, i'm also on no sleep for 2 days, so more eyes the better :)
[19:11:03] lethjakman: has joined #RubyOnRails
[19:11:12] pothibo: has joined #RubyOnRails
[19:11:16] busterarm: scope it to voters
[19:11:22] apeiros: tbuehlmann: do uniqueness validators use the db yet?
[19:11:49] tbuehlmann: apeiros, they just query for already existing records
[19:12:02] apeiros: ok, so still race condition waiting to happen :(
[19:12:30] apeiros: I thought they said they were working on using db conditions as far back as 2010. so I guess nothing moved in that regard.
[19:12:40] apeiros: s/conditions/constraints/
[19:12:47] busterarm: validates :quote, uniqueness: { :scope => :voters }, i'm thinking
[19:12:54] boxmein: busterarm: sorry, this is kinda the first time I'm playing around with activerecord and relations
[19:13:08] boxmein: relations make sense were I to make them myself but not when activerecord magic does them for me
[19:13:22] Pazician: has joined #RubyOnRails
[19:13:27] busterarm: you just have to love and trust the magic :D
[19:13:28] tbuehlmann: yeah, race conditions possible. at least belongs_to associations have db constraints now
[19:13:30] busterarm: I'm with you though
[19:14:06] boxmein: busterarm: isn't :voters a Quote.rb field?
[19:14:18] boxmein: busterarm: or is that related to validates :quote
[19:14:46] busterarm: to validate the quote is unique to the user, no?
[19:15:19] busterarm: oh i see you're asking on vote.rb....hold on
[19:15:31] boxmein: yea, I wanna validate that one person can vote once
[19:15:46] charliesome: has joined #RubyOnRails
[19:17:53] busterarm: wouldn't that just be validates_uniqueness_of :user_id, :quote_id?
[19:18:47] busterarm: you're basically validating the uniqueness of the record to the pair of the user and quote
[19:18:58] busterarm: if I understand your relations correctly
[19:19:14] boxmein: yes, the pair of [user,quote] should be unique
[19:19:15] tbuehlmann: I think you want `Vote.validates :user_id, uniqueness: {scope: :quote_id}`
[19:20:33] TomasAchmedovas: has joined #RubyOnRails
[19:22:04] IceyEC: has joined #RubyOnRails
[19:22:24] mostlybadfly: has joined #RubyOnRails
[19:22:34] busterarm: you just need a pair of validations scoped to the opposite
[19:22:46] busterarm: validates :user_id, uniqueness: { scope: quote_id }
[19:22:56] busterarm: validates :quote_id, uniqueness: { scope: user_id }
[19:23:10] busterarm: i don't know why I thought there was a shorter way to write that (there shoudl be)
[19:23:11] tbuehlmann: as I said. also, one direction is enough
[19:23:29] boxmein: I was about to ask why it should be two directions
[19:24:04] busterarm: oh, you only need 1? interesting
[19:24:13] lethjakman: has joined #RubyOnRails
[19:24:17] boxmein: also can I search for objects like Vote.where(:quote => quote, :user => user), where :quote and :user are both relation-defined (not actually in the database) and quote, user are respective objects
[19:25:42] tbuehlmann: that's possible
[19:26:54] earthquake: has joined #RubyOnRails
[19:27:01] doodlehaus: has joined #RubyOnRails
[19:27:46] nobitanobi: has joined #RubyOnRails
[19:30:27] busterarm: i can be useful now -- I made coffee!
[19:30:42] jottr: has joined #RubyOnRails
[19:31:15] busterarm: i think if you wanted to be super careful, you could also index the two fields together in the schema
[19:31:28] busterarm: (on top of this)
[19:31:41] drupald: has joined #RubyOnRails
[19:32:23] karmapolice: one question. why after my loop rails is printing the entire object?
[19:32:30] boxmein: busterarm: I think I'm doing that maybe
[19:32:38] boxmein: busterarm: if you wanna, you can look at db/schema.rb
[19:32:47] busterarm: yeah i'm looking
[19:32:53] busterarm: it looks like they're indexed individually
[19:33:28] tbuehlmann: karmapolice, I can only guess what you mean: the #each method returns the object it is called on. collection.each { ??? } returns collection
[19:33:29] busterarm: https://github.com/slancio/meeplespace/blob/master/db/schema.rb
[19:33:38] busterarm: the Outings model has an example of what I'm talking about
[19:35:37] Rukeal: has joined #RubyOnRails
[19:37:36] karmapolice: tbuehlmann: what should i change here http://pastie.org/10311971
[19:39:41] ktchup: has joined #RubyOnRails
[19:40:24] hahuang65: has joined #RubyOnRails
[19:43:34] chinmay_dd: has joined #RubyOnRails
[19:44:18] tbuehlmann: karmapolice, the usage of #each there irritates me, what do you want to do?
[19:44:44] nofxx: has joined #RubyOnRails
[19:44:44] nofxx: has joined #RubyOnRails
[19:46:16] cac: has joined #RubyOnRails
[19:47:19] karmapolice: tbuehlmann: show messages for each conversation
[19:49:32] tbuehlmann: karmapolice, I think you want something like this: https://gist.github.com/tbuehlmann/02b0b800b94b2f43f581
[19:49:43] tbuehlmann: also: N+1 queries incoming
[19:51:06] doodlehaus: has joined #RubyOnRails
[19:51:12] eggoez: has joined #RubyOnRails
[19:51:50] poli: has joined #RubyOnRails
[19:52:44] roolo_: has joined #RubyOnRails
[19:52:55] IceyEC: has joined #RubyOnRails
[19:53:09] karmapolice: tbuehlmann: still shows the array of objects after the end of the loop in my view
[19:53:18] l0oky: has joined #RubyOnRails
[19:53:39] tbuehlmann: karmapolice, then your view is screwed. you are probably using <%= instead of <%
[19:53:49] tbuehlmann: show the corresponding view code, please
[19:56:01] karmapolice: tbuehlmann: you were right sir thanks
[19:56:52] erichu: has joined #RubyOnRails
[19:58:57] bonhoeffer: has joined #RubyOnRails
[20:00:54] zick: has joined #RubyOnRails
[20:04:17] ellisTAA: has joined #RubyOnRails
[20:04:52] ellisTAA: i just downloaded this SQL file that contains info on all cities in the US, if I want to put this into my postgres db is this called a SQL dump
[20:04:53] cytoskeletor: has joined #RubyOnRails
[20:06:06] VeryBewitching: has joined #RubyOnRails
[20:06:09] waseem_: EllisTAA: That'll be called importing a SQL dump
[20:06:39] michael_mbp: has joined #RubyOnRails
[20:07:15] lethjakman: has joined #RubyOnRails
[20:09:30] cytoskeletor: If I have a hash like this { 'x' => '1', 'x' => '2', 'x' => '4', 'x' => '5', 'x' => '7', 'x' => '8' } and I want to group all of the values based on if they are consecutive like this [[1,2], [4,5], [7,8]] how would I go about doing that?
[20:10:05] ktchup: has joined #RubyOnRails
[20:10:09] chipotle: has joined #RubyOnRails
[20:10:14] poli: has joined #RubyOnRails
[20:10:37] hahuang65: has joined #RubyOnRails
[20:11:07] bin_005: has joined #RubyOnRails
[20:13:48] FernandoBasso: has joined #RubyOnRails
[20:16:14] Jarboe: has joined #RubyOnRails
[20:18:55] cytoskeletor: Do I need to somehow compare the the values?
[20:19:17] bonhoeffer: has joined #RubyOnRails
[20:19:31] ellisTAA: iterate through the hash and see if the previous value is == to the current value if one is added to it?
[20:20:29] cytoskeletor: That's kinda what I was thinking but I'm not sure how to get the previous value on an iteration
[20:26:30] ellisTAA: maybe something lke this https://gist.github.com/ellismarte/767fc1e7f7123f8f64c4
[20:26:54] Rubie: has joined #RubyOnRails
[20:28:29] workmad3: has joined #RubyOnRails
[20:29:19] cytoskeletor: Thank you! I'll see what I can do with that
[20:29:49] ellisTAA: https://gist.github.com/ellismarte/767fc1e7f7123f8f64c4
[20:32:01] kh0d: has joined #RubyOnRails
[20:32:14] tuelz: has joined #RubyOnRails
[20:35:41] Lightsword: has joined #RubyOnRails
[20:37:42] sinkensabe: has joined #RubyOnRails
[20:38:16] devdazed: has joined #RubyOnRails
[20:40:39] christiandsg: has joined #RubyOnRails
[20:42:46] hahuang65: has joined #RubyOnRails
[20:43:20] cytoskeletor: You just added the counter += 1?
[20:43:50] Mendenhall: has joined #RubyOnRails
[20:43:56] l0oky: has joined #RubyOnRails
[20:43:57] nalley: has joined #RubyOnRails
[20:44:45] xploshioon: has joined #RubyOnRails
[20:45:32] cajone: has left #RubyOnRails: ()
[20:47:28] xploshioon: what is the correct way to do something like this @cities = Country.find(params[:country_id]).states.cities
[20:47:50] xploshioon: i cant go through states to cities in the same line?
[20:50:09] Trynemjoel: has joined #RubyOnRails
[20:51:43] cytoskeletor: You want all the cities in the country?
[20:53:07] xploshioon: but there is no direct relationship, the relation is between country > state > city
[20:53:24] cytoskeletor: cities have a state_id and states have a country_id?
[20:54:30] xploshioon: I tried with State.where(:country_id => params[:country_id]).cities and still the same
[20:54:33] elia: has joined #RubyOnRails
[20:55:07] Maletor: has joined #RubyOnRails
[20:55:23] lupine: try City.where(:country_id => params[:country_id]).all
[20:55:39] lupine: assuming has_many / belongs_to
[20:56:03] lupine: oh, wait, I see
[20:56:06] cytoskeletor: I think xploshioon said there is no direct relationship
[20:56:10] xploshioon: city doesn't have a country_id
[20:56:30] lupine: yeah, there's a join in the middle
[20:57:07] lupine: easy to do with two queries, possible but a tad awkward in rails with 1
[20:58:21] cytoskeletor: City.where(state_id: State.where(country_id: params[:country_id]).all or something like that?
[20:58:48] lupine: aye, that's 2 queries
[20:59:28] lupine: City.joins(:state: :country).where(country_id: params[:country_id]).all is kind of how to do it with a join, but not quite
[20:59:40] lupine: bah, but with proper hash syntax
[20:59:50] lupine: can't do it off the top of my head
[20:59:51] blackmesa: has joined #RubyOnRails
[20:59:57] Saloaty: has joined #RubyOnRails
[21:00:05] Saloaty: Hello rails people
[21:00:05] cytoskeletor: xploshioon can you create another relationship?
[21:01:03] lupine: belongs_to :through isn't a thing is it@?
[21:01:50] cytoskeletor: has_many :cities, :through => :states
[21:02:10] boxmein: has left #RubyOnRails: ("whoops")
[21:02:40] Saloaty: has left #RubyOnRails: ()
[21:03:10] Olumayowa: has joined #RubyOnRails
[21:03:24] Saloaty: has joined #RubyOnRails
[21:04:03] hahuang65: has joined #RubyOnRails
[21:04:11] xploshioon: i can, but is the best way?
[21:04:20] Saloaty: has left #RubyOnRails: ("rubyonrails")
[21:04:31] xploshioon: i really can't just load something like Country.first.states.cities?
[21:04:58] lupine: not without incurring N+1
[21:05:09] lupine: the join version is fine
[21:05:17] lupine: the two-queries version is fine
[21:05:25] lupine: the unidirectional has_many :though is fine
[21:06:44] Olumayowa: has joined #RubyOnRails
[21:07:18] blackmesa: has joined #RubyOnRails
[21:08:18] xploshioon: what is the join version?
[21:08:34] shpoont: has joined #RubyOnRails
[21:09:46] lupine: <lupine> City.joins(state: :country).where(country_id: params[:country_id]).all is kind of how to do it with a join, but not quite
[21:10:19] lupine: it might need to be where( state: { country_id: params[:country_id] } ) or some such
[21:10:24] lupine: play, read the docs
[21:10:37] mary5030: has joined #RubyOnRails
[21:10:43] lupine: write the SQL statements you want directly and then try to get AR to make them
[21:11:12] roolo: has joined #RubyOnRails
[21:13:09] xploshioon: ok, thanks guys
[21:16:55] xploshioon: City.joins(:state).where(:state => {:country_id => 1})
[21:17:10] Maletor: has joined #RubyOnRails
[21:17:16] xploshioon: it says no such column: state.country_id
[21:17:33] charliesome_: has joined #RubyOnRails
[21:19:01] SteenJobs: has joined #RubyOnRails
[21:19:58] sump: has joined #RubyOnRails
[21:22:46] hahuang65: has joined #RubyOnRails
[21:24:47] workmad3: has joined #RubyOnRails
[21:26:12] FunkyPajamas: Hey guys, just got back. Sorry it took a while.
[21:26:19] FunkyPajamas: Long call with the boss.
[21:26:59] rickmasta: has joined #RubyOnRails
[21:28:17] Rubie: has joined #RubyOnRails
[21:28:30] blackmesa: has joined #RubyOnRails
[21:28:54] FunkyPajamas: xploshioon, I assume you checked your relations and everything is properly defined, so it's really a matter of the query?
[21:29:03] FunkyPajamas: Can you link/paste the resulting SQL?
[21:31:25] glenn: has joined #RubyOnRails
[21:32:58] tuelz: has joined #RubyOnRails
[21:33:19] hahuang65: has joined #RubyOnRails
[21:33:21] nickenchuggets: has joined #RubyOnRails
[21:33:44] nickenchuggets: has joined #RubyOnRails
[21:37:21] cornerma1: has joined #RubyOnRails
[21:38:01] FernandoBasso: If I have a class Article, I do params.require(:article).permit(:title, :text). What about if I have a model Admin::User ?
[21:38:21] FernandoBasso: params.require(:admin_user)... ?
[21:39:11] Papierkorb: has joined #RubyOnRails
[21:40:04] FernandoBasso: http://guides.rubyonrails.org/getting_started.html#saving-data-in-the-controller
[21:40:12] FernandoBasso: This is what I am reading, by the way.
[21:40:12] sump: has left #RubyOnRails: ()
[21:40:15] sump: has joined #RubyOnRails
[21:40:30] Pazician: has joined #RubyOnRails
[21:42:53] FernandoBasso: To my wonder, it worked.
[21:43:05] FernandoBasso: Things don't work even when I know what I am doing. This was pure luck.
[21:46:23] [H]unt3r: has joined #RubyOnRails
[21:46:48] RegulationD: has joined #RubyOnRails
[21:47:40] blackmes1: has joined #RubyOnRails
[21:52:55] hahuang65: has joined #RubyOnRails
[21:54:43] Trynemjoel: has joined #RubyOnRails
[21:55:50] lethjakman: has joined #RubyOnRails
[21:56:40] michael_mbp: has joined #RubyOnRails
[21:57:39] markholmes: has joined #RubyOnRails
[21:58:11] yfeldblum: has joined #RubyOnRails
[21:58:59] waseem_: FernandoBasso: The parameter names do not depend upon the class you create. It depends upon the HTML form that you create. So in case of Admin::User you can have your form use the same parameter names.
[21:59:00] glenn: has joined #RubyOnRails
[22:00:14] glennt: has joined #RubyOnRails
[22:00:22] FernandoBasso: waseem_, Sorry, I do not follow the part "it depends upln the html form".
[22:01:37] proboszcz: has joined #RubyOnRails
[22:02:02] drale2k: has joined #RubyOnRails
[22:02:03] towski_: has joined #RubyOnRails
[22:02:46] erichu: has joined #RubyOnRails
[22:03:42] FernandoBasso: Actually, I don't understand why I do params.require(:article), for instance.
[22:03:59] FernandoBasso: Is this :article related to my model name?
[22:04:19] FernandoBasso: Nope if I understood what you said "The parameter names do not depend upon the class you create."
[22:04:46] busterarm: it's really a security feature
[22:05:18] busterarm: the broswer can pass back whatever params the user wants, so you're just defining what you'll accept to try and sanitize your input
[22:05:29] segy: has joined #RubyOnRails
[22:06:20] FernandoBasso: I understood that it is about security. What I don't understand is params.require(:article). I am inclined to believe that :article is a symbol that matches the model name.
[22:06:38] FernandoBasso: It requires an Article, and allows :this and :that.
[22:06:43] FernandoBasso: That is how I think about it.
[22:07:02] FernandoBasso: And that is why I tried :admin_user in my previous question/example.
[22:07:18] busterarm: i don't think Admin::User is the same as :admin_user
[22:07:49] FernandoBasso: What else could I write here, then, for instance? params.require(:admin_user).permit(:name, :email)
[22:08:03] FernandoBasso: Instead of :admin_user, I mean.
[22:08:15] busterarm: where's your code?
[22:08:35] FernandoBasso: Only local, for now. I can upload some code if need be.
[22:08:39] tuelz: has joined #RubyOnRails
[22:09:06] busterarm: yeah without having a look at your models it's hard to say
[22:09:48] hahuang65: has joined #RubyOnRails
[22:10:28] FernandoBasso: And how do people paste stuff on questions like this, involving several source files?
[22:10:37] FernandoBasso: Copy and paste one by one?
[22:11:00] FernandoBasso: Any prefered paste service?
[22:11:27] busterarm: github or bitbucket links usually
[22:11:49] Limix: has joined #RubyOnRails
[22:12:19] FernandoBasso: And if have unfinished, uncommitted changes, I'd have to commit then, or there is another trick?
[22:12:27] FernandoBasso: (I'm preparing a gist)
[22:12:52] Limix: Hi all, any advice on the best gems for testing a api only rails app?
[22:13:10] Limix: was looking at airborne
[22:14:19] sump: try json spec havent used it personally but it might be what you are looking for
[22:14:29] FernandoBasso: busterarm, https://gist.github.com/FernandoBasso/9b464113064af2b02075
[22:14:30] Limix: thank you
[22:15:34] gheegh: has joined #RubyOnRails
[22:18:42] gheegh: so, anyone ever have a problem where their gems just don't seem to update? everything looks right.. but i'm literally removing gems, bundling, and it should error.. but it has the gem there nad loads it..
[22:18:54] shpoont: has joined #RubyOnRails
[22:20:11] busterarm: yeah the model/control naming doesn't make sense to me
[22:20:43] busterarm: what I think you actually want is admin to inherit from UsersController
[22:20:51] givanse: has joined #RubyOnRails
[22:21:02] busterarm: well AdminController from UsersController, Admin model from Users model
[22:21:11] Scriptonaut: has joined #RubyOnRails
[22:21:11] jottr: has joined #RubyOnRails
[22:21:25] busterarm: or just use a User model and set up some sort of flag for admin rights
[22:21:30] Scriptonaut: Are the timestamps in activerecord updated automatically by rails or by activerecord?
[22:21:48] SteenJobs: has joined #RubyOnRails
[22:21:52] busterarm: should be AR anytime you modify the object, Scriptonaut
[22:22:00] Scriptonaut: ah ty busterarm
[22:23:41] Cache_Money: has joined #RubyOnRails
[22:27:59] Scriptonaut: My users model has a has_many association for my Message model. Message has a belongs_to to User. My problem is, while I can take a message instance and do: my_message.user, when I do my_user.messages, it says undefined method 'messages' for User. Here's what my models look like: https://gist.github.com/robins35/31e2d098e162791acce7
[22:28:45] Rubie: has joined #RubyOnRails
[22:29:17] JeramyRR: has joined #RubyOnRails
[22:29:47] tejasmanohar: has joined #RubyOnRails
[22:30:17] ellisTAA: has joined #RubyOnRails
[22:31:41] chuy: has joined #RubyOnRails
[22:33:12] mostlybadfly: has joined #RubyOnRails
[22:33:15] Trynemjoel: has joined #RubyOnRails
[22:33:53] busterarm: you probably need ActiveSupport for the rails magic stuff to work
[22:33:56] busterarm: for pluralize, etc
[22:34:03] busterarm: and possibly ActiveModel
[22:34:16] zorak8: has joined #RubyOnRails
[22:34:36] busterarm: but that's weird
[22:34:45] Scriptonaut: busterarm: isn't ActiveModel included in ActiveRecord?
[22:35:40] blackmes1: has joined #RubyOnRails
[22:35:42] busterarm: what's your schema?
[22:36:16] cac: has joined #RubyOnRails
[22:36:16] Scriptonaut: I don't actually have a schema.rb file, that must be another component of rails. I rolled out my own db rake tasks like migrate, rollback, drop, create, etc
[22:36:24] Scriptonaut: I'm adding activesupport to see if that fixed is
[22:37:10] Scriptonaut: I just think it's odd the magic goes one way (Message.first.user), but it doesn't go the other way
[22:37:18] Scriptonaut: I can just write my own but kinda disappointing
[22:41:48] busterarm: well it's based on the columns in the db
[22:41:50] hahuang65: has joined #RubyOnRails
[22:41:55] busterarm: so i'm wondering what your tables look like
[22:42:03] Scriptonaut: ah, let me show you, one sec
[22:42:12] charliesome: has joined #RubyOnRails
[22:42:50] busterarm: did you look into Sequel at all?
[22:42:57] diegoviola: has joined #RubyOnRails
[22:43:17] Scriptonaut: https://gist.github.com/robins35/94e1ebe6465a2e047b69
[22:43:28] busterarm: also, not to shamelessly plug myself
[22:43:28] Scriptonaut: busterarm: I read about it, that's about it
[22:43:38] Scriptonaut: did you write it?
[22:43:39] busterarm: but I wrote an ORM based on ActiveRecord that might do what you need
[22:43:50] Scriptonaut: well link me the repo for your thing
[22:43:54] Scriptonaut: I'll consider using it
[22:43:55] busterarm: though a has_many through relationship might not work
[22:44:06] Scriptonaut: so that's some rails magic?
[22:44:31] busterarm: no it's just not finished
[22:44:43] Scriptonaut: what do I need to add to finish it?
[22:44:44] busterarm: tons of features left to implement and I wasn't that interested in continuing
[22:44:50] Scriptonaut: oh, nvm, you're talking about your thing
[22:44:54] busterarm: https://github.com/slancio/arliteorm
[22:45:02] JeramyRR: has joined #RubyOnRails
[22:45:15] Scriptonaut: cool, I'll bookmark it
[22:45:34] bonhoeffer: has joined #RubyOnRails
[22:45:34] busterarm: if anything it may be useful for just rolling your own with the parts you need
[22:45:43] Scriptonaut: ya, definitely
[22:46:02] busterarm: but I am using ActiveSupport because it makes life easier
[22:46:12] Scriptonaut: ya, love me some activesupport
[22:46:25] Scriptonaut: so, I'll just have to write my own has_many association methods?
[22:46:29] busterarm: and this is married to SQLite3
[22:46:30] Scriptonaut: or am I a step too short or something
[22:46:32] dideler: has joined #RubyOnRails
[22:46:48] FernandoBasso: What is the proper way to handle database.yml in git repos?
[22:46:50] busterarm: i think the issue is both sides of the relationship might not work
[22:46:58] diegoviola: have you guys played with sequel? what's your opinion on it?
[22:47:06] busterarm: one does but it was the last thing I did and didn't poke too hard at it
[22:47:21] Scriptonaut: FernandoBasso: most projects I've worked on database.yml is in .gitignore, and then we have a database.yml.example, that has mock data in it
[22:47:31] Scriptonaut: you don't want your actually db credentials in a repo
[22:47:33] VeryBewitching: How do I cleanup files generated by tests for models using has_attached_file with Paperclip?
[22:47:37] FernandoBasso: Scriptonaut, Reasonable enough. Thanks.
[22:48:06] Scriptonaut: ah, alright busterarm, thanks
[22:48:07] shock_one: has joined #RubyOnRails
[22:48:56] busterarm: i hear nothing but glowing praise for Sequel, tbh
[22:49:05] busterarm: haven't used it though
[22:50:27] baweaver: has joined #RubyOnRails
[22:50:58] mary5030: has joined #RubyOnRails
[22:52:53] qejk: has joined #RubyOnRails
[22:55:49] arooni-mobile: has joined #RubyOnRails
[22:56:28] elgee123: has joined #RubyOnRails
[22:56:33] lethjakman: has joined #RubyOnRails
[22:56:58] hahuang65: has joined #RubyOnRails
[22:58:57] DukeDave: has joined #RubyOnRails
[23:00:12] bonhoeffer: has joined #RubyOnRails
[23:01:13] joshsmith: has joined #RubyOnRails
[23:02:49] arBmind1: has joined #RubyOnRails
[23:02:58] doodlehaus: has joined #RubyOnRails
[23:06:42] kitsuneyo: has joined #RubyOnRails
[23:06:48] shock_one: has joined #RubyOnRails
[23:07:39] wethu: has joined #RubyOnRails
[23:08:24] zenspider: has joined #RubyOnRails
[23:08:51] charliesome: has joined #RubyOnRails
[23:09:06] erichu: has joined #RubyOnRails
[23:09:31] zenspider: is it possible (preferably easy as well) to render in a test w/o setting up a route / controller / request / response? Specifically want to test view helpers using assert_select.
[23:09:44] hahuang65: has joined #RubyOnRails
[23:10:11] kitsuneyo: Another beginner question. I have three models, Game, Person and PersonGameCredit. A game has_many people through person_game_credits. I want to find all the people where person_game_credit has the :credited_as value "Director". How do I do it?
[23:10:32] shock_one: has joined #RubyOnRails
[23:10:48] kitsuneyo: I can get all the people with @people = @game.people.all
[23:11:13] kitsuneyo: But I don't know how to set conditions for people based on person_game_credits
[23:12:58] kitsuneyo: I guess it's pretty simple, anyone mind helping me?
[23:13:41] hosh__: has joined #RubyOnRails
[23:13:52] bruno-: has joined #RubyOnRails
[23:14:17] bmurt: has joined #RubyOnRails
[23:14:47] lethjakman: has joined #RubyOnRails
[23:16:10] ebryn: has joined #RubyOnRails
[23:16:26] sump: has joined #RubyOnRails
[23:17:19] workmad3: has joined #RubyOnRails
[23:19:20] bruno-: has joined #RubyOnRails
[23:19:50] ledestin: has joined #RubyOnRails
[23:20:53] fighella: has joined #RubyOnRails
[23:21:23] andrew9184: has joined #RubyOnRails
[23:23:21] jottr: has joined #RubyOnRails
[23:24:45] bruno-: has joined #RubyOnRails
[23:26:22] willywos: has joined #RubyOnRails
[23:26:47] tuelz: has joined #RubyOnRails
[23:28:21] busterarm: @game.people.where(@game.person_game_credit.credited_as == "Director")?
[23:28:41] busterarm: big huge guess there
[23:29:35] busterarm: i'd probably set up a custom relation that has the where filter on it
[23:30:08] nya: has joined #RubyOnRails
[23:32:11] baweaver: has joined #RubyOnRails
[23:35:03] bruno-: has joined #RubyOnRails
[23:35:49] hahuang65: has joined #RubyOnRails
[23:37:25] blackmes1: has joined #RubyOnRails
[23:39:49] ephantmon: has joined #RubyOnRails
[23:41:36] shock_one: has joined #RubyOnRails
[23:45:39] michael_mbp: has joined #RubyOnRails
[23:47:12] malcolmva: has joined #RubyOnRails
[23:50:24] zorak8: has joined #RubyOnRails
[23:51:07] nickenchuggets: has joined #RubyOnRails
[23:51:37] dcunit3d: has joined #RubyOnRails
[23:54:12] DylanJ: diegoviola: it's dope. play with it.
[23:54:19] ewitchin: has joined #RubyOnRails
[23:54:42] diegoviola: DylanJ: sequel?
[23:54:50] balr0g: has joined #RubyOnRails
[23:55:06] DylanJ: i used it just the other day for a tiny ruby project that needed some persistence.
[23:55:45] zenspider: too bad it isn't warning free...
[23:56:33] tejasmanohar: has joined #RubyOnRails
[23:56:46] DylanJ: zenspider: is rails "warning free"?
[23:57:08] ewitchin: has left #RubyOnRails: ()
[23:57:09] zenspider: if it isn't, it's a bug.
[23:57:41] Limix: has joined #RubyOnRails
[23:58:05] diegoviola: what do you mean warning free?
[23:58:27] zenspider: I mean that it runs warning free
[23:58:39] DylanJ: diegoviola: ruby -w yourthings.rb