« Back to channel list

#RubyOnRails - 15 July 2015

« Back 1 day Forward 1 day »
[00:01:17] vaq: Hi I got a table with a number of td's produced by a loop. http://pastie.org/private/ucmximc2p7fchvh5bka One of td's lists the hours of the given shift. Is it possible to calculate the total sum of hours outside the loop? I did try <%= my_calendar.map(:hours).sum %> outside the loop but it results in wrong number of arguments calling `map` (1 for 0) which I don't understand
[00:03:27] baweaver_: has joined #RubyOnRails
[00:04:13] blackmes1: has joined #RubyOnRails
[00:05:21] exchgr`: has left #RubyOnRails: ()
[00:05:28] SteenJobs: has joined #RubyOnRails
[00:05:29] EXCHGR: has joined #RubyOnRails
[00:07:29] Cache_Money: has left #RubyOnRails: ()
[00:08:04] surrealanalysis: has joined #RubyOnRails
[00:09:11] Grundell: has joined #RubyOnRails
[00:09:57] bruno-: has joined #RubyOnRails
[00:10:12] Oog_: has joined #RubyOnRails
[00:15:43] ekain: has joined #RubyOnRails
[00:16:00] w0rd-driven: has joined #RubyOnRails
[00:18:09] smathy: vaq, &:hours not :hours
[00:18:25] pontiki: vaq: http://api.rubyonrails.org/classes/ActiveRecord/Calculations.html#method-i-sum
[00:19:07] smathy: vaq, but it looks like you're actually calculating each shift_assignment's `hours` inside the loop?
[00:19:28] smathy: vaq, ie. it's not a method on ShiftAssignment
[00:20:16] vaq: smathy: i put this inside my controller now: def hours ((end_time - start_time) / 1.hour).to_i end
[00:20:45] vaq: smathy: so my td row is now <td><%= shift_assignment.rostered_position.hours %></td>
[00:21:31] giowong: has joined #RubyOnRails
[00:21:32] vaq: smathy: so I should now be able to use <%= my_calendar.map(&:shift_assignment.rostered_position.hours).sum %> outside my loop to get total number of hours right?
[00:23:16] sevenseacat: has joined #RubyOnRails
[00:23:42] giowong_: has joined #RubyOnRails
[00:24:06] vaq: smathy: does that make sense?
[00:25:11] gambl0re: has joined #RubyOnRails
[00:25:20] smathy: vaq, I assume you meant that you put the `hours` method inside your model (you said inside your controller).
[00:25:36] vaq: smathy: sorry yes, inside my model
[00:25:55] sp33drac3r: has joined #RubyOnRails
[00:27:54] smathy: vaq, but no, you can't ues &: with a method chain like that, you'd need a proper block.
[00:28:10] smathy: vaq, FWIW, you can use `inject` so you're just accumulating the total as you loop: https://gist.github.com/smathy/df1249c134e7a96fb4ea
[00:32:15] vaq: smathy: many thanks
[00:32:19] simplyianm: has joined #RubyOnRails
[00:34:29] jfelchner: has joined #RubyOnRails
[00:35:35] smathy: vaq, you're welcome.
[00:36:38] givanse: has joined #RubyOnRails
[00:41:05] VeryBewitching: Can someone potentially point out the obvious? Is there some different that has to be done for a controller in the admin scope? https://gist.github.com/bewitchingme/71953ba71332d7157183
[00:41:19] VeryBewitching: The test does not pass, just wondering why?
[00:41:34] arooni-mobile: has joined #RubyOnRails
[00:42:46] jfelchner: has joined #RubyOnRails
[00:45:13] giowong: has joined #RubyOnRails
[00:45:19] yashinbasement: has joined #RubyOnRails
[00:45:48] ledestin: has joined #RubyOnRails
[00:47:04] pontiki: did you get an error?
[00:48:21] bricker: VeryBewitching: 1. Look at `rake routes` output, 2. you're probably looking for "namespace", not "scope"
[00:48:23] VeryBewitching: Ya, I updated the gist with it
[00:48:44] darrencauthon: has joined #RubyOnRails
[00:48:53] VeryBewitching: The route is admin_user_path
[00:49:05] VeryBewitching: For that particular route.
[00:49:06] SuMo_D: has joined #RubyOnRails
[00:52:08] erich: has joined #RubyOnRails
[00:52:51] Axsuul: Anyone successfully running guard with their vagrant machine?
[00:52:53] VeryBewitching: bricker: Changing it to namespace made that test pass, but how?
[00:54:24] navo: has joined #RubyOnRails
[00:55:09] leslie: has joined #RubyOnRails
[00:55:09] leslie: has joined #RubyOnRails
[00:55:24] kies^: has joined #RubyOnRails
[00:56:33] leeky: has joined #RubyOnRails
[00:56:36] JeramyRR: has joined #RubyOnRails
[00:59:27] VeryBewitching: And wait, no, it is failing.
[01:00:06] VeryBewitching: It's the scoped variable, admin_scope: true
[01:00:19] VeryBewitching: Err.. parameter rather.
[01:00:51] xkickflip: has joined #RubyOnRails
[01:02:20] _djbkd: has joined #RubyOnRails
[01:04:25] madhums: has joined #RubyOnRails
[01:04:43] arooni-mobile: has joined #RubyOnRails
[01:05:17] nettoweb: has joined #RubyOnRails
[01:05:59] GriffinHeart: has joined #RubyOnRails
[01:06:00] neruda: has joined #RubyOnRails
[01:06:35] erich: has joined #RubyOnRails
[01:07:05] peeja: has joined #RubyOnRails
[01:07:20] Coldblackice: has joined #RubyOnRails
[01:08:19] vere: has joined #RubyOnRails
[01:10:33] earthquake: has joined #RubyOnRails
[01:10:39] annlewis_: has joined #RubyOnRails
[01:12:28] nzst: has joined #RubyOnRails
[01:12:40] Creeves: has joined #RubyOnRails
[01:14:18] helpa: has joined #RubyOnRails
[01:14:21] Radar: !botsnack
[01:14:21] helpa: Nom nom. Thanks, Radar!
[01:14:40] helpa: has joined #RubyOnRails
[01:14:48] one_zero: has joined #RubyOnRails
[01:18:43] darrik: has joined #RubyOnRails
[01:18:44] darrik: has joined #RubyOnRails
[01:19:59] LearningCN: has joined #RubyOnRails
[01:21:12] annlewis: has joined #RubyOnRails
[01:22:18] helpa: has joined #RubyOnRails
[01:22:23] SteenJobs: has joined #RubyOnRails
[01:22:56] robbyoconnor: has joined #RubyOnRails
[01:23:21] helpa: has joined #RubyOnRails
[01:23:56] Creeves: has joined #RubyOnRails
[01:24:21] neruda: has joined #RubyOnRails
[01:24:54] CGibsonmm: has joined #RubyOnRails
[01:25:19] bronson: has joined #RubyOnRails
[01:27:56] unreal: has joined #RubyOnRails
[01:30:13] neruda: question about form binding: for dynamic nested forms, is it necessary to create objects via new or build for each row or is it enough to have a properly constructed params hash when posting the form?
[01:30:47] doodlehaus: has joined #RubyOnRails
[01:31:04] Anakat: has joined #RubyOnRails
[01:31:31] annlewis_: has joined #RubyOnRails
[01:31:35] bluesnow: has joined #RubyOnRails
[01:31:41] Creeves: has joined #RubyOnRails
[01:31:47] bluesnow: Hi, it's been a while since I worked with Rails and I need to set up a rails app
[01:32:10] bluesnow: So right now I tried to run bin/rails server and I got "your ruby version is 1.9.2, but your gemfile specified 2.2.2"
[01:32:31] bluesnow: I'm on Ubuntu..is there an easy way to upgrade my ruby to 2.2.2 and install the libs specified in the gemfile?
[01:32:55] jfelchner: has joined #RubyOnRails
[01:32:55] Radar: bluesnow: setting up a development environment or a production environment?
[01:33:14] bluesnow: Radar: a development environment right now, though I'll eventually have to get this pushed to a production environment tonight..
[01:33:51] Radar: Best to deploy to Heroku.
[01:33:57] Radar: As for your local environment: http://ryanbigg.com/2014/10/ubuntu-ruby-ruby-install-chruby-and-you//
[01:34:10] Aeyrix: The one true guide.
[01:34:13] Radar: How did you install Ruby in the first place?
[01:34:30] Miesco: has joined #RubyOnRails
[01:34:36] bluesnow: Radar: Thanks. It's been about two years since I worked with Ruby / Rails, so I don't really remember.
[01:34:54] Radar: bluesnow: Does the command "rvm" show you anything?
[01:34:54] Aeyrix: You haven't updated your dev environment for two years?
[01:35:26] Miesco: Hi. How come I get this from 'bundle exec rake test': https://gist.github.com/c697770c830b17577d74
[01:35:31] bluesnow: Radar: yeah, rvm does show me the instructions for rvm
[01:35:44] Radar: bluesnow: "rvm implode" then follow that guide to development environment bliss.
[01:35:54] bluesnow: Aeyrix: Well, I've been doing non Ruby/ Rails dev for two years
[01:35:54] Radar: Miesco: hello again!
[01:35:55] Maletor: has joined #RubyOnRails
[01:36:02] Miesco: Radar: Hi
[01:36:08] Radar: Miesco: I finished the guide btw: http://ryanbigg.com/2015/07/deploying-a-rails-application-on-ubuntu-passenger-edition/
[01:36:12] Radar: It's ~3k words.
[01:36:14] OS_Connoisseur: has joined #RubyOnRails
[01:36:38] Aeyrix: http://i.imgur.com/0TyImuS.gif
[01:37:01] Radar: Miesco: Likely because it guard-minitest can't find the guard gem.
[01:37:06] Radar: I don't know why that would be.
[01:37:27] Miesco: Here is my Gemfile: https://gist.github.com/7b6eb0bc6ace4a8307a7
[01:38:18] Radar: https://rubygems.org/gems/guard-minitest doesn't depend on guard.
[01:38:23] Radar: Add guard to the test group in your gemfile as well
[01:38:50] beauby: has joined #RubyOnRails
[01:39:27] Anakat: has joined #RubyOnRails
[01:39:34] Miesco: Radar: Hey did you make that guide in markdown? Where did you get the template?
[01:39:54] Aeyrix: That's his site's styling.
[01:40:16] Miesco: Radar: Weird how my book didn't tell me to add the guard gem.
[01:40:21] sevenseacat: lol at guard-minitest not depending on guard
[01:40:23] Radar: Miesco: I sure did: http://git.io/vmncS
[01:40:33] Radar: Miesco: The styling of the post is my custom theme.
[01:40:47] Radar: Really shows off my design chops (I'm a developer can you tell?)
[01:40:50] Aeyrix: > To install a Ruby version system-wide.
[01:40:53] Aeyrix: > system-wide
[01:40:56] Radar: Aeyrix: neg
[01:41:01] Radar: actually works well in this situation
[01:41:11] Aeyrix: This situation is the situation I am generally in.
[01:41:28] Aeyrix: Except not passenger.
[01:41:37] jenrzzz: has joined #RubyOnRails
[01:41:48] sevenseacat: my blog repo is sekrit so no-one can see my drafts >:)
[01:42:44] siemprefresco: has joined #RubyOnRails
[01:42:47] mary5030: has joined #RubyOnRails
[01:43:26] GreySyntax: has joined #RubyOnRails
[01:43:39] Aeyrix: sevenseacat: lol
[01:43:43] Aeyrix: IHATETURBOLINKSIHATETURBOLINKSIHATETURBOLINKS
[01:43:51] Aeyrix: nice draft
[01:44:02] sevenseacat: nah, but there's a couple posts in there atm like on remote working and testing in phoenix
[01:44:03] bmurt: has joined #RubyOnRails
[01:44:22] yashinbasement: how to replace ntext new line char in sql , anyone ?
[01:44:32] Radar: yashinbasement: example
[01:44:43] Radar: yashinbasement: You've gotta stop asking questions without providing examples.
[01:45:03] yashinbasement: okay wait sorry
[01:45:26] eggoez: has joined #RubyOnRails
[01:45:26] lethjakman: has joined #RubyOnRails
[01:46:42] yashinbasement: https://gist.github.com/1342fad51b6bc247c0ba.git
[01:46:54] yashinbasement: https://gist.github.com/Narwal21/1342fad51b6bc247c0ba
[01:47:09] sevenseacat: thats... not good sql and also nothing to do with rails
[01:48:12] Miesco: ACTION ponders writing a guide to install ruby from debian packages... apt-get install ruby && export GEM_HOME=$(ruby -e 'puts Gem.user_dir')
[01:48:21] Aeyrix: Why the fuck would you do that?
[01:48:24] sevenseacat: please don't.
[01:48:48] sevenseacat: I would consider that to be a legitimately bad thing.
[01:48:57] sevenseacat: and would decry it at every opportunity.
[01:48:59] Aeyrix: Actually, do it.
[01:49:01] Aeyrix: I want to blog about it.
[01:49:10] Radar: bbl, lunch
[01:49:11] mary5030_: has joined #RubyOnRails
[01:51:29] sevenseacat: I want to shoot activeadmin.
[01:51:55] pontiki: it's the humane thing to do
[01:52:03] rhizome: activeadmin is user friendly, it's just picky about yadda yadda
[01:52:06] Aeyrix: What're you saddled with it for, sevenseacat?
[01:52:24] sevenseacat: Aeyrix: the app I'm working on at work uses it
[01:52:55] CGibsonmm: has joined #RubyOnRails
[01:53:49] lethjakman: has joined #RubyOnRails
[01:57:10] abuzze: has joined #RubyOnRails
[01:58:50] GriffinHeart: has joined #RubyOnRails
[01:59:43] seank_: has joined #RubyOnRails
[01:59:53] surrealanalysis: has joined #RubyOnRails
[02:00:01] Scriptonaut: has joined #RubyOnRails
[02:01:54] tenderlove: has joined #RubyOnRails
[02:04:29] beauby: has joined #RubyOnRails
[02:05:36] kil0byte: has joined #RubyOnRails
[02:08:32] bluesnow: Okay, when I run bin/rails server I'm now getting /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- bundler/setup (LoadError)
[02:08:33] bluesnow: from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
[02:08:33] bluesnow: from /home/david/eclipse_workspace/visualepidiego/config/boot.rb:4:in `<top (required)>'
[02:08:50] bluesnow: Woops, sorry for the multi line paste. Is that because I'm missing libraries specified in my gemfile?
[02:09:50] Creeves: has joined #RubyOnRails
[02:10:37] bluesnow: nvm, forgot to switch to the right ruby version
[02:10:42] GriffinHeart: has joined #RubyOnRails
[02:13:10] ValicekB: has joined #RubyOnRails
[02:13:52] kenndel: has joined #RubyOnRails
[02:15:49] crdpink: has joined #RubyOnRails
[02:20:33] sevenseacat: what isnt helping is the amount of hacks the team here has put into place ti customize parts of AA
[02:21:01] rhizome: convention is highly important in the AA world :/
[02:23:05] earthquake: has joined #RubyOnRails
[02:25:48] bluesnow: Okay, so I'm setting up a Rails application and I can start the server successfully but it's missing the database. I've installed PostgreSQL so now I just need to initialize the database correctly with the right data (there's a seeds.rb file)
[02:25:49] beauby: has joined #RubyOnRails
[02:26:01] bluesnow: What are the right commands for this? rake db:create right?
[02:26:02] jeromelanteri: i need help please: i would like to show list of "enum" in a select combobox ... how to do that ?
[02:26:14] bluesnow: And then there's a command for running the seed file I think..?
[02:26:14] bricker: has joined #RubyOnRails
[02:26:27] jeromelanteri: i use simple_form also...
[02:26:38] bluesnow: Sorry, this is my first time working with Rails again after 2 years ish and I can't remember how to set an app up
[02:27:20] jeromelanteri: bluesnow: is your database runing and have access ?
[02:27:32] bluesnow: Yeah, I'm pretty sure it's running on 127.0.0.1
[02:27:42] bluesnow: and I should have access I think
[02:28:00] jeromelanteri: bluesnow: your rails app access it from localhost to ?
[02:28:13] bluesnow: let me check
[02:28:56] shyshy: has joined #RubyOnRails
[02:29:55] bluesnow: jeromelanteri: Ah no. I get ActiveRecord::NoDatabaseError (FATAL: role "david" does not exist
[02:30:26] bluesnow: I did create a user and password for my postgres db though..how do I tell it to use the user I created?
[02:30:34] jeromelanteri: bluesnow: ok, so first, you have to go in your database and create user, or define an other one user to acces it from config/database.yml
[02:31:16] jeromelanteri: if you need to access later your database from an other computer, you need also to config it in files config of postgresql... for allow the ip of your computer want to access it.
[02:31:18] crdpink2: has joined #RubyOnRails
[02:31:40] bluesnow: well I've created a user, I'm not sure how to tell the Rails app to use that user. I looked in database.yml but there's no setting of user/user pw in there
[02:31:59] jeromelanteri: bluesnow: take care of technic of indentation of id... there is 2 possibilities: 1 normal id indentation, 2 uuid identation
[02:32:25] jeromelanteri: bluesnow: look inside config/databas.yml (from your directory of your nex Rails app
[02:33:08] jeromelanteri: then there is some "groups" options... one is default (serve for all... other are development, test and production
[02:33:20] jeromelanteri: so default is common configs...
[02:33:51] darrencauthon: has joined #RubyOnRails
[02:33:52] bluesnow: I tried updating the DB user and pw, but it now says that the authentication failed for the user
[02:33:55] jeromelanteri: nneed to indicate the adapter inside this default group: so for postgresql, adapter: postgresql
[02:33:58] bluesnow: let me try debugging this
[02:34:32] jeromelanteri: check also the encoding access char... for me it is unicode (by default on postgresql)
[02:34:50] jeromelanteri: encoding: unicode (in default group)
[02:36:27] Pharaoh2: has joined #RubyOnRails
[02:36:27] jeromelanteri: bluesnow: here is my copy of my databas.yml file: https://gist.github.com/jerome2/f5a05ed282925e6f02f4
[02:37:52] ur5us: has joined #RubyOnRails
[02:38:14] jeromelanteri: also, when this is ok, you have to create the database by rake db:create (you can also add some data inside by a file named seed.rb (inside "db" directory on your app)
[02:38:42] bluesnow: hmm I'm still getting PG::ConnectionBad (FATAL: Peer authentication failed for user "postgres"
[02:38:50] jeromelanteri: then you will see (if access is ok) the 3 databases created and named by the name you give them (from database.yml)
[02:39:15] jeromelanteri: do you have an user "postgres" access from your app ?
[02:39:35] jeromelanteri: or did you want an other one user ?
[02:40:14] Mastedon: has joined #RubyOnRails
[02:40:36] jeromelanteri: as you can see, for safe access (username and password), i give the name of the user and password from env variable (define from linux with export)
[02:42:20] bluesnow: yeah I have a postgres user in my database
[02:42:25] bluesnow: how do I check that my database is running?
[02:42:33] jeromelanteri: for do this: from console, i do "export PGSQL_USER="my user name" (the name of the variable is a choice i do... it is not an obligation
[02:42:48] jeromelanteri: are you under linux os ?
[02:42:54] bluesnow: I'm on ubuntu
[02:43:12] jeromelanteri: ok... many different possibility.
[02:43:26] jeromelanteri: you can check wich services are "on"
[02:43:36] jeromelanteri: for me: sudo systemctl status
[02:43:49] sevenseacat: can I step in here?
[02:43:54] jeromelanteri: if you use systemd, it could be the same
[02:44:03] jeromelanteri: sevenseacat: yes
[02:44:06] sevenseacat: bluesnow: what problem are you having?
[02:44:22] bluesnow: sevenseacat: I'm trying to set up my database for a rails app
[02:44:32] bluesnow: I've installed PostgreSQL successfully, but am now stuck
[02:44:34] sevenseacat: ok cool, postgres?
[02:44:46] beauby: has joined #RubyOnRails
[02:44:46] sevenseacat: what does your database.yml look like, and what error are you getting
[02:45:03] bluesnow: let me paste a gist
[02:46:20] bluesnow: Ok, here http://pastebin.com/8JrRtQPh
[02:46:25] peeja: has joined #RubyOnRails
[02:46:36] bluesnow: oh woops, didn't know not to use pastebin
[02:47:08] LearningCN: has joined #RubyOnRails
[02:47:41] bluesnow: sevenseacat: The error I'm getting is PG::ConnectionBad (FATAL: Peer authentication failed for user "postgres"):
[02:48:05] sevenseacat: can you uncomment the line in your database.yml under `development` that says "host: localhost"
[02:48:15] jeromelanteri: sevenseacat: i let you help...
[02:48:33] bluesnow: sevenseacat: ? That's already uncommented
[02:48:51] sevenseacat: sorry, I have pastebin blocked so I didn't see :)
[02:49:32] bluesnow: sevenseacat: https://gist.github.com/davidxc/731387a56cf67a9021d6
[02:49:46] duderonomy: has joined #RubyOnRails
[02:49:53] smathy: ACTION is tired from arguing with team members about not putting assets directly in public/assets
[02:49:56] sevenseacat: your postgres password is 'blank' ? >_>
[02:50:10] bluesnow: sevenseacat: no, that's just a temp replacement xD
[02:50:24] sevenseacat: ok, so the password is correct and you're sure about it?
[02:50:43] bluesnow: I think so..I just created the postgresql user and pw
[02:50:45] bluesnow: let me check again
[02:50:58] Pharaoh2: has joined #RubyOnRails
[02:51:12] GriffinHeart: has joined #RubyOnRails
[02:51:56] bluesnow: sevenseacat: okay, apparently not..
[02:52:01] Grundell: has joined #RubyOnRails
[02:52:23] bluesnow: that's weird. I'm pretty sure I created that user and pw after installing postgres
[02:52:24] sevenseacat: smathy: if anyone does that, punch them. you have my permission.
[02:52:54] sevenseacat: bluesnow: keep in mind thats a postgres user's details, not a ubuntu user's details
[02:53:12] sevenseacat: k cool, just double checking
[02:53:14] bluesnow: oh maybe my postgres server is not running anymore >_>
[02:53:15] jeromelanteri: sevenseacat: bluesnow: i think you have also (the best way i think) to create user access from user name you use for Rails app... inside the postgresql database. And also, have (create ) a password for postres user access: "passwd postgres"
[02:53:32] bluesnow: how do I start postgres again o.o
[02:53:33] sevenseacat: it's running.
[02:54:12] jeromelanteri: then from database, you can create your home user... and define his password to... then run the database. (if command line is difficult access for you, there is pgadmin 3 can do jobs... very easy)
[02:54:32] GriffinHeart: has joined #RubyOnRails
[02:54:47] smathy: sevenseacat, luckily, I work remotely.
[02:55:10] pontiki: telefacestabby
[02:56:27] jeromelanteri: bluesnow: you have to run the service for start it. For me, it is "sudo systemctl start postgresql.service"
[02:56:31] SuMo_D: has joined #RubyOnRails
[02:56:42] jeromelanteri: but depend of your services manager...
[02:56:49] smathy: It's running or you'd get a different error bluesnow
[02:57:06] smathy: Oh, heh, sevenseacat already said that.
[02:57:09] bluesnow: sevenseacat: https://help.ubuntu.com/community/PostgreSQL - the "postgres" database role in the Basic Server Setup section is the same as the "user" right?
[02:57:14] jeromelanteri: if you want it to run after boot time, you need to do: sudo systemctl enable postgresql.service
[02:57:21] bluesnow: I set the password for that database role
[02:58:24] sevenseacat: yeah that sets the password for the postgers user to postgres, i think.
[02:58:55] sevenseacat: it's not what I would do (I don't use the postgres user for anything), but eh
[02:59:09] bluesnow: sevenseacat: Oh! Yay I'm getting access now
[02:59:21] bluesnow: now I get the error ActiveRecord::PendingMigrationError
[02:59:45] jeromelanteri: because you not have full privilege abilities...
[02:59:53] pramsky: has joined #RubyOnRails
[03:00:02] Radar: bluesnow: run your migrations on your datavase.
[03:00:26] pontiki: not on your mingvase, tho
[03:00:44] bluesnow: hmm ok ran my migrations
[03:00:48] sevenseacat: then all should be good :)
[03:00:51] bluesnow: but I haven't even initialized the database with seeds.rb yet
[03:01:00] sevenseacat: thats fine, you can do that later
[03:01:22] bluesnow: sevenseacat: Okay..I ran my migrations
[03:01:22] CGibsonmm: has joined #RubyOnRails
[03:01:26] bluesnow: now should I run seeds.rb?
[03:01:27] nzst: has joined #RubyOnRails
[03:01:39] sevenseacat: if you have seeds you want to run, then you can with rake db:seed
[03:01:42] smathy: I have lots of pretty datavases.
[03:01:49] bluesnow: I actually thought I had to run rake createdb before all this
[03:02:04] jeromelanteri: sevenseacat: i need help... i try to create a combobox with simple_form for show a list of enum choices... how to do that ?
[03:02:37] jeromelanteri: rake db:create
[03:02:40] sevenseacat: jeromelanteri: https://github.com/plataformatec/simple_form#collections
[03:02:41] bluesnow: when I run rake db:seed I get warning: Insecure world writable dir /usr/bin in PATH, mode 040777
[03:02:42] bluesnow: rake aborted!
[03:02:42] bluesnow: Gem::LoadError: You have already activated rake 10.4.2, but your Gemfile requires rake 10.3.2. Prepending `bundle exec` to your command may solve this.
[03:02:56] bluesnow: ack, sorry for the multi line paste again
[03:02:59] sevenseacat: then you should prepend rake db:seed with bundle exec
[03:03:00] jeromelanteri: sevenseacat: i read it, but this not answer for my problem in fact.
[03:03:00] smathy: bluesnow, go on, see if you can work this one out on your own ;)
[03:03:01] _djbkd: has joined #RubyOnRails
[03:03:06] smathy: Aww, wrecked.
[03:03:29] sevenseacat: jeromelanteri: then you might have to be more specific about your problem, because that details how you can create all kinds of collection fields.
[03:03:31] bluesnow: haha, wasn't sure whether I should fix it some other way
[03:04:10] aerotus: has joined #RubyOnRails
[03:04:34] smathy: bluesnow, definitely worth trying those things, many error messages in the rails/ruby world are actually helpful.
[03:04:49] bluesnow: okay, got it
[03:04:54] bricker: has joined #RubyOnRails
[03:05:04] jeromelanteri: sevenseacat: ok. I will try... i create a column named "categorie" in the table "wconcerns" (type: integer) then i create an "enum" type from that in my wconcern.rb model: "enum categorie: ["no one", "travails", "voyages"]
[03:05:25] CGibsonmm_: has joined #RubyOnRails
[03:05:26] sevenseacat: jeromelanteri: can you make a gist of your code?
[03:06:12] jeromelanteri: then from a simple_form from a view for edit/new on "photos" model/controller part, i would like to show a select of collection who just list the enum possibilities: "no one", "travails", "voyages"
[03:06:23] jeromelanteri: sevenseacat: ok... i paste it...
[03:06:24] sevenseacat: jeromelanteri: gist.
[03:06:32] jeromelanteri: the form view ?
[03:06:35] beauby: has joined #RubyOnRails
[03:06:41] sevenseacat: and the model.
[03:09:40] peeja: has joined #RubyOnRails
[03:09:45] DiabolikFreenode: has left #RubyOnRails: ()
[03:10:12] jeromelanteri: https://gist.github.com/jerome2/b4b57c003cfcd68ab0a3
[03:10:16] braincrash: has joined #RubyOnRails
[03:10:20] Diabolik: has joined #RubyOnRails
[03:10:48] speaking1ode: has joined #RubyOnRails
[03:11:33] bungoman: has joined #RubyOnRails
[03:11:46] josh2: has joined #RubyOnRails
[03:12:21] sevenseacat: and the problem with that code is?
[03:13:06] jeromelanteri: the wconcern model for access db, is linked by Travail model (inside the Travail.rb model: belongs_to :wconcern) and photos is linked with travail by link: belongs_to :travail
[03:13:47] jeromelanteri: the problem is that i list only the categorie of each wconcern. That i want is to list the categorie choices: "no_one, travails, voyages...
[03:13:52] CGibsonmm: has joined #RubyOnRails
[03:15:08] jeromelanteri: from this choices, i would be able dynamicly (with jquery) to load concerned type of article and titles of each... just for be able from a photo to link them to an article.
[03:15:11] kil0byte: has joined #RubyOnRails
[03:15:24] sevenseacat: ok, so thats what you want to do. but what is the problem with the code you *have*?
[03:15:29] simplyianm: has joined #RubyOnRails
[03:16:02] jeromelanteri: the code works, but not do what i want, because i don't understand how to pass in the collection this "enum" list of choices.
[03:16:34] sevenseacat: I cannot help you if you cannot tell me what the problem is, sorry.
[03:16:44] jeromelanteri: this list is only define in the wconcern model by: "enum categorie: [ :no_one, :travails, :voyages]
[03:16:50] Radar: Steps to reproduce problem, kthx
[03:16:56] jeromelanteri: sevenseacat: i try to tell you.
[03:17:47] Radar: Mastedon: it doesn't work. Please try again later.
[03:18:05] jeromelanteri: i don't know how to tell it more simple: "i have a enum list created in my wconcern model... then i just want to list in a select box (line 231) the different choices exist (this choices are, from the wconcern model: "no_one, travails, voyages").
[03:18:24] jeromelanteri: sevenseacat: is it clear ?
[03:20:09] jeromelanteri: sevenseacat: please... is it more clear ? just show the conent choice of an enum list... is it more clear ? (i don't know... what i ask is not clear ? tell me)
[03:20:14] Mastedon: I have a question on loading server from Ruby 2.2
[03:20:38] jeromelanteri: Mastedon: rails s
[03:20:51] Radar: jeromelanteri: patience young one
[03:21:04] Radar: On both counts.
[03:21:09] jeromelanteri: Radar: ok... i'm afraid to not be clear... sorry.
[03:21:35] Radar: jeromelanteri: !gist-usage
[03:21:35] helpa: jeromelanteri: How to use Gist properly: https://github.com/radar/guides/blob/master/using-gist.markdown
[03:21:40] Radar: jeromelanteri: Separate your gist into multiple files
[03:21:42] Radar: jeromelanteri: That's step #1.
[03:21:52] mary5030: has joined #RubyOnRails
[03:21:56] Radar: jeromelanteri: Step #2: Point to what you want to do in your Gist by clicking on the line and then copying+pasting the URL here
[03:22:14] jeromelanteri: yes, you tell me allready, i'm on fault... ok, i look at this and paste better. thanks.
[03:22:16] Radar: I THINK you're wanting to get an enum list into a select box but I am not 100% sure.
[03:22:36] jeromelanteri: Ps: and for post an image of the result ?
[03:23:01] jeromelanteri: Radar: yes, absoluty what i would like to do.
[03:23:26] Radar: What's this about an image?
[03:23:29] rhizome: paste your post
[03:23:46] jeromelanteri: Radar: it's about to paste a image of result view i have from my code...
[03:23:57] jeromelanteri: but maybe it is not necessary ?
[03:24:02] Radar: jeromelanteri: imgur.com if you want to share screenshots
[03:24:06] Radar: https://gist.github.com/jerome2/b4b57c003cfcd68ab0a3#file-gistfile1-txt-L14 if you want to point to specific lines
[03:24:26] jeromelanteri: ok. i will go for try to give you informations in form you need. thank you.
[03:24:51] Mastedon: Ok so I'm new here. Loaded Ruby 2.2 and Rails and cannot get sqlite3 to load - gives error. So I want to find out how to redirect server to something else like Webrick.
[03:24:58] Diabolik: sup everyone
[03:25:26] pontiki: Mastedon: sqlite3 is a database management system. not a web server.
[03:25:32] Pharaoh2: has joined #RubyOnRails
[03:25:37] pontiki: you need to install sqlite3 itself for your platform
[03:26:29] josh2: has joined #RubyOnRails
[03:26:50] GriffinH_: has joined #RubyOnRails
[03:28:15] Mastedon: Yes I know it's db, but the "AutoInstall" that is supposed to magically do all this, does not set up properly so that sqlite3 loads without error. On one blog, someone who claims to manage sqlite3 says he has not coded upgrade for Ruby 2.2
[03:28:28] theery: has joined #RubyOnRails
[03:28:32] sevenseacat: what autoinstall?
[03:28:46] sevenseacat: sqlite3 on windows definitely wasnt compatible with ruby 2.2 last I checked.
[03:28:54] sevenseacat: that was a couple months ago though.
[03:29:10] Radar: Mastedon: What OS?
[03:29:12] Radar: Mastedon: What error?
[03:29:13] jeromelanteri: Radar: i not see... how to point a specific line please ?
[03:29:15] Radar: Mastedon: What installer>
[03:29:21] Radar: jeromelanteri: Click on the line number. The URL will update.
[03:29:33] Radar: jeromelanteri: Then you need to copy+paste the URL here so you can show me which line you're looking at.
[03:30:10] eggoez: has joined #RubyOnRails
[03:32:54] mary5030: has joined #RubyOnRails
[03:33:02] jeromelanteri: like that better ? https://gist.github.com/jerome2/d283668dc2e822e5809d
[03:33:52] Radar: Yes, much better :)
[03:34:01] Radar: Now where are you trying to put this select box? Show me the line.
[03:34:17] jeromelanteri: line 19 (it is pointed) on the _form.haml file
[03:34:53] jeromelanteri: (the point not works... i don't know why...)
[03:35:00] darrencauthon: has joined #RubyOnRails
[03:35:00] Mastedon: It the auto installer from RubyInstaller.org. I'm on Win 7 (don't yell). I'm not sure I want to get into the error since I think consensus is it won't work with 2.2 (not sure why they have it precoded as the default for preloading the server...
[03:35:05] Radar: You need to click the line number then copy + paste the URL
[03:35:15] sevenseacat: Mastedon: use ruby 2.1.6.
[03:35:38] jeromelanteri: Radar i done it, for 3 files...
[03:35:40] sevenseacat: because Ruby on windows is crap.
[03:35:58] Radar: jeromelanteri: No, you didn't. The URL you showed me does not show any line highlighted.
[03:36:04] Radar: https://gist.github.com/jerome2/d283668dc2e822e5809d#file-_form-haml-L19
[03:36:11] Radar: See how that URL is different to the one you posted?
[03:36:35] jeromelanteri: Radar: yes, it not show it, but i'm not a lier... i done it i tell you again. the line was blue color.
[03:36:45] SuMo_D: has joined #RubyOnRails
[03:36:52] Radar: ACTION palmfaces
[03:36:54] jeromelanteri: you want i try again ?
[03:36:57] willywos: has joined #RubyOnRails
[03:36:59] jeromelanteri: or line 19 is ok ?
[03:37:18] Radar: I don't think I can help you because I don't know what you want for line 19.
[03:37:32] Radar: Maybe you want Wconcern.categories there
[03:37:37] Radar: or whatever the class method is
[03:37:38] jeromelanteri: Radar: yes i see the reasult is not as i thank... what you want ? sorry sir... :)
[03:38:30] jeromelanteri: Radar: i would like: show the different choices for enum list of categorie. So: see the list: no_one, travails, voyages
[03:39:46] Mastedon: So I just would like to find out where the default "server" file is located so I can change it to something else like Webrick
[03:40:07] Radar: Mastedon: Follow sevenseacat's directions.
[03:40:25] sevenseacat: Mastedon: sqlite3 is not a server. it's a database system./
[03:40:31] jeromelanteri: Mastedon: when you call command "rails s", you call webrick.
[03:41:38] Mastedon: Sevenseacat: Yes I know SQL Lite is a db
[03:41:41] jeromelanteri: Mastedon: Webrick server don't care about your database... it just show you the content of html pages generates.
[03:41:54] sevenseacat: Mastedon: then I'm sure you can appreciate that your question doesnt make sense.
[03:42:07] jeromelanteri: Mastedon: you normally have nothing to do with webrick for database.
[03:42:19] sevenseacat: how do I ignore people in textual -_-
[03:42:37] pontiki: there's a menu... i don't recall now, though
[03:42:41] pontiki: something about users
[03:42:45] sevenseacat: ah hah, found it
[03:42:58] pontiki: i'm back to good ol' irssi
[03:43:05] kil0byte: has joined #RubyOnRails
[03:43:10] jeromelanteri: is someone want to help me please ?
[03:43:31] jeromelanteri: or if you don't know, tell it simply.
[03:44:14] Aeyrix: sevenseacat: /ignore.
[03:44:23] Aeyrix: This is why I like my Telegram chat. :D
[03:45:39] jeromelanteri: someone here know how to list in a select box choices of "enum" type content ? for exemple, in a model, define enum as: "enum categorie: [:no_one, :travails, :voyages]". then how to just show this list inside a select box ?
[03:45:43] baweaver_: has joined #RubyOnRails
[03:46:00] Radar: jeromelanteri: p.s. patience is a virtue
[03:46:15] Grundell: has joined #RubyOnRails
[03:46:28] Radar: [13:37:30] <Radar> Maybe you want Wconcern.categories there
[03:46:32] Radar: jeromelanteri: Did you try that suggestion at all?
[03:46:41] jeromelanteri: i ask it 2 days ago, avery day... i'm not only patient, i'm also perseverant.
[03:46:43] Radar: Because I created a test app and that shows me {"no_one"=>0, "travails"=>1, "voyages"=>2}
[03:47:00] jeromelanteri: i try it Radar... wait ing please.
[03:47:13] nickenchuggets: has joined #RubyOnRails
[03:47:13] nickenchuggets: has joined #RubyOnRails
[03:47:40] jeromelanteri: Radar: for collection: or for label_method: ?
[03:47:41] Mastedon: "Rails s" tries to load Sqlite3. All I want to do is edit the "s" file that is trying to load Sqlite.
[03:47:47] Radar: jeromelanteri: !try
[03:47:47] helpa: jeromelanteri: Why don't you try it and find out for yourself?
[03:47:52] jeromelanteri: or directly for association ?
[03:47:56] Radar: Mastedon: Gemfile + config/database.yml
[03:47:57] sevenseacat: Mastedon: because you created a rails app that uses sqlite3
[03:47:57] Aeyrix: Mastedon: config/database.yml ?
[03:48:15] sevenseacat: its the app that wants to use sqlite, not the server.
[03:48:41] bluesnow: hmm..I'm getting an UndefinedTable error and not entirely sure why. So when I access a page I get "ActiveRecord::StatementInvalid ... relation "trends" does not exist"
[03:48:50] Radar: bluesnow: Because you didn't run your migrations.
[03:48:50] pontiki: Mastedon: the "s" in "rails s" stands for "server", not "sqlite"
[03:48:55] Aeyrix: bluesnow: It's kind of a self-explanatory error.
[03:48:56] sevenseacat: bluesnow: because the table doesnt exist.
[03:49:01] bluesnow: In my seeds.rb file, I have csv.each do |row| .. Trend.create!(row.to_hash)..
[03:49:10] Aeyrix: bluesnow: Run `rake db:migrate`.
[03:49:19] sevenseacat: do you even have a migration to create a trends table?
[03:49:23] doctorly: has joined #RubyOnRails
[03:49:58] Radar: bluesnow: Is that error happening locally or on the server?
[03:50:03] doctorly: Does anyone use a time tracker in vim or terminal? I am looking at options but can't find a whole lot of opinions on what really works
[03:50:08] bluesnow: locally. let me check my migrations folder
[03:50:09] Mastedon: Ahhh! Thank you Radar: and Sevenseacat: That is exactly what I wanted. Thanks!
[03:50:15] Radar: doctorly: I use Toggl but it's not in a terminal.
[03:50:18] sevenseacat: doctorly: seems unrelated to rails.
[03:50:24] Radar: bluesnow: `rake db:migrate` should fix it.
[03:50:54] bluesnow: okay yeah I don't have a migration that creates a trends table..
[03:51:01] doctorly: sevenseacat: it is very related, because it involves tracking time on specific tasks related to rails projects. I would have posted somewhere else if it was more relevent.
[03:51:15] bluesnow: I thought the seeds.rb would do it, but I guess not
[03:51:18] Radar: doctorly: what sevenseacat is saying is that you should've posted in #time-tracking-apps
[03:51:30] CGibsonmm: has joined #RubyOnRails
[03:51:34] bluesnow: Hmm this is odd since the table exists on the online application so I'm not sure why there's no migration for it
[03:51:54] Radar: bluesnow: might be inferred from the schema. Try `rake db:reset` instead.
[03:52:14] jeromelanteri: Radar: ok... better, but not show me the categorie of the wconcern linked to the photo by the article... here is: https://gist.github.com/jerome2/9cb1ccbe0a99bd704b48#file-_form-haml-L19
[03:52:22] bluesnow: Radar: Well I just looked at schema.rb and there's no trends table in there either
[03:52:25] Radar: bluesnow: if that doesn't fix it, please gist (https://gist.github.com) your db/schema.rb
[03:52:43] Mastedon: I did not create the app. It is the default install process that "someone" developed as part of the RubyonRails auto installer package. And the doc makes it sound like it's all magic and all one has to do is write some Ruby code.
[03:52:44] Radar: jeromelanteri: I don't know how to fix that, sorry.
[03:52:45] sevenseacat: new requirements appear!
[03:52:49] doctorly: Radar: Lmfao
[03:52:57] sevenseacat: Mastedon: sure, if you're using a compatible version of ruby.
[03:53:03] jeromelanteri: Radar: ok, thank you for your help and patience man.
[03:53:03] Radar: jeromelanteri: I would need to see an application which reproduced the issue that you're seeing. I'm pretty sure other people would need to see an application too.
[03:53:06] sevenseacat: the makers of rubyinstaller have nothing to do with the maintainers of sqlite.
[03:53:17] sevenseacat: Mastedon: use ruby 2.1.6.
[03:53:33] Aeyrix: what auto-installer?
[03:53:39] Aeyrix: Even Windows doesn't have an auto-installer, does it?
[03:53:40] sevenseacat: rubyinstaller.
[03:53:42] Aeyrix: Fuck I hope not.
[03:53:45] Aeyrix: For rails?
[03:53:50] Radar: Aeyrix: stop
[03:53:51] Aeyrix: ddos comin
[03:54:01] Radar: ACTION tunes helpa some more
[03:54:11] Aeyrix: Radar: You need an exemptions list.
[03:54:20] Radar: Aeyrix: patches welcome
[03:54:28] Aeyrix: This one's open-source?
[03:54:32] bluesnow: Yeah I have no idea where this trends table would be coming from. It's not in any migrations and its not in schema.rb
[03:54:46] Mastedon: I just tried to follow the "easy install" directions on the site. I should know better than to trust auto installers. LoL. Thanks All!
[03:54:47] sevenseacat: bluesnow: then you probably shouldnt try and insert data into it :)
[03:54:49] Radar: Aeyrix: https://github.com/radar/railsbot
[03:54:55] jeromelanteri: sevenseacat: just for check... could you see me ?
[03:55:04] Aeyrix: Radar: Well dip me in cream and squat me in a kitchen of kittens, you actually open-sourced a channel bot.
[03:55:13] Radar: Aeyrix: Smart move
[03:55:18] sevenseacat: ACTION remembers writing the windows installation guide in Rails 4 in Action.
[03:55:26] sevenseacat: ACTION used Ruby 2.1.6.
[03:55:38] bluesnow: sevenseacat: Well, I'm not trying to insert data. This is all past code trying to insert / pull data from it.
[03:55:54] sevenseacat: well no, your seeds file is trying to insert data.
[03:55:57] sevenseacat: and you are running the seeds, so
[03:56:44] helpa: has joined #RubyOnRails
[03:56:54] sevenseacat: personally, I'd learn to love something other than windows, but ruby 2.1.6 will do for learning rails.
[03:56:54] jeromelanteri: sevenseacat: ho my God... you done it really... i'm really sorry for this action... it's a shame, i not do nothing bad. so ok, i have to do same and forget you, sorry man. peace.
[03:57:09] helpa: has joined #RubyOnRails
[03:57:23] jeromelanteri: wow... ok, i thank you ignore me... sorry.
[03:57:24] quarters: has joined #RubyOnRails
[03:57:30] jeromelanteri: that's fine, have a good day.
[03:58:01] theery: has joined #RubyOnRails
[03:58:20] Aeyrix: Radar: Patch incoming.
[03:58:34] Radar: Aeyrix: gg no re
[03:59:08] quarters: I've been following the tutorial on railstutorial.org but am finding issues when working with git as advised. I noticed that when working on a branch "hotfix" I can run "bundle exec rake test" just fine but when I do it in the master branch, I get a list of errors, which I can include in a gist if needed
[03:59:27] Radar: quarters: yes please do gist
[03:59:35] quarters: I wish that the tutorial had accounted for errors so that I don't have to start from scratch
[03:59:51] Radar: quarters: The tutorial (like all good tutorials) assumes the users follow them exactly :)
[03:59:56] Aeyrix: Radar: Is line 215 of bot.rb meant to be an "||" instead of an "&&"?
[04:00:23] Radar: Aeyrix: Code correct until proven otherwise.
[04:00:27] quarters: https://gist.github.com/zebralight/29d00385ee39c4e7eb24
[04:00:34] Aeyrix: Radar: Only you can forget commands.
[04:00:42] Radar: Aeyrix: Yup.
[04:00:44] quarters: Radar: I understand that but...I don't know...
[04:01:03] quarters: it's not super realistic
[04:01:04] Radar: hahahahah this error again
[04:01:20] Radar: Oh Michael. Your intentions are good, but your code is really shit.
[04:01:47] Radar: quarters: https://gist.github.com/anonymous/c697770c830b17577d74 look familiar?
[04:02:02] Radar: quarters: You need to add gem 'guard' to the test environment block too.
[04:02:10] Radar: Follow the previous conversation from here: http://logs.ryanbigg.com/RubyOnRails?date=2015-07-15#3624366
[04:02:16] pontiki: i think tutorials should make errors, then show you they get fixed
[04:02:30] quarters: pontiki: exactly my point
[04:02:39] pontiki: then write some!
[04:02:39] Radar: This is not an intentional error.
[04:02:51] Radar: This is a mistake because the gems have been updated recently and fucked everything over.
[04:03:02] quarters: I ended up having to learn to use git and vim(for vimdiff) far more than I had hoped at this point in my path
[04:03:36] pontiki: git and your editor are *far* FAR more important to understand completely
[04:03:36] quarters: I went in hoping to just learn some rails
[04:03:41] pontiki: you'll use them more than anything else
[04:04:17] quarters: pontiki: but I was hoping to learn them just enough to get me moving forward again
[04:04:46] quarters: especially since I don't know which vim or git guide will teach me the "basics"
[04:04:48] crdpink: has joined #RubyOnRails
[04:04:51] Radar: less qq more pew pew
[04:04:54] quarters: vs . EVERYTHING
[04:04:58] sinkensabe: has joined #RubyOnRails
[04:04:58] Radar: quarters: please prove me correct so that I can feel good about myself
[04:05:12] quarters: Radar: haha. one second
[04:05:30] willywos: does anyone know if the params hash always makes the values strings ?
[04:05:40] Radar: willywos: Yes it does.
[04:06:01] willywos: you know of any documentation on it?
[04:06:04] pontiki: https://www.codefellows.org/blog/this-is-why-learning-rails-is-hard
[04:06:05] Radar: willywos: UNLESS you're in a controller spec, in which case the params will be whatever are passed along. At least, that's the behaviour I remember.
[04:06:17] tenderlove: has joined #RubyOnRails
[04:06:29] quarters: Radar: the thing is guard isn't included ANYWHERE in the gemfile in either branch
[04:06:47] pontiki: does hartl use guard?
[04:06:57] Radar: quarters: Gemfile.lock from both branches, please.
[04:07:05] quarters: well, the error's gone, but now the test looks different
[04:07:09] Radar: quarters: Or if you could share the link on GitHub that would be great.
[04:07:16] SuMo_D: has joined #RubyOnRails
[04:07:32] quarters: Radar: ok. I'll have to push it first
[04:07:40] Radar: willywos: here's some documentation: http://goo.gl/nqK7iz
[04:07:41] bungoman: has joined #RubyOnRails
[04:10:25] krz: has joined #RubyOnRails
[04:11:47] bluesnow: Hmm, I found a trend.rb file with class Trend< ActiveRecord::Base in app/models/trend.rb
[04:12:05] bluesnow: Maybe this is creating the database table "trends" somehow..?
[04:12:06] Radar: bluesnow: That's just the model
[04:12:11] Radar: bluesnow: no it won't
[04:12:14] Radar: bluesnow: Where is this app from?
[04:12:26] CGibsonmm: has joined #RubyOnRails
[04:12:45] bluesnow: Radar: It's something that was created by someone external to our organization, and now I need to modify it
[04:13:01] Radar: bluesnow: And you don't have any migrations in it and schema.rb is empty?
[04:13:01] Pupeno: has joined #RubyOnRails
[04:13:01] Pupeno: has joined #RubyOnRails
[04:13:43] bluesnow: There's one migrations file that creates a "countries" table and there's a create_table "countries" in schema.rb
[04:13:47] bluesnow: But that's it
[04:13:50] Radar: loooollll
[04:13:55] quarters: Radar: I think for expediency's sake, I'll just add the gemfiles for both master and other branch since I had reverted to a previous commit making my local master behind the remote master, forcing me to pull before I push
[04:13:59] Radar: You will need to create the migration to create the trends table itself.
[04:14:05] Radar: quarters: ok
[04:14:16] quarters: it might not be THAT messy to y'all, but I'm not prepared to deal with this
[04:14:16] GriffinHeart: has joined #RubyOnRails
[04:14:18] bluesnow: Radar: I see. But I don't really know what fields the trends table needs to have
[04:14:52] bluesnow: Radar: Actually, I might know what fields it needs to have, since seeds.rb is just trying to populate it with a csv file
[04:15:03] bluesnow: csv.each do |row| Trend.create!(row.to_hash)
[04:15:20] bluesnow: so, I guess the trends table just needs the fields in each csv row
[04:15:23] Radar: bluesnow: yay critical thinking
[04:15:29] Radar: bluesnow: I like what you're doing. Keep it up :)
[04:16:04] bluesnow: haha I am trying. I haven't done any Rails for a long long time
[04:16:18] quarters: Radar: https://gist.github.com/zebralight/e099fa39c6ba8721fd9a
[04:16:29] Radar: Aeyrix: There is a bug in the spam protection code which I hope you're patching :)
[04:16:54] x44x45x41x4E: has joined #RubyOnRails
[04:17:36] Radar: Aeyrix: The bug is: if someone is spamming multiple channels at a time, helpa will pick up on that and only notify for the channel that the 5th message was sent to.
[04:17:49] quarters: Radar: actually, I do have a version, though not my current version up for review which exhibits the same issue, so I think it'll prove relevant enough to my issue?
[04:18:51] Radar: quarters: let's see
[04:20:19] quarters: radar: https://bitbucket.org/zebralight/sample_app
[04:20:35] Radar: Clone + bundle install + bundle exec rake test ?
[04:20:49] bluesnow: Radar: Hmm okay. So do I need to add this table to schema.rb and also add a migration for it?
[04:20:56] quarters: oh, can I clone from one branch to the master branch?
[04:21:10] Radar: bluesnow: create a migration and run rake db:migrate which will automatically update schema.rb
[04:21:11] bluesnow: I'm a little unsure about the point of migrations in my app, since it seems like I could just initialize the database with schema.rb everytime and then seed it
[04:21:14] Radar: quarters: what?
[04:21:19] bluesnow: ah okay, thanks
[04:21:22] Radar: bluesnow: migrations are version control for your database
[04:21:24] Radar: !migrations
[04:21:24] helpa: http://guides.rubyonrails.org/migrations.html - Migrations Guide by Frederick Cheung
[04:21:24] quarters: oh, that advice wasn't for me
[04:21:36] Radar: quarters: [14:20:34] <Radar> Clone + bundle install + bundle exec rake test ?
[04:21:38] Radar: That was for you.
[04:21:57] Radar: quarters: I can reproduce the issue on your master branch.
[04:22:11] LearningCN: has joined #RubyOnRails
[04:22:17] quarters: Radar: would I be cloning from the "good" branch to my master branch or clone from the remote repo to local or local to remote?
[04:22:33] Pharaoh2: has joined #RubyOnRails
[04:22:33] Radar: what is the good branch?
[04:22:44] jeromelanteri: why not show me the selected @wconcern.categorie ? (test followed works fine... then selected has to works... but not. https://gist.github.com/jerome2/3aa0492142270b9b4963#file-_form-haml-L22
[04:23:08] quarters: for the latter two, I'm referring to the master branch on both the remote and local repos
[04:23:21] Radar: quarters: p.s. adding guard to the Gemfile on master fixes the issue.
[04:23:27] Radar: quarters: I can run bundle exec rake test OK
[04:23:39] Radar: https://gist.github.com/radar/ff6de85804752c65e3b3
[04:23:39] quarters: Radar: the branch that doesn't have the guard gem added yet allows me to run bundle exec rake test w/out any issues
[04:23:43] Radar: So I am not seeing a problem here.
[04:23:51] Radar: quarters: And you were just about to tell me the actual branch name
[04:24:01] quarters: sign-up is the branch name
[04:24:32] Radar: sign-up doesn't have guard-minitest in the gemfile
[04:24:37] Radar: guard-minitest is what is requiring guard
[04:24:44] Aeyrix: Radar: Does that matter?
[04:24:52] Aeyrix: Like, if they're flooding the shit out of multiple channels yo'll see it anyway.
[04:25:06] Radar: Aeyrix: na :)
[04:25:29] Aeyrix: Also I disagree with your fix on the basis of slight efficiency gains.
[04:25:41] Aeyrix: Unless my understanding of `unless` isn't "basically reverse-if".
[04:25:47] quarters: the master branch is screwed up in some inexplicable way. sure using the guard gem is a workaround but I'd like to keep as close to the tutorial as possible, but also don't want to start from scratch due to some versioning issues
[04:25:59] bluesnow: Given that I'm using postgresql for my database, what would be the easiest place to deploy this rails app? heroku?
[04:26:02] Spami: has joined #RubyOnRails
[04:26:06] Aeyrix: bluesnow: Anywhere.
[04:26:25] quarters: Radar: how would I remove guard-minitest?
[04:26:32] Aeyrix: quarters: Remove it from the Gemfile.
[04:27:08] Radar: bluesnow: Heroku's good.
[04:27:12] quarters: found it :)
[04:27:14] Aeyrix: ACTION sighs.
[04:27:37] quarters: I'm a bit confused because I didn't add it in
[04:27:42] quarters: nor remove it from the other branch
[04:28:13] Radar: Didn't you?
[04:28:22] Radar: Let me introduce you to my 2nd favourite git command
[04:28:23] Radar: git blame
[04:28:45] Aeyrix: Radar patched his git binary so `git blame` just outputs my nick.
[04:28:52] quarters: ok. upon reviewing the tutorial, I see that the instructions did call for adding 'guard-minitest'
[04:29:06] quarters: which I presumably followed
[04:29:11] Radar: https://bitbucket.org/zebralight/sample_app/commits/28335bfb56ecb921b6c81cbe9e4453b44de6e492
[04:29:12] sinkensabe: has joined #RubyOnRails
[04:29:20] Radar: Magical :)
[04:30:02] quarters: Radar: wow, git's pretty cool for forensics
[04:30:48] quarters: I guess it shows just how much I'm just going through the motions
[04:33:10] helpa-bot: has joined #RubyOnRails
[04:33:11] bluesnow: I don't need to tell it that somewhere?
[04:33:13] Hobogrammer_: has joined #RubyOnRails
[04:33:30] Aeyrix: It knows that "Country" is probably going to have a tables called "countries" unless you explicitly tell it otherwise.
[04:33:35] Aeyrix: Welcome to the wonderful world of convention over configuration. :)
[04:33:52] Hardtail_: has joined #RubyOnRails
[04:34:05] Aeyrix: helpa-bot: Are you running with my patch? :^)
[04:34:18] Radar: !botsnack
[04:34:18] helpa: Nom nom. Thanks, Radar!
[04:34:26] Radar: It can't send to the channel
[04:34:40] helpa: has joined #RubyOnRails
[04:34:52] Radar: helpa-ping + helpa couldn't reach each other, so helpa was killed
[04:35:12] Aeyrix: Why do you have a helpa-ping bot?
[04:35:38] Radar: To check for netsplits on Freenode
[04:35:45] darrencauthon: has joined #RubyOnRails
[04:35:55] Radar: Both bots connect to different points in freenode. If they can't reach each other, then it's assumed helpa is incorrect and it is killed
[04:36:08] Radar: if it still can't connect, then helpa-ping commits suicide and reconnects
[04:36:14] Radar: The whole dance keeps going until they can see each other
[04:36:21] Aeyrix: You could just monitor for `*.net *.split`?
[04:36:32] Radar: not necessarily always the cause
[04:36:38] Radar: helpa has had bugs in the past which have taken it down
[04:36:47] Aeyrix: Bad coding.
[04:36:56] Radar: Because Ruby ;)
[04:37:51] Aeyrix: IRCCloud apparently lags out when Freenode netsplits.
[04:39:09] levifig: has joined #RubyOnRails
[04:39:23] lytol_: has joined #RubyOnRails
[04:40:30] Grundell: has joined #RubyOnRails
[04:40:37] dideler: has joined #RubyOnRails
[04:40:40] Oog: has joined #RubyOnRails
[04:40:53] ephantmon: has joined #RubyOnRails
[04:41:39] bronson: has joined #RubyOnRails
[04:42:06] bluesnow: Is it legal to have a database field like "ACCESS.1990" with a period in the middle?
[04:42:26] Aeyrix: Use an underscore.
[04:42:49] bluesnow: Well, the headers in my CSV have periods, so I'm kind of assuming that they should be periods if at all possible
[04:43:27] bluesnow: Or are you saying that those periods automatically get translated to underscores?
[04:43:35] Aeyrix: I'm saying that you should be using an underscore.
[04:43:43] Aeyrix: You can probably use a period but you'll need to escape it properly.
[04:43:54] firevolt: has left #RubyOnRails: ()
[04:44:16] bluesnow: My seeds.rb file does Trend.create!(row.to_hash)..with the csv rows, and the csv rows have "ACCESS.1990" as the header
[04:44:22] bluesnow: which is why I think I need to use periods
[04:44:48] Aeyrix: I envisage a lot of pain if you don't just rename the headers.
[04:44:50] Aeyrix: How many headers?
[04:44:57] robbyoconnor: has joined #RubyOnRails
[04:44:58] Radar: You can probably do some kind of transformation on the dataset during the seeds script.
[04:45:29] bluesnow: Like 30 headers. The problem is I'm not sure if the data is also being queried with periods elsewhere in my code
[04:45:43] bluesnow: I haven't really read the code at all since this is a last minute thing that got assigned to me
[04:45:45] Vols: has joined #RubyOnRails
[04:45:48] Radar: ACTION goes to Cmd+Tab and Mr. Cat hits space a couple of times.
[04:45:54] Radar: Fair warning: cat is awake and roaming free
[04:46:14] Aeyrix: What's your cat's name?
[04:46:16] Radar: bluesnow: confirm for "ACCESS.1990" elsewhere in your codebase.
[04:46:19] bluesnow: The convention seems to be to use the csv headers everywhere, so I'm assuming that's what they did here (even though the migration is missing)
[04:46:20] mary5030: has joined #RubyOnRails
[04:46:23] Radar: Aeyrix: Dex
[04:46:29] eminencehc_: has joined #RubyOnRails
[04:46:35] bluesnow: yeah let me check, though I don't know if they wrote it explicitly or are just referencing another file..
[04:46:50] Radar: bluesnow: database fields with a period in them aren't allowed in SQL (afaik)
[04:47:24] bluesnow: ah I see. Okay I'll do some searching and try to see what they replaced it with
[04:48:04] srinidhi: has joined #RubyOnRails
[04:50:19] nzst: has joined #RubyOnRails
[04:50:31] quarters: so it looks like 'bundle exec rake test' works without guard on the sign-up branch and so I proceeded to remove the guard gem from the master branch and also deleted gemfile.lock. But for some reason, the old version of gemfile.lock automatically regenerates without me entering 'bundle install
[04:51:52] quarters: even when renaming gemfile.lock to gemfile1111.lock another gemfile.lock appears
[04:52:15] Sylario: has joined #RubyOnRails
[04:52:38] kil0byte: has joined #RubyOnRails
[04:53:18] Radar: That might be Spring doing htat.
[04:53:56] DoubleMalt: has joined #RubyOnRails
[04:54:53] bhuvanaurora: has joined #RubyOnRails
[04:56:55] Lightsword: has joined #RubyOnRails
[04:57:39] sevenseacat: lolspring #nukeitfromorbit
[04:57:46] x44x45x41x4E: has joined #RubyOnRails
[04:58:05] x44x45x41x4E: has left #RubyOnRails: ()
[04:58:29] DoctorMonocular: has joined #RubyOnRails
[05:01:07] VeryBewitching: It's somewhat comforting to know that the only problem my tests is me.
[05:01:16] VeryBewitching: ACTION goes looking for a beer.
[05:01:20] Radar: missing a word
[05:02:18] VeryBewitching: I didn't compensate for stringex 'acts_as_url' field not being set from my fixture
[05:03:07] GriffinHeart: has joined #RubyOnRails
[05:03:13] bricker: has joined #RubyOnRails
[05:04:08] bluesnow: Okay..they do seem to be using periods I think
[05:04:23] yaymukund: has joined #RubyOnRails
[05:04:32] bluesnow: So for example, in the csv we have ACCESS.1990, ACCESS.2000, and ACCESS.2010 as three headers.
[05:04:38] sp1rs: has joined #RubyOnRails
[05:05:17] bluesnow: They do if indicator == "ACCESS": range = *(4..6) and then for i in range: trends.push({"year" => Trend.column_names[i].partition('.').last, "value" => send(Trend.column_names[i])})
[05:05:45] bluesnow: Trend.column_names[i] should give a field name of the database table I think, and then they partition on "." to get the year
[05:05:59] bluesnow: The only way I can interpret that is that the database fields actually have periods in them
[05:06:33] _djbkd: has joined #RubyOnRails
[05:07:22] rhizome: forsake ye relational
[05:08:56] bluesnow: so how do I use a period in a database field name
[05:08:59] arBmind: has joined #RubyOnRails
[05:10:56] jeromelanteri: why not show me the selected @wconcern.categorie ? (test followed works fine... then selected has to works... but not. https://gist.github.com/jerome2/3aa0492142270b9b4963#file-_form-haml-L22
[05:13:24] yfeldblum: has joined #RubyOnRails
[05:13:33] dhjondoh: has joined #RubyOnRails
[05:13:36] jeromelanteri: bluesnow: timestamp ?
[05:13:46] bluesnow: jeromelanteri: what?
[05:13:54] jeromelanteri: what is a period ?
[05:14:18] bluesnow: I need to create a table with a field called ACCESS.1990
[05:14:33] bluesnow: I'm not sure if I need to / how I can escape that period
[05:15:09] framling: has joined #RubyOnRails
[05:15:16] bluesnow: yes, string type
[05:15:23] jeromelanteri: no need normaly
[05:15:45] bluesnow: okay. so in my migration I can just have t.string :ACCESS.1990
[05:15:52] bluesnow: And the field will correctly get named ACCESS.1990?
[05:15:59] bluesnow: well I'll try it out
[05:16:12] jeromelanteri: it is not a field... in the migration, it is a column.
[05:16:12] chrissonar: has joined #RubyOnRails
[05:16:58] jeromelanteri: then for postgresql, give a name of a column by high caps is possible, but after you will have many ptoblems with interfaces
[05:17:16] jeromelanteri: then better of use _ than .
[05:17:27] rhizome: you can create more sensibly named getters and setters that map to those column names
[05:17:30] bbrowning_: has joined #RubyOnRails
[05:17:36] jeromelanteri: so access_1990 is a better choice i think
[05:17:53] bluesnow: yeah, I would, but this is a bunch of code that I just got assigned to make last minute modifications to
[05:17:54] jeromelanteri: but it is not an obligation
[05:18:01] bluesnow: and they've already used "." everywhere, so I'm stuck for now
[05:18:26] jeromelanteri: there is ability to change all of them from postgresql... with one command.
[05:18:56] jeromelanteri: and migration files is only for do a job... so you can remove, change them, etc...
[05:19:00] sevenseacat: bluesnow: I think you're in for a world of pain and you should go back to whoever gave you this task.
[05:19:19] sevenseacat: its been hours now and you haven't even spun up the app yet.
[05:19:23] riotjones: has joined #RubyOnRails
[05:19:38] bluesnow: sevenseacat: Well this is a summer internship and I'm a rising senior..so I kind of want to just give it my best shot and then forget about it
[05:19:43] bluesnow: sevenseacat: oh the app is working
[05:19:54] sevenseacat: not if you have missing tables
[05:19:55] jeromelanteri: from files access, change words is simple with application edit/replace options to. Maybe this will be more quick and easy than use a strange named column chars
[05:20:05] bluesnow: it's pretty much working completely correctly except for this small display that needs to read from the trends table
[05:20:09] sevenseacat: jeromelanteri: I don't think you're helping.
[05:20:19] kp666: has joined #RubyOnRails
[05:20:25] jeromelanteri: sevenseacat: thank you...
[05:20:48] kp666: has joined #RubyOnRails
[05:20:51] bluesnow: I'll work on it for tonight and see if I get anywhere
[05:21:00] bluesnow: I can crash tomorrow anyway since it's summer :)
[05:21:04] jeromelanteri: but i try. is it wrong ?
[05:21:20] bluesnow: jeromelanteri: No, I appreciate your help
[05:21:35] bluesnow: and you're being helpful
[05:21:38] kronoss: has joined #RubyOnRails
[05:21:54] bricker: what's a more succinct term for "sideloaded objects"
[05:22:23] htmldrum: has joined #RubyOnRails
[05:22:40] bricker: like from an API you'll get the main object(s) at the root and then some associated data also at the root
[05:23:10] kronoss: has joined #RubyOnRails
[05:23:39] GriffinHeart: has joined #RubyOnRails
[05:24:13] htmldrum_: has joined #RubyOnRails
[05:24:20] kronoss: has left #RubyOnRails: ()
[05:24:42] eggoez: has joined #RubyOnRails
[05:25:27] rushed: has joined #RubyOnRails
[05:25:49] htmldrum: has left #RubyOnRails: ()
[05:26:08] htmldrum: has joined #RubyOnRails
[05:27:20] konsolebox: has joined #RubyOnRails
[05:28:00] jeromelanteri: bluesnow: ok, i do my best but sure, sevenseacat and Radar would be a better help when then can/want.
[05:28:13] neopatross: has joined #RubyOnRails
[05:28:14] jeromelanteri: bluesnow: are you ok now ?
[05:28:26] konsolebox: has joined #RubyOnRails
[05:28:29] bluesnow: yes, I think I'm good for now
[05:29:58] GriffinHeart: has joined #RubyOnRails
[05:29:59] jeromelanteri: bricker: i'm not sure, but seems to be some object who are from client or server "side"... it is my interpretation, not sure.
[05:30:26] konsolebox: has joined #RubyOnRails
[05:30:33] jeromelanteri: bricker: maybe for exemple, an object create by a javascript from client side to client side...
[05:31:41] jeromelanteri: why not show me the selected @wconcern.categorie ? (test followed works fine... then selected has to works... but not. https://gist.github.com/jerome2/3aa0492142270b9b4963#file-_form-haml-L22
[05:31:59] x44x45x41x4E: has joined #RubyOnRails
[05:32:42] Oog: has joined #RubyOnRails
[05:33:17] sp33drac3r: has joined #RubyOnRails
[05:33:46] bruno-: has joined #RubyOnRails
[05:34:50] Grundell: has joined #RubyOnRails
[05:36:28] darrencauthon: has joined #RubyOnRails
[05:37:25] bbrowning__: has joined #RubyOnRails
[05:37:40] Aeyrix: https://twitter.com/Aeyrix/status/621191789660082176
[05:38:36] recurrence: has joined #RubyOnRails
[05:39:06] Anakat: has joined #RubyOnRails
[05:40:09] \13k: has joined #RubyOnRails
[05:40:54] robbyoconnor: has joined #RubyOnRails
[05:42:19] smathy: You're just discovering professional trolls?
[05:43:55] sevenseacat: what is that I don't even
[05:44:35] smathy: A professional troll? It's someone, helps if they're insane, who makes inane comments in various forums about borderline insane topics.
[05:45:00] sevenseacat: ACTION implodes
[05:45:01] x44x45x41x4E: Anyone tried using the Upstart scripts for Sidekiq? The manage-one example in their repo aren't that detailed.
[05:45:24] sevenseacat: ACTION goes back to swearing at activeadmin
[05:46:33] bluesnow: okay when I tried to run the migration, I got no .<digit> floating literal anymore; put 0 before dot for my t.string :ACCESS.1990 field
[05:46:56] Radar: bluesnow: I can't believe you're trying to create fields with dots in them still.
[05:46:58] bluesnow: if I add a 0 before the dot, is the field going to be ACCESS.1990 or is it actually going to be ACCESS0.1990?
[05:47:01] Radar: This is insanity.
[05:47:09] bluesnow: Radar: There are multiple places in the code that rely on the dots :(
[05:47:14] Radar: t.string "access.1990" might work
[05:47:19] Aeyrix: sevenseacat: https://disqus.com/by/ilyageller/
[05:47:21] Aeyrix: He posts it OVER AND OVER again.
[05:47:47] bluesnow: Radar: Well it would break the rest of the application which relies on the caps
[05:48:28] Radar: bluesnow: What I posted was a string.
[05:48:30] tvw: has joined #RubyOnRails
[05:48:34] Radar: bluesnow: "ACCESS.1990", if you ust
[05:48:53] Radar: once you get this app working I really do implore you to give these fields better names
[05:48:54] bluesnow: okay I'll try that
[05:49:11] bluesnow: once I get this app working I hope to move on to other things for the remainder of my internship and never see it again >_>
[05:49:19] Radar: Or you'll end up like us with an "email" table which represents franchises, users, retailers and god knows what else.
[05:49:59] Lytol: has joined #RubyOnRails
[05:50:02] bluesnow: Radar: That seems to be the fate of most tech companies from my limited experiences..
[05:50:15] Radar: legacy code is why I am employed a lot of the time :D
[05:50:28] Radar: Legacy code has kept me employed since 2009
[05:50:29] kronoss: has joined #RubyOnRails
[05:50:52] Aeyrix: Maybe you should learn proper code. ;)
[05:51:06] Aeyrix: ACTION prepares for the roasting of a century.
[05:51:23] Radar: Still working on that part.
[05:51:43] mauro1254: has joined #RubyOnRails
[05:53:10] intuxicated: has joined #RubyOnRails
[05:54:14] GriffinHeart: has joined #RubyOnRails
[05:54:21] sinkensabe: has joined #RubyOnRails
[05:54:21] jeromelanteri: why not show me the selected @wconcern.categorie ? (test followed works fine... then selected has to works... but not. https://gist.github.com/jerome2/3aa0492142270b9b4963#file-_form-haml-L22
[05:54:46] krokuz_: has joined #RubyOnRails
[05:54:46] jeromelanteri: i try on rails console to look at the render of @wconcern.categorie, then it give me back "travails".
[05:55:02] jeromelanteri: but for this, maybe i have to give back an integer ?
[05:55:30] jeromelanteri: is there a way for givbe back an integer instaed of a string from enum call ?
[05:57:35] jeromelanteri: here the rails doc: http://api.rubyonrails.org/classes/ActiveRecord/Enum.html
[05:57:59] jeromelanteri: i can not see how to give back the integer instead of the string.
[05:58:34] jeromelanteri: then maybe it is this problem occur on my code i paste and not give bacjk the correct selected categorie in the list.
[05:59:36] bluesnow: *crosses fingers*
[05:59:38] rails663: has joined #RubyOnRails
[06:00:20] bluesnow: I think it worked
[06:01:35] yardenbar: has joined #RubyOnRails
[06:02:34] tagrudev: has joined #RubyOnRails
[06:02:59] bluesnow: woo it's all working correctly. thanks everyone. and thanks to Radar for suggesting to use "ACCESS.1990"
[06:03:03] bluesnow: now I have to make my modifications
[06:03:16] Radar: bluesnow: p.s. my paypal is radarlistener@gmail.com just in case you were wondering
[06:03:32] bluesnow: haha I will send you something tomorrow
[06:03:49] bluesnow: it won't be much because I'm a college student :)
[06:04:18] intinig: has joined #RubyOnRails
[06:05:37] jeromelanteri: if i pass an integer for "selected", this not works more... (sniff)
[06:06:25] jeromelanteri: Radar: no idea ?
[06:06:33] jeromelanteri: sevenseacat: no idea ?
[06:06:40] Radar: jeromelanteri: I have asked yo.
[06:06:41] Radar: Multiple times.
[06:06:42] jeromelanteri: Aeyrix: no idea ?
[06:06:47] Radar: To give me an app which reproduces the issue.
[06:06:48] Radar: You have not done that
[06:06:51] Radar: My patience is at an end.
[06:07:01] Aeyrix: I don't really know why I was just pinged tbh.
[06:07:07] Aeyrix: I'm pretty bad at Rails.
[06:07:07] Radar: Aeyrix: because you're active
[06:07:14] Radar: It's the IRC equiv of Slack's @channel
[06:07:26] Aeyrix: ACTION quit the Slack.
[06:07:36] jeromelanteri: when you talk to me after more than 1 minute, please to give my username first for i can read you... then change your tonality with me, i'm not your dog. ok ?
[06:07:47] Aeyrix: OHBOY.AVI
[06:07:58] jeromelanteri: i'm not your boy to.
[06:08:09] jeromelanteri: at 39 years old i wait for respect.
[06:08:18] Aeyrix: ahahahaha
[06:08:18] Radar: +q jeromelanteri!*@*
[06:08:19] sevenseacat: you might be waiting a while.
[06:08:24] Radar: I asked nicely and now I'm not going to ask nicely.
[06:08:26] Aeyrix: itshappening.gif
[06:08:28] Radar: App to reproduce the issue or ban.
[06:08:49] giowong: has joined #RubyOnRails
[06:09:03] jeromelanteri: has left #RubyOnRails: ()
[06:09:16] riotjones: has joined #RubyOnRails
[06:09:29] Aeyrix: I needed that giggle.
[06:09:57] Radar: I have fucking had it with people who can't follow basic instructions today.
[06:10:02] Radar: He brings it up to 5.
[06:10:08] Aeyrix: Yeah there has been a serious influx of those.
[06:10:13] Radar: I am not showing any mercy for the rest of the day. Fuck feelings.
[06:10:19] Aeyrix: The eternal September has finally reached #rubyonrails.
[06:10:28] Radar: I am trying to do my fucking job and if you're not going to follow my instructions you can piss off.
[06:10:35] Aeyrix: alrite m8
[06:10:38] Aeyrix: calm down a tad
[06:10:40] Aeyrix: you still have ops
[06:10:53] Aeyrix: ok now you can yell
[06:11:10] Radar: I'm done yelling.
[06:11:21] Aeyrix: How's work?
[06:11:25] Aeyrix: Actual work, not #ror work.
[06:11:29] bluesnow: uhh my Gemfile.rb does not have a "production" group. But the heroku guide says that it needs to have a rails_12factor gem in the production group of my gemfile
[06:11:43] arup_r: has joined #RubyOnRails
[06:11:44] bluesnow: However, this app is currently hosted successfully on Heroku (just on an account that I don't have access to)
[06:11:45] Aeyrix: Add one, then.
[06:11:49] Aeyrix: You don't need it.
[06:11:55] Aeyrix: Essentially, all the grouping does is uh
[06:11:57] Radar: Aeyrix: The people at work today are not trying very hard to keep me happy.
[06:12:00] roolo: has joined #RubyOnRails
[06:12:10] Radar: It is leaking into the channel again.
[06:12:13] Aeyrix: bluesnow: Basically the groups are only run when you're running in that mode (dev/test/production)
[06:12:18] bluesnow: Okay. Is there a good guide on setting up a rails app on Heroku?
[06:12:24] Aeyrix: bluesnow: If it's not in a group, it'll be imported no matter what
[06:12:30] Aeyrix: Probably. Just Google it.
[06:12:33] Radar: -q jeromelanteri!*@*
[06:12:35] Aeyrix: I'm sure you can find one.
[06:12:59] rushed: bluesnow: thttps://devcenter.heroku.com/articles/getting-started-with-rails4
[06:13:02] sevenseacat: ACTION gives Radar a cookie
[06:13:14] bluesnow: rushed: thanks
[06:17:41] atmosx: has joined #RubyOnRails
[06:18:46] aganov: has joined #RubyOnRails
[06:20:48] htmldrum: has joined #RubyOnRails
[06:26:39] GriffinHeart: has joined #RubyOnRails
[06:27:45] Contigi: has joined #RubyOnRails
[06:28:38] Aeyrix: Now it's really quiet.
[06:28:45] Aeyrix: I can't tell if I preferred the people that didn't follow instructions.
[06:29:06] Grundell: has joined #RubyOnRails
[06:30:00] freezevee: has joined #RubyOnRails
[06:30:31] raj___: has joined #RubyOnRails
[06:31:25] raj___: What are the best gems to use to get coverage report for a minitest based test suite for a rails application?
[06:32:16] sevenseacat: that used to be the standard
[06:32:42] raj___: okay. is it still the standard? :)
[06:32:52] raj___: I mean ad-hoc standard...
[06:33:53] Rukeal: has joined #RubyOnRails
[06:34:17] tdguy: has joined #RubyOnRails
[06:34:18] krz: has joined #RubyOnRails
[06:36:53] GriffinHeart: has joined #RubyOnRails
[06:37:12] darrencauthon: has joined #RubyOnRails
[06:37:50] Aeyrix: railsbot/railsbot: Merged #41.
[06:37:54] rickmasta: has joined #RubyOnRails
[06:38:00] Aeyrix: I can now shitpost three times as fast.
[06:39:24] nzst: has joined #RubyOnRails
[06:41:25] Radar: It hasn't been deployed yet.
[06:43:24] Maletor: has joined #RubyOnRails
[06:45:05] eGGsha: has joined #RubyOnRails
[06:45:12] marr: has joined #RubyOnRails
[06:45:31] GriffinHeart: has joined #RubyOnRails
[06:48:07] robbyoconnor: has joined #RubyOnRails
[06:49:25] intuxicated: has joined #RubyOnRails
[06:51:35] Sylario: has joined #RubyOnRails
[06:51:47] raj___: has joined #RubyOnRails
[06:52:55] skroon: has joined #RubyOnRails
[06:55:55] Oog: how can i render a string that is an erb template
[06:56:22] Oog: nm i see ERB
[06:58:16] ledestin: has joined #RubyOnRails
[07:00:31] doodlehaus: has joined #RubyOnRails
[07:01:11] ur5us: has joined #RubyOnRails
[07:01:42] bbrowning_: has joined #RubyOnRails
[07:02:29] doodleha_: has joined #RubyOnRails
[07:03:43] artto: has joined #RubyOnRails
[07:04:24] doodlehaus: has joined #RubyOnRails
[07:06:19] doodleha_: has joined #RubyOnRails
[07:06:35] w1xz: has joined #RubyOnRails
[07:08:13] Glyphik: has joined #RubyOnRails
[07:08:14] doodlehaus: has joined #RubyOnRails
[07:10:12] doodlehaus: has joined #RubyOnRails
[07:10:48] Anakat_: has joined #RubyOnRails
[07:12:07] doodlehaus: has joined #RubyOnRails
[07:12:59] darutoko: has joined #RubyOnRails
[07:14:03] doodlehaus: has joined #RubyOnRails
[07:14:17] comrad: has joined #RubyOnRails
[07:14:47] pokky: has joined #RubyOnRails
[07:15:35] pokky: has joined #RubyOnRails
[07:15:55] doodleha_: has joined #RubyOnRails
[07:15:59] Anakat: has joined #RubyOnRails
[07:16:09] CheckYourSix: has joined #RubyOnRails
[07:16:48] raj___: has joined #RubyOnRails
[07:17:50] doodlehaus: has joined #RubyOnRails
[07:17:58] pokky: has left #RubyOnRails: ()
[07:18:05] edwinvdgraaf: has joined #RubyOnRails
[07:19:00] frg133: has joined #RubyOnRails
[07:19:49] doodlehaus: has joined #RubyOnRails
[07:20:25] GriffinHeart: has joined #RubyOnRails
[07:21:44] doodlehaus: has joined #RubyOnRails
[07:22:01] ndrei: has joined #RubyOnRails
[07:23:22] Grundell: has joined #RubyOnRails
[07:23:40] doodleha_: has joined #RubyOnRails
[07:24:42] Mathieu: has joined #RubyOnRails
[07:25:35] doodlehaus: has joined #RubyOnRails
[07:27:33] doodleha_: has joined #RubyOnRails
[07:28:12] user121212: has joined #RubyOnRails
[07:28:40] SirCmpwn: has joined #RubyOnRails
[07:29:26] doodlehaus: has joined #RubyOnRails
[07:29:46] pokky: has joined #RubyOnRails
[07:30:38] lytol_: has joined #RubyOnRails
[07:30:49] user121212: I'm trying to integrate image upload with s3 and I'm getting some error, what will be the reason behind it? here is the logs http://pastebin.com/TenWj5YA
[07:31:21] doodleha_: has joined #RubyOnRails
[07:31:40] ruurd: has joined #RubyOnRails
[07:32:47] user121212: I'm trying to integrate image upload with s3 and I'm getting some error, what will be the reason behind it? here is the logs http://pastie.org/10293466
[07:33:16] doodlehaus: has joined #RubyOnRails
[07:33:19] user121212: and configaration file https://gist.githubusercontent.com/peterberkenbosch/f5be9e65022cd33d3fba/raw/s3_assets_spree.rb
[07:33:24] sevenseacat: sounds like you should check the access key
[07:34:14] GriffinHeart: has joined #RubyOnRails
[07:34:57] bruno-: has joined #RubyOnRails
[07:35:09] doodlehaus: has joined #RubyOnRails
[07:35:09] skroon: has joined #RubyOnRails
[07:35:29] user121212: sevenseacat: I tried the same keys in another project using normal paperclip configuration and it works fine, But I didn't work on my spreecommerce site.
[07:36:38] rails663: Hello, how can I escape () chars in erb?
[07:37:04] doodleha_: has joined #RubyOnRails
[07:37:14] exadeci: has joined #RubyOnRails
[07:38:00] darrencauthon: has joined #RubyOnRails
[07:39:01] doodlehaus: has joined #RubyOnRails
[07:39:30] gnagno: has joined #RubyOnRails
[07:40:58] doodleha_: has joined #RubyOnRails
[07:41:07] Creeves: has joined #RubyOnRails
[07:41:46] sinkensabe: has joined #RubyOnRails
[07:41:54] Trefex: has joined #RubyOnRails
[07:42:32] hefest: has joined #RubyOnRails
[07:42:49] doodlehaus: has joined #RubyOnRails
[07:42:53] hefest: any idea way url path generator is generating urls with + sign instead of space and how can that be changed?
[07:44:35] eGGsha: has joined #RubyOnRails
[07:44:48] doodleha_: has joined #RubyOnRails
[07:46:38] doodlehaus: has joined #RubyOnRails
[07:47:03] DoubleMalt: has joined #RubyOnRails
[07:47:23] giowong: has joined #RubyOnRails
[07:48:29] Spami: has joined #RubyOnRails
[07:48:43] rushed: hefest: because spaces aren't allowed?
[07:48:44] Spami: has joined #RubyOnRails
[07:48:45] doodleha_: has joined #RubyOnRails
[07:48:52] hefest: rushed: in url? yes they are
[07:49:19] sevenseacat: yeah they are, as long as theyre encoded
[07:49:43] sevenseacat: you might not be encoding them
[07:50:28] doodlehaus: has joined #RubyOnRails
[07:50:46] rushed: hefest: spaces are unsafe, they're not allowed, so you would expect them to be encoded (as a + or %20 depending)
[07:50:52] sinkensabe: has joined #RubyOnRails
[07:51:16] hefest: rushed: well, it should be encoded as %20 but instead it's +
[07:51:26] sevenseacat: both are valid
[07:52:28] doodleha_: has joined #RubyOnRails
[07:52:54] hefest: sevenseacat: i know, the thing is urls are indexed by google already with %20, so it should stay that way
[07:53:13] sevenseacat: ok, so, example?
[07:53:41] hefest: sevenseacat: <%= link_to artist.interpret, artist_path(artist: artist.interpret), title: "#{artist.interpret}" %>
[07:53:56] livathinos: has joined #RubyOnRails
[07:54:04] krz: has joined #RubyOnRails
[07:54:10] hefest: artist.interpret contains string with space
[07:54:23] doodlehaus: has joined #RubyOnRails
[07:54:38] kazenjizo_: has joined #RubyOnRails
[07:55:17] Hardtail_: has joined #RubyOnRails
[07:55:26] clamstar: has joined #RubyOnRails
[07:55:51] ptierno: has joined #RubyOnRails
[07:55:57] atmosx: has joined #RubyOnRails
[07:56:05] seank_: has joined #RubyOnRails
[07:56:16] doodleha_: has joined #RubyOnRails
[07:56:25] sevenseacat: ok, thats half of it. what kind of URL does that produce?
[07:56:42] hefest: sevenseacat: the one with spaces replaced by +
[07:57:00] hefest: let me paste you an example
[07:57:13] Dfoolz: has joined #RubyOnRails
[07:57:24] hefest: sevenseacat: <a href="/artist/Michael+Jackson" title="Michael+Jackson">Michael Jackson</a>
[07:58:09] doodlehaus: has joined #RubyOnRails
[07:58:37] neanderslob: has joined #RubyOnRails
[07:58:44] hololeap: has joined #RubyOnRails
[07:58:45] Matadoer: has joined #RubyOnRails
[07:58:51] mikecmpbll: has joined #RubyOnRails
[07:59:43] sevenseacat: ok, that makes more sense - you should just pass the artist object into your artist_path helper, and let it figure out how to construct the URL
[07:59:46] Helheim_: has joined #RubyOnRails
[07:59:55] sevenseacat: it will do all the correct encoding for you
[08:00:05] edwinvdgraaf: has joined #RubyOnRails
[08:00:05] doodleha_: has joined #RubyOnRails
[08:01:23] sinkensabe: has joined #RubyOnRails
[08:01:59] doodlehaus: has joined #RubyOnRails
[08:03:50] Oog: can i put a scope on a has_many
[08:03:56] doodleha_: has joined #RubyOnRails
[08:04:15] simmerz: has joined #RubyOnRails
[08:05:35] Oog: on my vehicle model i put default_scope { where(:deleted => false) } my order model belongs_to :vehicle the problem now is order.vehicle returns nil when the vehicle.deleted is true
[08:05:48] Oog: is there a way to have belongs_to ignore the default scope?
[08:05:52] doodleha_: has joined #RubyOnRails
[08:06:47] sevenseacat: any other yes/no questions? :)
[08:06:48] Oog: how :)?
[08:07:43] doodlehaus: has joined #RubyOnRails
[08:07:45] konsolebox: has joined #RubyOnRails
[08:07:55] sevenseacat: http://guides.rubyonrails.org/association_basics.html#belongs-to-association-reference see section 4.1.3 (and similarly for the has_many question)
[08:08:11] dhjondoh: has joined #RubyOnRails
[08:08:27] hefest: sevenseacat: how can i do that?
[08:08:38] sevenseacat: hefest: artist_path(artist)
[08:09:12] hefest: sevenseacat: but artist is not an model
[08:09:16] Oog: 4.1.3 shows how to add a scope but how can i remove the default scope?
[08:09:16] dmz: has joined #RubyOnRails
[08:09:21] Oog: woudl i just do -> {} ?
[08:09:33] sevenseacat: hefest: well this is news
[08:09:44] doodleha_: has joined #RubyOnRails
[08:09:49] sevenseacat: Oog: by adding a new query.
[08:10:08] tvw: has joined #RubyOnRails
[08:10:26] hefest: sevenseacat: i just tried, it constructed url the same way, with +
[08:10:36] sevenseacat: if your default scope is deleted: false, then change it to deleted: [true, false] or something similar
[08:10:40] Oog: i want it to just be unscoped so i guess -> { where('true') } - so it is essentially a noop...?
[08:10:55] sevenseacat: alternatively, how the crap is your site going to work if you reference deleted objects
[08:10:57] sevenseacat: it probably isnt
[08:10:59] arup_r: has joined #RubyOnRails
[08:11:17] sevenseacat: hefest: so first it couldnt work because it wasnt an artist model, and now you do have an artist model?
[08:11:31] sevenseacat: Oog: that wont change anything.
[08:11:34] doodlehaus: has joined #RubyOnRails
[08:11:37] hefest: sevenseacat: no, i don't have an artist model but it did work
[08:11:44] CheckYourSix: has joined #RubyOnRails
[08:11:46] konsolebox: has joined #RubyOnRails
[08:12:09] baweaver: has joined #RubyOnRails
[08:12:20] Oog: sevenseacat i dont understand how to do it
[08:12:44] sevenseacat: Oog: you need to overwrite the default scope in your new scope
[08:13:33] doodlehaus: has joined #RubyOnRails
[08:14:01] Oog: how...?
[08:14:03] alphaatom: has joined #RubyOnRails
[08:14:06] Oog: i dont want any scope
[08:14:11] Oog: i want it to work like there is none
[08:14:30] sevenseacat: you want no scope at all? absolutely none? use unscoped then
[08:14:33] adre: has joined #RubyOnRails
[08:14:35] sevenseacat: dont blame me when shit breaks though
[08:14:47] konsolebox: has joined #RubyOnRails
[08:14:57] axl_: has joined #RubyOnRails
[08:15:01] Oog: belongs_to :vehicle, -> { where('deleted=true OR deleted=false') } didnt work
[08:15:13] sevenseacat: i'm not surprised.
[08:15:15] Dfoolz: has joined #RubyOnRails
[08:15:27] doodlehaus: has joined #RubyOnRails
[08:15:30] jkwood_: has joined #RubyOnRails
[08:15:32] Oog: it adds to the scope WHERE "vehicles"."deleted" = 'f' AND "vehicles"."id" = $1 AND (deleted=true OR deleted=false)
[08:15:34] Oog: how can i possible delete it
[08:15:47] sevenseacat: I've given you two possible methods now
[08:15:51] sevenseacat: it's up to you to use them.
[08:16:14] Oog: i dont understand how to do the override
[08:16:18] Oog: 4.1.3 doesnt show that
[08:16:57] sevenseacat: Oog: google `unscoped`.
[08:17:19] doodleha_: has joined #RubyOnRails
[08:17:37] arup_r: has joined #RubyOnRails
[08:17:38] Grundell: has joined #RubyOnRails
[08:17:58] hefest: so, how can i create urls with %20 instead of + sign?
[08:18:50] edwinvdg_: has joined #RubyOnRails
[08:19:14] sevenseacat: hefest: so, what does your code look like now?
[08:19:17] doodlehaus: has joined #RubyOnRails
[08:19:36] Oog: sevenseacat https://github.com/markets/unscoped_associations recommended?
[08:19:47] sevenseacat: Oog: you're really not listening are you
[08:19:55] Oog: that is what i got when i googled
[08:20:09] Oog: -> { unscoped } didnt work
[08:20:17] sevenseacat: define 'didnt work'
[08:20:23] arup_r: I want to toggle data inside the Jbuilder template by using `!` ,, But Jbuilder is not doing this ..
[08:20:28] arup_r: so how to do it
[08:20:37] arup_r: https://gist.github.com/aruprakshit/d8beae01f168eba61d87
[08:20:48] arup_r: check this https://gist.github.com/aruprakshit/d8beae01f168eba61d87#file-feed-js-L13
[08:20:58] hefest: sevenseacat: im sorry, i was looking at the wrong code. so the thing is that CGI.escape is generating urls with + sign. how can i generate %20 instead?
[08:21:00] arup_r: I am trying to toggle it.. using `!`
[08:21:09] doodlehaus: has joined #RubyOnRails
[08:21:14] arup_r: but it is showing the result as the method `like?` returns
[08:21:14] sevenseacat: hefest: if you wont answer my questions, I won't help you.
[08:21:17] PpPyg: has joined #RubyOnRails
[08:21:49] Oog: o.vehicle=2, Vehicle with id 2 exists and has deleted=true, default scope is where(:deleted=>false). on order i did belongs_to :vehicle, -> { unscoped }. i then do o.vehicle and get nil and the sql executed is SELECT "vehicles".* FROM "vehicles" WHERE "vehicles"."deleted" = 'f' AND "vehicles"."id" = $1 LIMIT 1 [["id", 2]]
[08:22:01] hefest: sevenseacat: <%= link_to artist.interpret, artist_path(artist: CGI.escape(artist.interpret)), title: "#{CGI.escape artist.interpret}" %>
[08:22:05] mloy: has joined #RubyOnRails
[08:22:47] sevenseacat: hefest: good-o. so what is an artist, if not a model?
[08:22:47] Oog: sevenseacat i see this is supposed to work in rails 4.1... seems like a bug
[08:22:56] Ergo: has joined #RubyOnRails
[08:23:04] doodlehaus: has joined #RubyOnRails
[08:23:10] sevenseacat: Oog: probably, but it's likely in your code.
[08:23:17] hefest: sevenseacat: it's a model in this case, named incorrectly though
[08:23:35] eGGsha: has joined #RubyOnRails
[08:23:36] sevenseacat: hefest: so why can't you use artist_path(artist) again then?
[08:23:50] sevenseacat: if it is a model, when you told me before that it wasnt?
[08:24:10] Oog: sevenseacat https://gist.github.com/anonymous/80653f8883debc729bdb
[08:24:11] hefest: sevenseacat: so, if i use artist_path(artist) it's going to encode the url with %20 instead of + ?
[08:24:13] lxsameer: has joined #RubyOnRails
[08:24:28] sevenseacat: there's an easy way to find out.
[08:24:36] sevenseacat: and it would have been quicker than typing that question.
[08:25:04] doodleha_: has joined #RubyOnRails
[08:25:11] hefest: sevenseacat: im already restarting the docker containing the app. writing the questions while it restarts ;)
[08:25:27] Oog: Vehicle.unscoped.find(2) returns the object
[08:25:38] jsrn_: has joined #RubyOnRails
[08:25:55] sevenseacat: Oog: you may need to rewhere or unscope it then.
[08:26:05] hefest: sevenseacat: ActionView::Template::Error (No route matches {:action=>"artist", :artist=>#<Tab id: nil, interpret: "Metallica">, :controller=>"tabs", :format=>nil, :letter=>"M"} missing required keys: [:artist]):
[08:26:12] sevenseacat: Oog: http://guides.rubyonrails.org/active_record_querying.html#overriding-conditions
[08:26:16] hefest: sevenseacat: there it is, artist_path(artist)
[08:26:57] doodlehaus: has joined #RubyOnRails
[08:27:06] hefest: sevenseacat: using ERB::Util.url_encode instead of CGI.escape solves the issue
[08:27:21] sevenseacat: lol okay. I don't know what on earth you're doing, but glad it's solved.
[08:27:48] kil0byte: has joined #RubyOnRails
[08:27:48] DoctorMonocular: has joined #RubyOnRails
[08:28:06] Oog: unscope(:where) worked thans
[08:28:15] nzst: has joined #RubyOnRails
[08:28:30] hefest: sevenseacat: i told you, trying to escape url but CGI.escape is replacing space with + instead of %20
[08:28:31] sevenseacat: Oog: I think showing deleted items is going to cause you pain.
[08:28:33] jenrzzz: has joined #RubyOnRails
[08:28:55] doodlehaus: has joined #RubyOnRails
[08:28:57] sevenseacat: there's a reason you added the default scope that is going to apply everywhere else.
[08:29:03] hefest: sevenseacat: i mean, thanks for the help and effort, but you were focused on getting the info your way rather than reading what i wrote :)
[08:29:21] sevenseacat: hefest: I knew exactly what you were trying to do.
[08:29:28] sevenseacat: thats completely different than 'what you're doing'
[08:29:32] adre: has joined #RubyOnRails
[08:29:42] Oog: sevenseacat maybe... well see. i mean if you can view the order and the credit card is "delteed" you shoudl still see the credit card
[08:29:47] sevenseacat: you're doing weird things by pretending unpersisted Tab objects are persisted Artist objects
[08:29:54] Oog: i just dont want the credit card showing up in the regulare lsist of credit cards hence the default scope
[08:29:56] jkwood: has joined #RubyOnRails
[08:30:01] sevenseacat: Oog: good luck.
[08:30:02] Oog: but if you get to it through a belongs_to that should be correct
[08:30:12] Oog: but.... if you have a better method please let em know
[08:30:17] sevenseacat: Oog: I think you're wrong, but I wish you luck.
[08:30:21] hefest: sevenseacat: but i just wanted to escape the url using %20 instead of + sign for space
[08:30:29] ruurd: has joined #RubyOnRails
[08:30:34] sevenseacat: problems all solved.
[08:30:37] noodman: has joined #RubyOnRails
[08:30:48] doodleha_: has joined #RubyOnRails
[08:31:09] hefest: sevenseacat: yeah, thanks for the inspiration
[08:31:32] Oog: sevenseacat can you recommend a better way i dont want to go down a rabbit hole
[08:32:46] doodlehaus: has joined #RubyOnRails
[08:32:56] arup_r: Well.. I finally convinced myself .. we can't evaluate Ruby code in Jbuilder, like we do in Erb template...
[08:33:53] x-light: has joined #RubyOnRails
[08:34:38] lxsameer: has joined #RubyOnRails
[08:34:42] doodlehaus: has joined #RubyOnRails
[08:36:36] doodlehaus: has joined #RubyOnRails
[08:38:33] doodleha_: has joined #RubyOnRails
[08:38:43] darrencauthon: has joined #RubyOnRails
[08:40:26] doodlehaus: has joined #RubyOnRails
[08:41:39] baweaver: has joined #RubyOnRails
[08:42:24] doodleha_: has joined #RubyOnRails
[08:42:35] arBmind: has joined #RubyOnRails
[08:42:56] kil0byte: has joined #RubyOnRails
[08:43:31] bronson: has joined #RubyOnRails
[08:44:19] doodlehaus: has joined #RubyOnRails
[08:45:25] _djbkd: has joined #RubyOnRails
[08:46:16] doodleha_: has joined #RubyOnRails
[08:47:45] bluesnow: has left #RubyOnRails: ()
[08:48:09] doodlehaus: has joined #RubyOnRails
[08:48:52] matcouto: has joined #RubyOnRails
[08:50:05] doodleha_: has joined #RubyOnRails
[08:52:00] doodlehaus: has joined #RubyOnRails
[08:52:06] ndrei: has joined #RubyOnRails
[08:53:25] kitsuneyo: has joined #RubyOnRails
[08:53:29] sp1rs: has joined #RubyOnRails
[08:53:57] doodlehaus: has joined #RubyOnRails
[08:55:55] doodleha_: has joined #RubyOnRails
[08:55:57] matcouto: has joined #RubyOnRails
[08:56:25] Oog: oh no... belongs_to :credit_card, -> { unscope(:where) } adding the unscope messes up an order.update!(:credit_card => blah) wtf....
[08:57:47] doodlehaus: has joined #RubyOnRails
[08:57:58] Oog: sevenseacat is this what you were afraid of...
[08:58:24] Oog: that is crazy
[08:59:45] doodlehaus: has joined #RubyOnRails
[09:01:07] bricker: arup_r is so wrong wtf
[09:01:15] bricker: but he left so I can't tell him how wrong he is
[09:01:17] fighella: has joined #RubyOnRails
[09:01:40] doodlehaus: has joined #RubyOnRails
[09:01:49] blackmesa: has joined #RubyOnRails
[09:01:50] user121212: has joined #RubyOnRails
[09:03:45] doodlehaus: has joined #RubyOnRails
[09:04:07] intuxicated: has joined #RubyOnRails
[09:04:07] intuxicated: has joined #RubyOnRails
[09:05:32] doodleha_: has joined #RubyOnRails
[09:07:27] doodlehaus: has joined #RubyOnRails
[09:08:15] BaNzounet: Hey guys, when you've a model foo that has many bar, is it possible to order foo on foo.bars.last.date ASC?
[09:08:42] chinmay_dd: has joined #RubyOnRails
[09:09:20] doodlehaus: has joined #RubyOnRails
[09:09:49] Oog: this is messed up
[09:11:19] doodleha_: has joined #RubyOnRails
[09:11:54] Grundell: has joined #RubyOnRails
[09:11:55] aceRacer: has joined #RubyOnRails
[09:13:13] doodlehaus: has joined #RubyOnRails
[09:15:06] eGGsha: has joined #RubyOnRails
[09:15:08] doodlehaus: has joined #RubyOnRails
[09:15:17] arup_r: has joined #RubyOnRails
[09:16:23] aceRacer: I am not being able to connect the dots between https://github.com/plataformatec/devise/blob/master/app/mailers/devise/mailer.rb#L12 https://github.com/plataformatec/devise/blob/1a0192201b317d3f1bac88f5c5b4926d527b1b39/lib/devise/models/authenticatable.rb#L167 and https://github.com/plataformatec/devise/blob/master/lib/devise/mailers/helpers.rb#L14 .. what happens is in my test I am using https://github.com/plataformatec/devise/blob/master/lib/devis
[09:16:36] arup_r1: has joined #RubyOnRails
[09:16:54] x44x45x41x4E: has left #RubyOnRails: ("Away, for now.")
[09:17:01] doodleha_: has joined #RubyOnRails
[09:18:29] Axsuul: has joined #RubyOnRails
[09:18:56] doodlehaus: has joined #RubyOnRails
[09:19:07] Oog: this unscoped where thing is bad something is fucked up
[09:19:27] Oog: on the object credit_card_id is 1092 and .credit_card returns object with id 1091! wtf
[09:20:12] Oog: sevenseacat this is terrible
[09:20:34] Oog: SELECT "credit_cards".* FROM "credit_cards" LIMIT 1 how dumb
[09:20:49] doodlehaus: has joined #RubyOnRails
[09:21:18] aceRacer: credit_card maybe a stale object .. not sure
[09:22:14] aceRacer: no sorry ignore that
[09:22:46] bricker: BaNzounet: you want to order on a single date?
[09:22:47] doodleha_: has joined #RubyOnRails
[09:23:34] mike___1234: has joined #RubyOnRails
[09:23:37] bricker: Oog: show the code that proves it
[09:24:04] Oog: i fixed it belongs_to :credit_card, -> { unscope(:where => :deleted) }
[09:24:13] Oog: belongs_to :credit_card, -> { unscope(:where) } was the problem
[09:24:43] doodlehaus: has joined #RubyOnRails
[09:26:28] BaNzounet: bricker: Nope, In fact I've Baz that join foo, And I want to get my Baz object order on foo.bar.last.date
[09:26:40] doodleha_: has joined #RubyOnRails
[09:27:24] bricker: BaNzounet: oh... it's possible with a more complex SQL query but not plain AR
[09:28:03] bricker: and that query will be slow, I recommend denormalizing that date if you want to do this efficiently
[09:28:36] doodlehaus: has joined #RubyOnRails
[09:29:11] dANO-: has joined #RubyOnRails
[09:30:30] doodlehaus: has joined #RubyOnRails
[09:33:10] intinig: has joined #RubyOnRails
[09:34:10] wethu: has joined #RubyOnRails
[09:34:33] dANO-: Hi, I used Puma and nginx with capistrano to deploy my rails applications and I would like to put two applications on the same server, I'm setting the nginx configuration (server name different for each application, test1.example.com and test.example.com). The problem is if I go on one or the other url, I am redirected to the first apps. Anyone can help me, for redirected my user in correct applications depend
[09:34:33] dANO-: of the url ?
[09:36:05] jeanlinux: has joined #RubyOnRails
[09:38:30] Ergo: has joined #RubyOnRails
[09:38:33] startupality: has joined #RubyOnRails
[09:39:31] darrencauthon: has joined #RubyOnRails
[09:40:23] GriffinHeart: has joined #RubyOnRails
[09:41:34] intinig: has joined #RubyOnRails
[09:43:19] DeweyD: has joined #RubyOnRails
[09:44:46] eGGsha: has joined #RubyOnRails
[09:45:28] rails663: I'm using paperclip and devise. On edit user profile page, user can see its current avatar, underneath it user can upload new avatar. Everything's ok, but if I upload an image that fails validation, current avatar image will change to the failed one (but it doesn't exists, so only its file name is shown). Does anyone know solution to this?
[09:47:32] Trefex: has joined #RubyOnRails
[09:51:40] chinmay_dd: has joined #RubyOnRails
[09:53:13] Karpah: has joined #RubyOnRails
[09:53:34] krz: has joined #RubyOnRails
[09:55:18] intinig: has joined #RubyOnRails
[09:56:59] ndrei: has joined #RubyOnRails
[09:59:11] dANO-: has joined #RubyOnRails
[10:02:07] xcesariox: has joined #RubyOnRails
[10:02:40] futilegames: has joined #RubyOnRails
[10:03:07] blackhuey: has joined #RubyOnRails
[10:04:00] kil0byte: has joined #RubyOnRails
[10:05:29] abuzze_: has joined #RubyOnRails
[10:06:15] Grundell: has joined #RubyOnRails
[10:08:46] lemonada: has joined #RubyOnRails
[10:09:32] lemonada: How do i pass rails string that is defined in controller to javascript?
[10:12:24] htmldrum: has joined #RubyOnRails
[10:12:40] Diabolik: does anyone have experience using LIKE statements in Rails?
[10:17:07] nzst: has joined #RubyOnRails
[10:19:38] pcpanic: lemonada: store it in a @variable and just put it in your js
[10:20:30] pcpanic: lemonada: if your js is external add an .erb extension sample.js.erb
[10:20:56] bruno-: has joined #RubyOnRails
[10:21:07] chinmay_dd: has joined #RubyOnRails
[10:21:40] Grundell: has joined #RubyOnRails
[10:21:47] heidar: has joined #RubyOnRails
[10:23:07] srinidhi: has joined #RubyOnRails
[10:25:15] chipotle: has joined #RubyOnRails
[10:26:43] GriffinHeart: has joined #RubyOnRails
[10:27:26] kil0byte: has joined #RubyOnRails
[10:27:29] intuxicated: has joined #RubyOnRails
[10:28:03] Grundell: has joined #RubyOnRails
[10:28:20] tes2: has joined #RubyOnRails
[10:28:33] DeweyD: has joined #RubyOnRails
[10:30:54] Tinyyy: has joined #RubyOnRails
[10:32:14] theBestNunu: has joined #RubyOnRails
[10:38:45] eGGsha: has joined #RubyOnRails
[10:39:14] platzhirsch: has joined #RubyOnRails
[10:39:15] Xiti`: has joined #RubyOnRails
[10:40:15] darrencauthon: has joined #RubyOnRails
[10:40:21] platzhirsch: def self.unscoped; with_exclusive_scope { yield where('users.deleted_at is NULL') }; end I thought with this I could chain scopes and have the default scope removed, but if I call this like: User.unscoped { |scope| scope.find(33) } then it adds the default scope again
[10:40:25] platzhirsch: what am I missing here?
[10:41:00] pabloh: has joined #RubyOnRails
[10:41:16] jamey-uk: has joined #RubyOnRails
[10:42:01] jamey-uk: Does anyone know which gem I should use to correctly validate a US cell number where the provided number doesn't yet have the +1 international prefix when entered in a form?
[10:42:19] cornerma1: has joined #RubyOnRails
[10:45:10] vigasdeep: has joined #RubyOnRails
[10:45:49] arup_r: has joined #RubyOnRails
[10:48:02] arup_r: I am thinking to use counter_cache in Rails .. Because some of the counts I am doing frequently in my views.. But what is worrying me, if I add it now.. it wouldn't be updated for the old recrods.. If so what should I do ? I now I can manually update the count, other than that any other options ?
[10:51:23] nickenchuggets: has joined #RubyOnRails
[10:54:32] CheckYourSix: has joined #RubyOnRails
[10:55:20] Elion: has left #RubyOnRails: ()
[10:59:42] arup_r: Well I found one blog post which has answer exactly to my question.. http://blog.obiefernandez.com/content/2011/08/adding-a-counter-cache-to-existing-records.html What is the Rails 4 way to do this? Anything new, or I need to follow the one written there, as nothing new is added ?
[11:01:14] yashinbasement: has joined #RubyOnRails
[11:01:23] kil0byte: has joined #RubyOnRails
[11:01:43] ndrei: has joined #RubyOnRails
[11:02:25] stamina: has joined #RubyOnRails
[11:03:12] yuuvee: has joined #RubyOnRails
[11:04:30] Xiti: has joined #RubyOnRails
[11:04:56] GriffinHeart: has joined #RubyOnRails
[11:05:16] poli: has joined #RubyOnRails
[11:05:28] DEA7TH: has joined #RubyOnRails
[11:05:59] p8m: has joined #RubyOnRails
[11:09:16] Oog: has joined #RubyOnRails
[11:10:09] coetry: has joined #RubyOnRails
[11:10:28] nettoweb: has joined #RubyOnRails
[11:12:07] bhuvanaurora: has joined #RubyOnRails
[11:13:08] wethu: has joined #RubyOnRails
[11:13:35] nettoweb_: has joined #RubyOnRails
[11:14:21] mauro1254: has joined #RubyOnRails
[11:18:29] yardenbar: has joined #RubyOnRails
[11:19:04] allcentury: has joined #RubyOnRails
[11:19:43] nettoweb: has joined #RubyOnRails
[11:22:10] sp1rs: has joined #RubyOnRails
[11:22:13] nickenchuggets_: has joined #RubyOnRails
[11:23:21] bruno-: has joined #RubyOnRails
[11:23:57] nzst: has joined #RubyOnRails
[11:25:52] Lightsword: has joined #RubyOnRails
[11:27:28] Pupeno: has joined #RubyOnRails
[11:28:38] noodman_: has joined #RubyOnRails
[11:28:56] chipotle_: has joined #RubyOnRails
[11:28:56] edwinvdgraaf: has joined #RubyOnRails
[11:29:07] jottr: has joined #RubyOnRails
[11:29:40] Grundell_: has joined #RubyOnRails
[11:29:46] codelahoma_: has joined #RubyOnRails
[11:30:09] tubbo`: has joined #RubyOnRails
[11:30:55] leex_: has joined #RubyOnRails
[11:32:28] alexblom: has joined #RubyOnRails
[11:32:35] ldnunes: has joined #RubyOnRails
[11:32:35] hfp__work: has joined #RubyOnRails
[11:32:39] jkwood_: has joined #RubyOnRails
[11:32:47] masscrx: can anybody tell me what is going on ? https://gist.github.com/masscrx/8e2f8f13df07c58bdaab
[11:32:54] masscrx: (devise gem)
[11:32:57] wwalker_: has joined #RubyOnRails
[11:33:04] DEac-_: has joined #RubyOnRails
[11:33:41] bphogan_: has joined #RubyOnRails
[11:33:48] Creeves: has joined #RubyOnRails
[11:33:48] sevenseacat: masscrx: devise by default adds a length requirement to passwords. in the first case, your password wasnt long enough.
[11:34:03] masscrx: ahhh ok thx
[11:34:08] sevenseacat: if you had've inspected user.errors after the first attempt, it would have said this
[11:34:15] sevenseacat: always check validation errors.
[11:34:33] mozzarel1: has joined #RubyOnRails
[11:34:46] nickenchuggets: has joined #RubyOnRails
[11:34:46] nickenchuggets: has joined #RubyOnRails
[11:34:47] masscrx: what was the method to convert error to more friendly format ?
[11:34:53] dpg1: has joined #RubyOnRails
[11:34:59] diegoviola: has joined #RubyOnRails
[11:35:07] mikecmpb_: has joined #RubyOnRails
[11:35:31] noah256_: has joined #RubyOnRails
[11:35:34] sevenseacat: probably full_messages or something like that.
[11:36:01] siddart_: has joined #RubyOnRails
[11:36:32] NuckingFuts: has joined #RubyOnRails
[11:36:33] lord4163_: has joined #RubyOnRails
[11:36:57] JeramyRR: has joined #RubyOnRails
[11:37:10] \13k_: has joined #RubyOnRails
[11:37:13] jokke-: has joined #RubyOnRails
[11:37:23] bartj3_: has joined #RubyOnRails
[11:37:35] jeanjack: has joined #RubyOnRails
[11:37:54] dionysus69: has joined #RubyOnRails
[11:37:55] brazenbraden: has joined #RubyOnRails
[11:38:12] CheckYourSix: has joined #RubyOnRails
[11:38:56] doodlehaus: has joined #RubyOnRails
[11:39:25] Tarential: has joined #RubyOnRails
[11:39:37] braincrash: has joined #RubyOnRails
[11:40:58] darrencauthon: has joined #RubyOnRails
[11:41:08] eGGsha: has joined #RubyOnRails
[11:41:10] fgo: has joined #RubyOnRails
[11:41:35] CheckYourSix: has joined #RubyOnRails
[11:42:03] sp1rs: has joined #RubyOnRails
[11:42:19] voker57: has joined #RubyOnRails
[11:44:11] Denarii: has joined #RubyOnRails
[11:46:08] meinside: has joined #RubyOnRails
[11:48:15] qejk: has joined #RubyOnRails
[11:50:40] chinmay_dd: has joined #RubyOnRails
[11:52:32] DaniG2k: has joined #RubyOnRails
[11:53:48] Papierkorb: has joined #RubyOnRails
[11:53:53] nya: has joined #RubyOnRails
[11:54:11] wethu: has joined #RubyOnRails
[11:55:33] skroon: has joined #RubyOnRails
[11:55:59] srinidhi: has joined #RubyOnRails
[11:57:35] xcesariox: has joined #RubyOnRails
[11:58:19] rails247: has joined #RubyOnRails
[12:01:40] rails247: hi guys my controller is getting params as -https://gist.github.com/anonymous/9867309acec19251df80
[12:02:05] rails247: Its not able to parse the params
[12:02:48] rikkipitt: has joined #RubyOnRails
[12:02:51] konsolebox: has joined #RubyOnRails
[12:02:56] sevenseacat: thats not a valid gist URL.
[12:03:40] rikkipitt: hey guys, if I have some html from the database, how can I inject a link before the closing </p> tag?
[12:03:52] sevenseacat: rikkipitt: i have a sense of deja vu here.
[12:03:59] sevenseacat: i know you've asked this before.
[12:04:02] rikkipitt: eg <p>Text here [inject link here]</p>
[12:04:14] rikkipitt: dun dun der, possibly sevenseacat
[12:04:39] rails247: sevenseacat: here it is https://gist.github.com/anonymous/fd229d4a05e78a6147df
[12:04:43] rikkipitt: not sure if I properly conveyed my question last time
[12:05:15] sevenseacat: rails247: I'm confused as to what the problem is.
[12:05:46] sevenseacat: that looks like it might be a hash.
[12:06:06] rails247: sevenseacat: if I do params[: mihpayid], i get contents all jumbled up
[12:06:20] sevenseacat: if you remove the space, what do you get?
[12:06:33] kil0byte: has joined #RubyOnRails
[12:07:06] rails247: params[:mihpayid] results in a hash with key - mihpayid and rest of the entire string as the value
[12:07:17] sevenseacat: where did you copy that string from? what do your logs say for the entire request?
[12:07:43] sevenseacat: can you gist what you're actually doing?
[12:07:43] rails247: this is from the logs,
[12:07:58] rails247: sure, give me a second
[12:08:01] mary5030: has joined #RubyOnRails
[12:09:59] edwinvdgraaf: has joined #RubyOnRails
[12:10:32] rails247: sevenseacat: here it is https://gist.github.com/anonymous/7e1afa46f615b63b8ecf
[12:11:03] rails247: sevenseacat: this is a POST resquest by the Payment gateway.
[12:11:27] rails247: my controller can't parse it properly
[12:11:35] sevenseacat: the controller is parsing it just fine.
[12:11:45] renews: has joined #RubyOnRails
[12:11:55] edwinvdg_: has joined #RubyOnRails
[12:12:03] l0oky: has joined #RubyOnRails
[12:12:07] sevenseacat: I presume the 'puts params' is what you posted earlier?
[12:12:40] shyshy: has joined #RubyOnRails
[12:13:40] rails247: sevenseacat: yes
[12:13:56] sevenseacat: so its parsed it as a hash just fine
[12:14:09] devdazed: has joined #RubyOnRails
[12:14:26] sevenseacat: this part is wrong - params[':mihpayid'] - you have a symbol inside quotes, which doesnt match whats in your params
[12:14:29] lemonada: has joined #RubyOnRails
[12:14:49] sevenseacat: but without seeing an actual problem like i asked to see, its kinda hard to help any further
[12:15:03] mhib: has joined #RubyOnRails
[12:15:09] l0oky: I have a `params.require(:group).permit(:name).require(:subscription).permit(:id)` in a controller action called `Groups#create` and when I want to redirect to it I do It like this `redirect_to group_new_url, :group => { :name => group_name }, :subscription => { :id => subscription.id}`. Am I doing it wrong because I get an exception `param is missing or the value is empty: group`
[12:15:19] lemonada: How do I pass ruby string from rails controller to javascript?
[12:15:45] Detch: has joined #RubyOnRails
[12:15:57] ndrei: has joined #RubyOnRails
[12:16:13] sevenseacat: l0oky: whatever params that controller action is receiving is missing the :group key, which you've specified is required.
[12:16:16] l0oky: lemonada: There is a great gem for that called Paloma, it organizes your js according to your controllers and you can pass variables easily
[12:16:51] lemonada: I'll give it a try I already tried gom but its not working
[12:17:08] l0oky: sevenseacat: Am I passing It wrong? I did a redirect_to ^^^
[12:17:23] sevenseacat: in the params.require.
[12:18:14] l0oky: yeah group_new_url is that Groups#create action
[12:18:19] sevenseacat: l0oky: can you gist your code? irc is a terrible medium for sharing it.
[12:18:42] sevenseacat: plus the logs of this create action.
[12:19:13] sevenseacat: which you certainly shouldnt be redirecting to, but we'll getto that.
[12:19:33] arooni-mobile: has joined #RubyOnRails
[12:19:39] rails247: sevenseacat: params['"mihpayid"'] is also not giving ghe right result, its vakue is ">\"403993715512701454\", \"mode\"=>\"CC\", \"status\"=>\"success\",
[12:19:57] sevenseacat: rails247: you dont need to double quote the name.
[12:20:34] rails247: sevenseacat: thats what is POSTed to my server
[12:20:43] arup_r: has joined #RubyOnRails
[12:21:06] rails247: that the exact string that the controller receives
[12:21:14] l0oky: sevenseacat: https://gist.github.com/l0oky/a0970f8e8b7c0747d26b
[12:21:35] mostlybadfly: has joined #RubyOnRails
[12:21:41] l0oky: Tell me If I need to add something to that gist
[12:21:46] Dwarf: has joined #RubyOnRails
[12:21:50] rails247: while parsing, ',' should be the boundry condition
[12:22:02] sevenseacat: l0oky: your routing is very wrong if group_new_url hits the create action.
[12:22:39] l0oky: you mean naming?
[12:23:05] l0oky: yeah well I'll fix it
[12:23:07] sevenseacat: no. please gist your routes, and agin, the logs of the request hitting the create action.
[12:23:14] Betray1st: has joined #RubyOnRails
[12:23:56] sevenseacat: rails247: i would also like to see the entire logs of the request from you, as i requested like 15min ago.
[12:24:09] bruno-: has joined #RubyOnRails
[12:24:25] rails247: ok, sending in a minute
[12:24:50] l0oky: sevenseacat: Updated the gist
[12:25:32] sevenseacat: that makes sense why its messed up then.
[12:25:41] josh2: has joined #RubyOnRails
[12:25:48] lethjakman: has joined #RubyOnRails
[12:26:14] l0oky: :P not your standard. I am still a beginner so yeah it can hurt your eyes a bit
[12:26:32] sevenseacat: thats not how you pass params to a route method - a route name like group_new_url is a method like any other
[12:26:53] sevenseacat: how would you normally call a method with parameters?
[12:27:18] l0oky: I could do that inside of my controller?
[12:27:28] l0oky: uh oh normally umm
[12:28:13] l0oky: right now I am doing a redirect with params
[12:28:29] sevenseacat: no, youre not
[12:28:32] l0oky: I thought calling my action directly would be anti pattern
[12:28:49] sevenseacat: you're issuing a redirect to group_new_url, and discarding the params
[12:29:02] l0oky: interesting.. how?
[12:29:02] sevenseacat: if you had a method def foo(blah), how would you call it?
[12:29:35] l0oky: foo("123") ?
[12:29:42] Ropeney: has joined #RubyOnRails
[12:30:09] kitsuneyo: has joined #RubyOnRails
[12:30:13] sevenseacat: because you need to do the same thing for your group_new_url method
[12:30:20] sevenseacat: the params you want to pass are arguments to the method
[12:30:41] jenrzzz: has joined #RubyOnRails
[12:31:11] blackmesa: has joined #RubyOnRails
[12:31:26] l0oky: so what you are suggesting is that I need to call group#create action directly using self.create(params) instead of redirecting with params?
[12:32:19] l0oky: uhh not self.create group.create(params)
[12:32:19] kil0byte: has joined #RubyOnRails
[12:32:33] sevenseacat: no. i'm suggesting that if you want to do it this way, you need to actually pass the params to the named route.
[12:32:50] sevenseacat: at t he moment your group_new_url has no arguments passed to it, ie. no params passed through
[12:33:10] l0oky: how is that possible I have 3 arguments in redirect_to method
[12:33:19] sevenseacat: exactly, and none to group_new_url
[12:33:36] sevenseacat: the params are part of the call to redirect_to, not group_new_url
[12:34:16] sevenseacat: this is your code: https://gist.github.com/sevenseacat/02522dfd5dc0995276ab#file-subscriptions_controller-rb-L3
[12:34:17] l0oky: Can you suggest how can I resolve this?
[12:34:29] sevenseacat: ive been trying to do that for about 10min now
[12:34:58] sevenseacat: youve established you know how to call a method with arguments, and i've told you that your params need to be an argument to your route
[12:35:05] l0oky: True thats how I imagined it
[12:35:06] sevenseacat: so now you need to call your route with the right arguments
[12:35:22] loocash: has joined #RubyOnRails
[12:35:25] l0oky: ohhh wait 2 aguments there
[12:36:43] sevenseacat: are you following a rails tutorial at all?
[12:36:53] l0oky: is there a cleaner way to write this `redirect_to(group_new_url(), (:group => { :name => group_name }, :subscription => { :id => subscription.id}))`
[12:37:05] l0oky: sevenseacat: No this is a bit of my practical work :)
[12:37:23] arBmind: has joined #RubyOnRails
[12:37:26] sevenseacat: can i recommend that you follow a tutorial to learn the basics of how rails works?
[12:37:48] arBmind: has left #RubyOnRails: ()
[12:38:17] sevenseacat: if not, I've said what you need to do in as many ways as I can think of, so good luck :)
[12:38:24] Lightsword: has joined #RubyOnRails
[12:38:53] sevenseacat: but I would really recommend finding a tutorial because what you're doing isnt at all normal.
[12:39:52] l0oky: I do practical stuff or follow tutorials that benefit my interest atm, there is no tutorials for what I am doing.
[12:40:07] sevenseacat: it looks like basic crud from here
[12:40:14] sevenseacat: but then again you only showed very small snippets
[12:40:21] sevenseacat: regarldess, the principles are the same
[12:40:46] sevenseacat: a create action should *never* be a get request
[12:40:51] peeja: has joined #RubyOnRails
[12:41:05] sevenseacat: and you should *never* be redirecting to it
[12:41:11] hashrocket: has joined #RubyOnRails
[12:41:35] l0oky: thanks for the tips
[12:41:46] darrencauthon: has joined #RubyOnRails
[12:41:47] sevenseacat: which are things a basic rails tutorial would tell you, when going through building your first resource.
[12:42:45] l0oky: I am supposed to know resources before I go on ofc..
[12:42:51] arup_r: has joined #RubyOnRails
[12:43:05] helpa: Rails 4 in Action - http://manning.com/bigg2 - An excellent book combining Rails and TDD/BDD development. Written by Rebecca Skinner, Steve Klabnik, Ryan Bigg, Yehuda Katz
[12:43:19] sevenseacat: I can recommend that book as a great resource for learning rails, and not only because I helped write it.
[12:43:26] sevenseacat: it was great before I stepped onto the project.
[12:43:30] l0oky: Thank you very much.
[12:44:07] melter: has joined #RubyOnRails
[12:44:13] l0oky: Is there a better way to write `redirect_to(group_new_url(), (:group => { :name => group_name }, :subscription => { :id => subscription.id}))`?
[12:45:32] kitsuneyo: has joined #RubyOnRails
[12:45:58] victortyau: has joined #RubyOnRails
[12:46:29] l0oky: RubyMine is sending all kinds of warnings about that line
[12:46:40] sevenseacat: theres a reason for that.
[12:47:10] arooni-mobile: has joined #RubyOnRails
[12:47:30] l0oky: `This inspection warns about unexpected parameter values of Rails specific calls. E.g. parameters of 'hide' action should be symbols pointing to existing public methods of a current class or it's predecessors, or there is no sense in :my_magic hash key for parameters of a 'render' call.`
[12:48:05] rails247: sevenseacat: thanks, now its ok
[12:48:34] rails247: I guess - params.transform_keys!{ |key| key.to_s.downcase } - does something
[12:48:45] arup_r: I have some rake tasks which I would like to run Every day once.. What backgorund job should I use ?
[12:49:53] jkamenik: has joined #RubyOnRails
[12:50:28] griffindy: has joined #RubyOnRails
[12:50:48] akam-it: has joined #RubyOnRails
[12:50:50] arup_r: I can't use whenever with ActiveJob as per the list given http://api.rubyonrails.org/classes/ActiveJob/QueueAdapters.html
[12:51:29] sevenseacat: whenever is a cron interface, not a background job interface.
[12:52:35] l0oky: sevenseacat: the line you wrote has a syntax error
[12:52:40] akam-it: Hello! I'm trying to User.where(auth.slice(:provider, :uid)).first_or_initialize but got error ActiveModel::ForbiddenAttributesError
[12:52:49] l0oky: `c:/projects/ruby/gtrack/app/controllers/subscriptions_controller.rb:28: syntax error, unexpected =>, expecting ')' ..`
[12:52:56] sevenseacat: yeah, the () should have been {}
[12:53:19] sevenseacat: its exactly the same as what you wrote, only with extra grouping to show what arguments are going to what method.
[12:53:22] akam-it: How to use strong parameters with where statement?
[12:53:26] sevenseacat: because you didnt seem clear.
[12:53:30] l0oky: sevenseacat: you know I that in mind before I asked the question
[12:53:36] l0oky: didn't dare try it
[12:53:48] kil0byte: has joined #RubyOnRails
[12:53:55] l0oky: Ok thank you :D
[12:54:04] workmad3: has joined #RubyOnRails
[12:54:06] sevenseacat: regardless, it wont fix your problem.
[12:54:14] sevenseacat: because its exactly the same as what you originally had.
[12:54:15] arup_r: sevenseacat: Yes I just saw..
[12:54:18] stantonnet: has joined #RubyOnRails
[12:54:35] sevenseacat: arup_r: so you dont want a background job interface.
[12:54:44] sevenseacat: you want a cron interface.
[12:55:01] arup_r: So I should use Cronjob for scheduling my rake tasks.. not background jobs..
[12:55:15] konsolebox: has joined #RubyOnRails
[12:55:33] sevenseacat: you could in theory use a background job system if it had a scheduler built in
[12:55:44] sevenseacat: things like sidekiq have extensions for scheduling
[12:56:06] ramortegui: has joined #RubyOnRails
[12:56:55] sevenseacat: eg. https://github.com/tobiassvn/sidetiq
[12:57:23] jottr: has joined #RubyOnRails
[12:57:50] devdazed: has joined #RubyOnRails
[12:57:55] loocash: has left #RubyOnRails: ()
[12:58:19] loocash: has joined #RubyOnRails
[12:58:36] mhib: has joined #RubyOnRails
[12:59:20] arup_r: sevenseacat: looking into the Gem.. But ActtiveJob didn't list it as backend support..
[12:59:28] l0oky: after a bit of testing.. I still get the same error `param is missing or the value is empty: group`
[12:59:38] sevenseacat: sidekiq is supported by activejob.
[12:59:48] l0oky: does that mean my value is really empty? hmm gotta debug that
[13:00:42] arup_r: Yes.. you gave link of sidetiq
[13:00:50] arup_r: that's why I am saying
[13:01:06] konsolebox: has joined #RubyOnRails
[13:01:17] arup_r: sevenseacat: check this https://github.com/tobiassvn/sidetiq/wiki/ActiveJob-Integration
[13:01:23] sevenseacat: ...which is an extension for sidekiq.
[13:02:13] sevenseacat: i dont know why you want activejob integration at all.
[13:02:15] jamey-uk: has joined #RubyOnRails
[13:02:38] arup_r: Ok... then I am going with whenever .. cronjob
[13:02:40] willywos: has joined #RubyOnRails
[13:02:52] bmurt: has joined #RubyOnRails
[13:04:40] dangerousdave: has joined #RubyOnRails
[13:05:35] allcentury: has joined #RubyOnRails
[13:06:58] eggoez: has joined #RubyOnRails
[13:07:37] loocash: has left #RubyOnRails: ()
[13:09:02] chinmay_dd: has joined #RubyOnRails
[13:10:04] lemonada: How can i pass ruby @leprican string to var myString? @leprican is in the controller. Here is the paste http://pastie.org/10294496
[13:12:26] sevenseacat: lemonada: depending on what you're doing, a common way to do it is to write the string in ruby as a data attribute on the html element its for, and then read it from the element in the javascript.
[13:13:33] bungoman: has joined #RubyOnRails
[13:14:01] kitsuneyo: has joined #RubyOnRails
[13:14:06] lemonada: and if I want to do it without adding html element and reading from it, is it possible?
[13:14:29] sevenseacat: sure, but i dont know why you wouldnt go that route, given its directly related to your #read element
[13:15:19] fgo: has joined #RubyOnRails
[13:15:25] lemonada: so how can I now add @leprican string to #read element without displaying it in the view?
[13:15:55] sevenseacat: no-one said you had to display it in the view
[13:16:07] eGGsha: has joined #RubyOnRails
[13:16:07] jamiely: has joined #RubyOnRails
[13:17:03] lemonada: and how to do it? can you show me?
[13:17:39] Xiti: has joined #RubyOnRails
[13:17:41] sevenseacat: I'm not going to write the code for you, no. if you have any questions about what I said, I'm happy to answer them.
[13:18:33] umgrosscol: has joined #RubyOnRails
[13:18:41] thelastinuit: has joined #RubyOnRails
[13:18:47] koos303: has joined #RubyOnRails
[13:19:02] lemonada: Of course not, I am just not sure what "tags" to put next to #read element
[13:19:43] sevenseacat: you wouldnt need to, you could put it as a data attribute on the #read element itself.
[13:20:05] lemonada: aham, thanks
[13:20:11] sevenseacat: I dont know what you should call that data attribute because I dont know what 'leprican' means or represents
[13:21:21] lemonada: leprican is a string containing name
[13:21:26] brazenbraden: has joined #RubyOnRails
[13:21:35] Lightsword: has joined #RubyOnRails
[13:22:05] konsolebox: has joined #RubyOnRails
[13:22:12] sevenseacat: why not just call it 'name' then? :/
[13:23:33] k4nd4lf: has joined #RubyOnRails
[13:23:41] garrypolley: has joined #RubyOnRails
[13:23:50] lemonada: yes I will, I am testing something and was bugged with false results so to put some humour in it I named it leprican just for fun :)
[13:24:11] eggoez: has joined #RubyOnRails
[13:25:45] arup_r: I have created my own schedule.rb file like (https://github.com/javan/whenever#example-schedulerb-file).. Now where to mention the environment ? I am going to put in production to run periodically.. But how to set the env as production ?
[13:26:03] erich: has joined #RubyOnRails
[13:26:29] kitsuneyo: has joined #RubyOnRails
[13:27:10] arup_r: When I was manually running my task I was doing `rake articles:update_articles RAILS_ENV=production`
[13:27:32] arup_r: Using whenever how should I mention it ?
[13:28:25] DylanJ: arup_r: i think it's -e
[13:28:28] DylanJ: whenever -e production
[13:29:05] lethjakman: has joined #RubyOnRails
[13:29:07] arup_r: No idea.. I read http://tutor.lugolabs.com/articles/14-schedule-rails-tasks-with-whenever-and-capistrano and http://www.sitepoint.com/schedule-cron-jobs-whenever-gem/ .. but no where I find my answer.. so I am confused if we need it..
[13:29:13] DylanJ: it's in --help
[13:29:20] DylanJ: --set='environment=staging'
[13:30:13] DylanJ: personally, for my projects deployed with capistrano i use the whenever capistrano plugin
[13:30:31] DylanJ: so then when i deploy my crontab is updated
[13:30:38] arup_r: I hv no Cap thing right now :)
[13:30:47] DylanJ: in the meantime, use --set
[13:30:52] arup_r: but yes `--help` has the answer
[13:31:00] sevenseacat: funny about that
[13:31:04] arup_r: but those blogs should mention this little thing
[13:31:19] DylanJ: blogs are terrible. dont read blogs.
[13:31:21] sevenseacat: that you can get help from the help text
[13:31:45] mikecmpb_: my regex is weak, how'd i match on any strings like this: "#{ any ol' shit here }" but not this "#{ some shit } more shit #{ more shit }"
[13:31:47] sevenseacat: its almost like.... thats what its for
[13:31:50] arBmind: has joined #RubyOnRails
[13:31:52] DylanJ: sevenseacat: i think you're wrong.
[13:31:59] annlewis: has joined #RubyOnRails
[13:32:02] DylanJ: i think --help is just a mandatory flag for all applications
[13:32:03] sevenseacat: probably. its been known to happen.
[13:32:26] Papierkorb: https://github.com/opal/opal-browser/blob/master/opal/browser/http/request.rb#L261 Any Opal'er in here? Sounds like a great way to permanently store stuff in the NSA cloud. At least packet drops should be not be an issue anymore
[13:32:34] DylanJ: in my apps --help prints see "--help"
[13:33:07] bungoman: has joined #RubyOnRails
[13:33:07] DylanJ: mikecmpbll: what
[13:33:16] sevenseacat: Papierkorb: if the date is in the past, that means the cache automatically expires.
[13:33:33] Papierkorb: sevenseacat: yes, I was more looking at the exact date time given in there
[13:33:48] Papierkorb: any other past date time would've worked too ..
[13:33:52] DylanJ: mikecmpbll: i think you want ^ and $
[13:33:56] DylanJ: start and finish line
[13:34:04] sevenseacat: yeah that date/time looks about familiar
[13:34:22] DylanJ: real examples for your regex are ahelluvalot more helpful
[13:34:28] mikecmpbll: DylanJ: doesn't need to be the whole line
[13:34:30] sevenseacat: 'where were you when..... i was working on my code'
[13:34:33] mikecmpbll: and that is a real example.
[13:34:40] mikecmpbll: but i think i got it anyways, one sec
[13:34:56] DylanJ: oh you're actually regexing over strings with ruby string interpolation in it?
[13:35:03] DylanJ: before being interped.
[13:35:21] mikecmpbll: i should've added [offtopic], not a ruby question or a rails question, my bad
[13:35:26] mikecmpbll: just plain ol' regex question
[13:35:40] DylanJ: mikecmpbll: do you know about rubular.com
[13:35:42] DylanJ: i think thats the domain
[13:35:44] mikecmpbll: this works : "#\{[^}]*\}"
[13:36:15] GhettoCode: has joined #RubyOnRails
[13:36:44] mikecmpbll: was for find & replace in sublime text ;) junior dev's been interpolating strings when he doesn't need to
[13:36:52] kazenjizo_: has joined #RubyOnRails
[13:37:21] mikecmpbll: `"#{some_var}"` instead of `some_var`
[13:37:35] kil0byte: has joined #RubyOnRails
[13:37:56] DylanJ: i just lay the law down when i see the intern here doing that
[13:38:18] mikecmpbll: gunna be a tricky find and replace because of the implicit .to_s
[13:38:28] nettoweb: has joined #RubyOnRails
[13:38:44] fuzzyhorns: has joined #RubyOnRails
[13:38:54] mikecmpbll: i don't really want to add .to_s to strings, but also replacing "#{not_a_string}" with `not_a_string` could cause errors.
[13:39:37] doodlehaus: has joined #RubyOnRails
[13:41:35] cpruitt: has joined #RubyOnRails
[13:43:08] devdazed: has joined #RubyOnRails
[13:43:19] arup_r: DylanJ: thanks added https://gist.github.com/aruprakshit/e309afde7f5f531caa43 ... I think it will run 12 amm... I'll verify tomorrow :)
[13:44:33] kil0byte: has joined #RubyOnRails
[13:46:42] r4pha: has joined #RubyOnRails
[13:49:07] ferski: has joined #RubyOnRails
[13:54:49] dopie: has joined #RubyOnRails
[13:55:15] intinig: has joined #RubyOnRails
[13:55:34] DEA7TH: has joined #RubyOnRails
[13:56:19] Anakat: has joined #RubyOnRails
[13:56:50] arBmind: has joined #RubyOnRails
[13:57:22] axl_: has joined #RubyOnRails
[13:59:51] bf4: has joined #RubyOnRails
[13:59:58] werelivinginthef: has joined #RubyOnRails
[14:00:57] gillesmath: has joined #RubyOnRails
[14:02:21] poli: has joined #RubyOnRails
[14:02:24] doctorly: has joined #RubyOnRails
[14:02:41] sarink: has joined #RubyOnRails
[14:03:50] noodman: has joined #RubyOnRails
[14:03:51] jgpawletko: has joined #RubyOnRails
[14:04:08] jgpawletko: has joined #RubyOnRails
[14:04:20] paulcsmith: has joined #RubyOnRails
[14:05:29] noodman: has joined #RubyOnRails
[14:06:20] workmad3: has joined #RubyOnRails
[14:06:26] darrencauthon: has joined #RubyOnRails
[14:07:17] darrencauthon: has joined #RubyOnRails
[14:07:24] gillesmath: am I authorized to participate now ?
[14:07:35] gillesmath: can anyone see what I am typing ?
[14:07:51] catcher: has joined #RubyOnRails
[14:08:02] gillesmath: Hello everyone
[14:08:17] DylanJ: gillesmath: i cant see what you're writing
[14:08:20] DylanJ: just shows up blank
[14:08:59] ruurd: gillesmath: I can see what you're typing.
[14:09:07] DylanJ: ACTION slaps ruurd
[14:09:08] Palsson: has joined #RubyOnRails
[14:09:09] ruurd: DylanJ: dark background?
[14:09:25] ruurd: kicks DylanJ
[14:09:29] gillesmath: Thx DylanJ ! Did someone has trouble with devise, capybara, rspec with js: true option, My feature specs are failing
[14:09:57] DylanJ: gillesmath: why are they failing? show us your exceptions
[14:12:03] gillesmath: http://pastie.org/10294581
[14:13:46] doodlehaus: has joined #RubyOnRails
[14:13:52] axl_: has joined #RubyOnRails
[14:14:10] krz: has joined #RubyOnRails
[14:14:49] gillesmath: I am creating a more complete pastie for you,
[14:16:31] arBmind: has joined #RubyOnRails
[14:19:05] darrenca_: has joined #RubyOnRails
[14:19:28] momomomomo: has joined #RubyOnRails
[14:22:01] elmhouse: has joined #RubyOnRails
[14:24:16] chipotle: has joined #RubyOnRails
[14:26:11] gillesmath: http://pastie.org/10294596
[14:26:18] gillesmath: here DylanJ : http://pastie.org/10294596
[14:28:42] chridal: Do you guys have any thoughts on when Rails 5 will be ready for release?
[14:29:15] chridal: Is it within a couple of months, or next year?
[14:29:17] giowong: has joined #RubyOnRails
[14:29:40] sevenseacat: chridal: septemberish.
[14:29:41] chridal: Well, it's not 8ball. Many people have insight, and some are even contributors, and know the state of the code / issues etc.
[14:29:46] chridal: sevenseacat: Brilliant. Thanks.
[14:29:57] BaNzounet: With has_many :bars, :order => 'bars.start_at ASC', if I do foo.bars.first I'm suppose to get the first bar in time isn't it? Because for the moment it returns the last... :/
[14:30:08] chridal: Well, if it is due to release in september, at least we will most likely see it this year.
[14:30:16] kies^: has joined #RubyOnRails
[14:30:31] sevenseacat: they aim for roughly a two-year major release schedule.
[14:31:32] chridal: Really excite about it. I have come to love working with this language and framework.
[14:31:46] jenrzzz: has joined #RubyOnRails
[14:32:44] SteenJobs: has joined #RubyOnRails
[14:34:14] chridal: Currently we have a microservice written in Node.JS to handle a chat for a social network we are building. Any one have any thoughts on whether ActionCable could be up for this task?
[14:34:25] sevenseacat: not known yet.
[14:34:52] nateberkopec: has joined #RubyOnRails
[14:34:52] arBmind: has joined #RubyOnRails
[14:35:07] CanTonic: has joined #RubyOnRails
[14:35:52] mary5030: has joined #RubyOnRails
[14:35:56] AzaToth: has joined #RubyOnRails
[14:37:02] [H]unt3r: has joined #RubyOnRails
[14:37:40] chridal: Currently struggling a bit with a join. Maybe someone is up for having a look at it.
[14:37:45] chridal: https://gist.github.com/christiandalsvaag/4ab1759137d72ce2dea4
[14:37:55] chridal: I am trying to achieve the query on the bottom using scopes
[14:38:02] mary5030: has joined #RubyOnRails
[14:38:48] chridal: I am working on the scope subscribees to try to do the join part except the buc.drops_count > 0
[14:39:07] ndrei: has joined #RubyOnRails
[14:39:29] intinig: has joined #RubyOnRails
[14:40:37] Lightsword: has joined #RubyOnRails
[14:40:42] nogic: has joined #RubyOnRails
[14:40:55] JoshL: has joined #RubyOnRails
[14:41:59] momomomomo: chridal: what's your question? you don't want the drops_count ?
[14:42:21] chridal: I want to construct the same join that I do in that SQL-query using the subscribees scope
[14:42:57] chridal: momomomomo: But I am struggling with this syntax.
[14:43:18] momomomomo: chridal: and what's the query result of the 'current query' code you have in that gist?
[14:43:47] chridal: It returns the ID and title of the buckets
[14:44:03] chridal: the query itself is just fine, I just need do rework that join and first part of the WHERE clause into the scope
[14:44:30] arup_r: has joined #RubyOnRails
[14:44:41] Lightsword_: has joined #RubyOnRails
[14:45:14] zorak8: has joined #RubyOnRails
[14:45:45] chridal: momomomomo: Aha! Now I see. I misunderstood your question.
[14:46:00] chridal: That query actually won't work at all, because of the syntax inside the subscribees scope, I believe
[14:46:02] gillesmath: Hello everyone,
[14:46:13] bronson: has joined #RubyOnRails
[14:46:34] Schalla: has joined #RubyOnRails
[14:47:22] momomomomo: chridal: yep, so reorder your line
[14:47:35] momomomomo: Bucket.with_drops.public_bucket.subscribees(...)
[14:48:02] chridal: I don't understand what more to include inside that scope though to make it join on the proper columns, and use the proper WHERE clause
[14:48:06] chridal: any thoughts on that part too?
[14:48:07] arooni-mobile: has joined #RubyOnRails
[14:49:20] momomomomo: chridal: what would be best is to either understand more about how arel is making the query (http://blog.codeship.com/how-arel-converts-ruby-queries-into-sql-statements/) or open your rails repl and play around
[14:49:44] chridal: momomomomo: That article is perfect! Thanks!
[14:51:44] jobewan: has joined #RubyOnRails
[14:52:01] gillesmath: Can someone help me with a devise/rspec/capybara issue on rails 4.2.3 app ??? my spec is failing when I fill in the devise sign-in form, but only when the js: true option is set on the scenarii ? Here is a pastie of my code :http://pastie.org/10294627
[14:52:55] jamey-uk1: has joined #RubyOnRails
[14:53:05] eggoez: has joined #RubyOnRails
[14:54:45] disgrntld: has joined #RubyOnRails
[14:55:38] jamey-uk: has joined #RubyOnRails
[14:56:44] willywos: has joined #RubyOnRails
[14:56:59] nettoweb: has joined #RubyOnRails
[14:57:16] Hates_: has joined #RubyOnRails
[14:57:17] jottr: has joined #RubyOnRails
[14:58:12] pothibo: has joined #RubyOnRails
[14:58:20] SteenJobs: has joined #RubyOnRails
[14:58:51] arashb: has joined #RubyOnRails
[14:59:43] paulcsmith: has joined #RubyOnRails
[14:59:47] workmad3: has joined #RubyOnRails
[15:00:25] gambl0re: has joined #RubyOnRails
[15:01:01] gremax: has joined #RubyOnRails
[15:01:33] Ergo^: has joined #RubyOnRails
[15:01:50] garrypolley: has joined #RubyOnRails
[15:02:15] shtirlic: has joined #RubyOnRails
[15:04:03] podman: has joined #RubyOnRails
[15:05:08] darrencauthon: has joined #RubyOnRails
[15:06:17] SuMo_D: has joined #RubyOnRails
[15:06:25] eggoez: has joined #RubyOnRails
[15:08:51] intinig: has joined #RubyOnRails
[15:09:48] thezanke: has joined #RubyOnRails
[15:11:22] jocuman: has joined #RubyOnRails
[15:12:10] kitsuneyo: has joined #RubyOnRails
[15:14:45] srinidhi: has joined #RubyOnRails
[15:14:58] doodlehaus: has joined #RubyOnRails
[15:15:25] riotjones: has joined #RubyOnRails
[15:15:37] darrik: has joined #RubyOnRails
[15:15:47] kitsuneyo: has joined #RubyOnRails
[15:17:01] kinduff: has joined #RubyOnRails
[15:17:16] blackmesa: has joined #RubyOnRails
[15:17:20] Lightsword: has joined #RubyOnRails
[15:18:03] lethjakman: has joined #RubyOnRails
[15:21:33] doodlehaus: has joined #RubyOnRails
[15:22:16] speaking1ode: has joined #RubyOnRails
[15:22:17] recurrence: has joined #RubyOnRails
[15:22:43] eminencehc_: has joined #RubyOnRails
[15:25:57] recurrence: has joined #RubyOnRails
[15:26:02] doodlehaus: has joined #RubyOnRails
[15:27:39] konsolebox: has joined #RubyOnRails
[15:28:16] DylanJ: gillesmath:
[15:28:28] DylanJ: what does page.body look like?
[15:31:00] shinnya: has joined #RubyOnRails
[15:31:58] r_baron: has joined #RubyOnRails
[15:32:26] Ergo^: has joined #RubyOnRails
[15:33:20] bronson: has joined #RubyOnRails
[15:34:03] bruno-: has joined #RubyOnRails
[15:34:34] SuMo_D: has joined #RubyOnRails
[15:34:39] baweaver: has joined #RubyOnRails
[15:35:32] eddie_v98: has joined #RubyOnRails
[15:35:55] gillesmath: DylanJ, actually I think I found some answers by digging the web more ???
[15:36:20] gillesmath: and page body shows me the sign in form with ???Invalid email or password??? flash message on it ???
[15:37:47] pkrnj: has joined #RubyOnRails
[15:38:07] ruurd: has joined #RubyOnRails
[15:38:14] giowong: has joined #RubyOnRails
[15:45:04] Cache_Money: has joined #RubyOnRails
[15:46:48] lexluthor1: has joined #RubyOnRails
[15:47:59] Ergo: has joined #RubyOnRails
[15:48:07] theery: has joined #RubyOnRails
[15:50:03] barriommx: has joined #RubyOnRails
[15:51:34] towski_: has joined #RubyOnRails
[15:52:15] FooMunki: has joined #RubyOnRails
[15:52:44] bronson: has joined #RubyOnRails
[15:53:58] garrypolley: has joined #RubyOnRails
[15:55:28] Anubix1: has joined #RubyOnRails
[15:55:47] sp33drac3r: has joined #RubyOnRails
[15:56:13] Anubix1: guys i need help, how to edit path when submiting form in my admin section
[15:56:22] nobitanobi: has joined #RubyOnRails
[15:57:25] Anubix1: i am using namespaces admin for my dogs model, in for_for (@dogs) when click on create (f.submit) it redirects me on localhost/dogs and not into localhost/admin/dogs
[16:01:54] elmhouse: has joined #RubyOnRails
[16:03:33] edwinvdgraaf: has joined #RubyOnRails
[16:03:59] gambl0re: has joined #RubyOnRails
[16:04:47] meoblast001: has joined #RubyOnRails
[16:05:09] Anubix1: has left #RubyOnRails: ()
[16:06:39] edwinvdg_: has joined #RubyOnRails
[16:07:29] mikepack: has joined #RubyOnRails
[16:09:33] eGGsha: has joined #RubyOnRails
[16:10:49] joelataylor: has joined #RubyOnRails
[16:11:19] [Butch]: has joined #RubyOnRails
[16:11:50] SteenJobs: has joined #RubyOnRails
[16:11:54] r4pha: has joined #RubyOnRails
[16:14:15] dopie: smathy, thanks for the help explaining delegate :)
[16:14:32] eddie_v98: what does this error means http://pastie.org/10294768
[16:14:59] kitsuneyo: has joined #RubyOnRails
[16:15:04] edwinvdgraaf: has joined #RubyOnRails
[16:15:38] workmad3: has joined #RubyOnRails
[16:16:00] noodman: has joined #RubyOnRails
[16:17:55] chipotle: has joined #RubyOnRails
[16:17:57] tubbo: eddie_v98: it means you tried to constantize a string for which no actual constant existed.
[16:18:21] dopie: tubbo, ready for a good one?
[16:18:26] tubbo: eddie_v98: *big* fan of this method :) http://api.rubyonrails.org/classes/ActiveSupport/Inflector.html#method-i-demodulize
[16:18:31] tubbo: dopie: sure
[16:18:38] dopie: https://gist.github.com/staycreativedesign/69056ad1feffdb8cf126/edit
[16:18:51] Spami: has joined #RubyOnRails
[16:18:51] dopie: Basically I want to have each error show
[16:18:53] tenderlove: has joined #RubyOnRails
[16:18:56] smathy: dopie, you're welcome.
[16:19:03] dopie: instead of doing flash[:error]
[16:19:13] dopie: i went into console
[16:19:25] dopie: and did @reviews.errors.messages and got the error
[16:19:34] dopie: oin a hash format
[16:19:59] tubbo: dopie: you can actually do @review.errors.messages.to_sentence and it will generate a really nice error message out of the errors hash for you.
[16:20:01] dopie: hmmm I think I just answered my question
[16:20:02] smathy: dopie, you're just doing a `render` - why do you need the flash?
[16:20:10] tubbo: i literally have been doing this shit for 6 years and i just found out about that this year :P
[16:20:21] widith_: has joined #RubyOnRails
[16:20:22] akam-it: has joined #RubyOnRails
[16:20:23] dpg1: has joined #RubyOnRails
[16:20:27] Tarential: has joined #RubyOnRails
[16:20:28] tubbo: do you have any idea how many times i wrote a damn reduce loop for that?? :D
[16:20:29] JimmyNeutron: has joined #RubyOnRails
[16:20:30] ramortegui: has joined #RubyOnRails
[16:20:30] Isthar: has joined #RubyOnRails
[16:20:32] noah256: has joined #RubyOnRails
[16:20:33] siddart_: has joined #RubyOnRails
[16:20:36] stamina: has joined #RubyOnRails
[16:20:49] SteenJobs: has joined #RubyOnRails
[16:21:06] bphogan: has joined #RubyOnRails
[16:21:33] Dwarf: has joined #RubyOnRails
[16:21:34] jottr: has joined #RubyOnRails
[16:23:19] dopie: tubbo, thats for an array
[16:23:33] dopie: k hold on
[16:23:40] dopie: wait wait :) don't say anything yet
[16:24:59] FrankD: has joined #RubyOnRails
[16:25:35] kitsuneyo: has joined #RubyOnRails
[16:25:41] Senjai: What value does config.assets.debug -actually- provide
[16:25:46] Senjai: besides making assets slow as hell
[16:26:10] jottr: has joined #RubyOnRails
[16:26:29] drale2k: has joined #RubyOnRails
[16:27:02] edwinvdg_: has joined #RubyOnRails
[16:27:19] smathy: Senjai, set it to false, restart your app, reload and look at the source of your <head>
[16:28:54] Senjai: smathy: Ah
[16:28:57] Senjai: Thank you
[16:29:00] charliesome: has joined #RubyOnRails
[16:29:07] smathy: Senjai, you're welcome.
[16:29:08] Senjai: smathy: I'm just going to make it false by deafult
[16:29:23] smathy: Yeah, certainly with the comments in dev it's not a dealbreaker.
[16:29:36] drale2k: has joined #RubyOnRails
[16:29:45] Senjai: smathy: I'm simply going through figuring out why the dev env is so slow
[16:29:50] smathy: (although, I'm not sure how much faster it'll be, it's still checking all those files each request)
[16:29:50] Senjai: I found a couple issues so far
[16:29:58] Senjai: Bullet, pry-byebug > 1.0
[16:30:10] Senjai: smathy: We're talking like 5 seconds faster
[16:30:15] Senjai: smathy: This is a -large- codebase
[16:30:37] smathy: Yeah, bullet is something I wish would be just a test assertion or something.
[16:30:50] smathy: Senjai, 5 seconds with the assets.debug ?
[16:31:06] bricker: has joined #RubyOnRails
[16:31:07] Senjai: smathy: yep
[16:31:14] smathy: Wow, that's cool.
[16:31:19] smathy: ...not that big a downside.
[16:31:38] Senjai: smathy: TBH the assets should not be that large, but thats not a problem I can fix right now
[16:31:52] Senjai: large or complex **
[16:31:57] gambl0re: has joined #RubyOnRails
[16:32:24] giowong: hi i have a few questions for the collection_select method and was wondering if anyone could help me
[16:32:28] smathy: My JS and CSS are perfectly modular and well written.
[16:32:32] smathy: ...said no one, ever.
[16:32:37] Senjai: hahaha so true
[16:32:49] Senjai: smathy: This is not an in house project, most of it was written by the client
[16:33:17] Senjai: Completed 200 OK in 39381ms (Views: 24454.4ms | ActiveRecord: 385.4ms) (with debug on)
[16:33:22] tens0r: has joined #RubyOnRails
[16:33:24] Senjai: on a cold load
[16:33:26] tubbo: hilarious
[16:34:01] Senjai: It's fine after the initial load
[16:34:49] bashusr: has joined #RubyOnRails
[16:34:50] bashusr: has joined #RubyOnRails
[16:35:10] giowong: https://gist.github.com/gwong89/13d87add6261c22d93ca
[16:35:19] griffindy: has joined #RubyOnRails
[16:36:08] giowong: if i have a one to many relationship from client and theme, will this collection select save the selected theme name by id into the foreign key?
[16:36:27] Papierkorb: How can I have CSRF protection within the API portion of a single site application?
[16:36:33] DoubleMalt: has joined #RubyOnRails
[16:37:34] bricker: Papierkorb: google for "ajax CSRF protection"
[16:38:05] Papierkorb: bricker: Can't I use the rails CSRF protection?
[16:38:50] bricker: Papierkorb: you are, you just have to manually send the token with the request
[16:39:12] Papierkorb: bricker: Can I reuse the token for multiple requests?
[16:39:15] cochise: has joined #RubyOnRails
[16:39:40] bricker: Papierkorb: yes
[16:39:47] Papierkorb: bricker: ok, thanks!
[16:40:42] _solomon: has joined #RubyOnRails
[16:45:12] erich: has joined #RubyOnRails
[16:45:38] bungoman: has joined #RubyOnRails
[16:45:59] User458764: has joined #RubyOnRails
[16:47:35] cpruitt: So??? I???m trying to create a rails plugin as a gem using rspec. I???ve done it before just to play but it was a LONG time ago. I???ve got a dummy rails app in spec/dummy and inside the app my spec directory is symlinked to the spec directory in my gem. The problem is, all my tests run twice. I???m looking at this for a kind of step-by-step to make sure I???m doing it right, but even following that I get the same result.
[16:47:35] cpruitt: http://namick.tumblr.com/post/17663752365/how-to-create-a-gemified-plugin-with-rails-3-2 Anyone else ever seen this? Is Rails 4 somehow different than Rails 3 in this setup?
[16:48:51] ndrei: has joined #RubyOnRails
[16:49:15] bronson: has joined #RubyOnRails
[16:51:56] Maletor: has joined #RubyOnRails
[16:53:21] tuelz: has joined #RubyOnRails
[16:53:38] jottr: has joined #RubyOnRails
[16:53:55] tuelz: man, all my default channels are boring today. None of my dadjokes are landing anywhere!
[16:54:05] Scriptonaut: has joined #RubyOnRails
[16:57:48] skyjumper: tuelz: you have channels that sometimes aren't boring?
[16:58:04] skyjumper: ACTION didn't think people socialized on irc anymore
[16:58:31] tuelz: skyjumper: you have to say more dumb shit if you want your channels to be fun.
[16:58:49] bungoman: has joined #RubyOnRails
[16:58:55] tuelz: it's a tradeoff, but worth it in my opinion
[16:59:12] bricker: rubyonrails is usually not boring
[16:59:20] skyjumper: definitely a tradeoff. i wouldn't spout dumb shit in here on any regular basis
[16:59:41] bricker: skyjumper: don't worry tubbo and I have that covered
[16:59:44] nya: has joined #RubyOnRails
[16:59:57] skyjumper: someone's got to
[17:00:58] tuelz: I think the best thing I've read in IRC was once I was having a conversation that was barely related to the channel with someone and we were the only ones talking. One of the ops asked us to pipe down and I said I don't think were bothering anyone, no one else is talking
[17:01:15] tuelz: he told me that people were probably just waiting their turn to chat and I was holding them up
[17:01:37] sddd: has joined #RubyOnRails
[17:01:46] tuelz: I knew I would fit right into the IRC culture right away after that
[17:02:11] sddd: hi all! After working with ruby for a couple of weeks, I still have some questions:
[17:02:18] skyjumper: haha, IRC is just real-time stackoverflow nowadays
[17:02:31] tuelz: sddd: you've come to the right place my friend. We have nothing but answers here
[17:02:33] skyjumper: personality not permitted
[17:02:33] sddd: if I wanted to implement Hash.trim! or any method that changes the object on which is called, how would I go about that?
[17:02:37] tuelz: and some of the answers are actually right!
[17:02:43] sddd: tuelz: thanks!
[17:03:31] tuelz: sddd: what exactly do you want to do? I imagine you're trying to transform something, but trim works on strings, so I'm not following what you want it to do to hashes
[17:03:47] towski_: has joined #RubyOnRails
[17:04:22] tuelz: well actually ruby doens't have trim, it's strip I think
[17:04:24] sddd: I'm just wondering if I can implement a function that receives a reference of the original object insted of having to return a new one
[17:04:43] sddd: but actually, if I may answer myself, that'd just be self right?
[17:05:05] tuelz: sddd: sounds like you got it
[17:05:28] sddd: great, just to clarify, there's no passing of references in ruby
[17:05:32] tuelz: although I'm still unsure what you're trying to do :p
[17:05:46] n008f4g_: has joined #RubyOnRails
[17:05:58] sddd: I was just wondering how to implement those ! functions myself like trim! slice! and so on
[17:06:03] tuelz: sddd: I'm not sure I understand the question, in ruby you send messages (methods) to object
[17:06:10] tuelz: s/object/objects/
[17:06:20] sddd: good, this is clear
[17:06:29] greengriminal: has joined #RubyOnRails
[17:06:35] sddd: another one: In python I can do function(*args, **kwargs) to support an undefined number of arguments
[17:06:43] tuelz: the ! isn't a strict meaning, but generally it means you're editting the object in pace instead of returned a transformed copy
[17:06:50] sddd: where args would be unnamed args as a list and kwargs a hash of them
[17:06:51] tuelz: s/pace/place/
[17:06:55] sddd: does ruby have an equivalent of that?
[17:06:57] lethjakman: has joined #RubyOnRails
[17:07:23] tuelz: no idea what that means so I don't know :p
[17:07:27] duderonomy: has joined #RubyOnRails
[17:07:34] bricker: sddd: it's the exact same syntax even
[17:07:44] tuelz: kw = keyword? I think I got it now :P
[17:07:46] bricker: def foo(*args); args.each ... end
[17:07:52] sddd: ah! great
[17:07:53] bricker: sddd: and ruby has kwargs too
[17:08:27] sddd: last one for now: what's the standard / prefered way of filtering lists?
[17:08:40] bricker: and the syntax for kwards splat is the same
[17:08:55] bricker: sddd: Enumerable#select http://ruby-doc.org/core-2.2.2/Enumerable.html#method-i-select
[17:09:03] tuelz: sddd: there are a good number of filtering methods
[17:09:20] sddd: can I do include Enumerable in my class
[17:09:26] sddd: and thus make a list that has a few extra methods?
[17:10:30] sddd: has left #RubyOnRails: ()
[17:10:32] sddd: has joined #RubyOnRails
[17:10:47] tuelz: kinda depends on your end goal, I guess
[17:10:56] bricker: sddd: Yes, if you include Enumerable you just need to define an #each method to implement the "interface"
[17:10:57] sddd: sorry I missed the last few messages
[17:11:30] sddd: what if I wanted to have a class that reacts like a list, but has one extra method for example
[17:11:38] sddd: in python we would do class x(list)
[17:11:47] jamiely: has joined #RubyOnRails
[17:11:49] workmad3: has joined #RubyOnRails
[17:11:51] SuMo_D: has joined #RubyOnRails
[17:11:59] chinmay_dd: has joined #RubyOnRails
[17:12:02] sddd: class n extends List or Include List would be the equivalent
[17:12:10] tuelz: sounds to me like you just want a module that adds those methods to your class
[17:12:16] bricker: sddd: you can inherit from Array similarly, class MyClass < Array
[17:13:03] sddd: great thank you!
[17:13:39] tuelz: extending enumerable will be confusing to other developers jumping into the project, whereas including a module with your new methods would be more clear to me, not sure if this is just my preference or if people agree with me though
[17:13:59] zorak8: has joined #RubyOnRails
[17:14:23] bricker: tuelz: he wants to extend Array though, including a module into Array would be a Bad Idea
[17:14:47] tuelz: bricker: sounds like he wants to add a new methods to a couple classes at best to me
[17:14:48] rubyonrailed: has joined #RubyOnRails
[17:15:02] bricker: I think we answered his questions anyways
[17:15:05] tuelz: I know, that's why I wish he'd tell me his end goal :p
[17:15:13] bricker: he seems like a competent Python dev, just needed some help with syntax
[17:15:26] tuelz: indeed, but python conventions and ruby conventions can be quite different
[17:15:50] bricker: yeah sometimes
[17:16:24] JulienTant: has joined #RubyOnRails
[17:16:39] sddd: still here! that's what i wnant to get used to
[17:16:49] sddd: the thing is I don't have an example, they're just abstract questions
[17:17:03] gambl0re: has joined #RubyOnRails
[17:17:26] tuelz: gotcha, well keep in mind ruby has a lot of convenience methods that can be handled with more general methods, but it's nice to have them
[17:17:27] sddd: in python we use that technique though, say that for example we want a list that holds just 10 items and if item 11 gets appended, it deletes 0
[17:17:42] SteenJobs: has joined #RubyOnRails
[17:17:48] tuelz: keeping that in mind when people see 'new' methods that do somewhat standard things they immediately think it's in a stdlib
[17:17:50] sddd: I'd extend list for that, for example
[17:17:54] DEA7TH: has joined #RubyOnRails
[17:18:23] tuelz: because there are so many convenience methods it's hard to remember all of them....that's why including modules can be better sometimes, because it becomes much more clear you've included that functionality into that class and it's not i na stdlib
[17:18:55] sddd: you mean include Array instead of myclass < Array?
[17:19:01] tuelz: the difference isn't really all that important, imho
[17:19:18] sddd: but when you include it's a module, right?
[17:19:22] tuelz: well array is a class that you would inherit from. I mean a module which basically just groups together methods you want to include inside a class
[17:19:22] sddd: whereas Array is a class
[17:19:53] sddd: doesn't that differentiation put a limitation on multiple inheritance?
[17:20:09] tuelz: I'm not sure I follow
[17:20:11] sddd: becaue if I want to include stuff I need to restructure my code
[17:20:16] sddd: say I have two classes
[17:20:23] jottr: has joined #RubyOnRails
[17:20:31] sddd: if I wanted to have a class that inherits from both I need to change them to modules
[17:21:06] tuelz: not necessarily...you can inherit a into b and b into c and c has a, also
[17:21:35] hanss: has joined #RubyOnRails
[17:21:40] sddd: any other suggestion for a ruby newbie?
[17:22:18] bungoman: has joined #RubyOnRails
[17:22:51] tuelz: umm, I would recommend not going to jail, but I can't relate that to ruby
[17:22:57] mercerist: has joined #RubyOnRails
[17:23:22] tuelz: unless you're just visiting a friend. I'm sure then it wouldn't be too bad
[17:23:46] sddd: well that may be relaated to rubies and other jewelry
[17:23:52] sddd: I'll keep it in mind
[17:24:11] tuelz: valid point
[17:24:28] Spami: has joined #RubyOnRails
[17:24:44] tuelz: also #ruby would be better for these types of questions
[17:24:51] tuelz: #rubyonrails is barely ruby at all
[17:25:13] tuelz: it's one huge (and really nice) DSL that lets you write your buisiness logic in ruby, basically
[17:26:00] sddd: true, sorry! it's really easy to confuse them
[17:26:11] sddd: as it seems 90% of people get into ruby with rails
[17:26:15] sddd: including me of course
[17:26:25] tuelz: yep, easy mistake to make
[17:26:37] djbkd: has joined #RubyOnRails
[17:29:50] ruurd: has joined #RubyOnRails
[17:30:15] fgo: has joined #RubyOnRails
[17:30:26] xcesariox: has joined #RubyOnRails
[17:32:29] blackmesa: has joined #RubyOnRails
[17:32:35] giowong: has joined #RubyOnRails
[17:33:51] Lightsword: has joined #RubyOnRails
[17:33:53] RatelDev: has joined #RubyOnRails
[17:35:04] platzhirsch1: has joined #RubyOnRails
[17:35:31] RatelDev: has joined #RubyOnRails
[17:38:26] chinmay_dd: has joined #RubyOnRails
[17:38:55] fmcgeough: has joined #RubyOnRails
[17:39:32] intinig: has joined #RubyOnRails
[17:40:05] cnk: has joined #RubyOnRails
[17:40:27] RatelDev: has joined #RubyOnRails
[17:40:57] jhack: has joined #RubyOnRails
[17:40:57] jhack: has joined #RubyOnRails
[17:41:37] Ergo: has joined #RubyOnRails
[17:42:31] RatelDev: has joined #RubyOnRails
[17:44:04] noodman: has joined #RubyOnRails
[17:48:20] gsd: has joined #RubyOnRails
[17:50:38] theery: has joined #RubyOnRails
[17:50:48] stesind: has joined #RubyOnRails
[17:50:50] JoshL: has joined #RubyOnRails
[17:51:33] baweaver: has joined #RubyOnRails
[17:51:38] smathy: "rubyonrails is barely ruby at all" is a very wrong statement.
[17:52:04] peeja: has joined #RubyOnRails
[17:52:06] smathy: The biggest problem I see with people trying to understand Rails is a lack of understanding of ruby.
[17:52:20] tuelz: smathy: then explain how on simple apps I write easily twice as much DSL as ruby?
[17:52:28] bricker: ACTION slowly backs away
[17:52:37] tuelz: bricker: lol
[17:53:08] smathy: tuelz, "on simple apps" is a strawman argument, I could argue that on simple apps I can do most things with the scaffold generator. Doesn't really speak to an actual rails app.
[17:53:42] tuelz: smathy: what? 99% of people in this channel are building simple apps, that's why theey are here....well 99% of people asking for help anyways
[17:53:44] smathy: tuelz, as I said, the biggest problem I see in helping people is a lack of ruby understanding.
[17:54:23] tuelz: biggest problem I see is lack of server client separation understanding /shrug
[17:54:32] smathy: tuelz, that's entirely opposite what I've just said, so obviously I disagree with it.
[17:55:30] tuelz: okay, I guess we disagree then. Good chat :p
[17:56:32] ruurd: has joined #RubyOnRails
[17:57:04] arBmind: has joined #RubyOnRails
[17:57:34] tuelz: I will say I was employed and writing rails apps for big name contracts before I knew any intermediate ruby
[17:57:43] r4pha: has joined #RubyOnRails
[17:57:43] r4pha: has joined #RubyOnRails
[17:57:57] smathy: tuelz, that's probably where your bias stems from.
[17:58:00] tuelz: hell I'm still barely an intermediate rubyist :P
[17:58:01] SuMo_D: has joined #RubyOnRails
[17:58:59] tuelz: smathy: what's your point? That my bias is blinding me? Because I would say that datapoint is proof you can do rails without knowing ruby very well and solve real problems with it
[18:00:14] ndrei: has joined #RubyOnRails
[18:01:32] smathy: I never said you couldn't, and you weren't arguing that there was at least one case of someone able to write rails just intermediate ruby knowledge.
[18:01:47] smathy: You said that rails is barely ruby at all.
[18:01:55] intinig: has joined #RubyOnRails
[18:02:09] smathy: ...that's a generic statement which implies either totality, or at least majority/commonality.
[18:02:17] smathy: I say that's false.
[18:02:43] tuelz: sorry, I would've been more precise if I knew I was presenting the affirmative to a debate
[18:03:19] tuelz: would you like to cross examine now?
[18:03:27] smathy: I say that rails involves more than whatever "barely ruby at all", I say rails requires a decent understanding of ruby, and more importantly I say that the better your understanding of ruby the more effective you will be at writing good rails apps - which directly refutes the claim that rails is barely ruby at all.
[18:03:52] tuelz: depends on what you mean by 'good rails apps'
[18:04:05] tuelz: if by good you mean it works and solves a problem I disagree
[18:04:23] tuelz: if you mean you're able to follow conventions and work on a team - then ruby will be highly useful
[18:04:24] smathy: tuelz, so you can say whatever you like, then when challenged instead of backing away from it gracefully you argue the point, only to claim I am pedantic later on?
[18:05:00] tuelz: let's just say there are more graceful ways to disagree with someone ;)
[18:05:10] smathy: tuelz, depends on your definition of "it works" and depends on which problem it's solving. Any commercial app will work even better if the rails devs understand ruby well.
[18:05:33] smathy: tuelz, and many problems are just not comprehensible/solvable without a good understanding of ruby.
[18:05:43] tuelz: or so you say
[18:06:08] tuelz: I'd be willing to bet most of the problems you've solved could be solved to a clients likings with nothing more than plugging in gems and writing front end
[18:06:23] smathy: tuelz, heh, how much?
[18:06:32] tuelz: how much what?
[18:06:37] smathy: tuelz, how much are you willing to bet?
[18:07:03] tubbo: tuelz: you can do a lot of things without knowing ruby very well, that's a testament to how easy of a language ruby is to leran
[18:07:14] dopie: has joined #RubyOnRails
[18:07:29] tubbo: its subsequent problems in performance and understanding are a testament to how difficult of a language ruby can be
[18:07:30] tuelz: find a 3rd party willing to mediate and judge and I'll put up $500
[18:07:36] yfeldblum: has joined #RubyOnRails
[18:07:39] tubbo: ACTION raises hand
[18:07:44] smathy: tubbo, just because ruby is easy to learn, doesn't mean that you don't know it when you're doing these lots of things.
[18:08:10] smathy: tubbo, will you mediate?
[18:08:29] smathy: (this fool obviously hasn't even looked at my github repo or SO answers)
[18:08:49] tuelz: what are the top 3 features of your last 3 projects
[18:09:03] tuelz: as demonstrated by clients
[18:09:08] tuelz: not by your project management
[18:09:17] tuelz: what were your clients most interested in seeing
[18:09:35] Casty: has joined #RubyOnRails
[18:10:07] tubbo: tuelz: 1.) money, 2.) money, 3.) money, 4.) MAHHHH-NAY!
[18:10:26] tuelz: is there a money producing gem yet?
[18:10:30] tubbo: gem install money
[18:10:32] tuelz: I should write that
[18:10:44] tubbo: yeah it's called "every app i make" *drops mic*
[18:10:49] tuelz: LOLOLOLOLOL
[18:11:05] pixelhandler: has joined #RubyOnRails
[18:11:27] tuelz: I'm wondering if smathy got quite once he realized that clients almost always are focused on things that have been solved by gems
[18:11:28] tubbo: i think what you are confusing here is "knowing ruby" and "knowing how ruby works"
[18:11:39] tubbo: like plenty of people can use ruby, javascript, java, et. al. without knowing how their respective VMs work...
[18:12:01] tubbo: tuelz: no, i'm thinking he probably got quiet because he has better things to do than argue with someone on the internet.
[18:12:08] smathy: tuelz, just because a client only knows/appreciates the UX, doesn't mean that the backend isn't important.
[18:12:09] tubbo: currently, i am waiting for my tests to pass so i'm a little bored ;)
[18:12:09] greengriminal: has joined #RubyOnRails
[18:12:17] tubbo: i also broke sudo on one of the staging servers because I SUCK
[18:12:18] tuelz: tubbo: seems you were wrong
[18:12:41] tuelz: besides I didn't start this (lets call i a debate, that's a more forgiving presumption)
[18:13:03] jhack: has joined #RubyOnRails
[18:13:09] smathy: tuelz, and no, my clients are generally impressed by my ability to solve big problems, fix performance bottlenecks, do more with less, and work quickly without creating performance problems. All things which require good knowledge of the languages in question, including ruby.
[18:14:02] tuelz: whatever, I'm bored with this argument. goalposts already being moved
[18:14:20] framling: has joined #RubyOnRails
[18:14:56] iamjarvo: has joined #RubyOnRails
[18:15:43] tubbo: this all stemmed from a discussion on whether one should extend Array or just make their own Enumerable object
[18:15:49] tubbo: and typically the latter is best :)
[18:16:05] tubbo: you're more sure of the footprint, rather than extending Array which may or may not have already been extended
[18:16:29] rhizome: you're trying to keep this going aren't you
[18:17:10] hololeap: has joined #RubyOnRails
[18:18:15] smathy: I still think bricker's response was the best.
[18:18:29] giowong: anyone here to help?
[18:18:52] intinig: has joined #RubyOnRails
[18:18:59] pixelhan_: has joined #RubyOnRails
[18:19:27] giowong: im trying to set an association through a dropdown
[18:19:51] giowong: but everytime i save , it seems like its not being associated properly
[18:19:52] giowong: https://gist.github.com/gwong89/13d87add6261c22d93ca
[18:20:21] rhizome: giowong: do we already know how your associations are set up?
[18:20:23] giowong: the client has a one to many relation to the theme
[18:20:53] giowong: i placed a foreign key for client_id on theme
[18:20:53] rhizome: say that again in rails terms
[18:21:07] giowong: client has_many themes
[18:21:14] giowong: theme belongs_to client
[18:21:41] edwinvdgraaf: has joined #RubyOnRails
[18:21:44] rhizome: ok. the form is for a client, but the theme selector only mentions :theme, singular
[18:21:44] smathy: giowong, you probably want to use `f.association` in your simple_form
[18:21:53] giowong: for the dropdown?
[18:22:02] bin_005: has joined #RubyOnRails
[18:22:25] smathy: giowong, and yeah, rhizome is right, add your models to the gists, showing the associations.
[18:22:30] platzhirsch1: has left #RubyOnRails: ()
[18:23:00] JakFrist: has joined #RubyOnRails
[18:23:22] rushed: has joined #RubyOnRails
[18:23:29] intinig: has joined #RubyOnRails
[18:24:18] DoubleMalt: has joined #RubyOnRails
[18:25:19] giowong: https://gist.github.com/gwong89/13d87add6261c22d93ca
[18:26:01] rhizome: themes. has_many :themes
[18:26:35] tuelz: has joined #RubyOnRails
[18:28:31] smathy: giowong, so a client can have more than one theme?
[18:28:58] GPrime: has joined #RubyOnRails
[18:28:58] smathy: giowong, so how do they pick more than one in a simple dropdown?
[18:29:26] smathy: giowong, anyway, use the `association` helper from simple_form
[18:29:29] kaymation: has joined #RubyOnRails
[18:29:50] smathy: `= f.association` not `= f.collection_select`
[18:30:25] greengriminal: has joined #RubyOnRails
[18:30:41] SteenJobs: has joined #RubyOnRails
[18:30:52] tuelz: sorry, internet dieded
[18:30:56] kaymation: Hey guys, for a project I need to have a' browser' within a div of a page that loads an existing web page and allows the user to select an image from the embedded webpage and in turn downloads that image to the server
[18:30:57] giowong: smathy we will just add another new row
[18:31:12] kaymation: can anyone reccommend any gems/ approaches to help with this task?
[18:31:17] giowong: pretty shitty but just need something to work for now
[18:32:41] romdi: has joined #RubyOnRails
[18:33:04] smathy: giowong, so if you use association you will get a multiple-select dropdown, or you can specify checkboxes, read the simple_form docs.
[18:33:10] GPrime: How would you guys approach a problem where you have a button that has 2 functions depending if someone was logged in or not?
[18:33:23] tuelz: kaymation: only thing I can think of is writing some JS to attach some unqiue ID to every img element inside an iframe and then use JS to post that image bac kto you on click
[18:33:50] GPrime: Since javascript are all run as the page loads, I get nil:class when user is not logged in. Been trying to think of a way to work around this quirk
[18:33:53] rhizome: it's a copyright infringement machine!
[18:34:25] tuelz: would it be rhizome? Is downloading illegal without permission? or would that be considered sharing without permission?
[18:34:39] rhizome: just speculating
[18:34:45] eminencehc_: has joined #RubyOnRails
[18:34:51] tuelz: probably a safe presumption, err on the side of caution
[18:35:08] rhizome: i wanted to make an actual joke about it, but
[18:35:26] Lytol: has joined #RubyOnRails
[18:35:28] tuelz: sorry, noone liked my dadjokes this morning so you're not allowed to have fun either
[18:35:34] workmad3: has joined #RubyOnRails
[18:35:40] rhizome: humpday amirite
[18:35:57] tuelz: more like....nevermind I got nothin....
[18:36:06] smathy: GPrime, "Since javascript are all run as the page loads" is why we have $(document).ready
[18:36:37] GPrime: oh, and that would be ajax right?
[18:36:39] lexluthor1: has joined #RubyOnRails
[18:37:12] smathy: GPrime, no, it's just an event that your browser calls back to once the page is loaded. So you can run JS code in there that depends on the page being loaded.
[18:37:17] tuelz: ajax = asyncronous javascript and xml
[18:37:21] kaymation: haha it's for a client so they can take care of any legal headaches
[18:37:26] smathy: GPrime, read more here: https://api.jquery.com/ready/
[18:37:36] GPrime: okay, great! Thanks
[18:37:53] noodman: has joined #RubyOnRails
[18:37:56] smathy: GPrime, also be aware that if you're using turbolinks (which you are unless you disabled it) then you need to know about that event too: https://github.com/rails/turbolinks
[18:38:16] GPrime: Thanks smathy
[18:38:24] smathy: GPrime, you're welcome.
[18:38:30] paulcsmith: has joined #RubyOnRails
[18:38:45] tuelz: kaymation: then yeah, I would warn your client and then write some JS that upon loading an iframe you attach some unique id to every img element. You'll then want to write a click handler that POSTs that image to your server when it's clicked
[18:38:57] blackmesa: has joined #RubyOnRails
[18:39:05] tuelz: highly doubt there's already a library for this
[18:39:14] tuelz: mostly because it sounds illegal
[18:39:14] Rubie: has joined #RubyOnRails
[18:39:30] rhizome: it doesn't have to be
[18:40:03] tuelz: right, it's only illegal when it's illegal, of course!
[18:40:08] tuelz: and legal when it isnt'
[18:40:15] tuelz: hope that clears things up for you
[18:41:02] adavia: ok now this works fine but shouldnt be adding the likeable_type also? i get nil http://pastie.org/10295053
[18:41:33] tuelz: kaymation: although if the client owns the server he would just be downloading the image itself which would probably never be illegal
[18:41:59] tuelz: this whole things sounds like it would be better suited for a browser extention rather than a web app though
[18:43:10] jottr: has joined #RubyOnRails
[18:44:39] Casty: has joined #RubyOnRails
[18:44:58] DEA7TH: has joined #RubyOnRails
[18:45:17] kies^: has joined #RubyOnRails
[18:47:05] bruno-: has joined #RubyOnRails
[18:49:50] momomomomo: has joined #RubyOnRails
[18:50:01] DEA7TH_: has joined #RubyOnRails
[18:50:33] __butch__: has joined #RubyOnRails
[18:50:44] giowong: something is going weird
[18:51:00] giowong: on my page, it shows that i have the theme object associated
[18:51:22] giowong: but when i try to access it through rails console by doing client.theme or themes it says no method?
[18:51:43] urkle: has joined #RubyOnRails
[18:51:54] JoshL: has joined #RubyOnRails
[18:54:40] tuelz: 'on my page' what does that mean? Also, what is client? Probably need code to help you debug
[18:55:15] bungoman: has joined #RubyOnRails
[18:55:47] lethjakman: has joined #RubyOnRails
[18:56:06] jdayvie: has joined #RubyOnRails
[18:56:35] moeabdol: has joined #RubyOnRails
[18:56:39] charliesome: has joined #RubyOnRails
[18:56:47] CheckYourSix: has joined #RubyOnRails
[18:56:56] sarink: has joined #RubyOnRails
[18:59:00] nobitano_: has joined #RubyOnRails
[18:59:08] jdayvie: I recently installed paperclip to use and when I bundled, it showed three other gems: mimemagic, cocaine, and climate_control. Are these three associated with paperclip and if so, how? I have not placed any others so I assume so, but didn't see anything in the documentation.
[18:59:38] FCser: has joined #RubyOnRails
[18:59:53] rhizome: jdayvie: Gemfile.lock will tell you
[19:00:03] tubbo: jdayvie: https://github.com/thoughtbot/paperclip/blob/master/paperclip.gemspec#L25-L27
[19:00:20] rhizome: i don't think i see dependencies listed in docs very often
[19:00:52] smathy: adavia, no, you told it to just add the _id, use `likeable: @likeable` instead to get both.
[19:01:05] jdayvie: rhizome: Ahh, very well, I appreciate it. =)
[19:01:13] jdayvie: Still nothing there on climate_control though?
[19:01:57] juanpaucar: has joined #RubyOnRails
[19:02:08] jdayvie: I know having many gems can cause a project to load slower so I just don't want to have unnecessary ones there.
[19:02:30] smathy: jdayvie, cocain has climate_control as a dependency: https://rubygems.org/gems/cocaine
[19:02:31] adavia: smathy: i dont know why i get uninitialized constant Like::Likeable when i try that
[19:02:44] jdayvie: smathy: Very well =) Thank you! =)
[19:04:12] smathy: jdayvie, do you see how your Gemfile.lock shows you that?
[19:04:43] jdayvie: smathy: Oh! I see it now! =P cocaine (0.5.7)
[19:04:43] jdayvie: climate_control (>= 0.0.3, < 1.0)
[19:04:58] jdayvie: climate_control is a dependency for cocaine
[19:05:17] jdayvie: Just like bcrypt is a dependency for Devise.
[19:05:51] jdayvie: And I see all of paperclips dependencies now, which lists all the ones I asked about. Thank you Smithy!
[19:06:26] smathy: jdayvie, you're welcome :)
[19:08:54] giowong: https://gist.github.com/gwong89/13d87add6261c22d93ca
[19:09:24] giowong: on index.html.erb, the client.themes.try(:name) doesnt render name, it renders VG::Theme
[19:09:46] giowong: and in rails console, if i try client.theme or client.themes it doesnt bring up the association??
[19:10:01] pkrnj: has joined #RubyOnRails
[19:10:33] roolo: has joined #RubyOnRails
[19:11:30] Lytol: has joined #RubyOnRails
[19:12:06] yardenbar: has joined #RubyOnRails
[19:14:17] benlieb: has joined #RubyOnRails
[19:14:57] kies^: has joined #RubyOnRails
[19:15:26] tuelz: giowong: well in console you're probably not setting client to a Client object
[19:15:38] giowong: client= Client.all
[19:15:42] giowong: and there is only 1 client
[19:15:42] tuelz: giowong: and client.themes will return an array of themes
[19:15:56] tuelz: giowong: try client.themes.first.try(:name)
[19:16:18] tuelz: well you need client.first.themes.first.try(:name) then
[19:16:21] tuelz: giowong: ^
[19:16:31] tuelz: see the difference?
[19:17:17] giowong: undefined method for clien
[19:17:25] giowong: thats what is confusing me
[19:17:52] tuelz: because Client.all is an array of AR relations, the method does, in fact, not exist.
[19:18:12] lapide_viridi: has joined #RubyOnRails
[19:18:33] SuMo_D: has joined #RubyOnRails
[19:18:35] tuelz: [[AR1],[AR2]] does not have a .themes method....the AR relations INSIDE that array have a .themes, but the array itself does not
[19:18:44] blackmesa: has joined #RubyOnRails
[19:18:57] rhizome: .try always feels like an antipattern to me
[19:19:27] tuelz: rhizome: what pattern is the solution? (because I agree with you, but don't know the solution)
[19:19:38] smathy: rhizome, you like the null object pattern better?
[19:20:02] giowong: i did this:
[19:20:04] giowong: client.first.themes.first.try(:name)
[19:20:08] lxsameer: has joined #RubyOnRails
[19:20:08] lxsameer: has joined #RubyOnRails
[19:20:11] giowong: gave me "VG::Theme"
[19:20:26] giowong: but in my association i have the theme.name showing up??
[19:20:31] tuelz: ACTION shrugs
[19:20:44] rhizome: i would lean toward null object if you can't guarantee the object will exist. or just an if
[19:21:01] pixelhandler: has joined #RubyOnRails
[19:21:04] tuelz: unless your theme is named VG::Theme then I have no idea, giowong
[19:21:26] rhizome: but then again, I DIDN'T LEARN RUBY BEFORE RAILS
[19:21:31] tuelz: have you overridden the name method somehwere?
[19:21:43] tuelz: rhizome: is that still a thing? are we still talking about that :p
[19:22:00] rhizome: in comedy it's called a callback
[19:22:15] tuelz: in javascript we call that aweful
[19:22:50] rhizome: full of awe. agreement
[19:23:00] tuelz: damnit english, you've betrayed me again
[19:23:21] tuelz: maybe I should learn languages before I use them....heh heh heh heh
[19:23:49] rhizome: learn english before attempting tumblrspeak
[19:24:05] tuelz: that's not even english though, it's basically just a huge DSL
[19:24:14] tuelz: huehuehuehuehuehue
[19:24:41] Criten: has joined #RubyOnRails
[19:24:52] rhizome: a really nice DSL
[19:25:24] tuelz: and now I have coffee all over me...thanks
[19:25:26] hadees: has joined #RubyOnRails
[19:25:43] rhizome: my work here is complete
[19:26:14] gnagno: has joined #RubyOnRails
[19:26:34] smathy: rhizome, .try is just an if in different clothing.
[19:27:25] smathy: giowong, !code please
[19:27:25] helpa: giowong: 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.
[19:27:27] rhizome: ok, maybe not so much an antipattern as semantically annoying (to me). i'm not being particularly rigorous here.
[19:27:47] giowong: in the schema the table is called vg_themes but in the model the themes model is under the folder vg
[19:27:47] eggoez: has joined #RubyOnRails
[19:28:03] tuelz: I mean I agree that it's an anti-pattern and I've heard about the null object pattern, but never seen it before
[19:28:05] coetry: has joined #RubyOnRails
[19:28:27] tuelz: or I have and just haven't known it...I need to look it up
[19:28:56] coetry: I have a version mismatch between my spring server and client ( the client is 1.3.6 and the server is 1.3.4 ), I have this deployed on Phusion Passener
[19:29:01] coetry: what should I do?
[19:29:39] llakey: has joined #RubyOnRails
[19:29:44] tuelz: client? You mean you're dev machine?
[19:29:55] tuelz: your********
[19:30:11] tuelz: ACTION laughs at his own typo
[19:30:22] Surt_Q: has joined #RubyOnRails
[19:30:23] coetry: tuelz: https://gist.github.com/anonymous/23f1832de0abea95cb66
[19:31:10] ruurd: has joined #RubyOnRails
[19:31:46] tuelz: sorry I have no idea what that error message means by client
[19:32:04] tuelz: then again, spring is just a magic black box to me...
[19:32:06] poli_: has joined #RubyOnRails
[19:32:41] tuelz: is spring trying to run rails console locally through ssh?!
[19:32:54] tuelz: maybe you're the client
[19:33:08] tuelz: see what your local machines spring version is
[19:33:55] coetry: `spring stop` did the trick :)
[19:34:01] coetry: freakin spring
[19:34:12] tuelz: problem solved....NEXT!
[19:34:19] pramsky: has joined #RubyOnRails
[19:35:44] giowong: apparently my array is returning nothing
[19:35:44] tuelz: giowong: in your erb replace client.themes.try(:name) and try instead `client.themes.pluck(:name)`
[19:36:07] giowong: Client.first.themes.count => 0
[19:36:22] tuelz: well that's a problem :)
[19:36:23] baweaver: has joined #RubyOnRails
[19:36:27] tuelz: you should create some themes :p
[19:36:41] hadees: I???m using a simple routes constraint but for some reason rspec doesn???t seem to be using it at all in my request spec. Any idea whats up with that?
[19:36:45] giowong: Client.first.themes.all => #<ActiveRecord::AssociationRelation []>
[19:36:46] hadees: Here is the route get "/auth/google_oauth2/callback" => action, :constraints => lambda { |request| binding.pry; request.env["omniauth.params"]["kind"] == kind.to_s }
[19:36:46] smathy: rhizome, I agree, it reeks of uncertainty about your objects, but I think it's an either-or. Either you go for a null object pattern, or you have to use (something like) try or .compact to protect yourself from calling methods on `nil` objects in collections.
[19:36:49] giowong: empty association,,
[19:37:02] hadees: I put in binding.pry to just see if it actually gets run and it doesn't
[19:37:18] hadees: i???m really confused because this works in my app
[19:37:36] kies^: has joined #RubyOnRails
[19:37:41] hadees: i should add that route is in a loop which is why there are variables
[19:37:55] tuelz: hadees: a lamba creates some code to be executed later...where are you executing the lambda?
[19:38:23] hadees: tuelz: i???m just doing get "/auth/google_oauth2/callback", kind: "app_signup" in my request spec
[19:38:46] hadees: tuelz: there is a fallback route that is just "/auth/google_oauth2/callback" and it hits that every time
[19:38:55] chipotle: has joined #RubyOnRails
[19:39:08] eminencehc_: has joined #RubyOnRails
[19:39:10] hadees: so the request spec for some reason isn???t running the constraints when I use get
[19:39:15] tuelz: hadees: well unless you're calling that lambda inside an action inside that request you've made I think all that code is doing is creating a hash with a lambda as the value
[19:39:17] alphaatom: has joined #RubyOnRails
[19:39:31] tuelz: not sure what rails is actually doing there, though
[19:39:34] hadees: tuelz: no the routes file is supposed to call the lambda
[19:39:36] tuelz: might be some DSL I don't understand
[19:39:53] giowong: but i have themes already in my database..
[19:40:11] workmad3: has joined #RubyOnRails
[19:40:22] giowong: all i simply want to do
[19:40:25] tuelz: hadees: oh, gotcha, well maybe rspec doesn't know how to do what rails is doing with that route? I honestly don't know - just shooting out suggestions
[19:41:06] tuelz: giowong: well you're not associating correctly to themes, obviously. If you do in fact have themes populated inside your DB, then your model is incorrectly connecting to another table
[19:41:16] giowong: is let the user choose the appropriate theme name in relation to the client, and set the relation
[19:42:34] girakrok: has joined #RubyOnRails
[19:42:53] VeryBewitching: has joined #RubyOnRails
[19:44:30] lucha: has joined #RubyOnRails
[19:46:09] Oog: has joined #RubyOnRails
[19:46:32] Oog: add_belongs_to :users, :rachel, :index => true, :foreign_key => true - the foreign key goes to table users can that be done?
[19:47:56] girakrok: has joined #RubyOnRails
[19:48:03] jhack: has joined #RubyOnRails
[19:48:20] stesind: has joined #RubyOnRails
[19:48:51] Lightsword: has joined #RubyOnRails
[19:48:58] tubbo: Oog: wait, so you want a rachel_id on the users table? :D
[19:49:05] tubbo: how many rachels we got on this ship anyhow?
[19:49:15] tuelz: not enough
[19:49:20] tuelz: I'll tell you that right now
[19:49:35] Oog: rachel is special :)
[19:49:37] arooni-mobile: has joined #RubyOnRails
[19:49:55] Oog: lot of people can have a rachel
[19:50:02] arooni-mobile: has joined #RubyOnRails
[19:50:14] Oog: add_column :users, :rachel_id, :integer, :index => true; add_foreign_key :users, :users, :column => :rachel_id seems to work
[19:50:22] tuelz: is this a simulator for which Friends character you're most like?
[19:50:33] dynomist: has joined #RubyOnRails
[19:50:40] giowong: maybe im misunderstanding how class_name works
[19:50:49] giowong: btw this is a exisitng code base im using
[19:52:08] tubbo: Oog: should woth with foreign_key: true as well
[19:52:18] tubbo: but there has to be a 'rachels' table i think
[19:54:04] ndrei: has joined #RubyOnRails
[19:54:33] bricker: has joined #RubyOnRails
[19:54:58] dynomist: I've just finished reading 'Practical Object-Oriented Design in Ruby' (and really enjoyed it) - but I have a question. It talks a lot about using Modules and Classes.
[19:55:10] dynomist: I understand how Modules and Classes work - but I don't know where to put them in my Rails application.
[19:55:31] Salve: has joined #RubyOnRails
[19:56:21] tubbo: dynomist: think about the parts of your app based on what each piece does, not on what type of object it is.
[19:56:33] Zadrel: has joined #RubyOnRails
[19:57:06] dynomist: tubbo - in case I'm not clear, I am asking about file / directory structure
[19:57:08] tubbo: use a class when your object needs state, and a module if it's really just a collection of methods.
[19:57:21] dynomist: where do you __put__ the code
[19:57:26] baweaver: has joined #RubyOnRails
[19:57:32] Zadrel: hello there! anny knows if its possible and how do i submit a form_tag or call a remote ajax :onchange of a check_box_tag?
[19:57:33] tubbo: dynomist: my advice still applies. you don't see ./app/classes in a rails app, right? you see ./app/decorators or ./app/models
[19:57:37] JoshL: has joined #RubyOnRails
[19:57:43] ruurd: has joined #RubyOnRails
[19:58:00] tubbo: Zadrel: i'd just bind that event in JS, don't think rails has anything built-in to handle that.
[19:58:07] dynomist: tubbo - not sure that I've ever used decorators
[19:58:08] xkickflip: has joined #RubyOnRails
[19:58:21] dynomist: i've seen 'concerns' but was a little confused by those
[19:58:24] Zadrel: tubbo: thx :)
[19:58:49] nettoweb: has joined #RubyOnRails
[19:59:04] tubbo: dynomist: i guess the question i'd have to ask is what kind of code are you talking about that you can't find a place for? or is this just a general question?
[19:59:06] smathy: dynomist, concerns are just mixins with a nicer DSL
[19:59:09] Zadrel: tubbo: i can call a jquery function using the :onchange attr right?
[19:59:31] Zadrel: tubbo: idk how i do it, may you point me to something?
[19:59:33] tubbo: if the latter, you basically need to figure out what you need to do
[19:59:55] dynomist: thanks smathy - i guess i haven't used mixins yet either
[19:59:59] tubbo: Zadrel: you will have to bind the 'change' event to the element you're talking about in javascript, what you use to do that is none of my business :)
[20:00:15] smathy: dynomist, you didn't learn about that when learning about ruby modules?
[20:00:23] tubbo: Zadrel: in jquery it would be like $('#the_id_of_your_check_box').on('change', function() { $.ajax(...) }); for example
[20:00:37] baweaver: has joined #RubyOnRails
[20:01:11] zorak8: has joined #RubyOnRails
[20:01:34] SuMo_D: has joined #RubyOnRails
[20:02:10] dynomist: tubbo - if you have a behavior that you want to share across models - this would be something that could be put in a Module and then included in both, right? but where would the code for the Module be ?
[20:02:34] Zadrel: tubbo: thx very much, you helped me a lot, may Odin bless you.
[20:03:09] DeweyD: has joined #RubyOnRails
[20:03:13] tubbo: dynomist: yeah basically. that's what app/models/concerns are for. you can put regular old modules in there if you don't need the ActiveSupport::Concern DSL
[20:03:49] joofy: has joined #RubyOnRails
[20:03:55] dynomist: tubbo - do they get loaded automagically?
[20:04:15] dynomist: and what if you have a module that you want to be available in application_controller.rb
[20:04:22] giowong: does anyone know how to pass in a custom class name to f.association
[20:04:33] tubbo: dynomist: they do, yeah. anything in ./app/** gets auto-loaded
[20:04:43] tubbo: dynomist: you could put that in app/controllers/concerns
[20:04:54] bricker: giowong: you don't, it knows the class name from your model
[20:05:21] dynomist: by ./app/** i assume you mean ./app/*/* ?
[20:05:58] dynomist: or is it just EVERYTHING inside of app ?
[20:06:15] giowong: bricker: well its a little trickyt
[20:06:37] tubbo: dynomist: everything inside of app. when i say app/**/* i mean "any file in any dir inside of app", just like the shell wildcard.
[20:06:48] giowong: right now my associations arent even saving
[20:07:16] dynomist: tubbo - thx. I think that is the missing piece for me
[20:07:18] giowong: even though in the model they are specifed, for some reason both ways cant work
[20:07:59] dynomist: tubbo - what are your thoughts on 'decorators' that smathy mentioned?
[20:08:32] lapide_viridi: has joined #RubyOnRails
[20:09:01] kadoppe: has joined #RubyOnRails
[20:09:17] Lightsword: has joined #RubyOnRails
[20:09:48] Anakat: has joined #RubyOnRails
[20:10:11] tubbo: dynomist: my thoughts? they're definitely useful if you want to move view-level logic out of your model classes
[20:10:37] tubbo: assuming we're talking about draper decorators, which are more like presenter objects honestly
[20:10:59] tubbo: dynomist: you might want to check out the concept behind decoration... https://en.wikipedia.org/wiki/Decorator_pattern
[20:11:08] tubbo: there are tons of other design patterns you can use
[20:14:47] juanpaucar: has joined #RubyOnRails
[20:15:19] charliesome: has joined #RubyOnRails
[20:16:10] ndrei: has joined #RubyOnRails
[20:16:21] urkle: has joined #RubyOnRails
[20:19:57] symbol: has joined #RubyOnRails
[20:20:03] dynomist: thanks tubbo
[20:21:05] ruurd: has joined #RubyOnRails
[20:24:06] avitzurel: has joined #RubyOnRails
[20:24:07] edwinvdg_: has joined #RubyOnRails
[20:25:53] StevePotayTeo: has joined #RubyOnRails
[20:28:51] Zadrel: i have this url ---http://localhost:3000/category/2/show_subcategories---, anyone knows how do i pass the id in the url to the ajax jquery ---$.ajax("/category/:id/filter")---?
[20:28:59] nettoweb: has joined #RubyOnRails
[20:29:26] rhizome: what is it?
[20:29:45] duderonomy: has joined #RubyOnRails
[20:29:51] rhizome: how does the url appear?
[20:29:53] edwinvdgraaf: has joined #RubyOnRails
[20:29:55] Zadrel: rhizome: talking to me? it's for filtering a list
[20:30:07] rhizome: so it's in a...link?
[20:30:33] Zadrel: rhizome: um... yeah
[20:31:17] rhizome: why not just submit the link, why is the url different if submitted via js?
[20:31:28] Zadrel: rhizome: inside the $.ajax is the route i wanto to go, but i don't know how to maintain the id (in my case "2")
[20:31:50] rhizome: you're using two different routes
[20:32:18] Zadrel: rhizome: yeah, becouse the "filter" is a different method
[20:32:25] smathy: ACTION didn't mention decorators
[20:32:36] Zadrel: rhizome: but i guess i undertand you
[20:32:44] atmosx_: has joined #RubyOnRails
[20:32:46] rhizome: why are you using a different method for js?
[20:33:18] Zadrel: rhizome: i intend to change only a section of the page using AJAX
[20:33:48] Zadrel: rhizome: i don't understand what is "vs"
[20:34:10] rhizome: "as opposed to" ...said another way, why not put the .../filter url in the href?
[20:34:16] rhizome: in the first place
[20:34:30] dopie: tubbo, had a question looking at the api docks
[20:34:47] dopie: how would i find where .full_messages is available for the error messages
[20:34:53] dopie: under the errors?
[20:34:56] bronson: has joined #RubyOnRails
[20:34:57] tubbo: sittin on the dock of the api
[20:35:14] dopie: ActiveModel::Errors < Object
[20:35:16] ruurd: has joined #RubyOnRails
[20:35:19] dopie: thats what i was looking for
[20:35:28] tubbo: dopie: every active_record model has an errors method, which in turn instantiates an Errors object
[20:35:40] Zadrel: rhizome: i got confused how will i insert the href. the ajax event is fired by a "onchage cehckbox"
[20:35:45] tubbo: dopie: you can probably go to api.rubyonrails.org, search for ActiveModel::Errors and find it that way
[20:36:00] dopie: tubbo, yep thats what i found out :)
[20:36:05] tubbo: though there are probably multiple classes named Errors, so you'll have to read a few to figure out what you're lookign for
[20:36:10] FCser: has joined #RubyOnRails
[20:36:30] smathy: ...or just search for full_messages
[20:37:06] pkrnj: has joined #RubyOnRails
[20:37:06] dopie: smathy, my question was how would i find methods that would be available from ActiveModel::Errors < Object
[20:37:36] smathy: dopie, weird, I read it as you asking how to find where the .full_messages method was available.
[20:38:36] dopie: that translates to what I said :)
[20:38:46] rubyonrailed: has joined #RubyOnRails
[20:39:00] baweaver: has joined #RubyOnRails
[20:39:44] tubbo: dopie: it's kinda like if i wanted to ask you what the weather was, so i asked you "did water fall on you when you were outside?"
[20:40:02] tubbo: sure, that gets me the answer i'm looking for, but the person who's asking looks like a crazy person
[20:40:13] dopie: hahahahaa!
[20:40:20] DEA7TH: has joined #RubyOnRails
[20:41:21] jdayvie: has joined #RubyOnRails
[20:41:26] htmldrum: has joined #RubyOnRails
[20:42:26] charliesome: has joined #RubyOnRails
[20:44:27] lethjakman: has joined #RubyOnRails
[20:45:03] smathy: dopie, in any case, if you just search for full_messages then you'll see the object(s) it's defined on, and it's easy then to investigate the other methods you have available. As a "teach a man to fish" exercise.
[20:45:32] dopie: smathy, yes thats is what I wanted
[20:46:00] dopie: except I'm being taught to fight bears with my bare hands
[20:46:07] Miesco: has joined #RubyOnRails
[20:46:32] noodman: has joined #RubyOnRails
[20:46:39] smathy: dopie, still, better than having to ask someone else to kill each bear.
[20:47:19] DoctorMonocular: has joined #RubyOnRails
[20:47:23] coetry: has joined #RubyOnRails
[20:47:34] urkle: has joined #RubyOnRails
[20:47:40] Miesco: Hi. This is really strange. My production server (passenger/nginx) is giving me a 404 for my rails 'get' functions in 'routes.conf', while my 'rails server' is displaying them properly. How do I ask for help?
[20:48:00] mikecmpbll: has joined #RubyOnRails
[20:48:37] ProLoser: has joined #RubyOnRails
[20:49:49] nettoweb_: has joined #RubyOnRails
[20:50:29] Miesco: Perhaps its because of this in my nginx config?: root /home/shawn/Dropbox/workspace/sample_app/public;
[20:51:39] tubbo: hey guys, am i crazy or does every call to CSV.open instantiate a new file handler?
[20:51:54] tubbo: that's what i would *assume* given the API (similar to the File APIs) but not entirely usre
[20:52:03] CanTonic: has joined #RubyOnRails
[20:52:05] rhizome: Zadrel: what do you mean, insert? why are they different?
[20:52:21] Hates_: Miesco: your root should be your public directory
[20:52:41] Hates_: Miesco: which is what you have
[20:52:59] Hates_: Miesco: can you show use the whole server block?
[20:53:07] smathy: Miesco, !gist your nginx config.
[20:53:07] helpa: Miesco: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[20:54:17] Zadrel: rhizome: i got help from my friend, he told me to use a form_tag with :remote=>true do do the filtering
[20:54:40] godzillaenlacasa: has joined #RubyOnRails
[20:54:50] Zadrel: rhizome: thx for your attention and sorry for the confusion
[20:55:21] smathy: tubbo, yes, should do.
[20:56:20] godzillaenlacasa: Trying to see what methods are available for me in https://github.com/sethvargo/chef-api and the docs say that's it's "heavily documented inline using YARD". How do I get to the documentation?
[20:57:41] tubbo: smathy: should do what?
[20:57:42] momomomomo: has joined #RubyOnRails
[20:57:58] Jacky: godzillaenlacasa: check out YARD (it might be visible on rdoc.info)
[20:58:17] godzillaenlacasa: jacky so i have to install the gem?
[20:58:20] yuuvee: has joined #RubyOnRails
[20:58:44] smathy: tubbo, should be a new IO instance / filehandle.
[20:58:49] Jabberwock: has joined #RubyOnRails
[20:58:50] tubbo: smathy: holy shit :D
[20:58:56] Jabberwock: has left #RubyOnRails: ("<3")
[20:59:10] tubbo: well i think i might know what's causing the CSV export timeouts now :P
[20:59:15] relipse: has joined #RubyOnRails
[20:59:18] charliesome: has joined #RubyOnRails
[20:59:36] smathy: ACTION rejoices
[21:00:02] teadur: has joined #RubyOnRails
[21:00:06] godzillaenlacasa: jacky not visible on rdoc.info ... any other sources?
[21:00:43] tubbo: godzillaenlacasa: click the "Add Project" button at the top of rdoc.info and paste the git url for the repo you want into it, and rdoc.info will generate the docs for you.
[21:01:28] baweaver: has joined #RubyOnRails
[21:01:47] Lightsword: has joined #RubyOnRails
[21:01:47] godzillaenlacasa: tubbo thanks... just added the readme file... guess it's not as 'heavily documented' as they claimed
[21:03:22] tubbo: must be something wrong godzillaenlacasa, here's the documentation inline that should have been generated. maybe it's just taking a sec? https://github.com/sethvargo/chef-api/blob/master/lib/chef-api/authentication.rb#L53-L71
[21:03:38] bricker: tubbo: didn't you figure that out yesterday?
[21:04:01] bin_005_l: has joined #RubyOnRails
[21:04:16] tubbo: godzillaenlacasa: "ChefAPI is currently in rapid development!" is right there at the top
[21:04:27] godzillaenlacasa: tubbo yeah, i just saw that...
[21:04:53] godzillaenlacasa: tubbo guess I'll just have to troll the files...
[21:04:55] giowong: is there a way to specify mass assignment for has_many relationship?
[21:05:28] giowong: in my console its saying unpermitted parameters: theme_ids
[21:05:39] tubbo: godzillaenlacasa: do you just need an api client for the chef server? if so, https://github.com/reset/ridley is pretty popular.
[21:05:49] giowong: but in my controller i specified it to allow it
[21:05:49] tubbo: perhaps chef-api isn't quite done yet..
[21:05:54] m3nd3s: has joined #RubyOnRails
[21:05:56] leandrosnunes: has joined #RubyOnRails
[21:06:05] godzillaenlacasa: tubbo yes... that's probably what I'm going to use now. At least it's stable
[21:08:15] moeabdol1: has joined #RubyOnRails
[21:08:18] rushed: has joined #RubyOnRails
[21:08:39] fighella: has joined #RubyOnRails
[21:10:25] jkamenik1: has joined #RubyOnRails
[21:10:48] smathy: godzillaenlacasa, what did "just added the readme file" mean?
[21:11:03] smathy: godzillaenlacasa, you saw the help in adding a project, ie. that it's the git: URL?
[21:11:31] godzillaenlacasa: smathy it just added the same text that shows up on the github project
[21:12:47] smathy: godzillaenlacasa, that's the front page, sure, but you will also get a list of classes down the left.
[21:12:51] smathy: That's the docs.
[21:14:11] cleopatra: has joined #RubyOnRails
[21:14:17] cleopatra: hello people
[21:14:21] godzillaenlacasa: smathy ah, gotcha. lesson learned
[21:14:45] blackmesa: has joined #RubyOnRails
[21:16:52] moeabdol1: would anyone know how to show my controller and views names in the url in my i18n language
[21:16:55] kb3ien: has joined #RubyOnRails
[21:17:28] SuMo_D: has joined #RubyOnRails
[21:18:29] rhizome: moeabdol1: one possibility: https://github.com/enriclluelles/route_translator
[21:19:10] rhizome: puts the locale in the route name, not sure if that'd be an issue
[21:19:27] kb3ien: `bundle exec rake routes` reports that "short_view_articles GET /articles/:dbid/:an/short(.:format) articles#short_view" exists, but GET http://srvr//articles/edsacl/edsacl.heb92945/short reports 'No route matches [GET] "/articles/edsacl/edsacl.heb92945/short"'
[21:19:55] rhizome: kb3ien: might be choking on the period
[21:20:25] kb3ien: YEP. (can I define dot as valid char?
[21:21:10] moeabdol1: thank you rhizome :)
[21:23:18] cek: has joined #RubyOnRails
[21:23:27] jottr: has joined #RubyOnRails
[21:23:39] ur5us: has joined #RubyOnRails
[21:26:15] edwinvdg_: has joined #RubyOnRails
[21:28:03] moeabdol1: perfect rhizome just what I wanted...thank you so much :)
[21:30:20] DEA7TH: has joined #RubyOnRails
[21:31:25] momomomomo: has joined #RubyOnRails
[21:33:47] Scriptonaut: Hey guys, I have a one to many relationship (Account -> Products). How can I filter accounts based on whether or not they have products?
[21:34:14] Scriptonaut: gotta do a join?
[21:35:18] jottr_: has joined #RubyOnRails
[21:35:26] atal421: has joined #RubyOnRails
[21:37:03] atal421: any advice on how to search by ID on all models in an app?
[21:37:14] smathy: Scriptonaut, yes, do a join.
[21:37:19] rhizome: moeabdol1: cool!
[21:37:33] smathy: atal421, huh?
[21:37:36] rhizome: Scriptonaut: counter_cache
[21:37:37] SuMo_D: has joined #RubyOnRails
[21:38:03] yfeldblum: has joined #RubyOnRails
[21:38:08] rhizome: atal421: that seems suboptimal
[21:38:31] atal421: smathy: let's say you have Post, Comment, Author... then you have an id... how do you create a search that would find that id across all the models?
[21:38:58] atal421: rhizome: why is it suboptimal, if that's the feature?
[21:39:14] rhizome: why would you just have "an id?"
[21:39:37] atal421: rhizome: cause that's what the User of this feature will have
[21:39:52] rhizome: tautologies don't help
[21:39:54] atal421: the user, i'm guessing, will manually enter and id and hit the Enter key.
[21:40:00] SuMo_D: has joined #RubyOnRails
[21:40:18] baweaver: has joined #RubyOnRails
[21:40:47] rhizome: guessing? is this an interview test or something?
[21:41:00] atal421: rhizome: no, it's a story
[21:41:03] ndrei: has joined #RubyOnRails
[21:42:18] fighella: has joined #RubyOnRails
[21:42:51] rhizome: i'm having trouble connecting this question to reality
[21:43:11] tuelz: has joined #RubyOnRails
[21:43:24] giowong: in my f.association, why is there a empty value being passed in params?
[21:44:03] giowong: extra empty value in the array
[21:44:26] viiralvx: has joined #RubyOnRails
[21:44:37] atal421: rhizome: why is it so hard for you? like, what if google only accepted ID's... give me all the results with these ID's
[21:45:01] rhizome: google would have an index
[21:45:14] haltEnigma: has joined #RubyOnRails
[21:45:17] atal421: yeah, that's what i'm thinking
[21:45:22] atal421: global index and just find there
[21:46:06] rickmasta: has joined #RubyOnRails
[21:46:17] smathy: atal421, so the IDs in your DB uniquely identify it? So just use find_by and ||
[21:46:32] atal421: smathy: ohhh, simple
[21:46:42] atal421: I like it :-)
[21:47:06] atal421: Model1.find(id) || Model2.find(id)
[21:47:19] chipotle: has joined #RubyOnRails
[21:47:52] smathy: atal421, no, has to be find_by
[21:47:59] smathy: `find` raises an exception if the id doesn't exist.
[21:48:18] atal421: yeah, seeing that now
[21:48:48] atal421: find_by seems to work
[21:49:00] atal421: nice call smathy
[21:49:21] Anakat: has joined #RubyOnRails
[21:49:48] bricker: atal421: use some sort of global ID, your_model-123, easy to parse
[21:50:09] atal421: bricker: i think i'm gonna have to do this thourgh UUIDs
[21:50:17] atal421: i don't have a say on the data
[21:50:22] edwinvdgraaf: has joined #RubyOnRails
[21:51:28] bricker: atal421: you could store a mapping (UUID to class) in redis or similar, so you only have to do one database query
[21:51:56] paulcsmith: has joined #RubyOnRails
[21:52:25] atal421: bricker: that's interesting
[21:52:36] Scriptonaut: how do I modify the index route made by resources? I want to add a route: /index/a_variable
[21:52:59] Scriptonaut: get '/index/:myvar', on: :collection ?
[21:53:00] atal421: Scriptonaut: you can add your own route if you want
[21:53:15] Scriptonaut: I'm just wondering if there's a more elegant way to do it, ie how would you guys do it
[21:53:46] rushed: Scriptonaut: what is it for?
[21:54:06] bricker: Scriptonaut: that's how you do it, there's only one way
[21:54:08] Scriptonaut: I have an account index, I want to go to /index/somevar to filter those account types fromt he listing
[21:54:13] Scriptonaut: ah, ok, ty bricker
[21:54:17] bricker: you can't modify the convenience routes
[21:54:21] smathy: atal421, you can make it slightly prettier with Enumerable#reduce too, eg: [ Post, Comment, Author ].reduce(nil) { |prev, c| prev || c.find_by(id: 3) }
[21:54:32] bricker: well, you can modify edit and new
[21:54:34] bricker: but not index
[21:54:39] wethu: has joined #RubyOnRails
[21:54:46] smathy: (well, maybe not prettier, but easier to modify the list of classes and way cooler)
[21:54:50] existensil: resource(:users) { collection{ get 'a_variable' } }
[21:54:52] atal421: smathy: is that prettier?
[21:54:53] existensil: there is always more than one way
[21:54:54] rushed: Scriptonaut: /accounts?type=scriptonautish (no need for a new route)
[21:55:05] Lightsword: has joined #RubyOnRails
[21:55:20] atal421: smathy: actually, i like it
[21:55:25] existensil: (would create /users/a_variable route)
[21:55:41] bricker: existensil: not what he asked for unfortunately
[21:55:54] Scriptonaut: ya, I coulda done that. Is it frowned upon to use path variables?
[21:56:06] existensil: kind of is. you can replace 'a_variable' with :myvar for the same result as yours
[21:56:10] bricker: or maybe it is what he asked for? I can't tell with "index"
[21:56:35] Scriptonaut: ah I'll just use query param then
[21:57:00] soypirate: has joined #RubyOnRails
[21:57:49] atal421: smathy: would you call this via a service object? i think so
[21:57:56] atal421: it's domain specific
[21:58:09] atal421: so i'm not thinking of tucking this into the lib/ at all
[21:58:50] smathy: Yeah, definitely wrap it up in another class.
[21:59:33] Lightsword: has joined #RubyOnRails
[22:00:20] atal421: SearchService.new(id).get/.find/.go
[22:00:22] eminencehc_: has joined #RubyOnRails
[22:00:26] atal421: what's the verb i'm looking for here?
[22:02:19] charliesome: has joined #RubyOnRails
[22:02:58] bruno-: has joined #RubyOnRails
[22:04:59] Miesco: has joined #RubyOnRails
[22:05:56] smathy: atal421, actually, I'm more likely to do something like: PolyModel.find_by(id: your_id)
[22:06:33] werelivinginthef: has joined #RubyOnRails
[22:06:34] atal421: smathy: a class method
[22:07:09] atal421: i'm concerned about this growing
[22:07:23] atal421: class methods look like crap when being refactored
[22:07:32] atal421: i guess i could do a self.new inside of that
[22:07:44] atal421: self all the things
[22:08:04] atal421: i'll give it a shot, see how it looks
[22:08:23] smathy: For me I'd be making find_by just return the instance of the other model that got found.
[22:08:46] baweaver: has joined #RubyOnRails
[22:08:47] smathy: If it grows later, change it later (although I'm not sure what the issue would be, methods are methods)
[22:09:07] ght: Question: Why is it not recommended to include JavaScript in a view?
[22:09:22] darrencauthon: has joined #RubyOnRails
[22:09:24] charliesome: has joined #RubyOnRails
[22:09:53] atal421: smathy: you're right, no need to think TOO much about the future... can run with this and fix later if it's just not working
[22:10:13] smathy: ght, not recommended by whom?
[22:10:34] ght: Every time it's brought up someone says "It's not a good idea to put JS in your view"
[22:10:41] ght: Just wondering why that is.
[22:10:45] momomomomo_: has joined #RubyOnRails
[22:11:21] voker57: has joined #RubyOnRails
[22:12:02] bronson: has joined #RubyOnRails
[22:12:17] Scriptonaut: for some reason, going to /accounts/leads_products is trying to bring me to the show action, despite me putting this at the bottom of the resources block for accounts: get '/accounts/:leads_products' => 'accounts#index', on: :collection
[22:13:19] bricker: Scriptonaut: the convenience resources are higher up so they take precedence
[22:13:41] Scriptonaut: Oh, I thought the last thing in the file too precedence
[22:13:57] bricker: other way around, Rails goes with the first match
[22:14:06] Scriptonaut: thanks a lot, that's fixed it
[22:16:15] rushed: has joined #RubyOnRails
[22:16:55] sp33drac3r: has joined #RubyOnRails
[22:18:11] mloy: ght, I think people say that because it can be easy to forget where you included the js if you need to update it in the future. Plus, if you want to reuse the same script on a different page, using the Asset Pipeline makes it easier.
[22:18:27] leslie: for ActiveJob, is there any way to set the default queue?
[22:19:28] xkickflip_: has joined #RubyOnRails
[22:19:32] mase-chatter: has joined #RubyOnRails
[22:20:11] r4pha: has joined #RubyOnRails
[22:20:12] r4pha: has joined #RubyOnRails
[22:20:29] annlewis: has joined #RubyOnRails
[22:21:06] sloggerkhan: has left #RubyOnRails: ()
[22:21:30] blackmesa: has joined #RubyOnRails
[22:21:33] sloggerkhan: has joined #RubyOnRails
[22:22:13] garrypolley: has joined #RubyOnRails
[22:22:41] jkamenik: has joined #RubyOnRails
[22:23:26] Miesco: Hi, is this calling GistPaste() for EACH line in the visual range?: http://paste.pound-python.org/show/yJLuWo5ORxUM5L8mCPMQ/
[22:23:34] charliesome: has joined #RubyOnRails
[22:24:06] rhizome: wrong channel
[22:24:40] FooMunki_: has joined #RubyOnRails
[22:24:41] Miesco: Okay here is my nginx server setting: http://paste.pound-python.org/show/9u5oAE25kr0xEB2iZC4Q/
[22:26:16] Miesco: The problem is, my production nginx/passenger server is giving me a 404 for the static pages defined with 'get' in routes.config, while it is working on my rails development server.
[22:28:22] godzillaenlacasa: has joined #RubyOnRails
[22:28:46] camilasan: has joined #RubyOnRails
[22:30:30] FernandoBasso: has joined #RubyOnRails
[22:30:40] helpa: Miesco: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[22:30:40] ndrei: has joined #RubyOnRails
[22:31:34] strcmp1: has joined #RubyOnRails
[22:31:35] Miesco: helpa: I am getting this https://developer.github.com/v3/#rate-limiting
[22:31:37] x-light: has joined #RubyOnRails
[22:32:11] Miesco: VeryBewitching: ^
[22:33:16] lethjakman: has joined #RubyOnRails
[22:34:10] nfk: has joined #RubyOnRails
[22:34:28] atal421: smathy: you've probably already forgotten, but i've been thinking about your PolyModel.find_by idea... i think it's not a good idea because depending on the app, mine in this case, PolyModel doesn't mean anything
[22:34:43] atal421: if someone else jumps into this project they have to be taught what polymodel means
[22:34:59] atal421: where as i think a search_service is more intuitive... someone would just know what search is
[22:35:14] atal421: perhaps over thinking
[22:35:19] lucha: has joined #RubyOnRails
[22:35:23] seank_: has joined #RubyOnRails
[22:37:23] Miesco: wait got to go, be back later.
[22:40:57] seank__: has joined #RubyOnRails
[22:41:21] kies^: has joined #RubyOnRails
[22:41:36] seank_: has joined #RubyOnRails
[22:43:43] cleopatra: has joined #RubyOnRails
[22:45:26] ephantmon: has joined #RubyOnRails
[22:46:05] baweaver: has joined #RubyOnRails
[22:48:09] jkamenik: has joined #RubyOnRails
[22:48:51] DEA7TH: has joined #RubyOnRails
[22:49:17] smathy: atal421, sure, whatever makes more sense to you. I've given up people knowing what things are without looking at the code anyway.
[22:49:35] atal421: smathy: right right :-)
[22:49:37] smathy: atal421, I think it's very subjective, eg. I do not think that what we were talking about is anywhere close to a search service.
[22:50:10] atal421: gotta start somewhere
[22:50:33] smathy: Yep, of everything you said I agree most with "perhaps over thinking" :)
[22:50:46] mary5030: has joined #RubyOnRails
[22:50:51] smathy: Names are definitely important, but changing names isn't hard - especially class names like this.
[22:51:35] atal421: thanks for the help
[22:53:04] ProLoser_: has joined #RubyOnRails
[22:53:27] ght: Question: Is it possible to call a JavaScript / CoffeeScript function defined within a controller's associated javascript asset file from JS within a view?
[22:54:58] ght: Currently, if I write a bit of JS within the view for testing purposes and attempt to call a function that's defined within, in this case, the associated profile.coffee
[22:55:26] ght: If I call it from within the profile.coffee it works, but if I call it within the view it doesnt.
[22:55:39] ght: Just curious as to wheter or not this is possible, tricky finding information about this online
[22:56:58] Papierkorb: ght: Not while rendering the template, as it is rendered on the server, while the JS code runs on the client
[22:56:58] rhizome: amazing how a functional test depending on session can magically start working if it's moved to an integration
[22:57:32] Papierkorb: ght: You could however invoke JS by embedding the code in the view. This is not recommended though.
[22:58:07] ght: smarthy: Here you go, here's someone else who says that putting JS in the view is "not recommended". This happens all the time.
[22:58:11] rhizome: ght: no idea what you're talking about
[22:58:22] ght: Papierkorb, curious, why is putting JS in the view "not recommended"?
[22:58:32] ght: smathy*
[22:58:48] rhizome: ght: separation of concerns
[22:58:55] Papierkorb: ght: what rhizome says
[22:58:56] bricker: yes that's really the only reason
[22:59:01] cooldman224: has joined #RubyOnRails
[22:59:06] Papierkorb: ght: also, it looks like XSS
[22:59:17] bricker: lol "looks like XSS"
[23:00:16] rhizome: is that your irc'ism for "sh*t?"
[23:00:27] werelivinginthef: has joined #RubyOnRails
[23:00:38] joelataylor: has joined #RubyOnRails
[23:00:46] Papierkorb: wasn't there some option at some point which disallows having script inside <body> or something?
[23:01:02] Papierkorb: option meaning HTTP header or meta tag or something
[23:01:22] ght: This is the look we're going for on our latest website: http://nevisdm.com/
[23:01:48] Lytol: has joined #RubyOnRails
[23:02:07] yfeldblum: has joined #RubyOnRails
[23:02:29] doodlehaus: has joined #RubyOnRails
[23:02:43] Papierkorb: Now that's for starters
[23:02:57] ght: I'm LOLing
[23:03:31] ght: This site just gave me a seizure, currently cleaning up the mess of flailing everything about.
[23:03:53] roolo: has joined #RubyOnRails
[23:04:10] noodman: has joined #RubyOnRails
[23:04:31] rhizome: if i'm doing cart.line_items.destroy_all, how can i callback so that foo/self is destroyed if line_items_count is 0? should the callback be on line_items?
[23:05:29] seba4: has joined #RubyOnRails
[23:06:27] seba4: hello to everyone. Anyone ever tried passing variable to table prefix?
[23:07:15] CheckYourSix: has joined #RubyOnRails
[23:07:29] seba4: Idea is that some customer has a subdomain for his account. And then that subdomain is used as parameter to find account. If account is found all tables are called with prefix
[23:07:54] alphaatom: has joined #RubyOnRails
[23:08:05] kaymation: has joined #RubyOnRails
[23:08:09] seba4: example: test.domain.si . will use test.user table
[23:08:09] rhizome: i think that's essentially what the apartment gem provides
[23:09:10] seba4: thx will check it
[23:09:45] seba4: thanks rhizome that is what i was looking for
[23:10:12] Senjai: seba4: I recommend not doing multi tenanted development that way.
[23:10:47] seba4: how would be better to create it
[23:10:48] rhizome: you better hurry up about that before the other hemisphere wakes up
[23:11:01] Senjai: seba4: Unless you need 100% seperate access, we've typically brought in the concept of an application and associate resources that should be application specific with that
[23:11:21] Senjai: rhizome: hmm?
[23:12:05] rhizome: radar wrote a book about it
[23:12:31] rhizome: ACTION looks for notification sireens
[23:12:33] Senjai: I've read it.
[23:12:42] rhizome: carry on then
[23:12:53] Senjai: I'm just mentioning it's not the only way to accomplish the goal depending on exactly what needs to be done
[23:13:13] jkamenik: has joined #RubyOnRails
[23:14:45] jesterfraud: has joined #RubyOnRails
[23:14:55] godzillaenlacasa: has joined #RubyOnRails
[23:14:56] seba4: Senjai: Not so sure what you mean with that. How else could i work with it then? I want to separate some "user" info like products and everything. So every store has own databases.
[23:15:52] Senjai: seba4: Not saying that this is the perfect implimentation, but you can look at https://github.com/solidusio/solidus_multi_domain
[23:16:06] seba4: thx sure will check it
[23:16:40] dlitz: has joined #RubyOnRails
[23:17:07] dlitz: has joined #RubyOnRails
[23:18:11] baweaver: has joined #RubyOnRails
[23:19:23] asteros: has joined #RubyOnRails
[23:19:51] seba4: i will check it more tomorrow. Guys thx for help
[23:20:01] seba4: Good night
[23:20:32] mikeric: has joined #RubyOnRails
[23:21:32] dlitz: has joined #RubyOnRails
[23:22:34] Ropeney: has joined #RubyOnRails
[23:22:38] mikeric: has joined #RubyOnRails
[23:22:49] ght: Question: I have a JS "sleep" function I've created as detailed in multiple SlackOverflow posts. While the JS is executing...
[23:23:10] ght: I have code that makes the screen "gray" and overlays a "now working" animation
[23:23:30] ght: No matter how I write the JS, be it JS in the view, CoffeeScript in the controller's javascript asset file, etc, it doesn't matter..
[23:24:00] ght: When the button is clicked that calls the function containing the sleep call, the function is ignoring the CSS modifications at the top of the function
[23:24:12] mikeric: anyone familiar with actionmailer, is there a way to change the way actionmailer encodes headers (such as From and Subject) in such a way that it does not add line breaks in the middle of a multibyte character?
[23:24:23] ght: and seems to be executing the sleep statement prior, even though it's near the bottom of the function.
[23:24:33] Coldblackice: has joined #RubyOnRails
[23:24:34] ght: This is bizarre.
[23:24:47] blackmesa: has joined #RubyOnRails
[23:24:55] Aeyrix: mikeric: http://guides.rubyonrails.org/action_mailer_basics.html#auto-encoding-header-values
[23:25:08] jkamenik: has joined #RubyOnRails
[23:25:32] dlitz: has joined #RubyOnRails
[23:25:55] mikeric: @Aeyrix: yea, i saw that. you would think that it wouldn't break apart the multibyte character if it was at the very end of the line though..
[23:26:05] kaymation: has joined #RubyOnRails
[23:26:41] Radar: GOOD MORNING
[23:26:49] Radar: ACTION hands out hugs, rainbows and good vibes
[23:27:02] Radar: Unlike yesterday afternoon where it was quite the opposite.
[23:27:10] Aeyrix: Yeah yesterday was not rainbows. :P
[23:27:12] Aeyrix: Also morning yo.
[23:27:17] Aeyrix: You're an hour late.
[23:27:24] Radar: I've been busy.
[23:28:35] mikeric: @Aeyrix: do you know what it uses to encode the headers? i've been trying to find an example.
[23:28:36] fmcgeough: has joined #RubyOnRails
[23:29:07] fighella: has joined #RubyOnRails
[23:30:17] SiliconDon: has joined #RubyOnRails
[23:30:41] eminencehc_: has joined #RubyOnRails
[23:30:45] Radar: mikeric: Can you provide us with a small reproducible example using Mail::Message.new?
[23:30:56] Radar: I am not aware of Mail automatically adding new line characters.
[23:31:19] smathy: ght, !code
[23:31:19] helpa: ght: 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.
[23:31:49] ght: Yes, I'm well aware, I was making a gist but now I'm working on something, but that's for triggering the bot in that manner again.
[23:33:00] smathy: Radar, you haven't experienced ght's sensitive nature?
[23:33:04] Lightsword: has joined #RubyOnRails
[23:33:16] Radar: Is he a SNAG?
[23:33:34] smathy: I'm afraid to say yes, I haven't heard that term for 20 years :)
[23:33:43] smathy: Does it still mean sensitive new age guy?
[23:33:45] dlitz: has joined #RubyOnRails
[23:34:53] Aeyrix: Radar: can the bot do multiline?
[23:35:37] smathy: I'm not sure, might be just me :)
[23:35:52] Radar: Aeyrix: with multiple privmsg calls in a method, yes
[23:36:25] Aeyrix: [ interest intensifies ]
[23:36:53] Radar: Of all the things I've created, the channel bot is #2 the thing I am most proud of.
[23:36:55] CheckYourSix: has joined #RubyOnRails
[23:37:07] Radar: R3IA is #1, despite you-know-who
[23:37:18] VeryBewitching: I had a bot on EFNet about 18 years ago.
[23:37:53] VeryBewitching: I know how much I enjoyed building the damned thing.
[23:38:23] VeryBewitching: Can helpa go to war?
[23:38:32] gnagno: has joined #RubyOnRails
[23:38:33] Radar: helpa is a help-bot, not a war-bot
[23:38:37] Radar: helpa only loves
[23:39:12] smathy: I learned Perl by writing a bot.
[23:39:14] cornerma1: has joined #RubyOnRails
[23:39:18] smathy: Good times.
[23:39:23] VeryBewitching: smathy: Me too, actually.
[23:39:29] SiliconDon: has joined #RubyOnRails
[23:39:43] smathy: Same timeframe too :)
[23:39:50] greengriminal: has joined #RubyOnRails
[23:39:57] Aeyrix: Heh, that bug is still there.
[23:40:02] Radar: patches welcome :D
[23:40:07] helpa: Did you know Radar hasn't read any rails books? He learned everything by answering questions in #rubyonrails and googling for the answer
[23:40:07] Aeyrix: Fixing now.
[23:40:13] Aeyrix: Just adding a method to person.rb
[23:40:23] VeryBewitching: Radar: Can I fork your bot?
[23:40:26] Radar: VeryBewitching: yup
[23:40:33] Radar: It's open source
[23:40:36] Radar: https://github.com/radar/railsbot
[23:40:39] r_baron: has joined #RubyOnRails
[23:40:47] DEA7TH: has joined #RubyOnRails
[23:40:48] AntiSpamMeta: has joined #RubyOnRails
[23:41:27] bricker: "fork your bot" he he he
[23:41:28] VeryBewitching: ACTION gave helpa a star
[23:41:30] Radar: !bot-source
[23:41:30] helpa: My source code can be found at https://github.com/radar/railsbot. My underlying framework is at https://github.com/radar/summer.
[23:41:46] SiliconDon: has joined #RubyOnRails
[23:43:12] ght: Question: Any way to utilize a ruby instance variable in a controller's javascript asset file without gon?
[23:43:22] asteros: has joined #RubyOnRails
[23:43:34] ght: We can use them if we write the JS within a view via <%= @ourvar %>
[23:43:39] ght: Ok then, thank you.
[23:43:42] Radar: Instance variables from a controller are not available in assets because they are separate requests.
[23:43:50] ght: Gotcha, thank you.
[23:43:52] Radar: What is @ourvar supposed to be, anyway?
[23:43:58] Radar: ACTION is tempted to wheel out !fake
[23:44:00] ght: All good, thank you.
[23:44:16] bruno-: has joined #RubyOnRails
[23:44:42] JeramyRR: has joined #RubyOnRails
[23:46:19] AntiSpamMeta: has joined #RubyOnRails
[23:46:39] ararog: has joined #RubyOnRails
[23:46:43] Aeyrix: I'm half-glad that didn't work.
[23:47:05] Aeyrix: Also patch for !since incoming.
[23:47:13] Scripore: has joined #RubyOnRails
[23:47:22] Aeyrix: Just compiling ruby on this box, since I don't have VM templates for it yet.
[23:48:23] tfitts: has joined #RubyOnRails
[23:48:23] aerotus: has joined #RubyOnRails
[23:49:10] tfitts: when using a PG Hstore field is there an easy way to cast the fields in your model? so for example in a form with a boolean you get a checkbox?
[23:49:39] tfitts: I know you can set the input type to a checkbox for that field in your view, just wondering if you can do it in the model
[23:50:50] Aeyrix: you want to do it in the model, to be rendered in the view?
[23:51:03] aerotus: has joined #RubyOnRails
[23:51:24] greengriminal: has joined #RubyOnRails
[23:51:49] existensil: I think he's asking if you can coerce values within an hstore hash to specific types at the model level. Good question if so.
[23:52:16] existensil: how AR coerces strings into dates, decimals, integers, etc. based on column types
[23:52:43] Aeyrix: I'd venture no, as all hstore keys and values are just strings.
[23:52:57] aerotus: has joined #RubyOnRails
[23:53:22] Scriptonaut: does anyone know if in kaminari you can pass a query param to the page method so that the page links are like /blah?page=4&your_param=your_value
[23:53:24] tfitts: Aeyrix: I know they're all strings in the database, I'm wondering if there is a way in your model that you can cast that string to a different type
[23:53:24] mloy: has joined #RubyOnRails
[23:53:28] Scriptonaut: I read the docs and don't see anything
[23:53:39] Aeyrix: tfitts: You mean like this? https://github.com/diogob/activerecord-postgres-hstore
[23:53:52] Aeyrix: Beyond that + some manual modification
[23:53:56] Aeyrix: there's no magic way to do it
[23:54:06] aerotus: has left #RubyOnRails: ()
[23:54:10] Aeyrix: probably because hstore is kind of a really hilarious idea that i'm fairly sure was an april fool's joke
[23:55:00] Haydos: has joined #RubyOnRails
[23:55:47] greengriminal: Can someone take a quick look at this refactored code/duplicated code and tell me what they think. https://gist.github.com/anonymous/e00d116087272b13df13
[23:57:44] coetry: has joined #RubyOnRails