« Back to channel list

#RubyOnRails - 24 August 2015

« Back 1 day Forward 1 day »
[00:00:02] jtthedev: but I can do it in SQL?
[00:00:04] robbyoconnor: has joined #RubyOnRails
[00:00:15] jtthedev: i just want to show the top records of the results of that query
[00:00:16] Radar: Have people tried implementing jsonapi.org-compliant APIs in their apps? How did it go for you?
[00:00:35] nya: has joined #RubyOnRails
[00:01:00] Sylario: has joined #RubyOnRails
[00:01:42] broman: VeryBewitching, when i try to execute this i have an Starting with 'cd /home/ebejirails/ebeji && /usr/local/rvm/gems/ruby-2.0.0-p643/bin/bundle exec unicorn_rails -D -c /home/ebejirails/ebeji/config/unicorn.rb -E development'
[00:01:43] broman: /usr/bin/env: ruby: Not a directory
[00:02:40] VeryBewitching: broman: Also, you want to bundle exec unicorn I think, not unicorn_rails
[00:02:58] Grundell: has joined #RubyOnRails
[00:03:16] Cache_Money: is Devise.friendly_token guaranteed to be unique?
[00:03:21] Rodya_: has joined #RubyOnRails
[00:03:29] mary5030: has joined #RubyOnRails
[00:04:17] VeryBewitching: broman: Remember, I'm stabbing blindly, I've never setup unicorn (I mentioned that earlier)
[00:04:58] VeryBewitching: Cache_Money: Friendly how?
[00:05:08] VeryBewitching: Cache_Money: Sorry, brain bad today, unique how?
[00:05:54] Cache_Money: VeryBewitching: Meaning, if I give each User an `auth_token` using Devise.friendly_token, will each User's `auth_token` be unique to them?
[00:06:01] Cache_Money: So I can look them up by their `auth_token`?
[00:06:24] VeryBewitching: Cache_Money: I don't know if the model validates that it's unique, Devise.friendly_token just generates a string to be used as one.
[00:06:45] Cache_Money: So, should I verify it's unique before saving it then?
[00:07:29] VeryBewitching: Cache_Money: Unless Devise has a validator for that field, I would check first.
[00:07:38] VeryBewitching: Cache_Money: If it's a field you created, then yes absolutely.
[00:07:47] Cache_Money: okay, I'll just check to make sure it's unique before saving it
[00:08:03] VeryBewitching: Cache_Money: Or put a constraint on the field that values in the database should be unique.
[00:08:04] Ropeney: has joined #RubyOnRails
[00:08:54] Cache_Money: VeryBewitching: If I put a db constraint and the User goes to SignUp and get's a failure (due to non-unique auth_token) wouldn't that be a wierd error msg for the User?
[00:09:01] VeryBewitching: broman: You should see if anyone else here has setup unicorn on CentOS (or built an init script for it on any *nix out there really)
[00:09:47] VeryBewitching: Cache_Money: You can write a validator to generate a value, and check to see if it's in the database first; you have to do that anyway, the constraint is for integrity for the future.
[00:09:56] broman: VeryBewitching, this is like the 4th script i get
[00:10:06] VeryBewitching: Cache_Money: Or before_save hook rather
[00:10:22] Cache_Money: VeryBewitching: that's what I'll do, thanks
[00:10:38] VeryBewitching: broman: I would really check with CentOS to see if they have a solution for Unicorn on their platform.
[00:10:41] quazimodo: has joined #RubyOnRails
[00:10:51] VeryBewitching: broman: You may be going nuts for nothing. :)
[00:10:55] VeryBewitching: brb, more coffee
[00:11:18] broman: VeryBewitching, where can i get this kind of support?
[00:11:30] siemprefresco: has joined #RubyOnRails
[00:13:47] christiandsg: has joined #RubyOnRails
[00:15:14] annlewis: has joined #RubyOnRails
[00:15:48] jholm: has joined #RubyOnRails
[00:19:22] EminenceHC: has joined #RubyOnRails
[00:19:49] Rubie: has joined #RubyOnRails
[00:21:53] broman: VeryBewitching, E, [2015-08-23T20:21:09.954494 #10116] ERROR -- : database configuration does not specify adapter (ActiveRecord::AdapterNotSpecified) ... do you know what this is?
[00:22:09] VeryBewitching: For instance: https://www.digitalocean.com/community/tutorials/how-to-deploy-rails-apps-using-unicorn-and-nginx-on-centos-6-5
[00:22:32] VeryBewitching: database.yml doesn't have the adapter specified, I would assume.
[00:22:36] x-light: has joined #RubyOnRails
[00:23:39] broman: it only occurs when i choose the production env.. when i switch to development it runs ok
[00:23:50] christiandsg: has joined #RubyOnRails
[00:24:22] VeryBewitching: broman: Look at database.yml and search for "production:"
[00:24:56] jancel: has joined #RubyOnRails
[00:25:01] VeryBewitching: If adapter is declared in 'default.adapter' you would add <<: *default under production.
[00:25:14] PaulAtreides: has left #RubyOnRails: ()
[00:25:38] VeryBewitching: Or declare adapter manually, if it differs from development or test enviornments.
[00:26:25] broman: VeryBewitching, production:
[00:26:25] broman: <<: *defaults
[00:26:25] broman: database: ebejirai_rails_producao
[00:26:25] broman: username: ebejirai_ebeji
[00:26:25] broman: password:
[00:27:09] VeryBewitching: broman: Please don't paste in the channel.
[00:27:17] helpa: broman: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[00:27:24] broman: I'm sorry
[00:27:30] broman: this is my database.yml file
[00:27:42] VeryBewitching: broman: Check to see if 'default' is declared in database.yml
[00:27:53] VeryBewitching: broman: And that it has a key 'adapter'
[00:28:08] superlou: has joined #RubyOnRails
[00:29:05] jeadre: has joined #RubyOnRails
[00:29:57] broman: VeryBewitching, http://pastie.org/10371458
[00:31:11] VeryBewitching: broman: See https://gist.github.com/bewitchingme/7d3e243dc2bf3ec7eea9
[00:34:12] quazimodo: has joined #RubyOnRails
[00:36:47] sevenseacat: has joined #RubyOnRails
[00:38:20] pgatt: has joined #RubyOnRails
[00:39:38] broman: does it have something different?? i cant see
[00:40:08] Guest26811: has joined #RubyOnRails
[00:40:14] seanmclaren: has joined #RubyOnRails
[00:41:21] VeryBewitching: broman: My best advice is to find a tutorial to setup a ruby server environment on CentOS; if something is failing for you, I can only guess at why. You'll need someone who has configured these services on CentOS imo.
[00:42:41] kegan_: can you push a hash to an array index
[00:42:48] kegan_: or do you have to instantiate it as having hashes first
[00:43:03] kegan_: ill just try in rails c forget it
[00:43:12] VeryBewitching: kegan_: I'm sure you can kegan
[00:43:40] kegan_: ok thanks, sorry for the rtfm question. much obliged.
[00:47:11] kegan_: oh so that's what you meant
[00:47:14] dopamean_: has joined #RubyOnRails
[00:49:13] war_pigs: has joined #RubyOnRails
[00:50:04] christiandsg: has joined #RubyOnRails
[00:51:23] CheckYourSix: has joined #RubyOnRails
[00:53:22] nya: has joined #RubyOnRails
[00:59:35] poli: has joined #RubyOnRails
[01:03:24] jeadre: has joined #RubyOnRails
[01:11:48] ftj: has joined #RubyOnRails
[01:14:18] Axsuul: has joined #RubyOnRails
[01:15:58] annlewis: has joined #RubyOnRails
[01:17:09] doodlehaus: has joined #RubyOnRails
[01:18:41] sdwrage: has joined #RubyOnRails
[01:27:19] christiandsg: has joined #RubyOnRails
[01:27:20] broman: VeryBewitching, i went through! :) but now i have ActionView::Template::Error (File to import not found or unreadable: .... on my production.log
[01:28:06] VeryBewitching: Well, follow the thread, at least it's running.
[01:29:58] nones: has joined #RubyOnRails
[01:30:24] chipotle: has joined #RubyOnRails
[01:30:48] darrencauthon: has joined #RubyOnRails
[01:30:57] workmad3: has joined #RubyOnRails
[01:31:26] nones: has left #RubyOnRails: ()
[01:32:06] sk8er9954: has joined #RubyOnRails
[01:33:45] lvrbrtsn: has joined #RubyOnRails
[01:34:08] roolo: has joined #RubyOnRails
[01:34:43] nyaa: has joined #RubyOnRails
[01:37:14] broman: how do i precompile the assets?
[01:37:44] broman: rake assets:precompile RAILS_ENV=production
[01:40:19] sarink: has joined #RubyOnRails
[01:40:25] closer: has joined #RubyOnRails
[01:40:46] broman: it's alive"
[01:41:06] broman: now.. how can i make a subdomain point to the rails port? :P
[01:43:09] Cervajz: has joined #RubyOnRails
[01:43:14] war_pigs: has joined #RubyOnRails
[01:46:57] Rodya_: has joined #RubyOnRails
[01:50:17] ledestin: has joined #RubyOnRails
[01:55:14] oflannabhra: has joined #RubyOnRails
[01:56:04] baash05: has joined #RubyOnRails
[01:56:16] baash05: Hey all.. I got a strongparams questions
[01:56:37] baash05: is there a way to restrict instead of permit.
[01:57:40] baash05: if params[:carpet_floor] then params.restrict(:paint)
[01:58:15] baash05: if params[:carpet_floor] then params.restrict(: paint)
[02:00:31] chipotle: has joined #RubyOnRails
[02:01:31] dideler: has joined #RubyOnRails
[02:02:34] VeryBewitching: baash05: params.reject_if may be what you're looking for
[02:02:38] SteenJobs: has joined #RubyOnRails
[02:03:11] baash05: right.. but would that throw out the same type of error as if a user forgot a param?
[02:03:47] baash05: I'll test it.
[02:04:03] VeryBewitching: http://edgeapi.rubyonrails.org/classes/ActionController/Parameters.html#method-i-reject sorry this is what I meant
[02:07:34] Lightsword: has joined #RubyOnRails
[02:09:56] one_zero: has joined #RubyOnRails
[02:10:10] SteenJobs: has joined #RubyOnRails
[02:13:27] charliesome: has joined #RubyOnRails
[02:13:33] jancel: has joined #RubyOnRails
[02:14:10] rickmasta: has joined #RubyOnRails
[02:16:44] annlewis: has joined #RubyOnRails
[02:16:49] baash05: cool even finding that page is awesome
[02:18:33] darrenca_: has joined #RubyOnRails
[02:18:35] baash05: I was hoping it did more than passively removing them.. I was hoping it behaved like required
[02:19:07] bulldawgden: has joined #RubyOnRails
[02:19:57] bulldawgden: has joined #RubyOnRails
[02:20:49] bulldawgden: has joined #RubyOnRails
[02:20:51] Guest26811: has joined #RubyOnRails
[02:20:52] christiandsg: has joined #RubyOnRails
[02:20:55] michael_mbp: has joined #RubyOnRails
[02:21:25] maz-dev: has joined #RubyOnRails
[02:21:43] Creeves: has joined #RubyOnRails
[02:21:44] bulldawgden: has joined #RubyOnRails
[02:22:34] bulldawgden: has joined #RubyOnRails
[02:23:28] bulldawgden: has joined #RubyOnRails
[02:23:59] poli: has joined #RubyOnRails
[02:24:26] bulldawgden: has joined #RubyOnRails
[02:25:24] bulldawgden: has joined #RubyOnRails
[02:26:17] bulldawgden: has joined #RubyOnRails
[02:27:10] baash05: Something like ActionController::RestrictedParameter or some such thing
[02:27:17] bulldawgden: has joined #RubyOnRails
[02:27:53] VeryBewitching: baash05: I think only parameters in permit are provided.
[02:28:09] VeryBewitching: baash05: params.require(:model).permit(:field, :field2)
[02:28:18] bulldawgden: has joined #RubyOnRails
[02:28:54] bulldawgden: has joined #RubyOnRails
[02:29:07] Rubie: has joined #RubyOnRails
[02:29:44] bulldawgden: has joined #RubyOnRails
[02:30:01] choke: has joined #RubyOnRails
[02:30:36] bulldawgden: has joined #RubyOnRails
[02:31:29] bulldawgden: has joined #RubyOnRails
[02:31:38] umgrosscol: has joined #RubyOnRails
[02:31:58] baash05: Yeah.. there's a restict method but it doesn't throw anything.
[02:32:19] baash05: I have a permissions hstore that I have to allow every value through..
[02:32:29] bulldawgden: has joined #RubyOnRails
[02:32:45] baash05: when they're creating/editing a user admins can grant all permissions.
[02:32:46] charliesome: has joined #RubyOnRails
[02:32:57] baash05: except the ability to grant permissions. .
[02:33:06] baash05: So a SU can't make another user SU.
[02:33:24] bulldawgden: has joined #RubyOnRails
[02:33:33] baash05: If they add those to the permission I want to kick them back with a 422 or 401
[02:34:17] bulldawgden: has joined #RubyOnRails
[02:37:52] bulldawgden: has joined #RubyOnRails
[02:38:31] Maletor: has joined #RubyOnRails
[02:38:42] bulldawgden: has joined #RubyOnRails
[02:39:39] bulldawgden: has joined #RubyOnRails
[02:40:34] bulldawgden: has joined #RubyOnRails
[02:41:27] bulldawgden: has joined #RubyOnRails
[02:42:20] bulldawgden: has joined #RubyOnRails
[02:42:44] jher: has joined #RubyOnRails
[02:43:14] bulldawgden: has joined #RubyOnRails
[02:44:09] bulldawgden: has joined #RubyOnRails
[02:45:08] bulldawgden: has joined #RubyOnRails
[02:46:13] bulldawgden: has joined #RubyOnRails
[02:46:38] seanmclaren: has joined #RubyOnRails
[02:47:06] bulldawgden: has joined #RubyOnRails
[02:47:56] baash05: Hey.. so restrict is already taken as a name that IMHO does nothing really.
[02:48:00] bulldawgden: has joined #RubyOnRails
[02:48:19] baash05: Looking for a suggestion on a method name that throws an error if a key is found.
[02:48:28] baash05: Any ideas?
[02:49:04] bulldawgden: has joined #RubyOnRails
[02:50:03] bulldawgden: has joined #RubyOnRails
[02:50:19] sevenseacat: thats what will happen if the key isnt whitelisted, isnt it?
[02:50:58] bulldawgden: has joined #RubyOnRails
[02:51:03] sevenseacat: just making sure you're not trying to reinvent the wheel, here
[02:51:48] bulldawgden: has joined #RubyOnRails
[02:52:14] darrencauthon: has joined #RubyOnRails
[02:52:38] bulldawgden: has joined #RubyOnRails
[02:53:12] baash05: I'm trying to have the app raise when a parameter I don't want is passed..
[02:53:21] siemprefresco: has joined #RubyOnRails
[02:53:29] sevenseacat: right, so don't permit it
[02:53:33] bulldawgden: has joined #RubyOnRails
[02:53:34] sevenseacat: then it will go kaboom
[02:53:46] jher: "#blacklist"?
[02:53:51] Rodya_: has joined #RubyOnRails
[02:54:05] baash05: or will it just return the parameters without that value
[02:54:06] sevenseacat: if you configure Rails to raise on unpermitted params, then yes
[02:54:20] VeryBewitching: with the strong_parameters gem
[02:54:21] baash05: Ah.. but I don't want it to happen to every controller.
[02:54:28] bulldawgden: has joined #RubyOnRails
[02:54:32] baash05: not systemic. Just one instance.
[02:54:37] baash05: so I can't config it.
[02:54:51] baash05: Most times I don't care if they pass in useless params.
[02:55:02] sevenseacat: then may I suggest using `raise OhNoException if params[:foo].present?`
[02:55:04] baash05: But I have a case where I want to slam them if they do
[02:55:16] jher: So just include a check into the strong parameter private method
[02:55:19] bulldawgden: has joined #RubyOnRails
[02:55:44] christiandsg: has joined #RubyOnRails
[02:55:45] baash05: sevenseacat: I was planning on exactly that.
[02:55:57] gareim: has joined #RubyOnRails
[02:56:11] bulldawgden: has joined #RubyOnRails
[02:56:11] baash05: rescue_from ActionController::ParameterRestricted do bla_bla
[02:56:13] nya: has joined #RubyOnRails
[02:57:09] jher: Seems like rescuing an exception to slam a user might be bad practice though
[02:57:29] jher: Or even creating the exception to begin with
[02:57:30] baash05: well the rescue will spit out a 422 or 401
[02:57:56] bulldawgden: has joined #RubyOnRails
[02:57:59] baash05: I'd handle it the same way I handle a parametermissing.
[02:58:01] VeryBewitching: baash05: If this is going to happen in one controller, and only that one, just sort through the params list yourself.
[02:58:08] jher: Why not `head 401`
[02:58:46] bulldawgden: has joined #RubyOnRails
[02:59:06] baash05: I was wanting to have the implementation closer to the way strong_params are handled.. because this should be part of strong params..
[02:59:13] baash05: At least I think it should.
[02:59:37] bulldawgden: has joined #RubyOnRails
[02:59:50] sevenseacat: perhaps post an issue discussing it, seeing if it would be accepted
[02:59:55] baash05: I was going to submit a patch after I got it working because I can see how
[02:59:56] sevenseacat: and if so, write it :P
[03:00:10] VeryBewitching: baash05: I think that's subjective.
[03:00:25] bulldawgden: has joined #RubyOnRails
[03:00:30] baash05: that sentence is a totality.
[03:01:08] VeryBewitching: baash05: Params allows me to filter out what I don't want and include what's acceptable. If it's a security related issue where someone's trying to exploit, then put some time to examine the parameters with your own business logic.
[03:01:09] jher: baash05: I don't see the point. Why would a user specifically send in a wrong param that you know about beforehand?
[03:01:17] bulldawgden: has joined #RubyOnRails
[03:01:50] baash05: In my specific example I have an admin user who can create other admin users.
[03:02:05] jeadre: has joined #RubyOnRails
[03:02:12] bulldawgden: has joined #RubyOnRails
[03:02:23] baash05: But I don't want any users of the API to ever be able to add an admin user who can add other admin users.
[03:02:27] VeryBewitching: Be happy in knowing strong parameters works pretty well and call it a day, my advice. :D
[03:03:04] baash05: VeryBewitching: If I could accept that things worked pritty well I'd be in a different job. I want them to work better :)
[03:03:05] bulldawgden: has joined #RubyOnRails
[03:03:28] VeryBewitching: Then start writing a patch, as sevenseacat suggested :D
[03:03:36] baash05: already did :)
[03:04:03] bulldawgden: has joined #RubyOnRails
[03:04:56] bulldawgden: has joined #RubyOnRails
[03:05:35] VeryBewitching: I think this https://github.com/rails/strong_parameters really is enough.
[03:05:50] bulldawgden: has joined #RubyOnRails
[03:06:43] bulldawgden: has joined #RubyOnRails
[03:07:37] bulldawgden: has joined #RubyOnRails
[03:10:40] braincrash: has joined #RubyOnRails
[03:11:59] bulldawgden: has joined #RubyOnRails
[03:14:37] kegan_: has joined #RubyOnRails
[03:17:34] annlewis: has joined #RubyOnRails
[03:19:45] sevenseacat: VeryBewitching: because you don't see a use case for it, no-one can want it ever?
[03:20:34] VeryBewitching: sevenseacat: No, I think there's already a solution.
[03:20:41] sevenseacat: VeryBewitching: which is?
[03:20:56] dogweather: has joined #RubyOnRails
[03:21:00] VeryBewitching: reject, and raise in the block.
[03:21:04] drale2k: has joined #RubyOnRails
[03:21:17] VeryBewitching: On a condition, of course, but that would work.
[03:21:31] sevenseacat: in that case we don't really need strong_params because we can just raise if the param isnt present, and then slice
[03:22:17] roolo: has joined #RubyOnRails
[03:22:31] yfeldblum: has joined #RubyOnRails
[03:25:00] VeryBewitching: I would only ever examine any bad parameters if I felt there was some very specific need to. I think there are ways to accomplish the act of raising an exception in the event that someone passed me parameters that I hadn't whitelisted.
[03:26:27] sevenseacat: there are ways to do it globally, yes. and as stated, the behaviour isnt wanted globally
[03:26:39] sevenseacat: I don't see why you're fighting against this, it doesnt affect you at all
[03:26:57] VeryBewitching: I'm calmly answering your questions.
[03:27:09] sevenseacat: ok, so there is a specific need to
[03:27:18] sevenseacat: and there are ways to globally raise on unpermitted params, ys
[03:27:19] rogue_koder: has joined #RubyOnRails
[03:27:29] sevenseacat: neither of those answer the question of 'and the solution is?'
[03:27:53] VeryBewitching: Do you have a solution to do it in a single specific use case?
[03:28:18] sevenseacat: I think the suggestion to allow strong_params to expressly forbid params is a good one.
[03:28:28] Lightsword: has joined #RubyOnRails
[03:30:13] SteenJobs: has joined #RubyOnRails
[03:30:54] baweaver: has joined #RubyOnRails
[03:31:18] djbkd: has joined #RubyOnRails
[03:32:24] user1138: has left #RubyOnRails: ("Leaving")
[03:32:39] yfeldblum: has joined #RubyOnRails
[03:34:26] VeryBewitching: I'm happy with it rejecting everything at face value.
[03:34:47] sevenseacat: that... doesnt solve the problem
[03:40:07] christiandsg: has joined #RubyOnRails
[03:43:51] Cervajz: has joined #RubyOnRails
[03:46:30] siemprefresco: has joined #RubyOnRails
[03:47:07] mary5030: has joined #RubyOnRails
[03:50:35] JoshGlzBrk: has joined #RubyOnRails
[03:51:41] Maletor: has joined #RubyOnRails
[03:51:56] nahtnam: If I have json like this: https://gist.github.com/nahtnam/b6b00445ff4205268841 how can I access total_time_played?
[03:52:08] nahtnam: Do I have to do it by index or something?
[03:53:41] nahtnam: stats["playerstats"]["stats"]
[03:53:46] nahtnam: what do I put after that?
[03:53:55] Creeves: you'll need an index
[03:54:04] Creeves: stats is an array
[03:54:37] VeryBewitching: stats["playerstats"]["stats"][2]
[03:54:38] Creeves: stats["playerstats"]["stats"].each{|s| s["value"]
[03:54:52] VeryBewitching: For total_time_played
[03:55:27] mary5030: has joined #RubyOnRails
[03:55:50] nahtnam: Two different pieces of code. VeryBewitching Your code gives the time played, and Creeves yours maps everything to a hash?
[03:56:42] VeryBewitching: nahtnam: It's best to do as Creeves suggests unless you're certain it'll always be in that position in the collection.
[03:56:52] VeryBewitching: That way you can always look it up by key
[03:57:23] Creeves: oh sorry, didn't see the end of your question was asking for total_time_played specifically
[03:57:36] Creeves: but np also :)
[03:58:24] nahtnam: Creeves: Yeah, ill be using your code I didnt even know you could do that :D
[03:58:50] dogweather: has joined #RubyOnRails
[03:59:14] nya: has joined #RubyOnRails
[03:59:37] Creeves: nahtnam: yeah ruby blocks are awesome
[04:00:18] Creeves: anyone use hexchat here?
[04:00:47] nahtnam: Hm so would it map everything to a variable 's'?
[04:00:55] nahtnam: Or should i be doing something like `stats = request["playerstats"]["stats"].each{|s| s["value"]}`
[04:01:11] SteenJobs: has joined #RubyOnRails
[04:01:40] jancel: has joined #RubyOnRails
[04:01:56] Rubie: has joined #RubyOnRails
[04:02:40] jholm: has joined #RubyOnRails
[04:04:00] Creeves: it doesn't set s to 'everything', rather the code inside the braces ('{') will run for every element in the array, and s will be set to that element
[04:05:09] nahtnam: Ehh, its confusing
[04:05:13] nahtnam: Im gonna look at some docs
[04:05:17] Creeves: so if i had something like x = [1,2,3,4]
[04:05:18] nahtnam: for the syntax
[04:05:33] Creeves: and then wrote something like x.each{|e| puts e}, it would print
[04:05:56] Creeves: you can also use do and end
[04:06:09] nahtnam: Yeah, how do I do that?
[04:06:12] Creeves: x.each do |e|
[04:06:29] Creeves: no worries
[04:06:42] Creeves: sorry to others for spamming up the chat a bit with out single word lines haha
[04:07:05] Creeves: nahtnam: have you learned any other languages before ruby?
[04:07:22] nahtnam: Does that count as a language? lol
[04:07:37] nahtnam: I dont like it anymore
[04:07:40] nahtnam: except for laravel
[04:07:59] Creeves: yeah laravel is very pretty
[04:08:07] jeadre: has joined #RubyOnRails
[04:08:32] Creeves: i was mainly asking to say that using .each like that is essentially ruby's equivalent to a foreach in php
[04:08:58] Oog_: has joined #RubyOnRails
[04:09:45] maz-dev: has joined #RubyOnRails
[04:10:03] nahtnam: The syntax threw me off
[04:10:08] nahtnam: I dont like short syntax
[04:10:23] Creeves: yeah it's a little different but once you get used to it it's pretty great
[04:10:35] nahtnam: https://gist.github.com/nahtnam/2d0c39e6e9342eb5b406
[04:10:42] nahtnam: What I ended up doing
[04:10:46] Creeves: i think the general convention with blocks like that is to use braces on a single line and do..end on multi lines
[04:11:32] nahtnam: Im used to pretty syntax, so do...end is my fav
[04:11:50] sevenseacat: ACTION munches on popcorn
[04:12:21] Creeves: sevenseacat: literally?
[04:12:31] sevenseacat: unfortunately no. i ate all my actual popcorn last night.
[04:12:39] Creeves: as long as my advice isn't so bad it's entertaining
[04:13:10] Creeves: jump in any time
[04:13:10] jeadre: has joined #RubyOnRails
[04:13:11] nahtnam: To be fair, i joined and then I gave up
[04:13:19] nahtnam: and then tried 1/2 yr later
[04:13:27] nahtnam: and on and off again
[04:13:30] nahtnam: until it clicked
[04:14:00] sevenseacat: http://logs.ryanbigg.com/p/nahtnam/activity
[04:14:30] Creeves: sevenseacat: i'm still learning too so definitely let me know if i say something that's wrong
[04:14:43] nahtnam: 2014 end to 2015?
[04:14:50] sevenseacat: Creeves: will do.
[04:14:51] cornerma1: has joined #RubyOnRails
[04:15:43] nahtnam: I have no idea how that calendar works
[04:15:48] towski_: has joined #RubyOnRails
[04:15:57] iateadonut: has joined #RubyOnRails
[04:17:00] nahtnam: Is there a bot here to get a quick link to docs?
[04:17:19] Creeves: surely googling it is fastest
[04:17:47] rushed: has joined #RubyOnRails
[04:17:57] bruno-: has joined #RubyOnRails
[04:18:17] annlewis: has joined #RubyOnRails
[04:18:25] Creeves: ACTION looks at his own activity graph
[04:19:36] Aeyrix: I briefly considered taking appropriate time off to cause my activity graph to spell out "MEME"
[04:19:39] Aeyrix: but to be honest
[04:19:40] Creeves: it's cool how you can see where people have gone on holiday or just not come in for a few months
[04:19:41] Aeyrix: that's a lot of effort
[04:19:47] Radar: nahtnam: Use Dash.
[04:20:32] sevenseacat: dash is nice.
[04:20:49] sevenseacat: devdocs.io is decent if you want an online version.
[04:21:00] sevenseacat: with a much smaller collection of docs
[04:21:11] Creeves: dash is osx only?
[04:21:29] sevenseacat: ACTION mumbles something about all the fancy software only being made for osx
[04:21:39] sevenseacat: much to my dismay
[04:21:57] Creeves: i can't have osx on my desktop, so i find it hard to get into osx only products
[04:22:17] Radar: devdocs is a great substitute
[04:22:20] Aeyrix: sevenseacat: what do you expect
[04:22:27] Aeyrix: OS X has all the fancy devs
[04:22:42] Aeyrix: idk how people willingly write in Objective C though
[04:22:46] Aeyrix: it's objectively awful
[04:22:48] sevenseacat: Creeves: wanna swap? i have osx mandated on my work laptop
[04:22:56] Creeves: me too haha
[04:23:00] Creeves: not mandated
[04:23:09] Creeves: i should boot linux on it, but haven't been bothered
[04:23:21] Creeves: but it's a crackbook pro
[04:23:37] sevenseacat: turned up on my first day of work with a linux laptop 'uh.... you need a macbook, go buy one'
[04:23:45] Creeves: that's really shitty
[04:23:51] banjara: has joined #RubyOnRails
[04:23:52] Creeves: i could understand if you came in with a windows laptop
[04:23:55] Creeves: and they said that
[04:24:15] Aeyrix: my office is mostly windows
[04:24:16] Aeyrix: some linux
[04:24:17] sevenseacat: eh, they paid for half of it, and its a whiz-bang machine :)
[04:24:19] Aeyrix: and me :^)
[04:25:13] drale2k: has joined #RubyOnRails
[04:25:21] Creeves: Aeyrix, what are you using
[04:25:27] Creeves: oh osx i guess
[04:25:28] Aeyrix: Macbook Pro.
[04:25:33] Creeves: not much left haha
[04:25:45] Creeves: i recently switched to arch from windows on my desktop
[04:25:54] Creeves: kept trying ubuntu but it had too many issues
[04:25:58] sevenseacat: my desktop is a gaming machine, so it has win10 on it
[04:26:08] Aeyrix: sevenseacat: did you disable the spying? :v
[04:26:12] sevenseacat: my old laptop (which is still an awesome laptop) has ubuntu on it
[04:26:16] sevenseacat: Aeyrix: as much as i could find
[04:26:19] Creeves: but for dev, i was having to do everything on my laptop or on ubuntu, and it was horrible
[04:26:28] sevenseacat: but if they want to watch me rock out at elder scrolls online, then fine
[04:26:36] Creeves: everything runs so much nicer on arch so far
[04:26:39] Aeyrix: For my work it's a bit more serious.
[04:26:43] Creeves: no good for games though
[04:26:46] Aeyrix: We have to make sure it's all disabled.
[04:26:51] sevenseacat: i do miss a lot of things about ubuntu.
[04:27:04] Aeyrix: What, like Amazon Spotlight Search?
[04:27:07] sevenseacat: Aeyrix: i unchecked a shitload of 'watching you' stuff when I upgraded to win10, is there anything else I need to do?
[04:27:10] sevenseacat: nah i disabled that
[04:27:20] Aeyrix: https://github.com/dfkt/win10-unfuck/
[04:27:25] Aeyrix: By dfkt and cuckmaster flash
[04:27:33] Creeves: i don't bother with all the privacy stuff anymore really
[04:27:39] Creeves: i should... but i just can't be bothered
[04:28:06] Oog_: v.orders.complete.select('(MAX(date) - MIN(date)) / NULLIF(COUNT(*), 0) AS "abc"').abc
[04:28:17] Oog_: undefined method `abc' for #<ActiveRecord::AssociationRelation [#<Order id: nil>]>
[04:28:23] Creeves: it will bite me on the ass when the machines take over and they know all of my secrets
[04:28:35] sevenseacat: Oog_: you have a relation, not a single instance
[04:28:37] helpa: Please do not use fake values, as they can be confusing or misleading. Sometimes both.
[04:28:47] dogweather: has joined #RubyOnRails
[04:28:53] Aeyrix: Just seeing `abc` makes me twitch now.
[04:28:56] Oog_: sevenseacat ha... thanks
[04:29:03] sevenseacat: reading error messages is the shit :P
[04:29:14] dogweather: Anybody else find the rake tasks to be disorganized?
[04:30:23] manfrin`laptop: has joined #RubyOnRails
[04:31:39] sevenseacat: keep in mind that rake tasks are coming from lots of different sources
[04:32:24] czerasz: has joined #RubyOnRails
[04:35:06] jeadre: has joined #RubyOnRails
[04:35:58] charliesome: has joined #RubyOnRails
[04:36:26] dogweather: sevenseacat: I'm mostly thinking of the db namespace. There's a lot of inconsistent behavior, and undocumented tasks.
[04:36:43] sevenseacat: the undocumented ones are undocumented for a reason
[04:36:49] Creeves: i want to make a webservice that takes C code as data and compiles it to LLVM bytecode and then asm.js code which is returned
[04:36:53] Creeves: i wonder how possible this is
[04:36:54] dogweather: E.g., db:create affects development and test, most others dont
[04:37:01] srinidhi: has joined #RubyOnRails
[04:37:16] dogweather: db:reset is a good example of an undocumented one which should be, IMO: it's very high level
[04:37:30] dogweather: Some tasks accept :all, some don't
[04:37:55] sevenseacat: feel free to file these as issues for rails :)
[04:38:14] dogweather: So one use-case: a programmers clones a repo; how do they set up the databases and run the tests?
[04:38:25] Creeves: isn't that going to be project specific
[04:38:32] Radar: dogweather: That process is documented in that project's README.
[04:38:35] sevenseacat: typically, yes
[04:38:36] dogweather: It might be rake db:setup && rake ... but maybe not
[04:38:55] christiandsg: has joined #RubyOnRails
[04:39:22] dogweather: bec. db:setup invokes db:create which -does- create the test db, but then none of the other antecedent tasks seem to affect it
[04:39:41] Radar: dogweather: example?
[04:39:45] banjara: has joined #RubyOnRails
[04:39:57] Radar: i.e. steps to reproduce in a new app
[04:40:06] Aeyrix: 1. Rails new
[04:40:09] dogweather: So, db:setup could be considered broken, if i'm not mistaken: it completely sets up development, but only partially sets up test.
[04:40:11] Aeyrix: 2. Don't push a readme
[04:40:42] dogweather: i.e., tests cannot yet be run without doing a further db:setup RAILS_ENV=test, if i'm not mistaken
[04:40:49] Radar: dogweather: You are mistaken.
[04:40:55] Radar: db:setup should not be run on the test database itself.
[04:41:03] Radar: db:seed is only used for development, and not tests
[04:41:11] Radar: The tests themselves should setup their own environment.
[04:41:29] dogweather: In my case, the schema isn't loaded into test by db:setup.
[04:41:34] dogweather: This is Rails 4.1., though
[04:41:55] dogweather: I'll retry with a fresh project
[04:42:05] sevenseacat: but you wondered why db:setup wasnt documented? ;)
[04:42:15] dogweather: no... db:reset
[04:42:17] Radar: rake db:test:prepare is used to prepare the test databsae.
[04:42:22] Radar: db:reset is for only the current environment.
[04:42:23] pyemkey: has joined #RubyOnRails
[04:42:36] sevenseacat: db:test:prepare isnt in use in rails 4 silly
[04:42:40] havenwood: has joined #RubyOnRails
[04:42:41] Radar: It isn't?
[04:42:51] sevenseacat: which causes its own set of problems
[04:42:55] Radar: Why do I have Twist on Rails 4.2.2 that requires db:test:prepare?
[04:43:02] sevenseacat: i have no idea.
[04:43:06] sevenseacat: it shouldnt be defined.
[04:43:09] Radar: sevenseacat: [citation needed]
[04:43:20] dogweather: see... i do think these are a bit of a mess ... the set of them doesn't seem well defined
[04:43:47] Radar: dogweather: patches are still welcome
[04:44:04] sevenseacat: Radar: https://github.com/rubysherpas/rails_4_in_action/blob/master/ch03/ch03.adoc grep for db:test:prepare ;)
[04:44:12] Radar: sevenseacat: yeah yeah
[04:44:14] banjara: has joined #RubyOnRails
[04:44:26] Radar: sevenseacat: That's not working for me in Twist
[04:44:29] pyemkey: Hello. I'm looking for the help with naming table which contains newsletter_acceptance, :discount_informations, :insurance_expiration.
[04:44:33] Radar: I've been trying to figure out for a while now and I don't know why.
[04:46:31] x44x45x41x4E: has joined #RubyOnRails
[04:47:10] EvilEpoch: has joined #RubyOnRails
[04:47:18] EvilEpoch: Warm Greetings to all, I am The EvilEpoch.
[04:50:18] skbly7: has joined #RubyOnRails
[04:50:28] nya: has joined #RubyOnRails
[04:51:09] pedrito: has joined #RubyOnRails
[04:51:34] Radar: Warm greetings EvilEpoch :)
[04:52:05] rubyonrails655: has joined #RubyOnRails
[04:52:51] ChadyG: has joined #RubyOnRails
[04:52:53] pedrito: has left #RubyOnRails: ()
[04:53:32] EvilEpoch: Warm Greetings to Radar from The EvilEpoch.
[04:53:55] ur5us: has joined #RubyOnRails
[04:54:39] nahtnam: Radar: Dash?
[04:54:45] Radar: nahtnam: Dash.
[04:55:08] nahtnam: Mac only :(
[04:55:11] sarink: has joined #RubyOnRails
[04:55:31] nahtnam: Radar: Dash?
[04:55:38] nahtnam: http://zealdocs.org/
[04:55:45] Radar: Radar kicked nahtnam:
[04:55:46] dented42: has joined #RubyOnRails
[04:55:51] Aeyrix: ACTION is having Deja v??.
[04:56:00] Aeyrix: lmao that kick reason
[04:58:30] alex88: has joined #RubyOnRails
[05:00:51] togg719: has joined #RubyOnRails
[05:02:26] Creeves: it's always a bit sad when they don't come back
[05:02:39] arooni-mobile: has joined #RubyOnRails
[05:04:22] nahtnam: has joined #RubyOnRails
[05:04:26] nahtnam: Was I supposed to come back?
[05:04:32] nahtnam: I was just watching the logs
[05:04:43] nahtnam: has left #RubyOnRails: ()
[05:06:05] mary5030: has joined #RubyOnRails
[05:09:05] banjara: has joined #RubyOnRails
[05:10:07] JoshGlzBrk: has joined #RubyOnRails
[05:10:24] h4ckurate: has joined #RubyOnRails
[05:10:31] roolo: has joined #RubyOnRails
[05:11:23] lxsameer: has joined #RubyOnRails
[05:12:42] chrissonar: has joined #RubyOnRails
[05:13:03] towski_: has joined #RubyOnRails
[05:13:14] riotjones: has joined #RubyOnRails
[05:19:04] annlewis: has joined #RubyOnRails
[05:20:16] djbkd: has joined #RubyOnRails
[05:20:19] chipotle: i do not recommend ketamine and trying to do a code review
[05:20:32] chipotle: just throwing that out there
[05:22:18] Creeves: chipotle: yeah i don't fancy vomiting all over my keyboard
[05:22:40] chipotle: Creeves: indeed
[05:22:46] alex88_: has joined #RubyOnRails
[05:22:48] ur5us: has joined #RubyOnRails
[05:22:49] chipotle: i just lay down on my side
[05:23:03] Creeves: yeah it makes me throw up
[05:23:11] Creeves: nearly every time i had it when i was younger i did
[05:23:16] chipotle: so if i vomit i don't hurt mhy keyboard
[05:26:00] drale2k: has joined #RubyOnRails
[05:27:14] sk8er9954: has joined #RubyOnRails
[05:29:53] tagrudev: has joined #RubyOnRails
[05:32:55] banjara: has joined #RubyOnRails
[05:35:31] christiandsg: has joined #RubyOnRails
[05:36:52] Axsuul: has joined #RubyOnRails
[05:40:12] chipotle: i am almost back
[05:42:24] krz: has joined #RubyOnRails
[05:42:29] kegan_: from the hole?
[05:43:43] sinkensabe: has joined #RubyOnRails
[05:44:44] Cervajz: has joined #RubyOnRails
[05:48:13] ollie314: has joined #RubyOnRails
[05:48:39] christiandsg: has joined #RubyOnRails
[05:49:16] chipotle: ,kegan_ eys
[05:49:20] alex88: has joined #RubyOnRails
[05:49:21] chipotle: howmare you?
[05:49:43] jancel: has joined #RubyOnRails
[05:50:58] jholm: has joined #RubyOnRails
[05:56:03] bePolite: has joined #RubyOnRails
[05:56:49] nyaa: has joined #RubyOnRails
[05:56:59] lurkmaster: has joined #RubyOnRails
[05:57:36] maz-dev: has joined #RubyOnRails
[05:58:24] roolo: has joined #RubyOnRails
[05:59:02] duncannz: has joined #RubyOnRails
[06:00:25] riotjones: has joined #RubyOnRails
[06:01:52] TomyLobo: has joined #RubyOnRails
[06:03:43] VanWeyden: has joined #RubyOnRails
[06:05:07] darutoko: has joined #RubyOnRails
[06:07:12] nya: has joined #RubyOnRails
[06:10:22] pyemkey: Can anyone help me figure out why I've got unknown format in my update action. https://gist.github.com/pyemkey/def92f6b6af561836c7b
[06:10:49] lurkmaster: guys i need some help. i have a navigation bar in my app, and my application.css file doesn't seem to be applying the styles correctly to it, however its working on the rest of the app. here's my application.css file --> http://pastie.org/10371728
[06:11:10] choke: has joined #RubyOnRails
[06:11:13] lurkmaster: and here's my application.html.erb file --> http://pastie.org/10371732
[06:11:15] Cervajz: has joined #RubyOnRails
[06:11:47] MartinElvar: has joined #RubyOnRails
[06:11:56] sevenseacat: pyemkey: having the entire log for the request would help immensely
[06:12:05] sevenseacat: LurkMaster: I hope you find some guys to help you.
[06:12:13] mutuma: has joined #RubyOnRails
[06:12:32] jas02: has joined #RubyOnRails
[06:13:07] lurkmaster: guys or girls*, i use the word guys neutrally
[06:13:13] pyemkey: sevenseacat: gist updated
[06:13:35] sevenseacat: pyemkey: except you missed the request being made so we don't know what format it is
[06:13:44] sevenseacat: thats what I asked for
[06:14:20] eoy: has joined #RubyOnRails
[06:14:29] sevenseacat: LurkMaster: !rule12
[06:14:29] helpa: LurkMaster: Do not PM members of the channel without first asking if that is OK.
[06:15:35] Ropeney: LurkMaster: you could be more detailed on whats not working?
[06:16:09] yardenbar: has joined #RubyOnRails
[06:16:19] lurkmaster: ropeney: rails isn't applying any of the css styles to the navigation bar div on my page
[06:16:33] lurkmaster: ropeney: its just plain html
[06:16:51] Ropeney: LurkMaster: oh, you said "applying correclty" impling it applied something
[06:17:17] pyemkey: sevenseacat: Gist updated. Format should be js. I used remote: true in my form_for helper
[06:17:22] lurkmaster: ropeney: yea i messed up. i should've said its not applying it at all
[06:17:39] pyemkey: sevenseacat: it's first time when I'm getting this kind of error
[06:18:00] sevenseacat: pyemkey: the start of the log starts something like "Started GET '/your special url here'..."
[06:18:11] sevenseacat: that will tell us exactly what the format is, not what you think it is
[06:19:51] annlewis: has joined #RubyOnRails
[06:20:14] pyemkey: sevenseacat: you are right. Now should be ok
[06:20:18] x44x45x41x4E: has joined #RubyOnRails
[06:20:31] Ropeney: LurkMaster: It looks like it should do "something", its applying every other style to other parts of apps or?
[06:20:41] sevenseacat: pyemkey: ah hah, so now we can see we have no format specified at all
[06:21:35] pyemkey: sevenseacat: Where you see this information?
[06:21:49] sevenseacat: pyemkey: https://gist.github.com/pyemkey/def92f6b6af561836c7b#file-gistfile1-txt-L2
[06:21:58] sevenseacat: the reason this is because it's interpreting the .com in the URL as the format
[06:22:05] sevenseacat: which doesnt match any of the existing formats
[06:22:24] lurkmaster: ropeney: yup its applying the styles to every other part of the app except the nav bar
[06:22:30] sevenseacat: you'll need to escape these kinds of things if you want to use them in URLs
[06:22:47] jas02: has joined #RubyOnRails
[06:22:50] lurkmaster: ropeney: also I'm using bootstrap, not sure if that matters
[06:24:13] SteenJobs: has joined #RubyOnRails
[06:24:28] pyemkey: sevenseacat: In preferences my primary key is email. How can I escape email from url and make it work?
[06:25:04] sevenseacat: you will need to overwrite to_param in your model and escape the data
[06:26:53] ruurd: has joined #RubyOnRails
[06:27:09] lurkmaster: ropeney: the only thing thats different about the navbar compared to the rest of the page is that I defined it in the application.html.erb rather than directly applying it in a specific view
[06:27:28] dionysus69: has joined #RubyOnRails
[06:28:06] rails663: has joined #RubyOnRails
[06:28:09] pyemkey: sevenseacat: Thanks for help ;) I will try to escape the data
[06:28:18] drale2k: has joined #RubyOnRails
[06:28:37] sevenseacat: LurkMaster: which styles arent applying where?
[06:28:42] Ropeney: LurkMaster: Thats the only file in your layouts folder?
[06:29:32] sevenseacat: LurkMaster: is your CSS file actually a SCSS file?
[06:30:05] sandstrom: has joined #RubyOnRails
[06:30:57] Creeves: has joined #RubyOnRails
[06:31:04] lurkmaster: ropeney: yea thats the only file
[06:31:14] comrad: has joined #RubyOnRails
[06:31:34] lurkmaster: sevenseacat: yea its a css file, my css isn't applying to the navigation bar of my app, but its applying the styles correctly to the rest of my page
[06:31:42] sevenseacat: thats not what I asked
[06:31:55] sevenseacat: you're writing SCSS in that file, so is it actually saved as a SCSS file?
[06:34:01] rromanchuk: has joined #RubyOnRails
[06:35:16] aganov: has joined #RubyOnRails
[06:35:24] tonios57: has joined #RubyOnRails
[06:35:57] iateadonut: has joined #RubyOnRails
[06:36:57] Radar: The docs at https://github.com/cerebris/jsonapi-resources#fetchable-attributes show how to customise fetchable fields using a "context"... but don't show how to pass that context in in the first place!
[06:37:00] lurkmaster: it wasn't saved as a css file, i just saved it as an scss, now its applying the css thanks
[06:37:03] ruurd: has joined #RubyOnRails
[06:37:14] Radar: Has anyone used jsonapi-resources and can tell me how to pass a context through?
[06:39:00] andrewx10: has joined #RubyOnRails
[06:39:25] sevenseacat: that feeling when your squeel search returns 30 of the same result in staging and you cant duplicate it in dev
[06:41:01] sevenseacat: aaaah finally got it
[06:41:29] Axsuul: has joined #RubyOnRails
[06:42:37] ur5us: has joined #RubyOnRails
[06:43:06] VeryBewitching: Radar: Looks like it's defined by you https://github.com/cerebris/jsonapi-resources#resourcecontroller
[06:43:19] sevenseacat: so in what cases would LibraryProgram.where(id: ids) still carry a bunch of SQL from a previous query, fucking up results?
[06:43:20] Radar: Oh right. Thanks VeryBewitching :)
[06:43:41] ur5us: has joined #RubyOnRails
[06:43:50] VeryBewitching: http://www.cerebris.com/blog/2014/08/22/introducing-jsonapi-resources/ was a good read along the way.
[06:44:49] sevenseacat: like https://gist.github.com/sevenseacat/e6bf2e86a190d1762daa
[06:45:25] sevenseacat: I mean i'm making it a separate query to ditch the previous stuff
[06:48:03] sevenseacat: changing it to find instead of where seems to make it go away. hrrrm.
[06:48:51] artto: has joined #RubyOnRails
[06:49:08] skbly7: has joined #RubyOnRails
[06:49:16] christiandsg: has joined #RubyOnRails
[06:50:06] lxsameer: has joined #RubyOnRails
[06:51:25] sevenseacat: except find returns an array not a relation. phooey.
[06:52:06] jeadre: has joined #RubyOnRails
[06:52:14] Coldblackice_: has joined #RubyOnRails
[06:53:10] kwd: has joined #RubyOnRails
[06:54:27] rushed: has joined #RubyOnRails
[06:54:57] nya: has joined #RubyOnRails
[06:55:02] sevenseacat: `unscoped` for the apparent win.
[06:56:03] craysiii: has joined #RubyOnRails
[06:56:16] drale2k: has joined #RubyOnRails
[06:57:21] shivamKhandelwal: has joined #RubyOnRails
[07:00:00] alex88: has joined #RubyOnRails
[07:00:44] zimbabawe: has joined #RubyOnRails
[07:01:13] jancel: has joined #RubyOnRails
[07:02:58] johnflux: has joined #RubyOnRails
[07:02:58] johnflux: has joined #RubyOnRails
[07:03:49] abuzze: has joined #RubyOnRails
[07:05:03] sarink: has joined #RubyOnRails
[07:05:21] iateadonut: has joined #RubyOnRails
[07:05:38] sandstrom: has joined #RubyOnRails
[07:06:43] finnnnnnnnnnn: has joined #RubyOnRails
[07:09:56] redmaverick: has joined #RubyOnRails
[07:10:08] ur5us: has joined #RubyOnRails
[07:11:03] rvanlieshout: has joined #RubyOnRails
[07:13:39] redmaverick: How to use where clause to select all. Like Book.where(id: *)
[07:13:48] redmaverick: Instead of Book.all
[07:14:27] sevenseacat: just like that.
[07:14:37] sevenseacat: wait, why would you use where to select all?
[07:14:40] sevenseacat: and not just all?
[07:16:10] Aeyrix: I'm so confused about this question that I'm laughing like a crazy person.
[07:16:19] redmaverick: I have a query Book.where(hierarchy1: hierarchy1, hierarchy2: hierarchy2, hierarchy3: hierarchy3)
[07:16:34] redmaverick: but hierarchy1, 2 and 3 maybe nil
[07:16:56] redmaverick: so I want to take care of the nil situation and replace it with * in case it is nil
[07:16:58] sevenseacat: sounds like you need to build up this query in pieces
[07:17:07] sevenseacat: and only apply the filtering if its not nil
[07:17:29] redmaverick: yeah. I was wondering if there was a more elegant way to do it
[07:17:34] Aeyrix: Not really.
[07:18:32] sevenseacat: your other alternative is to use scopes with conditionals in them, eg. scope :in_hierarchy_1, ->(hierarchy1) { where(heirarchy_1: hierarchy_1) if hierarchy_1.present? }
[07:18:40] sevenseacat: and then just chain all the scopes together
[07:18:46] sevenseacat: ps. i hate the word 'hierarchy'
[07:18:55] sevenseacat: I hate typing it
[07:19:12] redmaverick: he he.. yeah.. the scope idea looks decent.. will try it out
[07:19:23] finnnnnnnnnnn: has joined #RubyOnRails
[07:19:42] sevenseacat: scopes are always chainable, so if hierarchy_1 is nil, that scope will just return the equivalent of .all
[07:19:54] ruurd: has joined #RubyOnRails
[07:20:36] annlewis: has joined #RubyOnRails
[07:23:38] SteenJobs: has joined #RubyOnRails
[07:23:52] TvL2386: has joined #RubyOnRails
[07:25:13] beauby: has joined #RubyOnRails
[07:26:37] Axsuul: has joined #RubyOnRails
[07:26:53] kegan_: how can i build out a modal with javascript populated by json an ajax request provides?
[07:26:58] edwinvdgraaf: has joined #RubyOnRails
[07:27:15] sevenseacat: kegan_: you may have to provide some more information, preferably with code.
[07:27:18] universa1: kegan_: look up the documentation for whatever library you use for modals?
[07:27:35] kegan_: is it too slow to simply have the javascript piece it together using the json
[07:27:39] jas02: has joined #RubyOnRails
[07:27:45] kegan_: I'm really just asking a general question if it's better to have a partial and use jquery to fill it out
[07:27:49] kegan_: or just do the modal inside of javascript
[07:28:07] universa1: kegan_: tbh, just try it out. it depends on your usecase.
[07:29:27] sarink: has joined #RubyOnRails
[07:29:32] Linuus: has joined #RubyOnRails
[07:30:02] kegan_: ok thanks guys
[07:30:32] iateadonut: has joined #RubyOnRails
[07:31:04] helpa: We're not all guys here - while you probably don't meant to be exclusive, not everybody feels that way. Maybe consider using "folks", "y'all" or "everyone" instead?
[07:31:05] Cervajz: has joined #RubyOnRails
[07:31:28] kegan_: ok thanks you two : )
[07:31:42] waseem_: kegan_: You're still having trouble with this problem? I think we talked about it yesterday. :)
[07:32:00] kegan_: waseem_ I didn't understand what I was doing yesterday, today I do
[07:32:19] kegan_: waseem_ a lot better, at least :D
[07:32:35] waseem_: kegan_: That sounds like progress.
[07:32:56] kegan_: your direction helped me get there!
[07:33:15] jas02: has joined #RubyOnRails
[07:34:23] Axsuul: has joined #RubyOnRails
[07:34:32] Ergo: has joined #RubyOnRails
[07:35:01] kitsuneyo: has joined #RubyOnRails
[07:35:09] Axsuul: has joined #RubyOnRails
[07:35:33] JEEB: regarding deployment into a subdirectory, does it sound like something has gone wrong in the development of a service if just setting RAILS_RELATIVE_URL_ROOT is not enough to make it JustWork?
[07:35:42] johnflux: has joined #RubyOnRails
[07:35:45] zpe: has joined #RubyOnRails
[07:35:52] x-light: has joined #RubyOnRails
[07:36:08] JEEB: I seemingly require to do the mapping trick in my config.ru to have the system completely work
[07:37:17] jensljungblad: has joined #RubyOnRails
[07:37:42] JEEB: this kind of config.ru modification http://stackoverflow.com/a/27299902
[07:38:42] jgt: has joined #RubyOnRails
[07:39:19] jholm: has joined #RubyOnRails
[07:42:54] rubyonrails417: has joined #RubyOnRails
[07:43:29] lvrbrtsn: has joined #RubyOnRails
[07:43:40] sameerynho: has joined #RubyOnRails
[07:43:44] bePolite_: has joined #RubyOnRails
[07:44:14] Linuus: has joined #RubyOnRails
[07:44:34] nyaa: has joined #RubyOnRails
[07:45:33] lvrbrtsn: Hello! I'm pretty new to Rails and to IRC haha
[07:46:12] maz-dev: has joined #RubyOnRails
[07:48:13] ruurd: has joined #RubyOnRails
[07:48:20] jensljungblad: has joined #RubyOnRails
[07:48:41] sevenseacat: lvrbrtsn: welcome :)
[07:49:21] lvrbrtsn: thanks sevenseacat!
[07:49:49] givanse_: has joined #RubyOnRails
[07:49:58] sevenseacat: lvrbrtsn: working on anything interesting right now?
[07:50:58] lvrbrtsn: Professionally no, Im working on the Hartl book. Then Ill do a project of my own.
[07:51:02] lvrbrtsn: How about you?
[07:51:34] sevenseacat: cool, liking the book?
[07:51:50] sevenseacat: I'm just finishing off a basic app for work at the moment, into the final week on it
[07:52:01] christiandsg: has joined #RubyOnRails
[07:52:10] lvrbrtsn: I am loving the book! spent a lot of time learning React lately, only to get really frustrated with JavaScript haha. So Ruby and Ruby on Rails are like a breathe of fresh air.
[07:52:19] sevenseacat: JavaScript will do that to you
[07:53:04] lvrbrtsn: I really enjoyed javascript to learn fundamentals. But I wouldn't want to work in it every day.
[07:53:21] lvrbrtsn: At least not extensively.
[07:53:25] roolo: has joined #RubyOnRails
[07:53:39] sevenseacat: I know just enough JavaScript to write little event handlers for the basic interactivity my apps need, but thats about it
[07:53:43] Macaveli: has joined #RubyOnRails
[07:53:52] sevenseacat: its on my todo list... like always... to learn it better
[07:53:56] bmalum: has joined #RubyOnRails
[07:54:21] kimegede_: has joined #RubyOnRails
[07:54:45] lvrbrtsn: Nice! I know it better than I currently know Ruby, I just can't believe people are so excited about Node and expanding JS to be even more places.
[07:55:42] sevenseacat: http://cube-drone.com/comics/c/relentless-persistence seems relevant <_<
[07:57:06] lvrbrtsn: wow nothing has ever seemed more relevant to how I feel lately haha!
[07:57:18] bmalum: Guy just tried to force the App to not render the application.erb layout with ???render :layout => false??? and ???layout false??? but is still rendered?!
[07:57:36] sevenseacat: bMalum: got some code we can see?
[07:58:17] lvrbrtsn: sevenseacat: do you work at an agency?
[07:58:35] sevenseacat: I sure do, I work here - https://reinteractive.net/
[07:59:24] lvrbrtsn: cool! do you enjoy it?
[07:59:51] sevenseacat: I do :) lots of new challenges
[08:00:11] bmalum: sevenseacat - was a weird caching effect. Thought think about that ^^ Thx
[08:00:12] sevenseacat: nothing like that feeling of 'how the crap do I do that?' *work work work work* 'wow... look at that, I did it!'
[08:00:20] sevenseacat: bMalum: glad we could help :P
[08:00:46] lvrbrtsn: Cool! I really want to work for an agency, but the few people I have asked about it really hated the experience.
[08:01:39] alex88: has joined #RubyOnRails
[08:01:56] sevenseacat: it can depend - sometimes the projects aren't about very interesting things, so there's that aspect of it
[08:02:17] sevenseacat: but you get exposed to lots of different things
[08:02:40] lvrbrtsn: yeah I can see that Im sure ill enjoy it a hell of a lot more than bussing tables! haha
[08:03:16] sevenseacat: michael hartl's tutorial should give you enough of the basics so you have an idea on how to build your own ideas out
[08:03:39] toomus: has joined #RubyOnRails
[08:03:55] sevenseacat: afternoon toomus
[08:04:11] sarink: has joined #RubyOnRails
[08:04:36] lvrbrtsn: I sure hope so! I want to finish it today or tomorrow. And hi toomus!
[08:05:17] krisquigley: has joined #RubyOnRails
[08:05:40] jgt: has joined #RubyOnRails
[08:06:14] lvrbrtsn: where do most people go after being competent at rails? Like once I have a few of my own apps up. Do people freelance, or jump into an entry level agency role?
[08:07:17] jsrn_: has joined #RubyOnRails
[08:07:25] sevenseacat: depends where you want to go, really - I think a lot of people harbor secret dreams of creating a SaaS platform that allows them to retire from the passive income
[08:07:32] xhosae: has joined #RubyOnRails
[08:07:59] sevenseacat: a lot of people go to startups building products, especially if you're in the states I think
[08:08:19] sevenseacat: some of us hang out here all day on IRC in between working and writing
[08:08:44] lvrbrtsn: Those all sound pretty cool to me!
[08:09:39] sevenseacat: oh, the enthusiasm, I love it lol
[08:10:12] quazimodo: has joined #RubyOnRails
[08:11:09] toomus: I have some Ruby question. What is the best solution. I have very long chain of functions in another function, eg. func1.func2.func3.....func99, and I want func99 to be called conditionally, depending on some variable value.
[08:11:34] lvrbrtsn: Haha thanks! I am excited to do this as a job, I just have trouble knowing what that looks like.
[08:11:48] bruno-: has joined #RubyOnRails
[08:11:49] tagrudev: has joined #RubyOnRails
[08:12:58] sevenseacat: a very long chain of functions is a bit of a code smell
[08:13:36] krz: has joined #RubyOnRails
[08:13:38] sevenseacat: but you could just take your last one off the end, store the result of calling func1-98, and then call 99 on the result in a conditional
[08:14:29] nya: has joined #RubyOnRails
[08:15:28] nya: has joined #RubyOnRails
[08:15:36] workmad3: has joined #RubyOnRails
[08:17:05] lvrbrtsn: Are you excited for rails 5?
[08:17:38] sevenseacat: mmm I haven't heard a lot about whats in it, apart from action cable and new turbolinks
[08:17:55] sevenseacat: it will be a busy time for the tutorial/book writers
[08:18:16] ollie314: has joined #RubyOnRails
[08:18:48] doerteDev: has joined #RubyOnRails
[08:18:56] lvrbrtsn: yeah most of its over my head, Im just happy to here people who know more than me seem passionate about it.
[08:19:11] lvrbrtsn: I really dig the rails community.
[08:19:20] sevenseacat: glad to hear it :D
[08:19:25] ruurd: has joined #RubyOnRails
[08:20:13] toomus: sevenseacat: http://pastie.org/10371824
[08:20:50] toomus: sevenseacat: This what I don't want to do
[08:21:07] sevenseacat: http://pastie.org/10371825 thats what I said to do
[08:21:21] annlewis: has joined #RubyOnRails
[08:21:37] sevenseacat: it could probably be made nicer, but yeah
[08:22:57] lvrbrtsn: Do you guys mostly use rails full stack still? or use it to serve API's?
[08:23:29] helpa: We're not all guys here - while you probably don't meant to be exclusive, not everybody feels that way. Maybe consider using "folks", "y'all" or "everyone" instead?
[08:24:17] lvrbrtsn: Super sorry! Silly Western American of me : /
[08:24:37] lvrbrtsn: I appreciate the help correcting that habit.
[08:25:05] sevenseacat: all good :) and I build whatever I get asked to build, really
[08:25:15] sevenseacat: usually typical full-stack rails apps
[08:25:49] koneko: has joined #RubyOnRails
[08:26:00] mutuma: has joined #RubyOnRails
[08:26:13] ruurd: has joined #RubyOnRails
[08:26:16] lvrbrtsn: cool! Thats what I was hoping to hear! The JavaScript community seems to be very local on saying that era is passed but I think thats silly.
[08:28:46] axsuul_: has joined #RubyOnRails
[08:29:08] sevenseacat: it really depends on the requirements of the given app
[08:29:30] sevenseacat: and what the client is willing to pay for ;)
[08:30:47] lvrbrtsn: For sure, and I'm comfortable using React, so its not that I couldn't do either, its just that I don't think its necessary most of the time. And is significantly slower to implement.
[08:30:55] Radar: lvrbrtsn: to answer your question: I'm doing a combination of both at the moment
[08:31:08] Radar: I just finished working on the docs for api.marketplacer.com and I'm currently scoping out how to build out V2.
[08:31:42] lvrbrtsn: Radar: cool! What are you using on the front-end?
[08:32:18] Radar: lvrbrtsn: Combination of React and Angular. Angular is legacy, React is the new shiny.
[08:32:55] lvrbrtsn: You digging react? Also am I doing the name thing right? I just type it at the beginning?
[08:33:30] Radar: lvrbrtsn: !tabcomplete
[08:33:30] helpa: lvrbrtsn: If you type a few letters of another user's name and then press tab, if you have a proper client, it'll autocomplete towards their name. You might have to press tab more than once to get there though.
[08:33:36] iateadonut: has joined #RubyOnRails
[08:33:46] Radar: lvrbrtsn: Yeah, React is way nicer than Angular.
[08:34:13] Radar: I am concerned that we're repeating a lot of AJAX code though and I wish we had some way of making that simpler.
[08:35:01] lvrbrtsn: Radar: Hmm, are you doing a flux implementation? Or using React in and MVC?
[08:35:11] bmalum: has joined #RubyOnRails
[08:35:12] Radar: No Flux, just straight React.
[08:35:49] maz-dev: has joined #RubyOnRails
[08:36:17] redmaverick: has joined #RubyOnRails
[08:36:18] lvrbrtsn: Radar: Flux might solve that problem. I think.
[08:37:29] stardiviner: has joined #RubyOnRails
[08:38:00] charliesome: has joined #RubyOnRails
[08:38:59] skroon: has joined #RubyOnRails
[08:40:01] johnflux: has joined #RubyOnRails
[08:41:24] artto: has joined #RubyOnRails
[08:42:22] Linuus: has joined #RubyOnRails
[08:45:38] charliesome: has joined #RubyOnRails
[08:48:51] jancel: has joined #RubyOnRails
[08:50:45] kitsuneyo: has joined #RubyOnRails
[08:51:15] sinkensabe: has joined #RubyOnRails
[08:51:29] marr: has joined #RubyOnRails
[08:53:08] nya: has joined #RubyOnRails
[08:53:43] errakeshpd: has joined #RubyOnRails
[08:54:29] errakeshpd: shows empty option in active admin selection comobo https://gist.github.com/errakeshpd/3203742e70f83e9d2a0e
[08:55:37] errakeshpd: How can i remove that empty value option
[08:55:51] Grundell: has joined #RubyOnRails
[09:03:08] Linuus: has joined #RubyOnRails
[09:07:48] ur5us: has joined #RubyOnRails
[09:11:45] nya: has joined #RubyOnRails
[09:12:19] errakeshpd: https://gist.github.com/errakeshpd/3203742e70f83e9d2a0e
[09:12:25] chridal: I'm writing some requests spec, but I usually write controller specs, so I have a question
[09:12:25] chridal: In the following link I have written in two "styles", if you will, the first one explicity passes the :user_id param in the URL, the other specifies it as a hash to pass. https://gist.github.com/e92475bc3fdb4bc68531
[09:12:25] chridal: I am used to using the second on (line: 11) when doing controller specs
[09:12:25] chridal: is there a way to use that with request specs as well?
[09:16:17] DoubleMalt: has joined #RubyOnRails
[09:21:05] subshad: has joined #RubyOnRails
[09:21:07] sevenseacat: I didn't think request specs were still a thing.
[09:21:25] michael_mbp: has joined #RubyOnRails
[09:21:50] nya: has joined #RubyOnRails
[09:22:00] universa1: hmm, aren't request specs just an alias to feature specs?
[09:22:08] annlewis: has joined #RubyOnRails
[09:22:31] sevenseacat: they used to be a poor man's feature specs yeah
[09:22:48] nya: has joined #RubyOnRails
[09:22:55] quazimodo: has joined #RubyOnRails
[09:23:02] demonlove: has joined #RubyOnRails
[09:23:17] universa1: ahh, it doesn't even support capybara anymore. so good that i directly went with feature specs
[09:24:09] hardtail: has joined #RubyOnRails
[09:24:24] universa1: chridal: and then: doding get /user, id: 50000 might work.
[09:24:49] universa1: chridal: your show route expects an id parameter, not an user_id parameter.
[09:25:24] universa1: unless you've defined your routes in some weird way ;)
[09:25:38] blnkammo_: has joined #RubyOnRails
[09:25:53] errakeshpd: where to find the email delivery errors from amazon ses.
[09:26:11] universa1: ACTION needs to stop babbling
[09:26:34] universa1: errakeshpd: hmm, check the amazon ses docs?
[09:27:18] universa1: errakeshpd: http://docs.aws.amazon.com/ses/latest/DeveloperGuide/ses-errors.html
[09:27:37] errakeshpd: Let me check.Thanks
[09:27:43] jholm: has joined #RubyOnRails
[09:28:18] pyemkey: anyone have experience with database shared session. I would like to use shared session inside 2 rails apps.
[09:29:51] livathinos: has joined #RubyOnRails
[09:29:58] errakeshpd: Is there any dashboard like sentry is offering ?
[09:29:59] cac: has joined #RubyOnRails
[09:30:42] universa1: context? problem with rails? ... ;)
[09:31:59] errakeshpd: mail is sending but ony one email was not sending. <universa1> Is there any dashboard to check this ?
[09:32:20] universa1: errakeshpd: no clue.
[09:33:32] universa1: never used amazon ses.
[09:34:12] universa1: but from a quick read of what i found on google, i doubt there is, since your app gets direct feedback, so you need to store that feedback and display in some way.
[09:34:45] atzorvas: has joined #RubyOnRails
[09:35:13] Karpah: has joined #RubyOnRails
[09:36:00] Macaveli: has joined #RubyOnRails
[09:38:02] atzorvas: shouldn't that work? https://gist.github.com/atzorvas/e60c2238791d77116028 i want controller/action with collection, but seems to not working and it renders show instead
[09:38:38] yfeldblum: has joined #RubyOnRails
[09:39:01] arup_r: has joined #RubyOnRails
[09:41:32] roolo: has joined #RubyOnRails
[09:44:44] atzorvas: oh my bad, I had defined my resources 2 times
[09:45:04] yfeldblum: has joined #RubyOnRails
[09:47:06] johnflux: I want to have files that belong to a project
[09:47:12] johnflux: so I use the belongs_to relation, right?
[09:47:28] johnflux: I've already created the "fileInfo", and now want to generate the project.
[09:47:46] johnflux: I'm thinking of using the scaffold command to generate the "project"
[09:49:54] lvrbrtsn: has joined #RubyOnRails
[09:52:04] johnflux: I think I want:
[09:53:10] nya: has joined #RubyOnRails
[09:53:24] johnflux: rails generate scaffold Project name:string
[09:53:32] johnflux: and then modify FileInfo
[09:54:15] gambl0re: has joined #RubyOnRails
[09:54:15] frzn: has joined #RubyOnRails
[09:54:39] naftilos76: has joined #RubyOnRails
[09:54:58] lvrbrtsn_: has joined #RubyOnRails
[09:56:14] lvrbrtsn_: IRC is weird haha
[09:56:49] christiandsg: has joined #RubyOnRails
[09:59:30] shilon: has joined #RubyOnRails
[10:00:10] etqqkoiflwhb: has joined #RubyOnRails
[10:00:50] imanzarrabian: has joined #RubyOnRails
[10:01:25] dionysus69: how do I pass an action of a specific controller to the method <li class="<%=is_active('bottles#show')%>"> ? I am changing active <li> tag class by helper
[10:02:43] etqqkoiflwhb: has joined #RubyOnRails
[10:03:08] alex88: has joined #RubyOnRails
[10:03:09] johnflux: rails generate scaffold Project shortname:string longname:string description:text
[10:03:17] johnflux: should I use "shortName" or "short_name" ?
[10:03:57] johnflux: dionysus69: (i'm a newbie but..) shouldn't you use the linkto ?
[10:04:27] johnflux: dionysus69: wait, what, i'm confused what you're trying to do
[10:04:31] dionysus69: johnflux: yes link_to follows li tag :) i just didnt include it here :)
[10:04:44] dionysus69: i am trying to change css class based on passed in action
[10:05:02] johnflux: dionysus69: dunno sorry
[10:05:10] WilfredTheGreat: has joined #RubyOnRails
[10:05:12] dionysus69: johnflux: no problem thanks anyway ))
[10:05:16] johnflux: dionysus69: don't suppose you know that answer to my question? short_name or shortName ?
[10:05:58] dionysus69: johnflux: not sure, I assume both would work, if you are asking which is a better way, then I would go to camelCase since rails uses underscore notation for stuff
[10:06:00] johnflux: ah, underscore
[10:06:10] johnflux: http://stackoverflow.com/questions/514216/where-are-the-docs-for-rails-script-generate-model this says underscore for field names
[10:07:08] dionysus69: i am not familiar with scaffolding so I didnt understand that those were fields of a model
[10:07:12] Gribo: has joined #RubyOnRails
[10:07:16] dionysus69: i guess _ is better in that case )
[10:07:30] johnflux: dionysus69: ah
[10:07:39] dionysus69: i am noob lol
[10:07:48] arup_r: I am confirming my user through email (Devis). Once the user click "confirm my account" from email it is going to the path which I set via method `after_confirmation_path_for`. But if they click on the link second time ... again, it is taking them here https://github.com/plataformatec/devise/blob/master/app/controllers/devise/confirmations_controller.rb#L28
[10:07:52] arup_r: Any idea why so ?
[10:08:18] allcentury: has joined #RubyOnRails
[10:08:37] matcouto: has joined #RubyOnRails
[10:13:32] Cervajz: has joined #RubyOnRails
[10:14:01] workmad3: has joined #RubyOnRails
[10:15:14] Hates_: has joined #RubyOnRails
[10:16:23] matcouto: With Assets Pipeline, if I add a custom.js file to app/assets/javscript folder, require it in application.js file(//= require custom.js), run rake assets:precompile, would I still need to include js in the layout with javascript_include_tag?
[10:18:11] allcentury: has joined #RubyOnRails
[10:18:40] sevenseacat: matcouto: no, it gets included into application.js
[10:18:54] charliesome: has joined #RubyOnRails
[10:20:22] rickmasta: has joined #RubyOnRails
[10:22:03] johnflux_: has joined #RubyOnRails
[10:22:48] ruurd: has joined #RubyOnRails
[10:22:53] annlewis: has joined #RubyOnRails
[10:24:44] matcouto: sevenseacat for some reason it doesn't get included in the partial. not loading at all. I'm also using bower. Could that be a reason? I meant bower and sprocket not working properly together?
[10:24:55] sevenseacat: what partial?
[10:25:02] sevenseacat: I thought we were talking about js
[10:25:12] sevenseacat: I have no idea what bower is/does, so
[10:26:31] johnflux: has joined #RubyOnRails
[10:26:35] matcouto: sevenseacat html partial's just a view where this js was supposed to work. But anyway, I'll play a bit more with it. Thanks
[10:34:57] kitsuneyo: anyone have a pick for the best jumping off point for learning javascript basics that i'll need for jquery, ajax etc? i started reading a guide at w3schools, it seems pretty good but i wonder if there's something better?
[10:37:40] hardtail: good morning
[10:38:11] kitsuneyo: hi Hardtail
[10:40:03] dionysus69: I want to pass both action and controller params to method, how do I do it, like this ? def is_active(controller,action) or something like this ? def is_active(params) ?
[10:40:07] malkovian: has joined #RubyOnRails
[10:42:14] stamina: has joined #RubyOnRails
[10:43:49] kitsuneyo: dionysus69, what does the method do? where are you getting the controller and action params from?
[10:44:25] sevenseacat: ^ good questions
[10:46:06] dionysus69: kitsuneyo: so my goal is this, I want to check - if controller and action coincide, put active class in <li> of UL tag, I want to check controller too because I have 2 actions with same name in 2 different controller and that makes my quest a lil more complicated
[10:47:02] dionysus69: this is what i have so far https://gist.github.com/anonymous/14721f9ab92e7ee0211c
[10:48:57] beauby: has joined #RubyOnRails
[10:49:50] kitsuneyo: the way i've done this kind of thing is to break my checks down into separate methods, then do stuff like "def my_method? params[:controller] == 'my_controller' || params[:action] == 'my_action'"
[10:50:27] charliesome: has joined #RubyOnRails
[10:50:43] kitsuneyo: if that makes any sense
[10:51:04] rodfersou: has joined #RubyOnRails
[10:51:49] robotbrain: has joined #RubyOnRails
[10:51:56] kitsuneyo: dionysus69: does the code in your gist not work?
[10:52:35] x44x45x41x4E: has left #RubyOnRails: ("Away, for now.")
[10:52:57] unreal: has joined #RubyOnRails
[10:53:02] DaniG2k: has joined #RubyOnRails
[10:53:48] FastJack: has joined #RubyOnRails
[10:55:36] johnflux: how can I comment out stuff in html.erb ?
[10:56:10] pcpanic: johnflux: <%# %>
[10:56:25] LBRapid: has joined #RubyOnRails
[10:56:27] universa1: has joined #RubyOnRails
[10:56:28] FooBarWidget: has joined #RubyOnRails
[10:57:05] jeadre: has joined #RubyOnRails
[10:57:50] asi_: has joined #RubyOnRails
[10:58:03] Phoop: has joined #RubyOnRails
[10:58:07] danlucraft: has joined #RubyOnRails
[10:58:09] hellschreiber: has joined #RubyOnRails
[10:58:18] dionysus69: kitsuneyo: i am testing, one second will post back
[10:58:34] leeky: has joined #RubyOnRails
[10:59:29] ELCALOR: has joined #RubyOnRails
[11:00:00] ebryn: has joined #RubyOnRails
[11:00:06] kitsuneyo: dionysus69, one thing i've noticed is that rails doesn't like complex statements about controllers and actions. e.g. (params[:action] == 'new' || 'edit') has not worked for me. i have to split them into separate statements. i'm not sure why this is...
[11:00:22] fluxsource: has joined #RubyOnRails
[11:00:36] Aeyrix: has joined #RubyOnRails
[11:00:43] kitsuneyo: even if i put params[:action] == ('new' || 'edit')
[11:01:06] george2: has joined #RubyOnRails
[11:01:13] bmalum: has joined #RubyOnRails
[11:01:29] dionysus69: kitsuneyo: https://gist.github.com/anonymous/9dcd004536511d01591c this works thanks for the input :) instead of || i needed && since action names can match
[11:01:42] synfinatic: has joined #RubyOnRails
[11:01:53] chridal: has joined #RubyOnRails
[11:01:56] iooner: has joined #RubyOnRails
[11:02:00] alex88: has joined #RubyOnRails
[11:02:00] larissa: has joined #RubyOnRails
[11:02:02] DarkBushido: has joined #RubyOnRails
[11:02:04] epochwolf: has joined #RubyOnRails
[11:02:08] johnflux: kitsuneyo: i don't know of any programming langauge at all that supports such a thing
[11:02:10] cschneid: has joined #RubyOnRails
[11:02:12] yfeldblum: has joined #RubyOnRails
[11:02:18] sfr^: has joined #RubyOnRails
[11:02:23] johnflux: kitsuneyo: you need: params[:action] == 'new' || params[:action] == 'edit'
[11:02:27] kitsuneyo: dionysus69, awesome, glad to be of some small help
[11:02:34] markelite: has joined #RubyOnRails
[11:02:38] lupine: has joined #RubyOnRails
[11:03:37] dionysus69: kitsuneyo: not small, quite some :D
[11:04:09] kitsuneyo: why is that johnflux? it seems logical to me
[11:04:11] Dwarf: has joined #RubyOnRails
[11:04:16] terrellt: has joined #RubyOnRails
[11:04:34] AckZ: has joined #RubyOnRails
[11:04:43] dionysus69: so much fun to do all these stuff in rails instead of js/jquery )
[11:04:54] johnflux: kitsuneyo: because you're doing (params[:action] == 'new') || ('edit')
[11:05:03] johnflux: in the first case.
[11:05:17] kitsuneyo: ok that makes sense but what about the second?
[11:05:34] johnflux: ('new' || 'edit') means true if 'new' is true, or if 'edit' is true
[11:05:48] johnflux: and then params[:action] == true
[11:06:04] johnflux: kitsuneyo: you could do this:
[11:06:05] johnflux: irb(main):006:0> ["hello", "goodbye"].include?"hello"
[11:06:17] johnflux: if your lists of possibilities becomes quite long
[11:06:25] johnflux: otherwise just write it out
[11:06:33] manara314: has joined #RubyOnRails
[11:06:34] skarn: has joined #RubyOnRails
[11:07:59] kitsuneyo: thanks johnflux
[11:09:02] johnflux: I want to add a variable for my navbar. Where can I place it? Specifically:
[11:09:03] johnflux: @projects = Project.all
[11:12:41] artto: has joined #RubyOnRails
[11:13:37] dionysus69: thought i was done lol, two links work, and the third one doesn't become active :\ https://gist.github.com/anonymous/282cfd899f83133ac647 Contact route might be the problem, it doesn't take it as "action" so it goes to nil because of something???
[11:15:56] jholm: has joined #RubyOnRails
[11:16:30] malkovian: johnflux: I would add before_action to controller you use or even to application_controller
[11:19:06] ruurd: has joined #RubyOnRails
[11:19:46] dionysus69: noticed my error nvm
[11:23:42] annlewis: has joined #RubyOnRails
[11:24:35] bruno-: has joined #RubyOnRails
[11:24:38] doodlehaus: has joined #RubyOnRails
[11:29:04] Linuus: has joined #RubyOnRails
[11:29:44] roolo: has joined #RubyOnRails
[11:33:53] fgo: has joined #RubyOnRails
[11:35:28] rustymyers: has joined #RubyOnRails
[11:35:30] amon777: has joined #RubyOnRails
[11:37:29] cac: has joined #RubyOnRails
[11:37:42] amon777: deleting a navigation item in production mode, i get a 500 error page....in development mode it works. Looking the log file, i see parameter before the error ... an authenticity token that probably fails..any idea?
[11:38:24] errakeshpd: how to skip " before_save " when trying to update a column data using rake task ? , (when calling f.save ) ?
[11:39:03] amon777: so, after the 500 error page, the item is not deleted at all...
[11:39:34] ldnunes: has joined #RubyOnRails
[11:39:50] ruurd: has joined #RubyOnRails
[11:43:00] kitsuneyo: has joined #RubyOnRails
[11:46:33] Cervajz: has joined #RubyOnRails
[11:48:17] jholm: has joined #RubyOnRails
[11:49:52] Cervajz: has joined #RubyOnRails
[11:50:17] beauby: has joined #RubyOnRails
[11:53:13] redmaverick: I have 3 tables. stores, books and book_store_relationships
[11:53:35] redmaverick: I can get all the books in any store
[11:53:46] rvanlieshout: Book.joins(:store).uniq.all
[11:54:11] Grundell: has joined #RubyOnRails
[11:54:14] redmaverick: I know.. but I want to improve performance. So I am going to add store_id to books table
[11:54:48] rvanlieshout: is this n-n or n-1?
[11:54:54] redmaverick: then I can do Book.where(store_id: store_id1)
[11:55:04] redmaverick: 1 store has many books
[11:55:14] rvanlieshout: then why do you have a book_store_relationshipts table?
[11:55:21] rvanlieshout: Book.joins(:store).where(stores: { id: 1 })
[11:56:38] rvanlieshout: and if it's book belongs_to store and store has_many books, then you need a store_id on books
[11:57:46] christiandsg: has joined #RubyOnRails
[11:58:40] Kallis: has joined #RubyOnRails
[11:59:56] johnflux: has joined #RubyOnRails
[12:01:58] doodlehaus: has joined #RubyOnRails
[12:02:26] redmaverick: I have a has_many :stores, through: :book_stores_relationship on Book as well..
[12:02:31] dionysus69: i put logo.png in assets/images and my img tag isnt loading it :\ what url should i specify other than <img src="logo.png"> ? i also have background cover in asset pipeline and it displays correctly and it is same directory
[12:02:55] rvanlieshout: redmaverick: it's one of both,
[12:02:55] Creeves: has joined #RubyOnRails
[12:02:57] Hates_: dionysus69: you should be using the rails helper image_tag
[12:02:58] rvanlieshout: it's either 1-n or n-n
[12:03:20] dionysus69: Hates_: thanks :) new to this xD
[12:03:22] rvanlieshout: so it's either has_many and belongs to, or 2x has_many + 2x has_many thrugh, or 2x has_and_belongs_to_many
[12:03:40] redmaverick: its n-n.. 1 book belongs to many stores and 1 store has many books
[12:03:49] Hates_: dionysus69: see section 3.1.4 http://guides.rubyonrails.org/layouts_and_rendering.html#asset-tag-helpers
[12:04:13] rvanlieshout: redmaverick: ok. so then it could be has_and_belongs_to_many or what you (might) have now
[12:04:27] rvanlieshout: redmaverick: then the Book.joins(:store).where(stores: { id: 123 }) is the way to go
[12:04:35] rvanlieshout: did you add indexes on your foreign keys?
[12:05:34] redmaverick: no.. I did not add.. have to add them
[12:06:05] redmaverick: then it will improve the performance of finding all the books in a particular store right..
[12:06:08] lxsameer_: has joined #RubyOnRails
[12:06:12] rvanlieshout: it's kinda crucial in having proper indexes
[12:06:25] rvanlieshout: assuming you have your scheme in a sane way
[12:07:23] imanzarrabian: has joined #RubyOnRails
[12:07:58] redmaverick: ok.. got it! thanks
[12:08:00] apeiros: sharing an aasm over multiple models the brute style: SharedAasm = proc { include AASM; ???aasm declaration??? }; class_eval(SharedAasm) :D
[12:08:06] apeiros: ACTION now wonders whether there's a nicer way
[12:09:07] redmaverick: rvanlieshout: is there any good book just on RoR database design, with real world examples
[12:09:19] rvanlieshout: it's not only ror database design
[12:09:23] rvanlieshout: it's just database design
[12:09:45] michael_mbp: high performance MySql is an interesting read
[12:10:05] michael_mbp: looking at a performance postgres book too, need to order it
[12:10:20] redmaverick: I would love for a book to exist where they say.. run this migration etc
[12:10:22] voker57: has joined #RubyOnRails
[12:10:23] rvanlieshout: it's also in basics not related to either postgres or mysql
[12:10:34] rvanlieshout: and it's not something you can recap in run this migration
[12:10:44] rvanlieshout: it's just how things relate and what a db needs to do to get the data
[12:10:48] michael_mbp: redmaverick: pick a generic RDBMS book to start
[12:10:59] michael_mbp: migrations are just abstractions around those basics.
[12:11:02] rvanlieshout: and what the impact would be using different methods in querying for data
[12:11:11] rvanlieshout: like using .joins over .includes (or in sql terms using inner join over left join)
[12:11:33] michael_mbp: as rvanlieshout said, the AR ORM makes abstractions on queries etc.
[12:11:50] Kallis: has joined #RubyOnRails
[12:12:26] amon777: i get a 500 error page when i try to delete a navigation item...any idea what it may cause that? It works on Development....but not in production
[12:12:41] michael_mbp: check production log
[12:12:46] amon777: i've already done
[12:12:47] michael_mbp: for stack trace.
[12:12:51] rvanlieshout: amon777: what is a navigation item?
[12:13:00] bruno-: has joined #RubyOnRails
[12:13:02] Kallis: has joined #RubyOnRails
[12:13:23] michael_mbp: is your local DB a clone of the latest production DB?
[12:13:45] amon777: michael_mbp: after the DELETE in production log, it says Parameters: authenticity_token...id (item id) and the next line is the 500 error
[12:14:10] futilegames: has joined #RubyOnRails
[12:14:24] amon777: rvanlieshout: an item, at the website navigation, to our back-end
[12:15:09] amon777: a menu / navigation item
[12:15:13] michael_mbp: I'd suggest adding the exception notifier - it emails traces etc
[12:15:15] rvanlieshout: you get a 500 internal server error with a stacktrace
[12:15:20] helpa: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[12:15:25] michael_mbp: amon777: are those "items" instances of AR?
[12:15:52] bbrowning: has joined #RubyOnRails
[12:15:55] michael_mbp: if so, if your code is poorly guarded, missing data will trip exceptions.
[12:17:08] amon777: michael_mbp: https://gist.github.com/glouk7/e3eea225b84e7035b408
[12:17:24] amon777: michael_mbp: i've added also some lines before and after the error
[12:17:29] krz: has joined #RubyOnRails
[12:18:27] amon777: michael_mbp: instances of "AR" ? AR = ?
[12:19:37] rvanlieshout: there is no error in there
[12:20:04] rvanlieshout: amon777: add your controller
[12:20:11] pyemkey_: has joined #RubyOnRails
[12:21:15] amon777: rvanlieshout: I've added it
[12:21:35] skroon: is there a way in the console to measure roughly the performance of my rails env, or perhaps setup just a small test suite and measure it's speed? I want to test the rails bootup, and page rendering times etc
[12:21:47] rvanlieshout: amon777: and what if you disable that exception notifier?
[12:22:42] amon777: rvanlieshout: I am not sure how to disable that...
[12:22:49] jancel: has joined #RubyOnRails
[12:22:49] rvanlieshout: how did you enable it?
[12:22:55] rvanlieshout: and where are those exceptions notified to?
[12:23:13] amon777: rvanlieshout: I didn't enable it...because i didn't build the website
[12:23:32] rvanlieshout: somebody is getting proper error notifications then i guess
[12:23:35] amon777: rvanlieshout: It should notify me, but i've never received any notification...never worked as it should the exception notifier
[12:24:09] rvanlieshout: then disable it :) read the gem's documentation
[12:24:26] annlewis: has joined #RubyOnRails
[12:25:02] amon777: rvanlieshout: i'll give it a try, let's see
[12:25:09] jancel_: has joined #RubyOnRails
[12:25:23] dEPy: has joined #RubyOnRails
[12:25:32] cha1tanya: has joined #RubyOnRails
[12:27:09] erich: has joined #RubyOnRails
[12:28:28] amon777: rvanlieshout: So i have only to delete the exception notifier lines in environments/production.rb, right?
[12:28:49] dionysus69: is following practice possible or good practice in rails app? in order to avoid too many requests to a db and make app faster, is it possible to load whole db(given that db isnt that large) in a data structure per session and serve it from there?
[12:28:59] rvanlieshout: amon777: could be he case
[12:29:16] rvanlieshout: dionysus69: less db calls isn't faster per see
[12:29:45] northfurr: has joined #RubyOnRails
[12:29:57] dionysus69: rvanlieshout: meaning ? :S what i said wouldn't make that much difference is that what you mean?
[12:30:59] rvanlieshout: that loading the full db in a session isn't going to make everything fast per se
[12:31:19] rvanlieshout: and the amount of requets to a db doesn't say anything about the speed impact they have
[12:31:54] dionysus69: hmm ok thanks, it was just my theory, now I know thanks :D
[12:31:59] northfurr_: has joined #RubyOnRails
[12:32:26] IrishGringo: has joined #RubyOnRails
[12:33:52] amon777: rvanlieshout: hmmm..i disabled it..and i went one step further..
[12:33:56] koneko: has joined #RubyOnRails
[12:36:23] naftilos76: has joined #RubyOnRails
[12:38:22] livathinos: has joined #RubyOnRails
[12:39:22] AzaToth_: has joined #RubyOnRails
[12:41:37] jancel: has joined #RubyOnRails
[12:41:59] amon777: rvanlieshout: at least, after 2 years i fixed the excemption notifier...it notifies me now
[12:42:08] amon777: rvanlieshout: the error has to do with beanstalkd, i am checking now
[12:44:57] NBarnes: has joined #RubyOnRails
[12:46:53] emba: has joined #RubyOnRails
[12:49:13] amon777: rvanlieshout: hmm beanstalk confirmed to be running...but i still get error"A Beanstalk::NotConnected occurred in navigation_items#destroy"
[12:49:59] jkamenik: has joined #RubyOnRails
[12:50:05] nickenchuggets: has joined #RubyOnRails
[12:50:27] pcpanic: Hello peoples - Anyone knows how to add a root node using rabl ?
[12:50:49] pcpanic: Right now, any node i add is being added to each child
[12:51:02] beauby: has joined #RubyOnRails
[12:51:12] emba: has left #RubyOnRails: ()
[12:51:19] emba: has joined #RubyOnRails
[12:51:57] amon777: rvanlieshout: I just found out, that when i click to delete the item, the beanstalkd is stopping...and at beanstalkd log, i see a connection error
[12:52:11] n1lo: has joined #RubyOnRails
[12:55:11] northfurr_: has joined #RubyOnRails
[12:56:42] victortyau: has joined #RubyOnRails
[12:56:57] mary5030: has joined #RubyOnRails
[12:58:01] float12129: has joined #RubyOnRails
[12:58:50] Encapsulation: has joined #RubyOnRails
[12:59:06] manara314: has left #RubyOnRails: ()
[13:00:23] joshkovach: has joined #RubyOnRails
[13:00:59] mary5030: has joined #RubyOnRails
[13:01:01] Detch: has joined #RubyOnRails
[13:01:27] dhjondoh: has joined #RubyOnRails
[13:05:55] Linuus: has joined #RubyOnRails
[13:06:18] bmalum: has joined #RubyOnRails
[13:06:32] jkamenik: has joined #RubyOnRails
[13:07:52] poli: has joined #RubyOnRails
[13:09:28] dionysus69: I am getting image undefined error, it works as expected in show action but not in the index action :\ what am I missing? i am permitting image in the params method
[13:09:38] dionysus69: i am using paperclip
[13:11:23] rvanlieshout: you shouldn't have to permit attributes for that
[13:11:30] rvanlieshout: start with gisting the full error and code
[13:11:42] pcpanic: dionysus69: I have no gist to look at, but that happens to me if there is a record in the model that has a blank attribute
[13:12:20] pyemkey: has joined #RubyOnRails
[13:12:21] dionysus69: rvanlieshout: https://gist.github.com/anonymous/d51bf0efb03611ac4d65
[13:12:24] pyemkey: I have a problem with sharing session between 2 rails apps. One of them use rails 4.0.3 and second 4.2. Both stores session in database. When I check inside chrome developer tools, there is the same session. Problem is when I try to submit form from one app to another. I'm getting authenticity_token error. CSRF-Token is different on both page. This is how my configuration looks https://gist.github.com/pyemkey/a284c38acb
[13:12:56] pcpanic: dionysus69: do all @bottles have an :image ?
[13:13:02] dionysus69: pcpanic: yes
[13:13:18] dionysus69: i mean not the ones I actually uploaded
[13:13:24] IrishGringo: has joined #RubyOnRails
[13:13:28] rvanlieshout: dionysus69: you don't have a @bottle
[13:13:31] rvanlieshout: @bottle != bottle
[13:13:36] dionysus69: damn it thanks, so how do I make an exception handler, if one bottle doesnt have it just skip img tag
[13:13:57] dionysus69: rvanlieshout: damn it that too :D
[13:14:04] dionysus69: facepalm, thx
[13:14:30] dionysus69: ohh and exception handler is included, the ones that dont have img, says missing
[13:15:03] Cervajz: has joined #RubyOnRails
[13:15:57] pcpanic: dionysus69: what I would do is set a default with a dummy image
[13:15:59] havenwood: has joined #RubyOnRails
[13:16:35] pcpanic: dionysus69: because i am assuming that eventually all bottles will have images
[13:16:38] amon777: rvanlieshout: huge headache mate...:/
[13:17:44] dstarh: has joined #RubyOnRails
[13:17:50] roolo: has joined #RubyOnRails
[13:18:42] doodlehaus: has joined #RubyOnRails
[13:18:44] amon777: rvanlieshout: any other idea? :)
[13:19:03] AnoHito: has joined #RubyOnRails
[13:19:17] dionysus69: pcpanic: yes, paperclip guide shows me the default image path, but where is this ? what is :style in this case?
[13:19:17] dionysus69: default_url: "/images/:style/missing.png"
[13:19:45] sankaber: has joined #RubyOnRails
[13:21:10] pcpanic: dionysus69: http://stackoverflow.com/questions/4253908/rails-missing-image
[13:21:41] atomical: has joined #RubyOnRails
[13:22:10] crdpink2: has joined #RubyOnRails
[13:22:22] allcentury: has joined #RubyOnRails
[13:22:38] dionysus69: pcpanic: one more question, where does it save uploaded images? its not in assets/images? even though when I open the image in browser the url shows assets/images/bla/bla/bla.png
[13:23:34] rvanlieshout: most likeley in public
[13:23:45] pcpanic: dionysus69: indeed, in the public/system
[13:23:53] IrishGringo: has joined #RubyOnRails
[13:24:14] pcpanic: dionysus69: https://github.com/thoughtbot/paperclip#understanding-storage
[13:24:32] dionysus69: thanks rvanlieshout pcpanic found it )) i am in rails public dir first time so :D
[13:24:47] pcpanic: dionysus69: cheers!
[13:24:57] float12129: has joined #RubyOnRails
[13:25:14] annlewis: has joined #RubyOnRails
[13:25:21] JoshL: has joined #RubyOnRails
[13:27:51] maz-dev: has joined #RubyOnRails
[13:29:09] Guest46991: has joined #RubyOnRails
[13:29:22] urkle: has joined #RubyOnRails
[13:30:05] shilon: has joined #RubyOnRails
[13:30:11] iooner: has joined #RubyOnRails
[13:30:51] lord4163: has joined #RubyOnRails
[13:31:13] subshad: has left #RubyOnRails: ()
[13:31:48] bmalum: has joined #RubyOnRails
[13:32:15] jhack: has joined #RubyOnRails
[13:32:19] george2_: has joined #RubyOnRails
[13:32:26] maz-dev: has joined #RubyOnRails
[13:33:14] Shidash: has joined #RubyOnRails
[13:35:12] Polysics: has joined #RubyOnRails
[13:35:26] Polysics: any Prawn users around?
[13:35:34] ckinniburgh: has joined #RubyOnRails
[13:35:42] Polysics: I have this font I am using on the website that looks like it has a coupel glyphs I need
[13:35:57] Polysics: but they show as ? in the generated PDFs
[13:36:08] Polysics: does the browser do some kind of fallback?
[13:37:01] fluxsource: has joined #RubyOnRails
[13:37:19] LateralOctober: has joined #RubyOnRails
[13:37:20] lupine: has joined #RubyOnRails
[13:37:41] rvanlieshout: pdf is generated by what?
[13:38:07] Polysics: ha sorry :D the prawn library
[13:38:29] rvanlieshout: then you might need to find out if prawn supports using glyphs
[13:38:45] Polysics: in theory it should, but there is not much in the docs
[13:39:03] Polysics: "For Unicode to work you need to load a TTF font that has the characters you require."
[13:39:09] Polysics: but my charset does have it
[13:39:38] rvanlieshout: your charset = the font embedded in the pdf?
[13:40:20] quazimodo: has joined #RubyOnRails
[13:40:22] Polysics: yes, I load the font in the PDF
[13:40:36] Polysics: I'll go doublecheck
[13:40:38] greengriminal: has joined #RubyOnRails
[13:41:40] doodlehaus: has joined #RubyOnRails
[13:42:28] quazimodo: has joined #RubyOnRails
[13:43:24] arup_r: has joined #RubyOnRails
[13:44:39] arup_r1: has joined #RubyOnRails
[13:44:40] johnflux: has joined #RubyOnRails
[13:44:46] johnflux: I just rebooted and now I get:
[13:44:47] johnflux: Connection refused -
[13:44:53] johnflux: Errno::ECONNREFUSED in FileInfosController#index
[13:44:53] Crashtown: has joined #RubyOnRails
[13:45:06] johnflux: (I'm using the default sqllite)
[13:45:14] Hates_: has joined #RubyOnRails
[13:45:35] johnflux: oh, it might be because of solr
[13:45:35] dionysus69: pcpanic: I have problems with setting default image :\ I put it at public/bottle/image/normal/missing.png and I also set: default_url: "/images/normal/missing.png" I dont get whats missing, I tried all options, I put missing img at the assets dir, didnt work either
[13:45:53] Polysics: rvanlieshout: ok, no, I was wrong- Avenir does not have those gliphs according to the Mac charmap
[13:46:04] Polysics: then I guess the browser somehow falls back to something else?
[13:46:39] bmalum: has joined #RubyOnRails
[13:46:52] rvanlieshout: the browser doesn't do anything with a pdf
[13:46:53] t4nkD: has joined #RubyOnRails
[13:47:01] rvanlieshout: what is avenir?
[13:47:02] bruno-: has joined #RubyOnRails
[13:47:07] rvanlieshout: and the font should be _in_ the pdf
[13:47:16] gerep: has joined #RubyOnRails
[13:47:48] johnflux: it's optional whether a pdf embeds the font or not
[13:47:56] Polysics: Avenir is the font, the browser does display the gliphs in text styled with that font
[13:48:27] gerep: Can someone please help me improve this loop? https://gist.github.com/gerep/48d980bf4fd0829712e6 It is has > 100k records and its taking too long
[13:48:51] rvanlieshout: gerep: if it's > 100k records it's never going to be fast
[13:48:57] rvanlieshout: you could try find_in_batches
[13:49:07] rvanlieshout: but move it to the background
[13:49:11] gerep: rvanlieshout, even using SQL instead?
[13:49:17] gerep: rvanlieshout, ok, thanks
[13:49:53] w0bni: has joined #RubyOnRails
[13:50:20] gerep: rvanlieshout, The problem is that for each record, AR has to make it an object for me to use its properties like: lic.serial, I can't find a way of doing that with SQL
[13:50:29] gerep: instead of just Rail's AR
[13:50:34] doodlehaus: has joined #RubyOnRails
[13:50:36] kimegede: has joined #RubyOnRails
[13:50:39] Linuus: has joined #RubyOnRails
[13:51:12] rvanlieshout: License.joins(company: :user).where(users: {id: user.id }).uniq.pluck('licenses.serial, licenses.license')
[13:51:49] rvanlieshout: and even using sql it's not going to be really fast
[13:52:08] beauby: has joined #RubyOnRails
[13:52:21] gerep: rvanlieshout, thanks a lot for your help :D I'll try something like that
[13:52:43] fmcgeough: has joined #RubyOnRails
[13:52:49] Crashtown: Hello, guys, I try to extract where condition from active records relation chain, but one scope return equality predication with placeholder $1, maybe you know how to extract actual value from active record relation ast? Now this works like: Sale.published.values[:where].reduce(:and).to_sql # => "\"sales\".\"status\" = $1", I realy want to insert real value in this where clause and pass ast to query builder
[13:53:14] HalcyonicStorm: has joined #RubyOnRails
[13:53:37] darrencauthon: has joined #RubyOnRails
[13:54:37] Zort0n: has joined #RubyOnRails
[13:56:38] Creeves: has joined #RubyOnRails
[13:56:47] elves: has joined #RubyOnRails
[13:57:37] devdazed: has joined #RubyOnRails
[13:58:48] elv: has joined #RubyOnRails
[14:00:32] christiandsg: has joined #RubyOnRails
[14:01:05] redmaverick: has left #RubyOnRails: ()
[14:01:38] ingusmat: has joined #RubyOnRails
[14:01:55] jgpawletko: has joined #RubyOnRails
[14:01:58] idd2d: has joined #RubyOnRails
[14:02:11] zly: has joined #RubyOnRails
[14:02:34] jhack: has joined #RubyOnRails
[14:04:38] new2rails: has joined #RubyOnRails
[14:05:15] Crashtown: I found that this feature is called "prepared statements", I'll dive in this direction :)
[14:05:32] annlewis: has joined #RubyOnRails
[14:05:45] JEEB: I will have to re-ask my question regarding applications that serve a subdirectory
[14:05:49] JEEB: http://stackoverflow.com/a/27299902
[14:05:59] JEEB: if you have to make the change in config.ru like this
[14:06:07] Olipro: has joined #RubyOnRails
[14:06:17] JEEB: does it mean that your application is written badly and it's supposed to work by just setting the relative root?
[14:07:02] nomzz: has joined #RubyOnRails
[14:07:14] codepete: has joined #RubyOnRails
[14:10:07] cajone: has left #RubyOnRails: ()
[14:11:12] banjara: has joined #RubyOnRails
[14:11:49] dopamean_: has joined #RubyOnRails
[14:12:39] lord4163_: has joined #RubyOnRails
[14:13:01] errakeshpd: how to perform a " user.save" with out any filters and validations ?
[14:15:06] jamiely: has joined #RubyOnRails
[14:15:13] emba: has joined #RubyOnRails
[14:16:27] sarink: has joined #RubyOnRails
[14:17:10] mhib: has joined #RubyOnRails
[14:18:35] i: has joined #RubyOnRails
[14:20:35] momomomomo: has joined #RubyOnRails
[14:20:55] cajone: has joined #RubyOnRails
[14:22:05] pcpanic: errakeshpd: if you havent set ant validations (on both the db and model) then there are none
[14:22:17] dojobo: has joined #RubyOnRails
[14:22:50] pcpanic: errakeshpd: as far as i know... if you have an error or gist, that might clarify your question
[14:23:21] j_mcnally: has joined #RubyOnRails
[14:23:37] errakeshpd: trying to update a column using rake task for a User table have 10000 of records. its have lotsof validation and before_filter after_create .....etc when running rake task field updation no need to check that
[14:24:24] umgrosscol: has joined #RubyOnRails
[14:25:04] pcpanic: errakeshpd: hmmmmmmmm, thats above my pay grade :) maybe just sql insert directly if just inserting records?
[14:26:47] quazimodo: has joined #RubyOnRails
[14:27:59] grotewold: has joined #RubyOnRails
[14:28:17] beauby: has joined #RubyOnRails
[14:30:25] hashrocket: has joined #RubyOnRails
[14:30:38] atomical: has joined #RubyOnRails
[14:30:54] bmalum: has joined #RubyOnRails
[14:33:22] quazimodo: has joined #RubyOnRails
[14:33:31] nertzy: has joined #RubyOnRails
[14:33:31] dionysus69: hey guys i have an idea for a website anyone care to hear it ?
[14:33:43] feezy: has joined #RubyOnRails
[14:34:05] NBarnes: has joined #RubyOnRails
[14:34:49] tonios57: has joined #RubyOnRails
[14:35:39] mloy: has joined #RubyOnRails
[14:35:49] lampd1: has joined #RubyOnRails
[14:37:24] Macaveli: has joined #RubyOnRails
[14:37:39] kitsuneyo: has joined #RubyOnRails
[14:39:04] ducklobster: has joined #RubyOnRails
[14:42:07] kies^: has joined #RubyOnRails
[14:42:32] nbor: has joined #RubyOnRails
[14:42:48] Vagnerlandio: has joined #RubyOnRails
[14:43:05] abuzze: has joined #RubyOnRails
[14:44:23] ngscheurich: has joined #RubyOnRails
[14:44:25] futilegames: has joined #RubyOnRails
[14:47:47] bruno-: has joined #RubyOnRails
[14:50:16] disgrntld: has joined #RubyOnRails
[14:50:39] mloy: Has anybody here run into pitfalls while using Hashes as multi-dimensional Arrays in Ruby?
[14:50:54] sevenseacat: dionysus69: !guys
[14:50:54] helpa: dionysus69: We're not all guys here - while you probably don't meant to be exclusive, not everybody feels that way. Maybe consider using "folks", "y'all" or "everyone" instead?
[14:51:02] bmalum: has joined #RubyOnRails
[14:51:18] dionysus69: sevenseacat: sorry missed that one this time :D so do you care ? :P
[14:51:29] sevenseacat: not particularly.
[14:52:51] lord4163: has joined #RubyOnRails
[14:52:53] momomomomo: has joined #RubyOnRails
[14:53:58] kb3ien: has joined #RubyOnRails
[14:54:35] Draggor: has joined #RubyOnRails
[14:54:38] sudiptamondal: has joined #RubyOnRails
[14:54:39] Draggor: Anyone know where I can look for help with the gollum/omniauth/omnigollum projects?
[14:55:20] ecnalyr: has joined #RubyOnRails
[14:55:28] kb3ien: I've an app with two controllers `bundle exec rake routes` tells me that I have this route defined : "short_view_catalog GET /catalog/:id/short(.:format) catalog#short_view" but when I go to a URI that matches that I see that the controller 'articles' is getting processed not catalog. How should I procede to debug this?
[14:56:41] abuzze: has joined #RubyOnRails
[14:56:56] sevenseacat: kb3ien: show us the logs from that request
[14:57:14] Papierkorb: kb3ien: what is a URI "that matches"? Are you sure that you don't have a matcher above that one which matches the URI? And what sevenseacat says
[14:57:40] kb3ien: http://styled.troika.www6.databit7.com/catalog/ocn436221158/short matches
[14:57:54] gerep: has joined #RubyOnRails
[14:57:57] sevenseacat: !gist the logs please
[14:57:57] helpa: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[14:58:48] momomomomo: has joined #RubyOnRails
[14:59:14] kb3ien: http://pastebin.ca/3126486 you tell me. I dont see it.
[14:59:23] ecnalyr: I've got a method that feels smelly due to the numerous conditionals, I feel I can clean it up by mapping but I'm not 'clicking' this morning - thoughts? https://gist.github.com/ecnalyr/8ff0a7cc8b18e16c3b2a
[14:59:40] ckinniburgh_: has joined #RubyOnRails
[14:59:59] lindii_: has joined #RubyOnRails
[15:00:01] sevenseacat: if you cant follow instructions, I tell you nothing
[15:00:15] dopamean1: has joined #RubyOnRails
[15:00:56] mloy: kb3ien, the third rule of this channel is to use Gist or Pastie to show code http://goo.gl/dgSj5
[15:00:59] kb3ien: the logs : https://gist.github.com/kb3ien/14fc8efc47d9da0f5f98
[15:01:35] sevenseacat: its not rendering the articles controller
[15:01:39] kb3ien: I did paste the logs, and I hate to paste more than 1 line into channel.
[15:01:51] sevenseacat: its rendering CatalogController#short_view which is exactly what your route says
[15:02:05] j_mcnally: has joined #RubyOnRails
[15:02:11] Papierkorb: ecnalyr: "pyramid of doom" for one (You could e.g. move the if-bodies into its own method). Also for line 10, you can use place_preferences = current_user.roles.select{...}.map(&:place_preference)
[15:02:36] sevenseacat: kb3ien: where are you getting articles controller from?
[15:02:37] Papierkorb: ecnalyr: That's using Enumerable#select to 'filter' the entries and #map to turn the array into something else
[15:02:40] kb3ien: Its trying to, but the code its running beforehand is from the ArticlesController, which confuses me no end.
[15:02:54] sevenseacat: kb3ien: https://gist.github.com/kb3ien/14fc8efc47d9da0f5f98#file-gistfile1-txt-L16-L17 where>
[15:02:57] ecnalyr: Papierkorb nice
[15:03:07] yashinbasement: has joined #RubyOnRails
[15:03:10] chouhoulis: has joined #RubyOnRails
[15:03:20] tubbo: kb3ien: seems like it's coming from a helper method
[15:03:35] yashinbasement: Hi what's the problem in the line
[15:03:45] yashinbasement: %li={:class => "btn btn-default btn-lg" , :id => "resume"} link_to "Resume", home_resume
[15:04:01] sevenseacat: yashinbasement: its a syntax error
[15:04:24] Gribo: has joined #RubyOnRails
[15:04:26] kb3ien: how do I find the source of it's being told to use articles ?
[15:04:28] sevenseacat: check the haml docs
[15:04:33] yashinbasement: yeah I don't know how to fix it, I try to find haml systax
[15:04:37] sevenseacat: kb3ien: where are you pulling articles from??
[15:04:52] sevenseacat: theres no reference to articles anywhere
[15:04:53] Papierkorb: yashinbasement: the = must go after the {}, also see how to properly set CSS classes on tags with HAML, it has a special and much better syntax for it
[15:05:00] Grundell: has joined #RubyOnRails
[15:05:09] kb3ien: articles controller is installed thusly : https://github.com/ebsco/blacklight_with_eds
[15:05:26] sevenseacat: kb3ien: no, in that error message
[15:05:29] tubbo: yeah that could easily be = link_to
[15:05:42] sevenseacat: you're insisting its rendering articles but theres no mention there
[15:05:44] Papierkorb: yashinbasement: oh, and another special syntax for setting the id too. There's no need for you to have {} at all in that line
[15:05:45] tubbo: err, .btn.btn-default.btn-large= link_to ...
[15:05:56] kb3ien: Oh, why do i think its calling articles controller?
[15:05:59] roolo: has joined #RubyOnRails
[15:06:06] tubbo: kb3ien: i don't know man
[15:06:26] tubbo: that's just like, your opinion
[15:07:43] tubbo: you might've just been confused because the method defined in Blacklight::BlacklightHelperBehavior was being called from somewhere outside the ArticlesController, where you have done include Blacklight::Catalog
[15:08:09] naftilos76: Hi, i was wondering if i could render multiple js templates from the first js template after an ajax call.
[15:08:16] kb3ien: might be.
[15:08:37] yashinbasement: doing this %li :class => "btn btn-default btn-lg" , :id => "resume" =link_to "Resume", home_resume, prints html
[15:08:50] Papierkorb: yashinbasement: are you even reading the HAML docs?
[15:08:52] IceyEC: has joined #RubyOnRails
[15:08:55] kb3ien: Look at the session dump. It's NOT a solr query. its an eds (articles) query.
[15:09:14] sevenseacat: kb3ien: what?
[15:09:48] rubyonrails616: has joined #RubyOnRails
[15:10:08] sevenseacat: kb3ien: the error is coming from line 180 of your blacklight behaviour helper
[15:10:15] sevenseacat: nothing to do with articles or sessions or solr
[15:10:29] kb3ien: The reason I think that that I'm executing code from the Articles controller, is that http://styled.troika.www6.databit7.com/catalog/ocn436221158/short shows a session dump. That dump isn't consistant with the query generated by the catalog controller.
[15:10:53] sevenseacat: !gist for the third time
[15:10:53] helpa: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[15:11:02] sevenseacat: you are trying my patience
[15:11:11] vladstoick: has joined #RubyOnRails
[15:11:56] kies: has joined #RubyOnRails
[15:12:01] tubbo: kb3ien: regardless of what you may think, rails is literally giving you a line number and a line to look at first. you need to figure out why you're not getting the data you need to use that method, otherwise stop using it.
[15:12:12] tubbo: kb3ien: so you really need to start there, at the behavior helper
[15:13:25] yashinbasement: :papierkorb can't find docs , there are only few syntax in the doc
[15:13:44] tubbo: kb3ien: where's your short_view route coming from? don't see it in the app at all
[15:13:47] Papierkorb: yashinbasement: https://www.google.de/search?q=haml+docs it's literally the first hit with google.
[15:13:50] EminenceHC: has joined #RubyOnRails
[15:13:53] sevenseacat: yashinbasement: http://haml.info/docs/yardoc/file.REFERENCE.html enjoy.
[15:14:18] yashinbasement: ahh okay thanks
[15:14:46] juanpaucar: has joined #RubyOnRails
[15:14:49] sevenseacat: I'm not sure if you even looked, but i'll give you the benefit of the doubt.
[15:14:50] kb3ien: https://gist.github.com/kb3ien/956c3bd4a29b1601871f that whol thingk only comes from the ArticlesController.
[15:15:17] sevenseacat: kb3ien: what exactly does that have to do with your error?
[15:15:27] kb3ien: No as Guest? That an articles Controller thing; ebscohost? that's an articles issue.
[15:16:32] kb3ien: The issue is that the articles controller is being called when I don't want it to be, and i'm unable to display the data from the catalog object, because; as best I can tell, ruby didn't load it.
[15:16:44] sevenseacat: the issue is thats on the page thats rendering *before* the one that generates the error
[15:17:03] kb3ien: (them) not it.
[15:17:06] kb3ien: Them the data.
[15:17:11] sevenseacat: check the current_url in that output
[15:17:15] sevenseacat: therefore, completely irrelevant to your error
[15:17:52] kb3ien: DOH ! What is that doing there?
[15:17:59] sevenseacat: the other issue is that you're making a boatload of assumptions and not listening to those of us trying to correct them
[15:18:23] sevenseacat: but it has nothing to do with the error at hand.
[15:19:27] leehambley: has joined #RubyOnRails
[15:19:49] kb3ien: Well then, the source of that URI (not url by the way by that rails' bug) changed, by how could that happen. That's not the URI in the browser....
[15:20:22] sevenseacat: lol you're trying to blame things on a rails bug?
[15:20:40] sevenseacat: when you've got the exact line that the error is coming from and you still havent looked at it twenty minutes later?
[15:20:56] cschneid_: has joined #RubyOnRails
[15:20:58] Papierkorb: sevenseacat: blaming others is much more fun anyway
[15:21:11] sevenseacat: yeah but it doesnt help get your problems fixed
[15:21:25] kb3ien: calling a URI a URL. common problem.
[15:21:45] dopamean_: has joined #RubyOnRails
[15:21:50] Papierkorb: sevenseacat: maybe he doesn't want to get it fixed. Now he complains about URI != URL.
[15:22:36] kb3ien: No, but i'm curious how the dump shows one thing, and the httprequest shows another....
[15:22:38] sevenseacat: I don't think they know what a URL is, but its still not related to the problem at hand
[15:22:45] brycesenz: has joined #RubyOnRails
[15:22:51] riotjones: has joined #RubyOnRails
[15:22:53] sevenseacat: [23:16:43] sevenseacat: the issue is thats on the page thats rendering *before* the one that generates the error
[15:23:09] mkopriva: has joined #RubyOnRails
[15:23:16] sevenseacat: [23:10:06] sevenseacat: kb3ien: the error is coming from line 180 of your blacklight behaviour helper
[15:23:24] tubbo: kb3ien: the session dump? that doesn't have to do with what page you're on, really
[15:23:38] kb3ien: that fact that it dumps something like this 'http://styled.troika.www6.databit7.com/articles...' when you request something like this 'http://styled.troika.www6.databit7.com/catalog/...' is the issue.
[15:23:40] maz-dev: has joined #RubyOnRails
[15:23:59] sevenseacat: ................
[15:24:00] feezy: has joined #RubyOnRails
[15:24:08] sevenseacat: you haven't read the error message, have you?
[15:24:22] brycesenz: Hi all! I was just wondering - does anyone know if it's possible to use the ActiveSupport::Testing::TimeHelpers in a Rails 3 project? Like, is there a gem to backport that functionality, or do I need to use an alternative like TimeCop?
[15:25:38] Exuma: has joined #RubyOnRails
[15:27:07] kb3ien: Why does the same code run properly when I leave off the '/short' if the base product is broken there?
[15:27:28] ChanServ: +o sevenseacat
[15:27:46] sevenseacat: because thats running an entirely different action.
[15:28:05] sevenseacat: kb3ien: I would invite you to read the error message now.
[15:28:22] sevenseacat: if not, I will invite you to leave.
[15:29:03] beauby: has joined #RubyOnRails
[15:29:25] IceyEC: has joined #RubyOnRails
[15:30:04] startupality: has joined #RubyOnRails
[15:30:10] kb3ien: So if there is a problem in document_show_html_title then how do I found out why it works well until I copy the .erb, and route /short to the copy ?
[15:30:15] maz-dev: has joined #RubyOnRails
[15:30:17] sevenseacat: brycesenz: I'd just use timecop personally, even in rails 4.
[15:31:02] andybernard: has joined #RubyOnRails
[15:31:04] sevenseacat: kb3ien: did you look at the line the error is coming from, yet?
[15:31:08] kb3ien: I'm sure that you are right, and I took the wrong approach to debugging it the first time; but how to confirm.
[15:31:11] sevenseacat: yes or no question
[15:31:15] sevenseacat: did you look at it
[15:31:18] brycesenz: sevenseacat: May I ask why? I've played a bit with both and only used functionality that both seem to have, but would ideally prefer to stick with something that's more of a "core Rails" thing.
[15:31:47] kb3ien: render_field_value(@document[blacklight_config.show.html_title]) yes I looked at it, and saw nothing the matter.
[15:32:06] sevenseacat: kb3ien: so the error says you're calling [] on nil - what in that line are you calling [] on
[15:32:43] andybernard: has joined #RubyOnRails
[15:32:51] emba: has left #RubyOnRails: ()
[15:32:51] emba: has joined #RubyOnRails
[15:33:21] chouhoulis: has joined #RubyOnRails
[15:33:54] strcmp1: has joined #RubyOnRails
[15:34:40] mloy: Are hashes counted as Enumerable objects?
[15:35:00] mloy: Wait sec I should google this-
[15:35:03] mloy: sevenseacat, thanks :)
[15:35:43] kb3ien: well @document should be populated, by the CatalogController. THis is what's confusing me.
[15:35:55] sevenseacat: kb3ien: so where are you populating it?
[15:36:06] sevenseacat: gist the code that populates it. or just gist the whole controller.
[15:37:13] kb3ien: THank's I have to run right now, but will return in an hour to two.
[15:37:52] ChanServ: -o sevenseacat
[15:39:15] srinidhi: has joined #RubyOnRails
[15:39:55] Grundell: has joined #RubyOnRails
[15:41:10] Cache_Money: has joined #RubyOnRails
[15:41:11] [Butch]: has joined #RubyOnRails
[15:41:13] The_Phoenix: has joined #RubyOnRails
[15:41:51] larissa: has joined #RubyOnRails
[15:42:49] The_Phoenix: has joined #RubyOnRails
[15:44:25] The_Phoenix: has joined #RubyOnRails
[15:44:41] johnflux: if I do: <dt><strong><%= model_class.human_attribute_name(:project) %>:</strong></dt>
[15:45:04] johnflux: but project is actually an object (project_id is a foriegn key)
[15:45:35] johnflux: okay nevermind :)
[15:45:43] tubbo: johnflux: glad we could help
[15:50:24] sonofdirt: has joined #RubyOnRails
[15:51:47] big|bad|wolf: has joined #RubyOnRails
[15:52:23] xhosae: has joined #RubyOnRails
[15:53:43] Papierkorb: I'm trying to get rid of Coffeescript. I thus removed its gems, but now I get a LoadError: cannot load such file -- coffee_script
[15:54:06] Papierkorb: I don't have any .coffee files under app/ anymore, nor do any gems have them
[15:54:33] mloy: I'm trying to grok this ruby file but I'm not sure what the point of @template is https://github.com/carouselapps/table_builder/blob/master/lib/table_builder/table_builder.rb
[15:55:36] mloy: well I should try to phrase this as a question, hmm...
[15:56:14] bruno-: has joined #RubyOnRails
[15:56:22] bmalum: has joined #RubyOnRails
[15:56:26] NBarnes: has joined #RubyOnRails
[15:56:49] sinkensabe: has joined #RubyOnRails
[15:57:01] Guest63096: has left #RubyOnRails: ()
[15:57:23] dopie: has joined #RubyOnRails
[15:58:06] jeadre: has joined #RubyOnRails
[16:02:36] ngscheurich: has joined #RubyOnRails
[16:02:39] rogue_koder: has joined #RubyOnRails
[16:03:22] christiandsg: has joined #RubyOnRails
[16:03:52] atomical: has joined #RubyOnRails
[16:03:52] pragmatism: has joined #RubyOnRails
[16:04:16] kitsuneyo: has joined #RubyOnRails
[16:04:25] mloy: If I am writing a view that I expect to retrieve user input from and update a model's PSQL table with that input, how do I keep from being overwhelmed trying to decide whether to write the view first or figure out how to structure the PSQL table first? >.< It's annoying because I need the functionality of a 2D array but want it to be searchable in the PSQL table. Blahh
[16:04:26] banister: has joined #RubyOnRails
[16:05:39] ngscheurich: has joined #RubyOnRails
[16:07:07] rodfersou: has joined #RubyOnRails
[16:08:12] JoshGlzBrk: has joined #RubyOnRails
[16:09:58] ruurd: has joined #RubyOnRails
[16:14:36] nzst: has joined #RubyOnRails
[16:15:06] nzst: Hi, in a controller #create, how do I make sure that the object was created and restored in the database before returning a response?
[16:15:17] nzst: *not restored, just stored
[16:15:57] mloy: Oh wow, the usefulness of 'yield' just hit me like a truck.
[16:20:20] nickenchuggets: has joined #RubyOnRails
[16:21:58] pixelhandler: has joined #RubyOnRails
[16:22:33] DEA7TH: has joined #RubyOnRails
[16:23:38] riotjones: has joined #RubyOnRails
[16:24:49] nzst: So, this method in a controller, http://hastebin.com/fiboxafazo.rb, sends out a response before the database call is over. I have a different db call that is supposed to occur after this create, through a promise library. It's creating a race condition, I would like to resolve
[16:26:46] bricker: has joined #RubyOnRails
[16:27:29] andybernard: nzst: shouldnt if @object.save?; do_some_stuff_since; else; do_other_stuff work?
[16:29:10] Spami: has joined #RubyOnRails
[16:29:46] beauby: has joined #RubyOnRails
[16:30:11] towski_: has joined #RubyOnRails
[16:30:23] maz-dev: has joined #RubyOnRails
[16:35:19] uberjar: has joined #RubyOnRails
[16:37:34] nickenchuggets: has joined #RubyOnRails
[16:38:17] bricker: save? isn't a method
[16:39:20] uberjar: .respond_to?(:save) should tell ya :)
[16:39:36] uberjar: oh wait.. that was a statement not a question??? nvm
[16:41:54] malkovian: Hi, I have the problem rails app in production, session gets reset every request, no matter if its POST or GET. This is not because of token authentication, in fact token cannot be authenticated because of lost session.
[16:42:13] sudiptamondal: has joined #RubyOnRails
[16:42:21] malkovian: I created post on stackoverflow about it http://stackoverflow.com/questions/32100052/rails-4-resets-session-on-every-request-in-production
[16:42:44] malkovian: anyone anything?
[16:42:51] pramsky: has joined #RubyOnRails
[16:43:01] johnflux: I currently do: <td><%= simple_format h project.description %></td>
[16:43:07] johnflux: how could I limit the size of this?
[16:43:08] sudiptamondal: has joined #RubyOnRails
[16:43:51] andybernard: bricker: thanks, slipped my mind, forget the question mark at the end
[16:43:58] Spami: has joined #RubyOnRails
[16:44:04] bricker: johnflux: you could make a helper but what's the point
[16:44:29] maz-dev: has joined #RubyOnRails
[16:47:20] mikebonar: has joined #RubyOnRails
[16:47:31] Spami_: has joined #RubyOnRails
[16:48:12] Rubie: has joined #RubyOnRails
[16:48:52] Maletor: has joined #RubyOnRails
[16:49:15] rustymyers: has joined #RubyOnRails
[16:49:23] DoubleMalt: has joined #RubyOnRails
[16:50:13] troyready: has joined #RubyOnRails
[16:51:51] sankaber: has joined #RubyOnRails
[16:52:37] rromanchuk: has joined #RubyOnRails
[16:54:09] roolo: has joined #RubyOnRails
[16:55:08] cornerma1: has joined #RubyOnRails
[17:00:45] yatish27: has joined #RubyOnRails
[17:01:41] bap1313: has joined #RubyOnRails
[17:02:29] alphaatom: has joined #RubyOnRails
[17:03:44] elv: has joined #RubyOnRails
[17:03:58] alphaatom: has joined #RubyOnRails
[17:07:42] roolo: has joined #RubyOnRails
[17:08:16] naftilos76: has joined #RubyOnRails
[17:09:52] maz-dev: has joined #RubyOnRails
[17:11:22] kies^: has joined #RubyOnRails
[17:12:02] maz-dev: has joined #RubyOnRails
[17:13:21] TomyLobo: has joined #RubyOnRails
[17:13:34] IrishGringo: has joined #RubyOnRails
[17:13:42] frzng: has joined #RubyOnRails
[17:14:03] beauby: has joined #RubyOnRails
[17:15:58] renanoronfle: has joined #RubyOnRails
[17:17:05] krz: has joined #RubyOnRails
[17:19:17] diegoviola: has joined #RubyOnRails
[17:19:51] joshkovach: has joined #RubyOnRails
[17:20:01] banjara: has joined #RubyOnRails
[17:21:16] _djbkd: has joined #RubyOnRails
[17:21:52] _djbkd: has joined #RubyOnRails
[17:22:26] cnk: has joined #RubyOnRails
[17:22:32] rickmasta: has joined #RubyOnRails
[17:23:30] big|bad|wolf: has joined #RubyOnRails
[17:24:22] riotjones: has joined #RubyOnRails
[17:27:16] baweaver: has joined #RubyOnRails
[17:27:31] davidheward: has joined #RubyOnRails
[17:28:15] j_mcnally: has joined #RubyOnRails
[17:29:43] juanpaucar: has joined #RubyOnRails
[17:31:05] j_mcnally: has joined #RubyOnRails
[17:32:38] arup_r: has joined #RubyOnRails
[17:32:43] Motoservo: has joined #RubyOnRails
[17:37:41] maz-dev: has joined #RubyOnRails
[17:43:44] nzst: has left #RubyOnRails: ("ERC (IRC client for Emacs 24.5.1)")
[17:46:36] kies^: has joined #RubyOnRails
[17:47:00] jsrn_: has joined #RubyOnRails
[17:47:26] nahtnam: has joined #RubyOnRails
[17:49:49] choke: has joined #RubyOnRails
[17:51:00] LambdaSource: has joined #RubyOnRails
[17:51:14] qejk: has joined #RubyOnRails
[17:52:00] yardenbar: has joined #RubyOnRails
[17:55:43] towski__: has joined #RubyOnRails
[17:56:28] mary5030: has joined #RubyOnRails
[17:57:23] mary5030: has joined #RubyOnRails
[17:59:19] maz-dev: has joined #RubyOnRails
[18:00:30] michaeldeol: has joined #RubyOnRails
[18:00:33] paulcsmith: has joined #RubyOnRails
[18:02:18] srinidhi: has joined #RubyOnRails
[18:02:42] ych_: has joined #RubyOnRails
[18:02:56] _djbkd: has joined #RubyOnRails
[18:03:06] d5sx43: has joined #RubyOnRails
[18:04:13] Spami_: has joined #RubyOnRails
[18:06:14] christiandsg: has joined #RubyOnRails
[18:06:37] greengriminal: has joined #RubyOnRails
[18:08:53] drale2k: has joined #RubyOnRails
[18:09:19] greengriminal: hey all, so So i had codeclimate say that this bit of code https://gist.github.com/anonymous/906df985e3977ec8bc2c went from a B -> C and was a complex method. So i decided to refactor it with the tell don't ask principle in mind. And i have the following: https://gist.github.com/davidpatters0n/720d754e4840942a9e4b. Fyi default_access_key is a field on the Rate and this bit of code sits in the Rate.rb
[18:09:51] bruno-: has joined #RubyOnRails
[18:10:15] greengriminal: What are your opinions on the above?
[18:10:33] kegan_: has joined #RubyOnRails
[18:10:48] Papierkorb: greengriminal: I'd try to avoid having an if in an if
[18:11:08] Papierkorb: greengriminal: early return if you don't want to 'outsource' any branch there
[18:11:25] greengriminal: Papierkorb, (y)
[18:12:14] Papierkorb: I always try to think of the method as being me. I'm lazy as hell. If I can get a short-cut to not do further work, I better take it. There's enough work to do afterall ;)
[18:12:20] greengriminal: Papierkorb, https://gist.github.com/davidpatters0n/720d754e4840942a9e4b#gistcomment-1558389
[18:12:38] IceyEC: has joined #RubyOnRails
[18:12:56] Papierkorb: greengriminal: the outer if branch
[18:13:22] Papierkorb: Returning from inside an if/unless is much more confusing than a clear "return if foo" on the top-level
[18:14:01] greengriminal: the comment that is.
[18:14:25] JoshL: has joined #RubyOnRails
[18:14:28] DLSteve: has joined #RubyOnRails
[18:14:35] Papierkorb: greengriminal: the indention is broken. Now, your if is criminal, in fact, I didn't even see it before
[18:15:00] Papierkorb: greengriminal: Empty branches are a sign of "meh". Instead, invert the condition. But wait, ruby has something better, it's "unless"!
[18:15:33] Papierkorb: greengriminal: With that in mind, you can further shorten the whole conditional branch to: find_or_create_ak unless default_access_key_was.present?
[18:15:50] Papierkorb: Now, your whole function fits in two readable lines
[18:16:48] juanpaucar: has joined #RubyOnRails
[18:17:18] Papierkorb: You could also then merge the conditions of the two unless's to make it a one-liner, but see for yourself, maybe it's much more confusing that way, especially with the somewhat inversed logic of unless
[18:18:01] momomomomo: has joined #RubyOnRails
[18:19:53] bricker: greengriminal: imo it was better before
[18:20:16] _djbkd: has joined #RubyOnRails
[18:20:35] bricker: greengriminal: you have some complex logic, there's no way around that. All you've done is spread that logic out over the file and made it harder for other people (and yourself in ~2 months) to debug
[18:20:47] _djbkd: has joined #RubyOnRails
[18:20:55] greengriminal: bricker, yeah was thinking that.
[18:21:25] greengriminal: thanks for feedback Papierkorb
[18:21:30] bricker: greengriminal: if it was me, I would short-circuit in the first line with a return
[18:21:36] bricker: then you eliminate one level of nesting
[18:22:04] bricker: greengriminal: so, def create_default_key; return if state.eql?('locked') && .....
[18:22:20] Papierkorb: I also think that the three lines of logic under there don't deserve its own method iff it's used nowhere else
[18:22:21] rakm: has joined #RubyOnRails
[18:22:30] elv: has joined #RubyOnRails
[18:23:01] Papierkorb: This ain't java, we don't take pride in having a 400 levels deep stack trace to wade through :P
[18:23:25] barhum2013: has joined #RubyOnRails
[18:23:39] bricker: Papierkorb: agreed. imo (again) if a method is only called in one place, it shouldn't be its own method. You're just unnecessarily adding onto the stack.
[18:23:47] bricker: There are some exceptions but that's my rule of thumb
[18:24:14] grotewold: has joined #RubyOnRails
[18:24:29] greengriminal: bricker, Papierkorb scrap everything I just said. But taking what you guys suggested returning early on is good. So i've done: https://gist.github.com/davidpatters0n/08588722784ee13a9262
[18:25:14] greengriminal: so just a simple return unless state.eql?('locked') && ... - Because I only want this piece of code to be executed if the state is 'locked' and t the default_access_key is present.
[18:25:14] riotjones: has joined #RubyOnRails
[18:25:15] Papierkorb: Does #save return self?
[18:25:35] Papierkorb: afaik it returns true or false, so you actually have weird return behaviour
[18:25:43] mikebonar: has joined #RubyOnRails
[18:25:49] greengriminal: derp was suppose to return false.
[18:26:22] Papierkorb: oh, don't mind me, I didn't see the #update
[18:26:26] greengriminal: i'm sure the return false was there if you check :P
[18:26:54] bricker: They should make some kind of programming language where the return type is part of the method definition
[18:27:03] bricker: so you don't make accidentally make mistakes like that
[18:27:09] bricker: I'm going to patent that idea
[18:27:36] Papierkorb: That would be a neat addition to Ruby3
[18:27:47] netzfisch: has joined #RubyOnRails
[18:27:58] Papierkorb: I never got why web developers hate type definitions so much. They're here to help
[18:29:26] sinkensabe: has joined #RubyOnRails
[18:29:55] manfrin`laptop: has joined #RubyOnRails
[18:31:04] bricker: Yes... going between Java and Ruby would be like if you were driving 60mph on a busy, curvy freeway and then the lanes just all disappeared
[18:31:40] bricker: Then you sorta just gotta trust everybody else not to screw up
[18:31:50] Papierkorb: Mh, can I stuff my models into a module, or will that change behaviour?
[18:32:48] Papierkorb: I have ::Article, Api::Article, ArticlesController, Brick::Article .. Really, having Model::Article instead would be great
[18:32:56] greengriminal: bricker, Papierkorb thinking about it I should really consider moving: https://gist.github.com/davidpatters0n/08588722784ee13a9262#file-refactored2-rb-L6-L8 to the AccessKey model.
[18:33:40] alejo: has joined #RubyOnRails
[18:34:01] Spami_: has joined #RubyOnRails
[18:34:06] barhum2013: has joined #RubyOnRails
[18:35:18] Papierkorb: aaand his computer decided to take a nap
[18:36:45] greengriminal: has joined #RubyOnRails
[18:41:53] finnnnnnnnnnn: has joined #RubyOnRails
[18:41:57] patrick_star: has joined #RubyOnRails
[18:43:11] kadoppe: has joined #RubyOnRails
[18:43:42] _djbkd: has joined #RubyOnRails
[18:44:11] moneylotion: has joined #RubyOnRails
[18:44:12] jenrzzz: has joined #RubyOnRails
[18:44:13] baweaver: has joined #RubyOnRails
[18:44:50] greengriminal: has joined #RubyOnRails
[18:46:02] kb3ien: has joined #RubyOnRails
[18:46:07] mloy: I'm trying to figure out how to load partials using AJAX and this is what I have so far
[18:46:08] mloy: https://gist.github.com/mmcnellis/8567eb590560be95541c
[18:46:35] MartinElvar: has joined #RubyOnRails
[18:46:59] mloy: currently in my index view I can see the link_tos, but the link_to hour-calendar does not render the _hour partial
[18:47:13] manfrin`laptop: has left #RubyOnRails: ()
[18:47:47] mloy: Any suggestions? >.<
[18:48:15] mloy: oh sorry I forgot to include new.js.erb
[18:48:29] mloy: one sec, updating with that
[18:49:38] mloy: Okay it's been updated. Also, sorry for spamming chat with 7 messages.
[18:51:48] roadpanda_: has joined #RubyOnRails
[18:52:06] Papierkorb: mloy: when you're using gists, that's much appreciated here, but you can also add multiple files there
[18:52:45] andybernard: and syntax highlighting, but i may just be picky
[18:53:45] Schalla: has joined #RubyOnRails
[18:54:51] mloy: Papierkorb, thanks for the tip.
[18:56:13] victortyau: has joined #RubyOnRails
[18:58:17] meoblast001: has joined #RubyOnRails
[19:00:35] kb3ien: has left #RubyOnRails: ()
[19:03:58] kb3ien: has joined #RubyOnRails
[19:05:57] yaymukund: has joined #RubyOnRails
[19:07:30] kb3ien: I've been looking into the problem I'm having with blacklight. I added a route to a page, but for reasons I don't understand the controller ISN'T loading its data as it used to.
[19:07:30] nertzy: has joined #RubyOnRails
[19:07:54] tubbo: kb3ien: that's pretty vague, can you give a bit more context?
[19:08:53] JoshL: has joined #RubyOnRails
[19:09:02] christiandsg: has joined #RubyOnRails
[19:11:21] maz-dev: has joined #RubyOnRails
[19:12:09] choke: has joined #RubyOnRails
[19:12:32] jholm: has joined #RubyOnRails
[19:12:49] Motoservo: has joined #RubyOnRails
[19:15:04] bruno-: has joined #RubyOnRails
[19:15:20] Diabolik: has joined #RubyOnRails
[19:15:39] drale2k: has joined #RubyOnRails
[19:15:54] greengriminal: has joined #RubyOnRails
[19:18:56] michael_mbp: has joined #RubyOnRails
[19:21:56] michael_mbp: has joined #RubyOnRails
[19:22:46] Guest46991: has joined #RubyOnRails
[19:25:05] netzfisch: has joined #RubyOnRails
[19:25:58] riotjones: has joined #RubyOnRails
[19:27:01] mloy: Does anybody have any experience using Turbograft?
[19:27:06] mloy: https://github.com/Shopify/turbograft
[19:27:43] jgt: has joined #RubyOnRails
[19:31:53] havenwood: has joined #RubyOnRails
[19:33:25] IrishGringo: has joined #RubyOnRails
[19:37:20] barhum2013: has joined #RubyOnRails
[19:37:27] jahbrewski: has joined #RubyOnRails
[19:39:33] jahbrewski: has left #RubyOnRails: ()
[19:39:37] dexter91x: has joined #RubyOnRails
[19:39:43] jahbrewski: has joined #RubyOnRails
[19:40:18] baweaver: has joined #RubyOnRails
[19:40:51] nahtnam: If I have a large hash, how can I get all the key/indexes with the prefix "total_kills_"?
[19:41:30] dopie: is this considered the right way to get "15" from "2015" https://gist.github.com/staycreativedesign/d1298499edb33e509228 ?
[19:41:34] dopie: or is there a better way
[19:41:47] jahbrewski: hey folks, I'm building a REST API using rails-api for a mobile app. What is the recommended way to test push notifications? (I'm currently using the Houston gem)
[19:43:32] cmckee: has joined #RubyOnRails
[19:43:34] nahtnam: dopie: Cant you just take the first two numbers out?
[19:44:19] Papierkorb: dopie: What about "2015"[-3..-1] ?
[19:44:44] dopie: nahtnam, what does "2015"[-3..-1] do?
[19:44:54] shinnya: has joined #RubyOnRails
[19:45:00] Papierkorb: dopie: run it in irb or pry
[19:45:02] nahtnam: Papierkorb: That returns 015
[19:45:08] Papierkorb: too bad. then it'
[19:46:51] toretore: has joined #RubyOnRails
[19:49:14] jgpawletko: has joined #RubyOnRails
[19:50:51] Axsuul: has joined #RubyOnRails
[19:52:06] momomomomo: has joined #RubyOnRails
[19:53:39] jgpawletko: has joined #RubyOnRails
[19:56:26] elv: has joined #RubyOnRails
[19:57:11] dopie: how did that work?
[19:58:25] barhum2013: has joined #RubyOnRails
[19:59:32] tens0r: has joined #RubyOnRails
[20:00:16] havenwood: dopie: http://ruby-doc.org/core/String.html#method-i-5B-5D
[20:00:46] Papierkorb: nahtnam: To your questions (didn't see it), just use hash.select{|key, _| key.start_with? 'total_kills'}
[20:01:54] sinkensabe: has joined #RubyOnRails
[20:02:02] Norrin: has left #RubyOnRails: ("Dueces")
[20:03:00] dopie: -2 starts at the end goes 2 to the right
[20:03:15] Papierkorb: havenwood: "If I have a large hash, how can I get >all< the key/indexes"
[20:03:16] VeryBewitching: has joined #RubyOnRails
[20:03:17] havenwood: dopie: Starts at the right and goes two to the left, unless Arabic or Hebrew.
[20:03:38] dopie: awesome :)
[20:03:47] havenwood: Papierkorb: ha, oops, i'm reading opposite today :O
[20:04:00] havenwood: Papierkorb: :D
[20:04:31] havenwood: VeryBewitching: hi
[20:05:26] bbrinck: has joined #RubyOnRails
[20:05:47] nahtnam: Papierkorb Awesome, thanks. Is there a way to sort a hash by its value
[20:05:55] nahtnam: if all the values are fixnums?
[20:07:15] Papierkorb: nahtnam: mh .. without looking at the docs: hash.to_a.sort{|pair, other| pair[1] <=> other[1]}
[20:07:39] havenwood: >> {a: 5, b: 2, c: 9}.sort_by { |_, v| v }.to_h
[20:07:48] havenwood: #=> {:b=>2, :a=>5, :c=>9}
[20:08:07] nahtnam: Lol its backwards
[20:08:08] nahtnam: but it works
[20:08:45] barhum2013: has joined #RubyOnRails
[20:08:53] havenwood: nahtnam: Alternative example above: sort_by { |_, v| v }.to_h
[20:09:02] havenwood: nahtnam: Or: sort_by { |_, v| -v }.to_h
[20:09:07] havenwood: To reverse it.
[20:09:18] nahtnam: Is sort_by a method for hash?
[20:09:27] Papierkorb: nahtnam: it is for Enumerable, and Hash is a Enumerable
[20:09:47] havenwood: nahtnam: {}.public_method(:sort_by).owner #=> Enumerable
[20:10:35] ngscheur1: has joined #RubyOnRails
[20:10:55] Coldblackice_: has joined #RubyOnRails
[20:12:51] bbrinck: has left #RubyOnRails: ()
[20:13:05] nahtnam: Thanks guys
[20:15:00] dstarh: has joined #RubyOnRails
[20:16:43] drale2k: has joined #RubyOnRails
[20:18:57] choke: has joined #RubyOnRails
[20:22:00] Sonicrida: has joined #RubyOnRails
[20:22:28] rikkipitt: has joined #RubyOnRails
[20:22:41] x-light: has joined #RubyOnRails
[20:25:31] zendrix: has joined #RubyOnRails
[20:26:47] riotjones: has joined #RubyOnRails
[20:29:56] jahbrewski: has joined #RubyOnRails
[20:30:29] doerteDev: has joined #RubyOnRails
[20:31:30] bruno-: has joined #RubyOnRails
[20:31:44] _djbkd: has joined #RubyOnRails
[20:33:34] johnflux: has joined #RubyOnRails
[20:34:01] johnflux: I have: <%= file_info.file_type.name %> by sometimes the file_type is nil so it crashes
[20:34:12] mloy: I can't figure out how to specify what partial I want to replace another partial with using Turbolinks
[20:34:12] johnflux: what's the best way to just return nothing instead?
[20:34:16] juanpaucar: has joined #RubyOnRails
[20:34:20] nya: has joined #RubyOnRails
[20:37:08] johnflux: ah <%= file_info.file_type.try(:name) %>
[20:37:15] johnflux: for anyone else who cares :)
[20:38:25] Limix: has joined #RubyOnRails
[20:39:36] Limix: Hi, is there a way to load fixture data into the dev db when running rake db:reset?
[20:39:51] Limix: is it a bad idea to use fixture data for development?
[20:40:39] MartinElvar: has joined #RubyOnRails
[20:42:05] jeadre: has joined #RubyOnRails
[20:43:14] yatish27: has joined #RubyOnRails
[20:43:56] cek: has joined #RubyOnRails
[20:47:25] sargas: has joined #RubyOnRails
[20:52:07] jeadre: has joined #RubyOnRails
[20:52:17] Rubie: has joined #RubyOnRails
[20:52:21] bricker: Limix: nothing wrong with that
[20:52:41] Limix: thanks bricker
[20:55:45] maz-dev: has joined #RubyOnRails
[20:56:13] seank_: has joined #RubyOnRails
[20:59:09] michaeldeol: has joined #RubyOnRails
[21:00:06] jeadre: has joined #RubyOnRails
[21:01:04] jholm: has joined #RubyOnRails
[21:02:51] troyready: has joined #RubyOnRails
[21:03:54] cmckee: has joined #RubyOnRails
[21:04:02] baweaver: has joined #RubyOnRails
[21:06:48] northfurr: has joined #RubyOnRails
[21:08:25] Lightsword: has joined #RubyOnRails
[21:10:40] kitsuneyo: has joined #RubyOnRails
[21:11:05] jeadre: has joined #RubyOnRails
[21:11:56] christiandsg: has joined #RubyOnRails
[21:14:15] DoctorMonocular: has joined #RubyOnRails
[21:15:28] allcentury: has joined #RubyOnRails
[21:17:23] pontiki: i'm having this problem with devise and cancan
[21:17:29] drale2k: has joined #RubyOnRails
[21:17:42] bricker: sounds serious
[21:18:05] pontiki: i want to be able for a user to hit a url, and if they aren't logged in, run through the sign_in step, then get to the original url
[21:18:25] VeryBewitching: I've done that before, lemme look
[21:18:27] pontiki: following the example in the devise wiki, i set a session parameter
[21:18:54] Wolland: has joined #RubyOnRails
[21:18:59] pontiki: but when it rolls around to the /accounts/sign_in controller action, session is completely empty
[21:19:06] VeryBewitching: https://github.com/plataformatec/devise/wiki/How-To:-Redirect-back-to-current-page-after-sign-in,-sign-out,-sign-up,-update
[21:19:34] pontiki: yeah, that's the example i was following, which seems like it should just work
[21:19:35] momomomomo_: has joined #RubyOnRails
[21:21:31] VeryBewitching: It shouldn't be clearing out your whole session though.
[21:21:39] pontiki: that's what i thought
[21:22:17] VeryBewitching: I think I had to find a way to specify the session key Devise uses, that's what I'm looking for.
[21:22:21] corioliss: has joined #RubyOnRails
[21:22:31] Radar: Is it redirecting to a subdomain
[21:22:34] Radar: question-mark
[21:24:31] cek: How do I tell delayed_job stop crapping in my prod.log?
[21:24:38] mary5030: has joined #RubyOnRails
[21:24:42] ur5us: has joined #RubyOnRails
[21:24:44] cek: I don't care about its nonsense polling logs.
[21:24:46] VeryBewitching: pontiki: Do your controllers have before_action :authenticate_user! ?
[21:24:48] pontiki: it's going through multiple redirects and maintaining the session, right up until it hits the users/session#new path
[21:25:34] elv: has joined #RubyOnRails
[21:25:34] pontiki: no, VeryBewitching, but there's a load_and_authorize_resource at the top of the UsersController
[21:25:50] VeryBewitching: pontiki: That's cancan.
[21:27:13] pontiki: authenticate_user! isn't called in any controller
[21:27:32] VeryBewitching: https://github.com/plataformatec/devise/blob/master/lib/devise/controllers/helpers.rb#L82
[21:27:35] riotjones: has joined #RubyOnRails
[21:27:39] VeryBewitching: It signs in or redirects the user.
[21:28:19] zendrix: has left #RubyOnRails: ()
[21:28:48] chouhoul_: has joined #RubyOnRails
[21:29:16] VeryBewitching: I think it's what you're looking for, at any rate.
[21:30:35] pontiki: you may be right. i'm going to give that a shot and see if that fixes anything.
[21:30:48] pontiki: we only want it on certain actions
[21:31:17] baweaver: has joined #RubyOnRails
[21:31:43] pontiki: and only certain resources
[21:31:59] yfeldblum: has joined #RubyOnRails
[21:32:41] quazimodo: has joined #RubyOnRails
[21:33:09] elv: has joined #RubyOnRails
[21:33:26] annlewis: has joined #RubyOnRails
[21:34:13] VeryBewitching: Grabbin' some Java, lemme know if that worked out.
[21:34:52] FernandoBasso: has joined #RubyOnRails
[21:34:59] barhum2013: has joined #RubyOnRails
[21:36:02] banjara: has joined #RubyOnRails
[21:45:40] northfurr: has joined #RubyOnRails
[21:47:32] pontiki: nah, that made no difference. i'm pretty sure this app is bypassing that; if the cancan authorization error blows, it runs through ErrorsController, which redirects to the new_user_session_path. I'm pretty sure that's why it's getting an empty session.
[21:47:44] VeryBewitching: pontiki: Just tested it myself in a fresh app, seems to work.
[21:47:48] pontiki: it's pretty screwy
[21:48:02] pontiki: yeah, i did that over the weekend, too :/
[21:48:15] VeryBewitching: So it's something else under the hood then.
[21:48:28] pontiki: let me paste up the controllers and see if it sparks something
[21:48:41] zendrix: has joined #RubyOnRails
[21:48:42] doerteDev: has joined #RubyOnRails
[21:49:28] VeryBewitching: Add the ability too, that's in use.
[21:51:27] matcouto: has joined #RubyOnRails
[21:51:47] lele: has joined #RubyOnRails
[21:52:48] tfitts: has joined #RubyOnRails
[21:55:33] pontiki: here's the gist: https://gist.github.com/tamouse/2a63ecca839376a2d19e
[21:55:47] depgame1990: has joined #RubyOnRails
[21:56:41] EXCHGR: has joined #RubyOnRails
[21:58:50] workmad3: has joined #RubyOnRails
[21:58:56] choke: has joined #RubyOnRails
[22:02:03] VeryBewitching: pontiki: It's going to take a bit to digest this, if anything hops out at me I'll let you know.
[22:02:20] pontiki: don't sweat it, but i sure do appreciate the extra eyes
[22:02:23] HalcyonicStorm: has joined #RubyOnRails
[22:02:36] pontiki: not like anyone at work here is willing to look at it :<
[22:04:38] JoshGlzBrk: has joined #RubyOnRails
[22:04:55] erich: has joined #RubyOnRails
[22:05:15] ctooley: has joined #RubyOnRails
[22:06:22] ckinniburgh__: has joined #RubyOnRails
[22:06:25] Xiti`: has joined #RubyOnRails
[22:06:32] edward__: has joined #RubyOnRails
[22:07:00] ctooley: I???m attempting to embed an iFrame of a youtube video in view and getting ???in a frame because it set ???X-Frame-Options??? to ???SAMEORIGIN??????. I???ve set the config.auto_dispatch.default_headers[???X-Frame-Options???] to ???ALLOWALL??? in config/application.rb, but to no avail.
[22:16:50] pontiki: VeryBewitching: i have to head home. if you come up with anything,just ping me here, but i might not get back on for some time
[22:17:16] pontiki: VeryBewitching: please don't put much effort into it, either
[22:17:19] VeryBewitching: pontiki: It's all good, it does seem a bit daunting to debug from a Gist though :D
[22:17:41] pontiki: VeryBewitching: i'm aware; i can't share the whole repo
[22:17:55] VeryBewitching: I know, I wasn't suggesting that.
[22:18:04] pontiki: again, don't sweat it; i appreciate what you've done already
[22:18:29] pontiki: this might end up with a big refactoring
[22:18:57] pontiki: anyway, thanks, and see you later
[22:20:10] kitsuneyo: how can i put this in a method: <%= raw @game.genres[0..2].collect { |genre| link_to genre.name, genre }.join(", ") %>
[22:21:06] bricker: kitsuneyo: you can put into a helper, which takes one argument @game
[22:21:31] kitsuneyo: thanks bricker, i'm not sure how to adjust the code?
[22:22:21] baweaver: has joined #RubyOnRails
[22:22:51] kitsuneyo: how do i to link_to and join?
[22:23:31] bricker: kitsuneyo: https://gist.github.com/bricker/dfebb33870b45061c249
[22:24:03] kitsuneyo: i see, thanks bricker
[22:24:21] kitsuneyo: i thought i had to break it up on multiple lines and use 'do'
[22:24:44] workmad3: has joined #RubyOnRails
[22:26:04] x-light: has joined #RubyOnRails
[22:27:35] greengriminal: has joined #RubyOnRails
[22:28:06] t4nkD: has joined #RubyOnRails
[22:28:20] cmckee: has joined #RubyOnRails
[22:28:21] riotjones: has joined #RubyOnRails
[22:29:02] k776: has joined #RubyOnRails
[22:30:13] Limix: has joined #RubyOnRails
[22:30:16] k776: Hello. I've turned on dalli/memcached support in development so that we can make sure it's working properly, but suddenly all assets are being read, missed, and written to caching, which has increased load times from 1s to over 10s! Anyone know how to tell rails caching to cache only fragments and not assets?
[22:30:48] Radar: k776: steps to reproduce in a new app plzkths
[22:30:55] arooni-mobile: has joined #RubyOnRails
[22:31:05] ishahnaz: has joined #RubyOnRails
[22:34:20] annlewis: has joined #RubyOnRails
[22:34:59] CheckYourSix: has joined #RubyOnRails
[22:35:35] j_mcnally: has joined #RubyOnRails
[22:36:30] _djbkd: has joined #RubyOnRails
[22:37:31] havenwood: has joined #RubyOnRails
[22:38:07] Sonicrida: has joined #RubyOnRails
[22:40:21] Sonicrida: has joined #RubyOnRails
[22:41:32] Sonicrida: what does it mean to use "serialize :property. array" in a model?
[22:42:05] Limix: has joined #RubyOnRails
[22:44:36] christiandsg: has joined #RubyOnRails
[22:44:43] VeryBewitching: The property will be serialized before it's inserted/updated.
[22:45:12] VeryBewitching: http://api.rubyonrails.org/classes/ActiveRecord/AttributeMethods/Serialization/ClassMethods.html
[22:45:30] nahtnam: I am using this: `.sort! { |a,b| a[:kills] <=> b[:kills] }.to_s`
[22:45:31] Sonicrida: alright VeryBewitching. Is there a simple way to turn a text column into a text array in postgres?
[22:45:34] nahtnam: how can I reverse it?
[22:45:38] nahtnam: (on an array)
[22:46:12] VeryBewitching: Sonicrida: Well, you can serialize it.
[22:46:27] VeryBewitching: Sonicrida: Or you can make another table and add the data as rows.
[22:46:40] dopie: anyone help me here with some pair programmingg?
[22:47:01] kitsuneyo: hey, i made a couple of helpers that create some arrays with links in and then join their contents on " | ", but the output shows all the html code instead of displaying the links. the gist is here: https://gist.github.com/kitsuneyo/088332657cdfaf3ff63d
[22:47:08] Sonicrida: so I can't change the column type to be an array of text VeryBewitching?
[22:47:57] kitsuneyo: how can i make it use and display the html properly?
[22:48:15] VeryBewitching: Sonicrida: If the field is set to 'text' in postgres then it's a string when you store it, but yes you can serialize the array and when it's retrieved it'll be an array.
[22:49:10] jholm: has joined #RubyOnRails
[22:49:41] kitsuneyo: it works if i add .html_safe to the end of the final display method
[22:50:00] Sonicrida: VeryBewitching, What if I don't want to serialize and I just want to store it as an array in postgres? I was trying to use the code from the answer here but I couldn't get it to work http://stackoverflow.com/questions/22550066/rails-migration-changing-column-to-use-postgres-arrays
[22:50:38] kitsuneyo: ahh, it also works if i put it inside raw()
[22:50:47] kitsuneyo: is raw safe and good?
[22:51:17] VeryBewitching: Sonicrida: Ohh, I've never tried doing that. If I store an array or collection inside a row I usually do it in JSON with Postgres because you can query the object in SQL statements.
[22:51:32] Dzejmskrokan: has joined #RubyOnRails
[22:53:14] Sonicrida: ahh ok thanks VeryBewitching. That sounds like the better way to do it. I have a bunch of columns and all of them are being stored as an array except for one that's being serialized because I didn't know how to do store them without serializing at first. Now, the serializing code is messing up another part of my app and I want to get rid of it for now so that's why I'm trying to convert it.
[22:53:18] nahtnam: Nvm, I figured it out
[22:53:20] t4nkD: has joined #RubyOnRails
[22:54:18] t4nkD: has joined #RubyOnRails
[22:54:21] VeryBewitching: Sonicrida: You'll still have to convert the data before you store it though, make sure you have a hook or something that encodes it to the target format.
[22:54:35] charliesome: has joined #RubyOnRails
[22:55:27] Sonicrida: Alright VeryBewitching. I'll see if I can get it working, if not, I think I'm just gonna delete the column and remake it as an array. It's not a production app fortunately.
[22:58:36] mloy: Does anybody here have experience using Turbograft?
[22:58:46] baash05: has joined #RubyOnRails
[22:58:48] charliesome: has joined #RubyOnRails
[22:59:35] sloggerkhan: mloy: I don't even use turbolinks :/
[23:00:45] _djbkd: has joined #RubyOnRails
[23:01:04] mloy: SloggerKhan, haha, well I don't really care much about turbolinks, I just am trying to figure out Turbograft so that I can replace partials in my views without reloading the page. I found tutorials on doing that with just AJAX but none of them worked for me. :/
[23:01:34] kitsuneyo: i guess i can only use collect on an instance variable, what is used instead on index views?
[23:04:04] rails471: has joined #RubyOnRails
[23:04:24] _djbkd: has joined #RubyOnRails
[23:04:34] frzn: has joined #RubyOnRails
[23:05:48] kies: has joined #RubyOnRails
[23:06:59] jmpp: has joined #RubyOnRails
[23:07:04] superlou: has joined #RubyOnRails
[23:08:32] _djbkd: has joined #RubyOnRails
[23:09:04] michaeldeol: has joined #RubyOnRails
[23:10:24] rubyonrails705: has joined #RubyOnRails
[23:10:58] rubyonrails705: has left #RubyOnRails: ()
[23:11:39] j_mcnally: has joined #RubyOnRails
[23:11:41] DLSteve: has joined #RubyOnRails
[23:14:34] JimmyNeutron: has joined #RubyOnRails
[23:14:36] blackmesa: has joined #RubyOnRails
[23:14:52] drale2k_: has joined #RubyOnRails
[23:15:07] bricker: kitsuneyo: that question doesn't make sense, are you having an error or unexpected results?
[23:16:11] jmpp: has joined #RubyOnRails
[23:16:12] kitsuneyo: yeah i had an error that said collect was not a method i could use, this was on my _game.html.erb partial that i use on an index view
[23:16:21] feezy: has joined #RubyOnRails
[23:16:22] kitsuneyo: actually though i don't need to use collect anyway
[23:17:01] greengriminal: has joined #RubyOnRails
[23:18:53] Ropeney: has joined #RubyOnRails
[23:19:14] _djbkd: has joined #RubyOnRails
[23:21:05] _djbkd: has joined #RubyOnRails
[23:21:56] _djbkd: has joined #RubyOnRails
[23:22:03] chipotle: has joined #RubyOnRails
[23:23:36] Radar: damn, left before I could !rule0 them
[23:24:11] helpa: Show rather than tell. Explaining your problem with code, stacktraces or errors is always preferred to explaining it with just text. Show us what's happening, rather than telling us.
[23:24:14] Aeyrix: Oh, yeah.
[23:24:29] Radar: I rearranged the rules last week.
[23:24:35] Aeyrix: Do you have a new list?
[23:24:40] Radar: http://goo.gl/dgSj5
[23:24:43] Radar: Same as the old list :)
[23:24:47] Aeyrix: Just rearranged>
[23:24:49] helpa: You might be looking for !rule0.
[23:24:51] helpa: Don't piss off Radar.
[23:24:52] helpa: Radar is the GodKing of #rubyonrails. Obey him and all shall go well.
[23:25:01] Radar: Rearranged like that :)
[23:25:19] Aeyrix: !rulebingo
[23:25:27] helpa: Don't argue with the ops. It never ends well.
[23:25:32] Radar: That's better :)
[23:26:40] gambl0re: has joined #RubyOnRails
[23:27:28] yfeldblum: has joined #RubyOnRails
[23:27:33] [H]unt3r: has joined #RubyOnRails
[23:29:06] riotjones: has joined #RubyOnRails
[23:29:16] yashinbasement: has joined #RubyOnRails
[23:29:34] roolo: has joined #RubyOnRails
[23:31:37] petersaints: has joined #RubyOnRails
[23:33:50] Swappticon: has joined #RubyOnRails
[23:34:47] oscarb92: has joined #RubyOnRails
[23:34:58] annlewis: has joined #RubyOnRails
[23:35:11] IceBear: has joined #RubyOnRails
[23:35:20] Ropeney: hello oscarb92
[23:36:10] hoodow: has joined #RubyOnRails
[23:36:10] hoodow: has joined #RubyOnRails
[23:36:47] ledestin: has joined #RubyOnRails
[23:36:54] _3dwardsharp: has joined #RubyOnRails
[23:37:20] chipotle: has joined #RubyOnRails
[23:37:44] oscarb92: I'm wondering why my submit button is not working in my form when I load it with a link_to. Works when I copy the url directly into the browser. I use simple_form
[23:37:54] oscarb92: https://gist.github.com/OscarBastardo/265269bb47a4c30caad3
[23:38:45] oscarb92: Ropeney: hello :)
[23:38:49] nahtnam: has joined #RubyOnRails
[23:39:07] nyandoge: has joined #RubyOnRails
[23:39:15] calleerlandsson: has joined #RubyOnRails
[23:39:20] newton: has joined #RubyOnRails
[23:39:21] ELCALOR: has joined #RubyOnRails
[23:39:21] Iacobus: has joined #RubyOnRails
[23:39:32] ngscheurich: has joined #RubyOnRails
[23:39:41] Ropeney: oscarb92: Where is the link_to ?
[23:42:27] oscarb92: Ropeney: in another page, I meant that when I load this page with a link_to, the submit button does not work, but it works if I use the url to get the page
[23:43:09] Meow-J: has joined #RubyOnRails
[23:43:41] Radar: oscarb92: !didntwork
[23:43:41] helpa: oscarb92: What "didn't work"? Did your server not start? Did your computer explode? Did your webpage turn bright pink? Did your client not pay your bill on time? You may have to be more specific. A Gist (http://gist.github.com) of the code that doesn't work (and the error you are getting) will be helpful.
[23:43:57] Ropeney: oscarb92: So it works when you come to it from a url but not a link_to ?
[23:44:22] oscarb92: Ropeney: exactly
[23:44:33] Ropeney: oscarb92: Where is the link_to?
[23:45:58] oscarb92: Ropeney: at the home page... it looks like this: <%= link_to "M??dico", new_medico_path, class: "btn btn-lg btn-primary center-block" %>
[23:45:58] blnkammo: has joined #RubyOnRails
[23:47:40] Radar: oscarb92: How it gets to that page shouldn't matter. Can you reproduce the issue in a new app?
[23:48:38] nya: has joined #RubyOnRails
[23:48:55] workmad3: has joined #RubyOnRails
[23:49:13] Ropeney: oscarb92: And what does 'not work' mean? If the form works at some point, sort of need context to where its not working.
[23:49:39] sininen: has joined #RubyOnRails
[23:50:30] oscarb92: Ropeney: the button those not submit the form, it does not sent the post request, it does not call the create method in the controller, it does nothing when I click it
[23:50:53] nyaa: has joined #RubyOnRails
[23:51:27] Radar: oscarb92: JavaScript errors?
[23:51:29] nyaa: has joined #RubyOnRails
[23:51:47] oscarb92: Ropeney: that's the case when I load that page with the link_to, but when I load it with with the url it does work
[23:52:48] oscarb92: Radar: that's what I've been thinking... but the js code that I wrote works (input validations, datepicker), so I'm not sure
[23:53:00] Radar: oscarb92: we can't help you if we can't see the issue happening for ourselves.
[23:54:03] Ropeney: oscarb92: what radar said, but your form you posted looks correct :)
[23:55:00] oscarb92: Ropeney, Radar: ok, thank you guys
[23:55:25] nya: has joined #RubyOnRails
[23:55:57] jtthedev: anyone wanna try to help me with this one ? http://pastie.org/10373323 Using lazy charts gem, followed instructions to the tee.... Whatn I look at the HTML source of my page, i can see the expected output for the graphs/charts... however, when I look at the rendering on the screen... everything is blank, the chart renders, but with none of the data that I see on the source.. I've now spent at least 12 hours tr
[23:55:58] jtthedev: ying to figure this out, and I can't.. i've researched, i have the charts working on other apps I use without a problem, but this specific app, is giving me a hard time
[23:56:10] jtthedev: please take a look, maybe you see something that I dont
[23:56:21] jtthedev: i included my controller, view and view source in the pastie
[23:57:56] chipotle: has joined #RubyOnRails
[23:58:32] jtthedev: also, when i look at log output... I can see the correct query for this chart being called and it passes with no errors
[23:58:34] Ropeney: jtthedev: Is the </div> before your end of form causing issues?
[23:58:40] Motoservo: has joined #RubyOnRails
[23:59:15] jtthedev: not sure, let me check
[23:59:34] jtthedev: ahh, no.. i've tried without the form all together, no go
[23:59:35] Ropeney: you have a div before the from, but closing all divs in the form, might be causing a js issue
[23:59:54] JoshuaPaling: has joined #RubyOnRails