« Back to channel list

#RubyOnRails - 27 June 2016

« Back 1 day Forward 1 day »
[00:03:24] jetpackj1: has joined #RubyOnRails
[00:06:29] skiz: has joined #RubyOnRails
[00:08:26] jetpackj1: has joined #RubyOnRails
[00:09:56] dc2: has joined #RubyOnRails
[00:10:33] Rodya_: has joined #RubyOnRails
[00:13:47] moeabdol: has joined #RubyOnRails
[00:16:22] _Tariq: has joined #RubyOnRails
[00:16:47] sumobob: has joined #RubyOnRails
[00:22:53] roamingdog: has joined #RubyOnRails
[00:26:04] xall_: has joined #RubyOnRails
[00:31:18] jenrzzz: has joined #RubyOnRails
[00:31:18] jenrzzz: has joined #RubyOnRails
[00:31:25] jscheel: has joined #RubyOnRails
[00:32:27] dminuoso: has joined #RubyOnRails
[00:34:27] sypheren: has joined #RubyOnRails
[00:40:42] Markhor1991: has joined #RubyOnRails
[00:45:39] allcentury: has joined #RubyOnRails
[00:49:45] DZj091231kld: has joined #RubyOnRails
[00:52:35] pilne: has joined #RubyOnRails
[00:58:02] omz: has joined #RubyOnRails
[01:00:14] sevenseacat: has joined #RubyOnRails
[01:01:23] omz_: has joined #RubyOnRails
[01:01:52] nettoweb: has joined #RubyOnRails
[01:06:09] tildes: has joined #RubyOnRails
[01:07:16] arBmind1: has joined #RubyOnRails
[01:23:20] allcentury: has joined #RubyOnRails
[01:23:43] arnonhongklay: has joined #RubyOnRails
[01:24:47] Lomax: has joined #RubyOnRails
[01:32:47] pontiki: has joined #RubyOnRails
[01:33:15] dminuoso: has joined #RubyOnRails
[01:36:30] armyriad: has joined #RubyOnRails
[01:37:58] workmad3: has joined #RubyOnRails
[01:43:02] workmad3_: has joined #RubyOnRails
[01:43:08] Lomax: Good evening everyone. I've run into a problem with Rack that I cannot figure out, despite spending hours digging and searching: whenever my application does a POST I get "undefined method `create' for Rack::Multipart::Parser:Class" - and this even with a very simple non-multipart form. OS is Ubuntu Xenial, Ruby version is 2.3.0p0, Rails version, system Rack version is 1.6.4, but the bundle uses 1.4.7, and the application server i
[01:43:14] FrankD: has joined #RubyOnRails
[01:43:17] Lomax: I suspect this is a version incompatibiltiy between the application's bundled version of Rack and the system one that gets installed with Ruby 2.3 (in /usr/lib/ruby/vendor_ruby/rack/), but I do not know how to resolve this. I am getting somewhat desperate and would greatly appreciate any help - perhaps this issue sounds familiar to someone?
[01:43:20] Rodya_: has joined #RubyOnRails
[01:46:04] moeabdol: has joined #RubyOnRails
[01:47:48] dc2: has joined #RubyOnRails
[01:49:32] eljimmy: has joined #RubyOnRails
[01:50:16] Leepoff: has joined #RubyOnRails
[01:54:14] Radar: Lomax: Bundle should use the one version of Rack.
[01:54:23] Radar: Lomax: If you're using multiple versions of Rack, then there is something screwy with your app.
[01:54:27] xall_: has joined #RubyOnRails
[01:54:28] Radar: Lomax: Can you reproduce this issue in a new app?
[01:55:17] Lomax: Radar: many thanks, in fact (as is often the case) just posing the question here gave me a clue: the application works fine when run with "bundle exec thin start"
[01:55:55] Radar: Lomax: Can you show me your `config/application.rb` please?
[01:56:11] Lomax: Radar: so I need to change my init script to start Thin through "bundle exec" instead of /usr/bin/thin
[01:56:26] Radar: Lomax: Yes, but there should be configuration in `config/application.rb` which takes care of that
[01:56:32] Radar: Something like
[01:56:33] Radar: Bundler.require *Rails.groups(assets: %w(development test))
[01:57:12] Lomax: Radar: I have "Bundler.require(*Rails.groups(:assets => %w(development test)))"
[01:57:28] Radar: Lomax: I need to see the context of that please.
[01:59:46] Lomax: Radar: here https://gist.github.com/anonymous/8128551d555ca142b61f146dfc793cc2
[01:59:58] Radar: https://gist.github.com/anonymous/8128551d555ca142b61f146dfc793cc2#file-application-rb-L5
[02:00:03] Radar: Does this line return true?
[02:01:43] Lomax: Radar: irb(main):001:0> defined?(Bundler)
[02:01:43] Lomax: => "constant"
[02:01:48] Radar: ok, seems fine.
[02:01:53] Radar: I dunno what could be going wrong then.
[02:02:27] Lomax: Radar: thanks, I appreciate you looking - I think I'm on the right track with the system vs. bundled Rack version
[02:02:46] Lomax: Radar: since the application works when I start it with "bundle exec thin start"
[02:03:41] Lomax: Radar: apt-get installs a version of Rack as well, which is much newer (I think via "apt-get install thin")
[02:03:53] Radar: Lomax: !ubuntu
[02:03:53] helpa: Lomax: Ubuntu, Ruby, ruby-install, chruby, Rails setup guide: http://ryanbigg.com/2014/10/ubuntu-ruby-ruby-install-chruby-and-you/ - Gauranteed to work 100% of the time or your money back!
[02:04:06] Radar: Lomax: Don't install Ruby through apt-get. Recipe for disaster (which I think you might be seeing now)
[02:04:29] Lomax: Radar: indeed I am realising that :)
[02:04:56] Lomax: Radar: I'll see if I can get my init script to launch the app with "bundle exec" instead
[02:05:53] Lomax: Radar: I've always used "thin install" after getting it via apt-get before, which of course pulls in Ruby as well
[02:06:10] Lomax: Radar: but last time was on 14.04, this is now 16.04
[02:06:58] Dios|: has joined #RubyOnRails
[02:09:05] Lomax: Radar: thanks again, you have been very helpful
[02:15:43] Lomax: this looks like it should do the trick: https://gist.github.com/sbeam/3454488
[02:19:22] one_zero: has joined #RubyOnRails
[02:31:14] benlieb: has joined #RubyOnRails
[02:33:57] dminuoso: has joined #RubyOnRails
[02:37:11] DZj091231kld: has joined #RubyOnRails
[02:42:14] Lomax: Radar: issue resolved, using alternative init.d script which calls "bundle exec" instead - though I can't get away without a system Ruby, or bundler won't work
[02:49:21] Leepoff: has joined #RubyOnRails
[02:52:45] justrohu: has joined #RubyOnRails
[02:54:48] allcentury: has joined #RubyOnRails
[02:56:41] ur5us: has joined #RubyOnRails
[02:56:55] ur5us: has joined #RubyOnRails
[03:01:48] rafaelfranca: has joined #RubyOnRails
[03:03:43] jetpackj1: has joined #RubyOnRails
[03:06:16] wethu: has joined #RubyOnRails
[03:07:36] xall: has joined #RubyOnRails
[03:09:09] nettoweb: has joined #RubyOnRails
[03:15:01] Axsuul: has joined #RubyOnRails
[03:20:57] k3rn31: has joined #RubyOnRails
[03:22:02] arnonhongklay: has joined #RubyOnRails
[03:23:37] braincras: has joined #RubyOnRails
[03:24:28] jetpackj1: has joined #RubyOnRails
[03:26:00] Lomax: has joined #RubyOnRails
[03:26:44] xall_: has joined #RubyOnRails
[03:26:48] piotrj: has joined #RubyOnRails
[03:28:42] DZj091231kld: has joined #RubyOnRails
[03:30:19] loglaunch: has joined #RubyOnRails
[03:30:38] icedragon: has joined #RubyOnRails
[03:30:49] pokEarl: has joined #RubyOnRails
[03:32:52] dc2: has joined #RubyOnRails
[03:32:53] harfangk: has joined #RubyOnRails
[03:34:06] moeabdol: has joined #RubyOnRails
[03:34:12] Janno: has joined #RubyOnRails
[03:34:42] dminuoso: has joined #RubyOnRails
[03:36:00] jetpackj1: has joined #RubyOnRails
[03:38:45] Lomax: has left #RubyOnRails: ()
[03:42:19] clouder`grr: has joined #RubyOnRails
[03:55:51] allcentury: has joined #RubyOnRails
[03:57:00] segy_: has joined #RubyOnRails
[03:58:54] benlieb: has joined #RubyOnRails
[04:00:42] hahuang61: has joined #RubyOnRails
[04:04:39] Leepoff: has joined #RubyOnRails
[04:05:57] rafaelfranca: has joined #RubyOnRails
[04:05:57] rafaelfranca: has joined #RubyOnRails
[04:08:12] njero: has joined #RubyOnRails
[04:15:54] sypheren: has joined #RubyOnRails
[04:16:09] duncannz: has joined #RubyOnRails
[04:35:07] sadaf2606: has joined #RubyOnRails
[04:35:28] dminuoso: has joined #RubyOnRails
[04:40:10] DZj091231kld: has joined #RubyOnRails
[04:41:18] k3rn31: has joined #RubyOnRails
[04:43:48] jeromelanteri: has joined #RubyOnRails
[04:43:54] jeromelanteri: https://gist.github.com/jerome-diver/424543757705487fc4856988f53dab16
[04:44:18] jeromelanteri: collection_select seems to not work as attempted (or i miss something, but what ?)
[04:48:01] xall: has joined #RubyOnRails
[04:53:29] hahuang65: has joined #RubyOnRails
[04:56:04] rubyonrailed: has joined #RubyOnRails
[04:56:14] emilkarl: has joined #RubyOnRails
[04:56:22] dionysus69: has joined #RubyOnRails
[04:56:40] quazimodo: has joined #RubyOnRails
[04:57:51] rogue_koder: has joined #RubyOnRails
[04:59:14] sadaf2606: has joined #RubyOnRails
[05:00:39] allcentury: has joined #RubyOnRails
[05:01:12] hahuang61: has joined #RubyOnRails
[05:01:27] alfiemax: has joined #RubyOnRails
[05:02:54] FrankD_: has joined #RubyOnRails
[05:04:00] pawnbox: has joined #RubyOnRails
[05:06:05] rogue_koder: has joined #RubyOnRails
[05:18:11] DZj091231kld: has joined #RubyOnRails
[05:27:06] dionysus69: has joined #RubyOnRails
[05:28:19] emiltin: has joined #RubyOnRails
[05:36:13] dminuoso: has joined #RubyOnRails
[05:39:33] jscheel: has joined #RubyOnRails
[05:39:46] emiltin: has joined #RubyOnRails
[05:40:38] allcentury: has joined #RubyOnRails
[05:45:55] DoctorMonocular: has joined #RubyOnRails
[05:48:31] hahuang65: has joined #RubyOnRails
[05:50:04] rvanlieshout: has joined #RubyOnRails
[05:53:08] hahuang61: has joined #RubyOnRails
[05:53:58] xall: has joined #RubyOnRails
[06:02:47] Geffy: has joined #RubyOnRails
[06:05:43] arathald: has joined #RubyOnRails
[06:06:23] rubyonrailed: has joined #RubyOnRails
[06:07:01] tildes: has joined #RubyOnRails
[06:07:09] Cork: in this situation i want to set user_id in profile when i create a new user with a profile https://pastebin.mozilla.org/8879085
[06:07:13] Cork: is there a way to do that cleanly in rails?
[06:07:21] Cork: user = User.new; user.build_profile(user_id: ??)
[06:09:04] rvanlieshout: Cork: you're creating a new user or profile to start with?
[06:09:22] Cork: rvanlieshout: the problem is they both link to each other
[06:09:45] Cork: THAT is the problem i'm trying to figure out
[06:10:32] Radar: Cork: Why have both a User and a Profile?
[06:10:41] AimlessRAven: has joined #RubyOnRails
[06:10:52] AimlessRAven: hi all i have admins model and posts model
[06:10:55] Cork: Radar: users have a profile (shared) and a user can be an administrator of a profile
[06:10:56] AimlessRAven: post belongs_to admin
[06:11:00] AimlessRAven: admin has_many posts
[06:11:08] AimlessRAven: but when i set to admin model has_many :posts
[06:11:12] Radar: Cork: That pastebin link shows nothing for me
[06:11:15] AimlessRAven: rails return me undefined method `arity' for :events:Symbol
[06:11:20] Radar: AimlessRaven: !code
[06:11:20] helpa: AimlessRaven: We cannot help you with your problem if you don't show us your code. Please put it on http://gist.github.com and give us the URL so we can see it.
[06:11:37] Cork: damn....
[06:11:39] Radar: AimlessRaven: Come on mate. It's been long enough now. You should know.
[06:11:47] Radar: AimlessRaven: Gist code, don't paste it in the channel.
[06:11:51] jas02: has joined #RubyOnRails
[06:11:59] AimlessRAven: Radar: yeah ok ill gist it now
[06:12:25] greenhat|: has joined #RubyOnRails
[06:12:26] rvanlieshout: Cork: you can create both in one go
[06:12:36] rvanlieshout: the link you've pasted doesn't show any code here
[06:12:38] rvanlieshout: care to use gist?
[06:12:53] Cork: don't have a gist available
[06:13:01] AimlessRAven: https://gist.github.com/anonymous/c31475af88d072fd9d29c7c5744c37e5
[06:13:17] Radar: Cork: Then create one?
[06:13:50] Radar: AimlessRaven: Associations must be defined on their own line.
[06:13:52] Radar: AimlessRaven: has_many :posts
[06:13:56] Radar: AimlessRaven: has_many :events
[06:14:10] AimlessRAven: Radar: ill try now
[06:14:14] rvanlieshout: AimlessRaven: see the documentation for has_many
[06:14:20] rvanlieshout: (which you already did?)
[06:14:44] AimlessRAven: Radar: yeah its a my wrong thanks man so much
[06:14:54] Cork: https://pastebin.mozilla.org/8879928
[06:15:19] rvanlieshout: Cork: and what are you creating to start with?
[06:15:27] Cork: rvanlieshout: both
[06:15:39] rvanlieshout: you cannot start with both
[06:15:41] Cork: user = User.new; user.build_profile
[06:15:42] swap_a_b: has joined #RubyOnRails
[06:15:48] rvanlieshout: what params do you have?
[06:15:52] swap_a_b: has left #RubyOnRails: ()
[06:16:11] Cork: what does params have to do with this?
[06:16:27] rvanlieshout: cause i'm trying to find out what you should do (and not what you're trying to do)
[06:16:39] rvanlieshout: let me rephrase: what user action triggers this?
[06:16:42] Cork: on user.save i need to figure out how to get profile to know about the id for the user AND the user to know about the id for the profile
[06:16:45] Cork: and i don't know how to do that
[06:16:50] Radar: ACTION hands award for "world's tiniest pastebin font to pastebin.mozilla.org"
[06:17:12] rvanlieshout: if that's all you need you might want to look at setting inverse_of on your relationships
[06:17:28] DoubleMalt: has joined #RubyOnRails
[06:17:43] Cork: rvanlieshout: except that doesn't set the user_id on the profile :)
[06:18:07] rvanlieshout: it does once saved
[06:18:12] rvanlieshout: or your relationships are wrong
[06:18:25] Cork: rvanlieshout: i think your missing that the profile has many users, users have profile_id
[06:18:30] DoubleMalt: has joined #RubyOnRails
[06:18:35] Cork: and the profile have a user that is the administrator
[06:18:36] rvanlieshout: user belongs_to profile_id then?
[06:18:39] Cork: it isn't the source of the link
[06:19:10] rvanlieshout: i still don't follow the actual problem
[06:19:21] Cork: rvanlieshout: i have a circular dependency
[06:19:31] Cork: and i don't know how to tell rails to link them up
[06:19:35] rvanlieshout: and you have a validation on an _id-field?
[06:19:53] gking: has joined #RubyOnRails
[06:19:55] rvanlieshout: add validations on foo, not on foo_id
[06:20:10] rvanlieshout: cause a number referring to a non existing foo shouldn't be valid
[06:20:15] Cork: ya, but that still doesn't work as the admin link is missing on the profile (as the user isn't a direct link)
[06:20:15] rvanlieshout: then add the inverse_of
[06:20:28] rvanlieshout: the admin link is missing what where?
[06:20:29] gking: Hi, how should I store and load data Yaml files for my unit tests to load and compare with?
[06:20:54] Cork: rvanlieshout: user.build_profile populates user.profile, not user.profile.admin
[06:21:10] rvanlieshout: you've got that inverse of set?
[06:21:11] allcentury: has joined #RubyOnRails
[06:21:12] gking: Create my own dir in /test/data/ with files like data1.yml then just load them in test_helper with YAML::Load? Is there a better way than this?
[06:21:20] Cork: rvanlieshout: but that is the user.profile.users
[06:21:28] Cork: not the .admin
[06:21:34] rvanlieshout: what's .admin ?
[06:21:42] Cork: the admin of the profile
[06:21:53] Cork: and in this case the only user of the profile
[06:21:54] rvanlieshout: and build_profile is a relationship to that admin?
[06:22:00] Cork: yes and no
[06:22:09] Cork: a profile has multiple users and one admin
[06:22:15] rvanlieshout: maybe gist your full models, add a console session where you show the problem
[06:22:51] conta: has joined #RubyOnRails
[06:23:29] Radar: gking: Look at activerecord and how it handles fixtures.
[06:23:42] tildes: has joined #RubyOnRails
[06:24:09] gking: I'm using fixtures already but this is for arbritrary data, like json responses from apis that i'll use for mocks
[06:26:11] AdamOnRails: has joined #RubyOnRails
[06:26:36] AdamOnRails: Question... so I have a Product model, and it has a "category" attribute.
[06:27:12] AdamOnRails: If I wanted to output a table of my products, grouped by category... is there a sweet lil rails way to do Products.all ...
[06:27:23] AdamOnRails: lol, think i just answere my own question haha
[06:27:35] Radar: AdamOnRails: Consider making categories its own tabnle.
[06:27:56] AdamOnRails: Radar - Yeah that was going to be one of my suggested options
[06:28:15] AdamOnRails: But I think I remember there being a "grouped_by" method within the Find method/
[06:28:19] AdamOnRails: looking for it now
[06:28:22] Radar: AdamOnRails: !querying
[06:28:22] helpa: AdamOnRails: http://guides.rubyonrails.org/active_record_querying.html - ActiveRecord Querying Guide by Ryan Bigg
[06:28:28] Radar: Please read the querying guide (that I wrote)
[06:28:34] Radar: http://guides.rubyonrails.org/active_record_querying.html#group
[06:28:38] AdamOnRails: haha, copy that!
[06:30:26] AdamOnRails: boom, exactly what I needed. Was trying to avoid creating a seperate category table, cheers :)
[06:30:45] Radar: You'll probably want to create a categories table down the track to normalise your data
[06:31:05] Radar: Imagine two products, one with the category of 'shirts' and one with the category of 'Shirts'
[06:31:13] Radar: Product.where(category: "shirts") is only going to return one of them
[06:31:25] aganov: has joined #RubyOnRails
[06:31:29] AdamOnRails: Presumably it spits out a Hash like {"category_1" => [#product_1,#product_2],"category_2" => [#product_3]} ?
[06:32:12] sadaf2605: has joined #RubyOnRails
[06:32:19] Tempesta_: has joined #RubyOnRails
[06:32:21] AdamOnRails: Thing is, it will always be a fixed list of categories, a user won' be able to customise it. I have a very static list of 4 categories.
[06:32:42] AdamOnRails: So would prefer to just hardcode instead of table.
[06:33:01] rvanlieshout: AdamOnRails: make it an enum
[06:33:06] AdamOnRails: Its been the same 4 categories of product for the past 50 years :P
[06:33:12] sevenseacat: that was exactly what I was going to suggest, at least enum it
[06:34:05] darutoko: has joined #RubyOnRails
[06:36:13] AdamOnRails: Hmm, haven't really used Enums before. They look useful for boolean attributes, but not sure how it'd be useful to enum a product category?
[06:36:32] rvanlieshout: because it's really fast
[06:36:46] sevenseacat: enums wouldnt be used for boolean attrubutes
[06:36:51] rvanlieshout: enum is just a mapping between a readable value and a indexable value
[06:36:52] sevenseacat: you'd use a boolean field for those :P
[06:36:57] dminuoso: has joined #RubyOnRails
[06:37:04] rvanlieshout: and that ^ :)
[06:37:18] jenrzzz: has joined #RubyOnRails
[06:39:00] yardenbar: has joined #RubyOnRails
[06:40:04] boshhead: I'm trying to find out about Devise and CSRF tokens, it seems to be a CSRF token wouldn't be necessary because the oauth token is sent with the http headers, which another site wouldn't have access to. Or does Devise also check a cookie for this oauth token? In which case you would want a separate CSRF token.
[06:40:53] boshhead: Basically I'm wondering if Devise can fallback to cookie-based authentication rather than header-based. Cuz if it can then I'd want a CSRF token too.
[06:41:30] yfeldblum: has joined #RubyOnRails
[06:41:56] Radar: AdamOnRails: https://bendyworks.com/rails-enum-sharp-knife/
[06:42:15] AdamOnRails: Thanks guys. Cheers Radar I'll take a look. :)
[06:42:22] helpa: We're not all guys here - while you probably didn't mean to be exclusive, not everybody feels that way. Maybe consider using "folks", "y'all" or "everyone" instead?
[06:45:47] AdamOnRails: That sharp-knife article is really good
[06:46:03] arup_r: has joined #RubyOnRails
[06:46:20] pawnbox: has joined #RubyOnRails
[06:46:33] Radar: yeah it is :)
[06:49:41] jenrzzz: has joined #RubyOnRails
[06:50:26] AdamOnRails: If my product category is made up of multiple words, can I do something like this... http://pastie.org/private/iyxa88yexcqy9dpyvdtmwg
[06:50:53] rvanlieshout: i would create a split between the category key and it's human readable presentation
[06:51:08] rvanlieshout: normal_duty: 0, heavy_duty: 1, ...
[06:51:08] sevenseacat: in that case I'd use keys in the enum list, and i18n to translate them into nice strings
[06:51:44] skroon: has joined #RubyOnRails
[06:52:03] rafaelfranca: has joined #RubyOnRails
[06:52:56] ur5us: has joined #RubyOnRails
[06:53:09] AdamOnRails: Copy that. Locales here we come.
[06:53:34] AdamOnRails: Out of curiosity, what do you mean by split it, rvanlieshout?
[06:54:14] GoranPavlovic: has joined #RubyOnRails
[06:54:36] rvanlieshout: AdamOnRails: what sevenseacat wrote, but in different words. don't use locale strings in models
[06:55:00] AdamOnRails: Ah, gotchya. Yep cheers :)
[06:55:12] sevenseacat: yes, I would do what rvanlieshout said, then write a helper method to generate human-readable versions of the keys
[06:55:24] rvanlieshout: or decorator, presenter
[06:55:27] sevenseacat: if you were using decorators, that would also be appropriate
[06:55:30] rvanlieshout: what fits your app :)
[06:57:03] dminuoso: has joined #RubyOnRails
[06:58:36] AimlessRAven: has joined #RubyOnRails
[06:58:39] AimlessRAven: https://gist.github.com/anonymous/10ba569ed8321dc9e0d813ee207ede5e
[06:58:47] AimlessRAven: how to create this model when i use rails g model ..
[06:59:17] Radar: AimlessRaven: rails g model comment
[06:59:17] xall: has joined #RubyOnRails
[06:59:23] Radar: AimlessRaven: Fill out the rest of the information in the model yourself.
[06:59:55] allcentury: has joined #RubyOnRails
[06:59:58] rvanlieshout: it's like we're starting all over again
[07:00:11] artto: has joined #RubyOnRails
[07:00:40] AimlessRAven: Radar: that mean if i want to link this model to another i use rails g migration AddAdminToComment admin:references:polymorphic
[07:00:48] Radar: AimlessRaven: You asked this question 4 days ago
[07:00:48] Radar: http://logs.ryanbigg.com/RubyOnRails?date=2016-06-23#5878374
[07:01:15] sevenseacat: 4 days to generate a model? nice.
[07:01:22] sevenseacat: oh, but weekend in there
[07:01:26] Radar: AimlessRaven: No. Generate the model and then type in the code yourself to the model. There is no shortcut to generate a model.
[07:01:28] sevenseacat: still, impressive.
[07:01:28] Radar: sevenseacat: yes.
[07:01:31] AimlessRAven: Radar: no 4 days ago i ask for post model with 1 polymorphic reference, not this model should be have 4-5 models references
[07:06:47] jenrzzz: has joined #RubyOnRails
[07:08:07] artto: has joined #RubyOnRails
[07:08:22] Pazician: has joined #RubyOnRails
[07:09:15] MaDErroR123: has joined #RubyOnRails
[07:12:02] tildes: has joined #RubyOnRails
[07:13:45] jgt1: has joined #RubyOnRails
[07:16:32] dionysus69: has joined #RubyOnRails
[07:18:25] AdamOnRails: So now that I have enumed my products
[07:18:34] Ergo: has joined #RubyOnRails
[07:19:30] AimlessRAven: is polymorphic resource is same as nested resource, but just model have polymorphic association
[07:19:35] antgel: has joined #RubyOnRails
[07:19:55] AdamOnRails: I want to loop through them to create a Table in my View. I will have multiple tables for each category. How do I do Products.where(:category => "heavy_duty") ?
[07:20:04] AdamOnRails: Presumably there is a nicer way than that
[07:20:35] rvanlieshout: AdamOnRails: Product.heavy_duty :)
[07:20:42] rvanlieshout: if you're on enum
[07:20:59] AdamOnRails: And that will return a full hash of all the products that is heavy_duty?
[07:21:01] rvanlieshout: ah. i read you are
[07:21:20] rvanlieshout: not a hash, but yes
[07:21:32] rvanlieshout: it would be the same as Product.where(category: Product.categories[:heavy_duty])
[07:21:38] AdamOnRails: yeah, hash was a poor choice of word
[07:22:04] AimlessRAven: rvanlieshout: is polymorphic resource is same as nested resource, but just model have polymorphic association
[07:22:22] rvanlieshout: it's not the same
[07:22:33] rvanlieshout: but you can use any resource as a nested resource
[07:24:02] sadaf2605: has joined #RubyOnRails
[07:24:25] jenrzzz: has joined #RubyOnRails
[07:26:00] mixnblend: has joined #RubyOnRails
[07:26:03] artto: has joined #RubyOnRails
[07:28:31] ur5us: has joined #RubyOnRails
[07:30:45] Kedare: has joined #RubyOnRails
[07:32:02] AimlessRAven: has joined #RubyOnRails
[07:32:08] AimlessRAven: rvanlieshout:
[07:32:19] AimlessRAven: ok what is polymorphic resource, for example if my comment model have polymorphic association to my post model can i use @post.comments without nested resource
[07:32:50] rvanlieshout: sure you can use @post.comments
[07:32:54] dminuoso: AimlessRaven: Have you considered reading a book and figuring out things yourself? For weeks I have seen you asking questions that even some crappy youtube tutorial would have covered...
[07:34:39] SteenJobs: has joined #RubyOnRails
[07:34:58] quazimodo: has joined #RubyOnRails
[07:37:28] anagha_: has joined #RubyOnRails
[07:38:01] dminca: has joined #RubyOnRails
[07:41:12] allcentury: has joined #RubyOnRails
[07:44:48] xhoy: hi! i have an issue
[07:44:53] xhoy: i have liquid templates
[07:45:11] xhoy: and when i include an InvoiceDrop it works but it doesnt work when i do InvoicePaymentDrop
[07:45:39] xhoy: Seems like its including a different directory or something?
[07:46:01] ngw: has joined #RubyOnRails
[07:46:08] sevenseacat: "it doesnt work"?
[07:46:16] dminuoso: sevenseacat: It doesn't work!
[07:46:16] xhoy: let me get you some code
[07:46:30] sevenseacat: dminuoso: I hate when that happens./
[07:47:16] xhoy: https://gist.github.com/xhoy/6712a257df383093e1f06a15033677b4 <<
[07:47:23] xhoy: NameError: uninitialized constant InvoicePayment::InvoicePaymentDrop
[07:47:34] xhoy: exact same code works for InvoiceDrop
[07:47:52] dminuoso: xhoy: http://guides.rubyonrails.org/autoloading_and_reloading_constants.html
[07:47:57] dminuoso: I recommend you give that article a read.
[07:48:28] xhoy: when i change the invoice_drop.rb i get this error: oadError: Unable to autoload constant InvoiceDrop, expected /home/thowou/rubyprojects/finance-dev/app/drops/invoice_drop.rb to define it
[07:48:29] tbuehlmann: xhoy: the file is named invoice_payment_drop and the constant is named InvoiceDrop
[07:48:46] xhoy: ow sorry that is while testing :)
[07:48:46] sevenseacat: xhoy: class names are expected to match file names.
[07:49:04] sevenseacat: you dont even have a class called InvoicePaymentDrop in that gist
[07:50:08] dminuoso: xhoy: Just give the article a read - it will explain exactly how Rails expects the filename to match the respective constant (such as a class name)
[07:50:14] xhoy: oke let me get you all code and the error's
[07:50:33] sevenseacat: its even simpler than that - InvoicePaymentDrop != InvoiceDrop
[07:50:36] xhoy: i think its requesting a different path hwn i use InvoiceDrop or InvoicePaymentDrop
[07:50:53] xhoy: sevenseacat: that was a copy typo :)
[07:50:57] sevenseacat: the fuck, how?
[07:51:27] sevenseacat: seriously, how do you make typos when you copy and paste code?
[07:54:33] xhoy: https://gist.github.com/xhoy/6712a257df383093e1f06a15033677b4
[07:54:35] xhoy: update :)
[07:54:39] xhoy: sevenseacat: no i was testing
[07:54:43] tildes: has joined #RubyOnRails
[07:54:58] xhoy: it seems it is not loading dorp/invoice_payments_drop but more like drops/invoice/payment_drop or something else
[07:55:25] xhoy: *drop/invoice_payment_drop.rb
[07:55:26] sevenseacat: I honestly don't know what problem you're trying to describe
[07:55:35] tbuehlmann: I can't follow either
[07:55:46] sevenseacat: yes, you stuffed up the class names, so the constants are no longer defined
[07:55:46] xhoy: let me give you another error
[07:55:53] tbuehlmann: xhoy: if the file is app/drops/invoice_payment_drop, name the class InvoicePaymentDrop
[07:56:00] CausaMortis: has joined #RubyOnRails
[07:56:09] sevenseacat: no need for more errors. just fix the problem.
[07:56:33] rubyonrailed: has joined #RubyOnRails
[07:57:09] xhoy: https://gist.github.com/xhoy/6712a257df383093e1f06a15033677b4#file-with_errors2-rb
[07:57:24] xhoy: tbuehlmann: done that
[07:57:38] dminuoso: ACTION would not have spoonfed xhoy as his next autoloading problem will bring him right back
[07:57:40] xhoy: its loading the file since i get an different error when the file is empty or "wrong"
[07:57:41] tbuehlmann: now you named to constant wrong
[07:57:53] tbuehlmann: InvoicepaymentDrop.new(self) has to be InvoicePaymentDrop.new(self)
[07:58:02] dminuoso: xhoy: Really. If I were you I would stop right now and read the damn article that explains how autoloading works.
[07:58:08] xhoy: tbuehlmann: yeah! then i would get the " i tought this would be in file x
[07:58:14] xhoy: dminuoso: ok :)
[07:58:15] artto: has joined #RubyOnRails
[07:58:21] tbuehlmann: I can't follow again
[07:58:50] sevenseacat: dminuoso: while I agree with not spoonfeeding people, its easier to do that than let them sit here and ask the same question over and over for six hours.
[07:58:51] dminuoso: xhoy: If you have questions regarding that article Id be more than happy to help. But I think its more important that you understand the mechanism, than just how to solve the problem.
[07:59:04] sevenseacat: (and yes, most of them will just sit here and ask over and over)
[07:59:36] dminuoso: sevenseacat: You don't seem to think very highly of your time then. :(
[07:59:53] sevenseacat: dminuoso: if it was up to me, I'd kick them all out.
[08:00:11] artto: has joined #RubyOnRails
[08:01:05] xhoy: tbuehlmann: when you give the DropClass the wrong name you get an error like " would love to find this file on location x" when i have name with 3 captials it doesn't work at all it just gives another error (and i 5 times checked it's not a typo in the file(s) names
[08:01:30] sevenseacat: xhoy: have you read the guide yet?
[08:01:37] xhoy: sevenseacat: working on that
[08:03:14] srinidhi: has joined #RubyOnRails
[08:07:53] xall: has joined #RubyOnRails
[08:08:42] sandelius: has joined #RubyOnRails
[08:11:29] rubyonrails246: has joined #RubyOnRails
[08:11:59] AdamOnRails: if I enumerate a second Product attribute, for example "broad_category"
[08:12:48] rubyonrails246: This is my first time ever using Rails (and Ruby itself for that matter) so please bear with me on this possibly elementary question. I am trying to get into web development with Ruby on Rails, but am having a lot of trouble getting it started. I installed Ruby on Windows 10 using http://rubyinstaller.org/, and it seemed to install without problems. I then used gem install rails to get the actual rails framework onto my
[08:13:13] xhoy: rubyonrails246: most gems do not workg (easy) on windows
[08:13:20] AdamOnRails: Product.broad_category.each do {|cat| cat.each do {|prod| some_stuff}}
[08:13:23] rvanlieshout: rubyonrails246: future wise you'd be better off if you use something like vagrant
[08:13:32] rvanlieshout: edit using your favorite editor, run in a vm
[08:13:53] xhoy: rubyonrails246: or use the windows 10 ubuntu thing (works with most gems)
[08:13:56] rvanlieshout: AdamOnRails: use 2 scopes?
[08:14:01] tbuehlmann: rubyonrails246: support for windows is getting better, but it's far away from good. I agree with ^, using a VM might save you from a lot of pain
[08:14:08] xhoy: AdamOnRails: that is a scope
[08:14:12] rubyonrails246: Okay will try it out
[08:14:24] AdamOnRails: Copy that, cheers.
[08:14:27] jenrzzz: has joined #RubyOnRails
[08:14:27] jenrzzz: has joined #RubyOnRails
[08:14:30] rvanlieshout: rubyonrails246: vagrant + puppet (or other provisioning tool) even helps you in maintining a dev environment for your project
[08:14:34] pawnbox_: has joined #RubyOnRails
[08:14:39] dminuoso: rubyonrails246: You tried to install Ruby on Rails on Windows. Now you have tons of problems.
[08:15:11] xhoy: AdamOnRails: you can stack scope on top of each other
[08:15:16] rubyonrails246: dminuoso: yes I did
[08:15:51] allcentury: has joined #RubyOnRails
[08:16:15] rvanlieshout: AdamOnRails: Product.heavy_duty.something_else.where(..).where(..).order(..).limit(..) it just keeps going :)
[08:20:23] marr: has joined #RubyOnRails
[08:20:40] jsrn: has joined #RubyOnRails
[08:26:26] AdamOnRails: Hmm, I'm still unsure how to achieve what I wish to achieve the quickest way...
[08:27:54] dminuoso: AdamOnRails: What do you mean by "quickest" way?
[08:27:58] AdamOnRails: Same deal as before: Product has broad_category and category attributes. I want to find all products, then in the view I want to loop through them all to create a table per category.
[08:27:58] rvanlieshout: AdamOnRails: what do you want to achieve?
[08:28:29] rvanlieshout: Product.heavy_duty.group_by(&:category).each do |category, category_products|
[08:28:35] AdamOnRails: I could do this easily by looping trough each product and doing an IF statement to see if it's category is "normal_duty"
[08:28:43] AdamOnRails: and do that for each product
[08:28:48] AdamOnRails: under each category table
[08:29:02] AdamOnRails: that seems resource-inefficient.. too many ifs in the View
[08:29:12] rvanlieshout: so you want to group wy what exactly?
[08:29:17] AdamOnRails: Ideally I'd like to be like
[08:30:16] dminuoso: AdamOnRails: Premature optimization is if you try to consider performance before: A) you have written code that works, B) you have written tests for that code, C) you have noticed a performance problem and D) you have profiled your code and determined for that particular bit of code to be slow.
[08:30:23] dminuoso: AdamOnRails: Do not do premature optimization.
[08:30:32] rvanlieshout: agreed, but that's not really the case imo
[08:30:33] Silthias: has joined #RubyOnRails
[08:30:38] rvanlieshout: AdamOnRails: what attributes do you want to group by
[08:30:39] AdamOnRails: {"broad_category_1" => {"category_a" => {#1, #2, #3}, "Category_B" => {#4,#5,#6}}, "broad_category_2" => {"category_c" => {#7,#8,#9}}}
[08:30:47] rvanlieshout: and that means?
[08:30:52] AdamOnRails: Thats what I'd like my instance variable to look like. Just not sure how to go about it.
[08:31:03] rvanlieshout: Product.group_by(:broad_category).each do |broad_category, broad_category_products|
[08:31:11] AdamOnRails: @products = Product.some_magic_stuff_that_gets_the_above
[08:31:17] Developer001: has joined #RubyOnRails
[08:31:17] rvanlieshout: broad_category_products.group_by(&:category).each do |category, category_products|
[08:31:35] Developer001: Where would be the best place to learn about things like what "middleware" "presenters" "endpoints" "helpers" are, and how to organise code around these sorts of paradigms
[08:31:46] AdamOnRails: ahhhhh, copy that. many thanks
[08:32:30] kp666: has joined #RubyOnRails
[08:32:38] Developer001: My day job consists of writing C/C++ code that nobody besides myself will ever see or use, so I've never been exposed to much of the developer world. Now I'm using a Grape API boilerplate to serve a RESTful API and Webserver to multiple end users.... and I have no idea what I'm doing, nor is someone with a technical background other than myself comming to save me XD
[08:32:40] adre: has joined #RubyOnRails
[08:32:43] Ergo^: has joined #RubyOnRails
[08:33:26] Developer001: A book, or 5, preferably available as an e-book, would be magic. Or a website ;P
[08:36:01] artto_: has joined #RubyOnRails
[08:36:36] arBmind: has joined #RubyOnRails
[08:39:20] AdamOnRails: rvanlieshout: That little block of code OK to use in View?
[08:39:37] AdamOnRails: or use it in controller to build an array of objects to pass to the view?
[08:40:22] rvanlieshout: AdamOnRails: you'll just have 2 lines with iterations
[08:40:33] rvanlieshout: if you don't have any html between the first and second it's wrong
[08:40:51] rvanlieshout: in that case you should explain again on what you want to group :)
[08:41:14] AdamOnRails: nope all good, I gotchya, cheers :)
[08:43:16] pawnbox: has joined #RubyOnRails
[08:46:00] artto: has joined #RubyOnRails
[08:49:48] artto: has joined #RubyOnRails
[08:49:50] njero: has joined #RubyOnRails
[08:52:16] emiltin: has joined #RubyOnRails
[08:53:35] srinidhi: has joined #RubyOnRails
[08:56:38] jenrzzz: has joined #RubyOnRails
[08:56:45] siaw23: has joined #RubyOnRails
[08:56:57] ahtik: has joined #RubyOnRails
[08:57:23] harfangk: has joined #RubyOnRails
[08:59:23] TvL2386: has joined #RubyOnRails
[08:59:32] jokke: does capistrano have an option for loading environment variables from a file on the remote machine?
[08:59:54] jokke: i tried hacking something together with rbenv_prefix
[09:00:11] jokke: but export doesn't work, since it's probably not a login-shell
[09:00:19] mdw: has joined #RubyOnRails
[09:01:15] FrankD: has joined #RubyOnRails
[09:02:33] dc2: has joined #RubyOnRails
[09:03:06] dminuoso: jokke: What is your goal?
[09:03:55] jokke: well there's stuff like RBENV_VERSION and RBENV_ROOT etc in there as well as application specific settings like db uri and so on
[09:04:18] dminuoso: jokke: I would avoid rbenv for production.
[09:04:32] dminuoso: In fact I would avoid rbenv entirely since it will just create problems where none need to be.
[09:04:39] jokke: my systemd service loads the env vars from file but cap db:migrate etc fails
[09:04:48] jokke: yeah that's not an option now
[09:04:54] dminuoso: jokke: Why?
[09:04:59] jokke: ok never mind
[09:05:47] dminuoso: jokke: for application specific settings, set them directly in your config files. That extra hoop through environment variables just adds complexity for 0 reason.
[09:06:23] jokke: it makes dokku deployment super easy
[09:06:41] emilkarl: has joined #RubyOnRails
[09:07:40] jokke: so no ideas how to fix the actual problem at hand? (without changing the whole deployment setup)
[09:09:03] dminuoso: jokke: The whole idea of first putting settings into a file, so they can be read into environment variables, so another part can then read from environment variables instead from a config file is silly.
[09:09:45] ezebe: has joined #RubyOnRails
[09:09:51] jokke: no it's not
[09:09:55] jokke: but thanks for your input
[09:10:04] dminuoso: jokke: Please explain to me why it might not be.
[09:10:11] jokke: i already did
[09:10:23] jokke: it plays nice with heroku buildpacks
[09:10:44] jokke: it's great for development too
[09:11:03] jokke: to be able to override settings by just passing different env vars
[09:11:10] jokke: but i'm not here to justify my setup
[09:11:38] emilkarl: I have a server which have both staging and production environment. Using sidekiq on both it sometimes fails that the sidekiq staging env tries production jobs and they fail because wrong db connection. Is there a config for this to prefix environments or something?
[09:11:54] dminuoso: emilkarl: How are you starting sidekiq?
[09:12:07] emilkarl: sidekiq.yml and by capistrano
[09:12:19] emilkarl: is there a conig for sidekiq.yml for this?
[09:12:55] emilkarl: Using gem capistrano-sidekiq
[09:13:26] ezebe: im trying to access a json hash for fullcalendar, and can see it in "root/users/{#@user.id}/diary.json" but cannot get my fullcalendar plugin to find it. it's expecting me to pass it as a parameter in the configuration javascript which i have currently tagged onto the end of my application.js file, in the tutorial i've been using it's giving events: '/events.json' as the example
[09:13:48] mdw: has joined #RubyOnRails
[09:14:16] ezebe: but in that case it is not buried behind a changing path depending on the user. how should i signpost it?
[09:15:25] mikecmpbll: has joined #RubyOnRails
[09:15:43] ezebe: this is the link to the tutorial http://blog.crowdint.com/2014/02/18/fancy-calendars-for-your-web-application-with-fullcalendar.html
[09:16:53] dminuoso: jokke: The only thing I know to assist is that there is a rbenv_vars plugin for capistrano that you can use together with linked_files to make environment variables available to your application.
[09:17:12] rikkipitt: has joined #RubyOnRails
[09:17:18] jokke: dminuoso: thank you!
[09:17:26] jokke: dminuoso: that's _exactly_ what i need
[09:18:46] jokke: i need the vars loaded _before_ rbenv
[09:19:19] AmiMoench: has joined #RubyOnRails
[09:20:13] dminuoso: jokke: What do you mean?
[09:20:26] jokke: well there's RBENV_VERSION etc
[09:20:40] tennis: has joined #RubyOnRails
[09:20:53] dminuoso: jokke: Look at the capistrano/rbenv gem.
[09:20:54] jokke: if i understand the plugin correctly it only sources the vars before spawning ruby
[09:21:40] universa1: jokke: hmm, take the plugin as a blueprint and write your own solution? ;)
[09:21:41] britter: has joined #RubyOnRails
[09:21:53] snowy: has joined #RubyOnRails
[09:22:22] jokke: naah i'd rather wrap rbenv in a shell script that sources the env file and then runs rbenv with the given params
[09:22:41] harfangk: has joined #RubyOnRails
[09:22:44] jokke: it's annoying but i guess the quickest solution
[09:23:17] jokke: i wish the env command would support file input
[09:23:24] rvanlieshout: have it use a login shell?
[09:23:39] jokke: rvanlieshout: true, also a solution
[09:24:24] xall: has joined #RubyOnRails
[09:26:32] allcentury: has joined #RubyOnRails
[09:27:50] binaryplease1: has joined #RubyOnRails
[09:28:58] moeabdol: has joined #RubyOnRails
[09:33:21] GorillaApe: has joined #RubyOnRails
[09:33:57] GorillaApe: I have LineItem which belongs to an Order model
[09:34:26] GorillaApe: Also LineItem has many SerialNumber models and each SerialNumber belongs to a LineItem
[09:34:49] GorillaApe: I want to persist a LineItem only if order status is complete
[09:35:03] rvanlieshout: validates :order_complete
[09:35:10] GorillaApe: I mean persist a SerialNumber
[09:35:24] GorillaApe: Yeah but how within SerialNumber?
[09:35:41] universa1: validates_associated
[09:36:00] universa1: be aware of circular dependencies though, then.
[09:36:46] GorillaApe: Even then how should it access its parent
[09:37:13] GorillaApe: what should LineItem contain ? If order.state=="complete" then save ?
[09:37:59] rvanlieshout: GorillaApe: create a method on SerialNumber that returns true if the related order has status complete
[09:38:24] rvanlieshout: GorillaApe: then add: validate :that_method_name
[09:38:42] AmiMoench: has joined #RubyOnRails
[09:42:06] pawnbox: has joined #RubyOnRails
[09:45:09] rubyonrailed: has joined #RubyOnRails
[09:45:13] artto: has joined #RubyOnRails
[09:46:50] xall: has joined #RubyOnRails
[09:57:41] pawnbox: has joined #RubyOnRails
[09:59:55] test0: has joined #RubyOnRails
[10:00:24] robot: has joined #RubyOnRails
[10:00:33] mdw: hey people, I am trying to setup a simple HABTM relationship with a custom name?
[10:00:34] mdw: https://gist.github.com/mattsrobot/fab7167064305253a51471e1b4123a5c
[10:00:46] robot: has joined #RubyOnRails
[10:00:53] mdw: I'm not sure if that's the right way, and a little confused about how to do the migration
[10:05:43] dminuoso: mdw: Don't use habtm. Use explicit has_many :through
[10:05:55] dminuoso: It is much clearer and gives you more fine grained control.
[10:05:57] rikkipitt: has joined #RubyOnRails
[10:06:00] mdw: dminuoso thanks
[10:06:23] mdw: dminuoso so I create a new join table model?
[10:06:32] mdw: and use has_many through this
[10:06:39] rikkipitt: has joined #RubyOnRails
[10:06:49] mdw: got it! makes sense
[10:08:07] test0: Hi, this command has failed : (gem dependency "rails-4.2.6" --remote --clear-source -s http://rubygems.org/) also this one fails (gem dependency "rails (4.2.6)" --remote --clear-source -s http://rubygems.org/) ...gem commands like 'specification' or 'contents' also fail, regexp with search command works , and gives 'rails (4.2.6)' , ...Now How to know the size or content of rails before installing it ??, also there is a long list dump after each command
[10:08:13] xall: has joined #RubyOnRails
[10:10:03] lessless: has joined #RubyOnRails
[10:10:29] lessless: how to use AMS with collection without `render` ?
[10:10:53] mdw: dminuoso do you have a convention for naming these join tables?
[10:11:03] dminuoso: test0: You need to specify the dependency using -v, do not include it in your gem name.
[10:11:07] fujinuma: has joined #RubyOnRails
[10:11:19] dminuoso: mdw: Lexical order, both pluralized. That is the Rails convention.
[10:11:32] mdw: dminuoso thanks
[10:11:54] test0: dminuoso: ok thanks I will try it...
[10:12:00] fujinuma: I'm writing a simily face rating system with a commenting area
[10:12:27] fujinuma: User has_many Comments should I put simily_face to another Model?
[10:12:49] fujinuma: or just add a field for simily face in Comment model?
[10:14:03] AntiSpamMeta: has joined #RubyOnRails
[10:14:15] dminuoso: mdw: Relevant official guide to reflect this: http://guides.rubyonrails.org/association_basics.html#updating-the-schema (see 3.3.2)
[10:14:41] mdw: dminuoso thanksagain
[10:14:45] dminuoso: You are welcome.
[10:19:13] test0: has joined #RubyOnRails
[10:20:03] jeromelanteri: from devise try to authenticate on smtp server, i have this error back: SSL_connect returned=1 errno=0 state=SSLv2/v3 read server hello A: unknown protocol
[10:20:42] jhass: jeromelanteri: does your SMTP server have a valid cert or is it self signed?
[10:21:03] jeromelanteri: jhzs, self signed
[10:21:12] artto: has joined #RubyOnRails
[10:21:18] jhass: self signed by a custom CA or on the host itself?
[10:22:01] jhass: well since you then don't seem to care about encryption much, you should be able to just turn of peer verification in the client
[10:22:06] jhass: or skip starttls altogether
[10:22:44] jhass: well, you could get the self signed cert and abuse it as CA cert
[10:22:53] duderonomy: has joined #RubyOnRails
[10:22:54] jhass: and configure your clients truststore to it
[10:23:03] jeromelanteri: jhass, i care, but it's the first time for me to make running my own dovecot and postfix server...
[10:23:14] jeromelanteri: i also not have any DNS server
[10:23:18] jhass: if you care, have a look at letsencrypt
[10:23:28] jhass: DNS is completely irrelevant here
[10:24:23] jeromelanteri: jhass, ho ok... i was afraid about DNS for DKIM
[10:24:56] jhass: DKIM certainly helps to get your mail accepted by larger providers (DMARC even more so)
[10:25:09] jeromelanteri: but the problem is not here... you tell me to look at "letsencrypt" ? what is that ? where to look for that ? is it something on postfix config or on devise or rails ?
[10:25:14] jhass: but that neither requires your own DNS server nor is it any relevant here
[10:25:40] jhass: it's to get a free valid DV cert in an automated way for your mailserver
[10:25:52] jhass: https://letsencrypt.org/
[10:25:59] lupine: TBH it sounds more like your problem is that you're trying to talk SSL on a starttls/plain port
[10:26:11] lupine: all this talk of certificates is irrelevant
[10:26:20] jhass: well, it isn't
[10:26:23] jeromelanteri: jhass, do you have a link to provide please ? i would like to try to learn more around all of that... it is steal confuse in my little head.
[10:26:37] conta: has joined #RubyOnRails
[10:26:41] jhass: even if you're correct, the self-signed cert will just be the next issue
[10:26:43] jeromelanteri: ho yes, i just see the link, thank you jhass
[10:26:53] lupine: well, sure, but it's worth fixing the first issue first
[10:27:07] lupine: invalid certs are very very common in SMTP
[10:27:15] jhass: which is very very sad
[10:27:20] jeromelanteri: lupine, sorry, i just reading you now...
[10:27:33] jhass: given LE and postfix native DANE support
[10:27:59] jeromelanteri: yes, i'm trying to to talk ssl on strattjs plain port, that's correct.
[10:28:18] jhass: also common != correct
[10:28:21] lupine: jeromelanteri: the immediate issue is that your client expects the server to speak SSL straight away. the server is not speaking SSL straightaway, but unencrypted SMTP
[10:28:34] artto: has joined #RubyOnRails
[10:28:39] jhass: jeromelanteri: show your SMTP client config
[10:28:47] lupine: if you want SSL straightaway, you probably want port 465 (or 587?) rather than 25
[10:29:05] lupine: but there's nothing wrong with connecting to port 25 and using starttls
[10:29:29] jeromelanteri: lupine, jhass, ok i understand better now (i thank that starttls is just a mode for force to use ssl... but not, it should encrypt datas.. that is ?) now
[10:29:34] xall: has joined #RubyOnRails
[10:29:41] jhass: lupine: sorry but that statement is pretty wrong these days
[10:29:54] lupine: jhass: I'm a perpass fundamentalist myself
[10:30:02] jhass: 465 was deprecated like 20 years ago, it's not even assigned anymore as SMTPS by IANA
[10:30:14] jhass: StartTLS is the way to go
[10:30:22] jhass: 25 is for MTA -> MTA communication, only
[10:30:24] jeromelanteri: lupine, jhas, my server can reicept and send messages (it works... it is far from be perfect because of need to be more recognized as acceptable, but it works)
[10:30:40] jhass: that is for mail which the receiving MTA is the destination for
[10:30:44] jeromelanteri: lupine, jhass so is it possible to config rails for accept thiongs like that first ?
[10:31:08] jhass: 587 is for submission and for this scenario StartTLS via 587 is the most if not only correct approach
[10:31:08] njero: has joined #RubyOnRails
[10:31:53] jeromelanteri: but if i well understand, the message is encrypted and go through port 25 also...
[10:32:17] jeromelanteri: (because i had to ask my VPS provider to open port 25 for be able to send emails)
[10:32:19] lupine: hmm, maybe I reversed the polarity of the error message
[10:32:40] jhass: lupine: it might just be a ciphermismatch
[10:32:59] artto: has joined #RubyOnRails
[10:33:00] jhass: jeromelanteri: we need to see your client config in order to see whether you enabled starttls correctly
[10:33:33] jeromelanteri: jhass, ok, thank you for take time for read it, i will post the part code of that in 2 minutes.
[10:33:34] jhass: lupine: but I've seen weird stuff on self signed certs too, so that's a variable I wanted to get rid of first
[10:34:04] lupine: think I'll leave you to it TBH ^^
[10:35:12] srinidhi: has joined #RubyOnRails
[10:35:23] GorillaApe: Is there a way to create N new objects ?
[10:35:28] jeromelanteri: https://gist.github.com/jerome-diver/1c57a974a5fcb1687d41bfda2e9d6ac7
[10:36:37] mixnblend: has joined #RubyOnRails
[10:37:29] dminuoso: GorillaApe: Integer#times
[10:37:49] GorillaApe: oh great. thankz
[10:37:57] jeromelanteri: also, i just change these parameters, because before i send on n other server smtp on shared host from o2switch provider (works well ... before... suddenly no more with same config, so i decided to change config for my new smtp server/adress)
[10:39:35] dminuoso: jhass: Of course StartTLS is a joke since it will not defend against MITM attacks. :-)
[10:39:56] jhass: dminuoso: only if you don't require it
[10:40:34] jhass: jeromelanteri: not your current issue, but don't do this: openssl_verify_mode => 'none'
[10:40:34] dminuoso: Yeah I suppose.
[10:40:46] jhass: jeromelanteri: it makes using TLS at all pointless
[10:41:03] nettoweb: has joined #RubyOnRails
[10:41:14] jhass: jeromelanteri: looks good otherwise, let me find a cipherscan for your smtp server
[10:41:21] allcentury: has joined #RubyOnRails
[10:41:31] jeromelanteri: jhass, and tls => true is not wrong ?
[10:41:34] jhass: jeromelanteri: ah no, I overlooked something
[10:41:38] jhass: yes, that's wrong
[10:41:52] jhass: does the error change if you remove it?
[10:42:17] jeromelanteri: instead of "none" for option openssl_verify_mode, which option it should be ?
[10:43:02] umdstu: has joined #RubyOnRails
[10:43:21] jhass: the default, peer
[10:43:40] jhass: all others make no sense in client usage, I recently fixed rails docs in that regard btw
[10:43:54] jhass: (just omit it, the default is good)
[10:44:00] jeromelanteri: jhass, the error is the same, and i also retsarted the nginx server for be sure it re-read the config env development.rb file
[10:44:30] jeromelanteri: (i go on nginx-passenger, from localhost first)
[10:44:34] jhass: you run in development mode in production?
[10:44:39] lxsameer: has joined #RubyOnRails
[10:44:52] jhass: or use nginx + passenger for your local dev env?
[10:44:56] jhass: both is rather... uncommon
[10:45:11] jeromelanteri: jhass, i'm in development ode, i not product nothing now, my code is not finished, and i try on my localhost computer first
[10:45:30] jhass: time to cipherscan I guess
[10:45:40] Moeh: has joined #RubyOnRails
[10:45:40] jeromelanteri: jhass, i'm trying to be closer than the last configuration, but on my computer fiorst
[10:46:01] mostlybadfly: has joined #RubyOnRails
[10:46:20] jeromelanteri: i'm reading things about use of "cerbot" application on archlinux
[10:46:48] jeromelanteri: certbot is the application who will ask certificat to letsencrypt server ?
[10:47:10] jhass: it's one of many but the official client implementation of the ACME protocol, yes
[10:47:27] jhass: note you should run it on your mailserver
[10:47:33] jeromelanteri: jhass, very good, i didn't know that. thank you for the link.
[10:47:52] jeromelanteri: jhass, yes, sure, i will install it now on my VPS server
[10:48:05] Moeh: Hey guys, I am using the braintree gem and unfortunately some of the objects are not serializable (see: https://github.com/braintree/braintree_ruby/issues/50). Braintree-rails seems to be overkill for us as well, therefore I would like to implement the recommendation from this comment: https://github.com/braintree/braintree_ruby/issues/50#issuecomment-227195012 So where do I have to override the Braintree::Customer model to be able to serialize it?
[10:48:45] sadaf2605: has left #RubyOnRails: ()
[10:49:42] fox_mulder_cp: hm. i use rails 4.2, but my AR orm can't generate uuid as id by default, i try this https://github.com/rails/rails/compare/f94e328cf801...5a47639aac45
[10:50:04] pawnbox: has joined #RubyOnRails
[10:50:33] PotatoChipz: has joined #RubyOnRails
[10:50:37] fox_mulder_cp: in rails5 seems ok
[10:51:00] GodFather: has joined #RubyOnRails
[10:53:47] fox_mulder_cp: i try fix config.generators, set config.active_record.primary_key = :uuid, but nothing
[10:54:25] quazimodo: has joined #RubyOnRails
[10:54:31] pawnbox: has joined #RubyOnRails
[10:55:56] marr: has joined #RubyOnRails
[10:56:37] jeromelanteri: jhass, in this link (arch wiki for certbot) it talk about create a service for renew certificats with a timer... but does it be more simple and sure to better go from create a fcron command in fcrontable for do it every month (every month or... i don't know currently what is the best timing for do that without abuse of letsencrpt server) ?
[10:57:17] jeromelanteri: fox_mulder_cp, i'm looking on your link and would like to help, but it is not my level... i'm not able to provide help, sorry.
[10:57:48] jhass: jeromelanteri: I don't know fcron, I find systemd timers very easy to use and replaced 95% of my cron usages with them
[10:58:01] jeromelanteri: jhass, it is like cron
[10:58:13] jeromelanteri: jhas, ho yes...
[10:58:24] CausaMortis: has joined #RubyOnRails
[10:58:49] emilkarl: has joined #RubyOnRails
[10:59:18] jeromelanteri: jhass, and renew certificat every day is not to much frequency ?
[11:00:00] dvinciguerra_: has joined #RubyOnRails
[11:00:04] jhass: jeromelanteri: the client will do nothing unless the cert is less than 30 days away from expirey
[11:00:14] jhass: note that you need to reload postfix after the cert was renewed
[11:00:20] srinidhi: has joined #RubyOnRails
[11:00:26] ur5us: has joined #RubyOnRails
[11:00:36] siaw23: has joined #RubyOnRails
[11:00:48] jeromelanteri: jhass, the idea for run on cron (or conire or fcron, anyway) was to not add more memory usage services running deamons, then use the tools allready running (and works fine) for do the job for reduce RAM memory usage.
[11:01:16] jhass: well systemd is already running anyway
[11:01:46] jhass: personally I run the renewal job once a week but I also have monitoring of certificate liftetimes in place
[11:02:08] jeromelanteri: jhass, yes, i have to restart postfix and should have to indicate the new keys/certificats on the new /etc/letsencrypt my_domain.tld/ directory.
[11:02:47] jhass: /etc/letsencrypt/live/ contains symlinks to the most recent version of the certificate
[11:02:50] jeromelanteri: jhass, ok, i see there is also a signalisation for frequency limitations on letsencrypt... i have to read it.
[11:02:51] jhass: a reload is enough
[11:03:55] fox_mulder_cp: oh. systemd timers... unix way - classic crontabs and try to renew certs at least one try per day
[11:03:59] jhass: btw the cipherscan for your mailserver looks ok, mh, if you really still have a negotiation error it's an ancient openssl on the client perhaps?
[11:04:15] jeromelanteri: and then from there, if i just use these certificat, normally the config rails client should be correct ? (what to put instead of "none" for option :openssl_verify_mode
[11:04:17] CausaMortis: has joined #RubyOnRails
[11:04:48] fox_mulder_cp: so, letsencrypt certs must be user only for apache/nginx, not exim/postfix/ftp etc
[11:05:32] fox_mulder_cp: by letsencrypt policy, and, as i think, this certs types
[11:05:51] jeromelanteri: fox_mulder_cp, so you tell me that if my user is "http" with nginx, it should not works for other users (postfix for example) ?
[11:06:03] jeromelanteri: same if postfix is inside the group http ?
[11:06:36] fox_mulder_cp: jeromelanteri: use for serving and securing your connection != system user postfix et
[11:07:01] harfangk: has joined #RubyOnRails
[11:07:09] AzaToth: has joined #RubyOnRails
[11:07:58] fox_mulder_cp: cert has a some types of using cases - mail, web, server, user auth, etc. u can't use web or auth cert for crypting files, as example
[11:07:59] jeromelanteri: fox_mulder_cp, and when postfix do communication on port 587, it is not comunication ? i not really understand why it should be limited and how.
[11:08:11] jhass: fox_mulder_cp: FUDI and plain wrong
[11:08:14] douglascorrea: has joined #RubyOnRails
[11:08:31] jhass: LE issues perfectly fine X509 DV certs, no restrictions on usage whatsoever
[11:08:55] fox_mulder_cp: jeromelanteri: https://community.letsencrypt.org/t/use-on-non-web-servers/425
[11:09:13] jeromelanteri: fox_mulder_cp, i'm going to read this. thank you
[11:09:29] JamieD: has joined #RubyOnRails
[11:09:40] jhass: fox_mulder_cp: you should read your own link
[11:10:21] workmad3: has joined #RubyOnRails
[11:10:48] darutoko: has joined #RubyOnRails
[11:10:55] fox_mulder_cp: jhass: hm. LE planned for use only with web servers, and i'm reaaly confused
[11:11:17] jeromelanteri: fox_mulder_cp, schoen said (aug 2015): Just in case people reading this thread aren't familiar with the key usage concept, the Let's Encrypt certs are indeed intended to be used with POP, IMAP, and SMTP servers and should work fine for these applications.
[11:11:18] jeromelanteri: The applications that are forbidden by the EKU policies are other non-TLS uses such as code signing.
[11:11:42] jhass: fox_mulder_cp: do you have an actual official source on that?
[11:12:32] xall: has joined #RubyOnRails
[11:12:47] arup_r: has joined #RubyOnRails
[11:13:16] Coldblackice: has joined #RubyOnRails
[11:14:13] fox_mulder_cp: jhass: i knows about this policy, but now and technically may be allowing to use LE certs for non-web server soft
[11:14:39] Phoop: has joined #RubyOnRails
[11:15:15] fox_mulder_cp: anyway, some can help me with my uuid's using ad id in generators?
[11:15:24] jhass: fox_mulder_cp: please either provide an official link to the policy stating that or stop spreading FUD, thank you
[11:16:00] jhass: I've talked to several people employed for working on LE and they never made such a claim, non the contrary
[11:17:12] jeromelanteri: fox_mulder_cp, i appreciate you tried to help me, and i read articles you provide, schoen said it does it, it's curently working for mail server imaps, pops, smtps, starttls. so i will also tell you if i arrived to make working this the same way from postfix smtp with starttls on port 587. thank you
[11:19:15] fox_mulder_cp: jeromelanteri: hm. when i try to use LE's for mails/ftp - it fails for cert type missmatching, but i try to do it when LE was beta
[11:19:34] emilkarl[away]: How can I separate Sidekiq instances on the same server. I have staging and production on the same machine and sharing same redis server. Is there some way to prefix queues or something be default in Sidekiq?
[11:20:34] jeromelanteri: fox_mulder_cp, ok, i will remember this note in a part f my head...; all of this is totlay new for me, lot ofd think to understand and do...
[11:20:58] rodfersou: has joined #RubyOnRails
[11:20:59] fox_mulder_cp: emilkarl[away]: queue can be tagged, so u can make it different by stage_blabla and production_blabla, as examle
[11:21:04] jhass: emilkarl[away]: you should be able to use the redis-namespace gem and configure sidekiq to use a redis client instance using it
[11:21:11] dminuoso: jhass: The only thing that makes LE focused on web servers is the fact that HTTP over TLS is by far the dominant use case for TLS.
[11:21:18] artto: has joined #RubyOnRails
[11:21:20] dminuoso: But that is just statistics, nothing else.
[11:22:03] jhass: dminuoso: yes and that the automation of their client is and for foreseeable future will be focused on webservers
[11:22:04] Fernando-Basso: has joined #RubyOnRails
[11:24:20] emilkarl[away]: ok jhass and fox_mulder_cp
[11:24:38] jhass: emilkarl[away]: https://github.com/mperham/sidekiq/wiki/Using-Redis#complete-control
[11:24:57] emilkarl[away]: i dont want to prefix queues. A better option would be so set it so each environment uses separate redis databases maybe?
[11:25:18] dminuoso: emilkarl[away]: As they should.
[11:25:20] jhass: emilkarl[away]: note that mike recommends using separate redis instances or at least separate redis databases instead though
[11:25:48] dminuoso: emilkarl[away]: In fact I wouldn't let my development <anything> have any access to my production <anything>.
[11:26:05] fox_mulder_cp: dminuoso: good practice :)
[11:26:07] emilkarl[away]: that would be ideal.
[11:27:20] emilkarl[away]: but lets say you have 3 different production apps on the same machine with the same redis server. and they all have queues low/normal
[11:27:27] PaaYaw: has joined #RubyOnRails
[11:27:56] dminuoso: Hello PaaYaw!
[11:28:27] artto: has joined #RubyOnRails
[11:28:37] PaaYaw: just joined this channel...have no idea how it works...
[11:28:41] jhass: jeromelanteri: to clarify, I in fact _am_ actively using LE certs for mail (postfix/dovecot) and XMPP, not just HTTP
[11:28:49] dminuoso: PaaYaw: If you have a question or a problem, just ask! :-)
[11:29:07] PaaYaw: sweet..thanks!
[11:30:56] jeromelanteri: jhass, yes, i understand it ow, i read your post on ssl certificat on currently discussions on github. that's good. Now i'm trying to well install and config certbot and certbot-nginx on my archlinux VPS server. thank you for your great help.
[11:33:58] xall: has joined #RubyOnRails
[11:34:16] Silthias: has joined #RubyOnRails
[11:35:32] PotatoChipz: has joined #RubyOnRails
[11:37:23] PotatoChipz: Hello! If I'm calling an API for a payment gateway and I have to update balance of my database right after, should I use locking or transaction?
[11:37:57] PotatoChipz: I should wrap the whole 2 processes, I'm thinking. But I'm not sure which of the 2
[11:39:33] ldnunes: has joined #RubyOnRails
[11:41:47] segy: has joined #RubyOnRails
[11:45:31] jeromelanteri: potatochipz, this is job for commit/transaction on database (from mysql and postgresql).
[11:45:46] artto: has joined #RubyOnRails
[11:46:49] jeromelanteri: potatochipz, locked should lock access to other... what you need is use of commit/transactions to be able to remove things back if something wrong happens. this functions are made for commercial transactions to.
[11:47:25] srinidhi: has joined #RubyOnRails
[11:48:31] Tempesta: has joined #RubyOnRails
[11:48:56] rodferso1: has joined #RubyOnRails
[11:50:14] xall: has joined #RubyOnRails
[11:54:39] mauro1254: has joined #RubyOnRails
[11:56:22] mauro1254: I guys, I'm trying to deploy a rails 4.2.6 app through capistrano and I have the following issue: An error occurred while installing mini_racer (0.1.4), and Bundler cannot continue.
[11:56:39] d0nn1e: has joined #RubyOnRails
[11:57:15] dminuoso: mauro1254: install the gem manually and look at the error message?
[11:59:46] artto_: has joined #RubyOnRails
[11:59:48] test0: has joined #RubyOnRails
[11:59:52] mauro1254: dminuoso: ERROR: Failed to build gem native extension.
[12:00:13] fox_mulder_cp: mauro1254: see logs, may be u need some dependencies
[12:00:41] c355E3B: has joined #RubyOnRails
[12:00:53] defsdoor: has joined #RubyOnRails
[12:00:57] dminuoso: mauro1254: Surely you got more than just than this undescriptive error message, right?
[12:01:34] dminuoso: mauro1254: Then why are you hiding the real error message from us?
[12:01:56] mauro1254: I can create a gist
[12:02:31] fox_mulder_cp: mauro1254: if u want a help, please, ask your qa properly
[12:03:03] dminuoso: mauro1254: But fine. Without a full error message I am as clueless as you are.
[12:05:07] mauro1254: Here is the gist: https://gist.github.com/maurosbu/4bfceaf66d28bd829e8666582639ac25
[12:06:06] dc2: has joined #RubyOnRails
[12:06:27] fox_mulder_cp: mauro1254: now ruby 2.3.1p112 (2016-04-26 revision 54768)
[12:06:31] xall: has joined #RubyOnRails
[12:06:32] fox_mulder_cp: why u use older>
[12:07:57] mauro1254: fox_mulder_cp: because I cannot upgrade it right now
[12:08:05] mauro1254: I'm not on a local machine
[12:08:28] mauro1254: Is the issue related to the version of ruby?
[12:08:59] fox_mulder_cp: mauro1254: heroku?
[12:09:10] mauro1254: fox_mulder_cp: no
[12:09:33] nettoweb: has joined #RubyOnRails
[12:09:48] dminuoso: mauro1254: What compiler are you using?
[12:10:52] dminuoso: mauro1254: And no, from what I can see the issue is not related to Ruby. Id say you are using an old compiler without C++11 support.
[12:11:05] mauro1254: on machine I see g++/cpp v. 4.4.7
[12:11:17] dminuoso: mauro1254: I think C++11 support starts at gcc-4.8
[12:11:32] dminuoso: mauro1254: Upgrade your compiler to at least that and then rebuild.
[12:11:35] rafaelfranca: has joined #RubyOnRails
[12:11:46] mauro1254: dminuoso: thx
[12:12:23] fox_mulder_cp: .. and rebuild everything, i mean...
[12:12:37] Fernando-Basso: has joined #RubyOnRails
[12:13:45] mauro1254: Ok, for the moment I'll stay with therubyracer, but I will go with an upgrade in the near future. Many thanks for your help.
[12:13:56] michael_mbp: anyone have any tips on finding clients for Ruby/Rails work?
[12:14:25] fox_mulder_cp: michael_mbp: meetups, elance/etc?
[12:14:33] fox_mulder_cp: local job lists
[12:15:05] michael_mbp: hey fox_mulder_cp well I have my resume up http://desilva.io
[12:15:19] michael_mbp: I work directly with clients rather than going through a 3-rd party system.
[12:15:36] pontiki: network, network, network
[12:15:36] bbrowning: has joined #RubyOnRails
[12:15:44] dminuoso: fox_mulder_cp: That should not be necessary. GCC adheres to a standard ABI for C++.
[12:15:54] pontiki: meetups are a great idea, talk / present at them
[12:15:56] michael_mbp: hey pontiki yeah, that's mostly where I've been getting most work.
[12:15:57] pontiki: build your brand
[12:15:57] fox_mulder_cp: michael_mbp: use linkedin, as example.
[12:16:00] dminuoso: So he can actually just build that gem with the newer compiler and everything should work out.
[12:16:17] jeromelanteri: fox_mulder_cp, i find this link show that certbot is not only working for starttls on email servers, it also want it to do by provide thrid-party plugin that has been provided by other developers for postfix (and some other like openVPN, etc...). all of this for free.
[12:16:26] jeromelanteri: https://certbot.eff.org/docs/using.html
[12:16:47] michael_mbp: pontiki: downside is I'm pretty remote, and also as a result always work 100% remote too
[12:16:47] fox_mulder_cp: dminuoso: i use rebuild my rbenv environment for some couple of months, for clear it, and patch ruby etc
[12:16:53] pontiki: linkedin seems to be recruiter fodder. so does dice. last week i made one change in my dice profile (i think i deleted a skill) and BAM all week i've been getting calls
[12:17:28] michael_mbp: aye, I get way too many recruiters contacting me
[12:17:30] fox_mulder_cp: jeromelanteri: i use LE classic script
[12:17:36] pontiki: follow up with them
[12:17:55] michael_mbp: I do, but then again, I'm not interested in relocating per-say.
[12:18:11] pontiki: what's relocating have to do with anything?
[12:18:33] michael_mbp: and if that was on the table 1. clients don't want to pay for VISAs typically or 2 they can't afford me. Ah recruiters on LinkedIn - the ones that ping me are for roles where they want you to move to another country.
[12:18:46] jeromelanteri: fox_mulder_cp, i'm trying to make running mode webroot for renew certificats, but i have an error... but ok... i think i not well all understand (have to re-read tomorrow). So now just try to put good links for keys on good option /etc/postfix/main.cf file (then try)
[12:19:20] pontiki: so you reply and tell them your needs. if they respond, you've got one. play the game the same way they do
[12:19:31] pontiki: but you know all this, you can figure this out
[12:19:53] pontiki: there's no magic hunting work as an independent, you have to keep working it and working it and working it
[12:19:55] jeromelanteri: jhass, did you also use webroot mode ?
[12:20:19] michael_mbp: pontiki: aye, thanks for the tips though.
[12:20:21] lessless: has joined #RubyOnRails
[12:20:22] jhass: jeromelanteri: yes
[12:20:37] jeromelanteri: jhass, with nginx ?
[12:20:43] michael_mbp: pontiki: dice.com worth it?
[12:20:49] fox_mulder_cp: jeromelanteri: read postfix docs, anyway
[12:21:06] pontiki: it costs nothing but a wee bit of time to set up, so yeah, maybe
[12:21:23] jeromelanteri: jhass, ok. certbot certonly --email jerome-lanteri@aquaworks-inspections.tk --webroot -w /var/lib/letsencrypt -d aquaworks-inspections.tk
[12:21:32] jeromelanteri: what's wrong here ?
[12:21:42] fox_mulder_cp: as about jobs - i try to switch from admin to programmer since 28 years old - all hr says, that i'm old for switching
[12:21:47] Detch: has joined #RubyOnRails
[12:21:51] jhass: jeromelanteri: is your nginx configured to pick that up?
[12:21:54] jhass: jeromelanteri: https://p.jhass.eu/3s.txt
[12:21:59] jeromelanteri: jhass, it answer that: Type: unauthorized
[12:22:29] rikkipitt: has joined #RubyOnRails
[12:22:32] fox_mulder_cp: i write my own cash control webapp on asp.net mvc and now write apps hosting control panel with mail, epp, sql, etc
[12:22:49] xall: has joined #RubyOnRails
[12:22:52] michael_mbp: any advice on getting monit to keep Unicorn running properly? I've got a bog-standard config, and if I kill off the master Unicorn process it takes ages before Monit does anything. https://gist.github.com/bsodmike/5ad8e4486a6a6708cd15c6202c9ba307 thoughts?
[12:22:53] jeromelanteri: jhass, no.. nginx need to handle that... ho ok, i understand, i have to add a directory redirection in nginx config file. ok, thank you
[12:23:09] jhass: jeromelanteri: if you place a file at /var/lib/letsencrypt/foo a curl aquaworks-inspections.tk/.well-known/foo should return it
[12:23:16] michael_mbp: I've checked ant that pid file exists just fine.
[12:23:25] jhass: er, sorry a curl aquaworks-inspections.tk/.well-known/acme-challenge/foo
[12:24:20] jhass: jeromelanteri: actually I currently don't remember whether certbot writes the file at /foo or /.well-known/acme-challenge/foo relative to the path you give it
[12:24:29] jhass: but the docs probably mention that
[12:24:48] jeromelanteri: jhass, yes, i'm reading that. thank you
[12:24:56] mdw: has joined #RubyOnRails
[12:26:09] dminuoso: jhass: Im actually curious whether administrators have started using LE for their company servers.
[12:27:11] jmignault: has joined #RubyOnRails
[12:27:12] jhass: dminuoso: sure, there are some hosting companies already integrating it
[12:27:21] snowy: has joined #RubyOnRails
[12:28:41] jhass: dminuoso: https://github.com/certbot/certbot/wiki/Web-Hosting-Supporting-LE
[12:29:22] dminuoso: It would be pretty awesome for our infrastructure because let's face it - certificate management is ultra annoying.
[12:29:46] dminuoso: We just want it all to be secure but not spend a single man hour for it.
[12:30:12] universa1: security costs time!
[12:30:28] jhass: the biggest consideration in large scale deployments is whether you're going to hit any rate limits
[12:30:51] fmcgeough: has joined #RubyOnRails
[12:31:27] fox_mulder_cp: certificate management is ultra annoying and costs under ~500usd/eur
[12:31:35] dminuoso: universa1: Sorry let me rephrase. We would like to live under the illusion that we are doing everything we can, without actually investing man hours into it. ;-)
[12:31:41] fox_mulder_cp: thats make me cry
[12:32:02] sergey_makagon: has joined #RubyOnRails
[12:34:25] allcentury: has joined #RubyOnRails
[12:36:14] arup_r: has joined #RubyOnRails
[12:36:30] Ergo: has joined #RubyOnRails
[12:39:07] elementaru: has joined #RubyOnRails
[12:39:09] xall: has joined #RubyOnRails
[12:42:35] matthewd: michael_mbp: How long is ages?
[12:44:03] artto: has joined #RubyOnRails
[12:46:05] xlegoman: has joined #RubyOnRails
[12:46:16] michael_mbp: matthewd: at least 2 mins if not more
[12:46:41] michael_mbp: and until it decides to restart it, nginx shows a 502 as the upstream is effectively dead (there's no socket to connect to).
[12:47:41] universa1: michael_mbp: can't you tell monit to restart it? instead of killing the unicorn process?
[12:48:03] michael_mbp: hey universa1 well, I was just checking to see how it would react _should_ the master process dies.
[12:48:26] emiltin: has joined #RubyOnRails
[12:48:33] matthewd: michael_mbp: That sounds about right: monit only checks every N seconds, as configured... which from memory defaults to something fairly high
[12:48:44] michael_mbp: matthewd: AAH!
[12:49:00] matthewd: (it's not like init, which will react immediately)
[12:49:53] tknz: has joined #RubyOnRails
[12:49:55] matthewd: If you're just monitoring should-be-very-stable processes though, like the unicorn master, I wouldn't necessarily worry too much, personally
[12:50:03] antgel: has joined #RubyOnRails
[12:51:07] pontiki: i don't think you'd want to monitor unicorn too quickly
[12:51:19] pontiki: well after it's own reap time, for sure
[12:53:13] kimegede: has joined #RubyOnRails
[12:54:05] aegis3121: has joined #RubyOnRails
[12:54:08] njero: has joined #RubyOnRails
[12:54:29] tercenya: has joined #RubyOnRails
[12:54:50] arBmind: has joined #RubyOnRails
[12:55:34] xall: has joined #RubyOnRails
[12:57:57] sadaf2605: has joined #RubyOnRails
[13:01:34] michael_mbp: well I'm assuming `set daemon n` is in seconds; my config has it set to 300s or 5 Min.
[13:01:46] michael_mbp: that sounds about right, for 'takes ages' :)
[13:02:06] allcentury: has joined #RubyOnRails
[13:02:48] michael_mbp: pontiki: recall where the unicorn reap time is set?
[13:03:00] pontiki: 30s by default, iirc
[13:03:49] michael_mbp: ah the timeout directive (nuke workers)
[13:04:04] oystersauce8: has joined #RubyOnRails
[13:04:27] lxsameer: has joined #RubyOnRails
[13:05:46] JamieD: has joined #RubyOnRails
[13:06:56] ramortegui: has joined #RubyOnRails
[13:07:26] jgt2: has joined #RubyOnRails
[13:07:47] moeabdol: has joined #RubyOnRails
[13:08:13] FernandoBasso: has joined #RubyOnRails
[13:10:07] michael_mbp: thanks chaps.
[13:11:05] quazimodo: has joined #RubyOnRails
[13:11:25] arup_r: has joined #RubyOnRails
[13:11:48] xall: has joined #RubyOnRails
[13:11:56] GodFather: has joined #RubyOnRails
[13:12:06] sk0r: has joined #RubyOnRails
[13:12:35] artto: has joined #RubyOnRails
[13:14:13] diegoviola: has joined #RubyOnRails
[13:14:46] artto: has joined #RubyOnRails
[13:15:46] wilsonc91: has joined #RubyOnRails
[13:16:59] shinnya: has joined #RubyOnRails
[13:18:40] arBmind: has joined #RubyOnRails
[13:22:57] PotatoChipz: has joined #RubyOnRails
[13:23:03] arup_r1: has joined #RubyOnRails
[13:23:21] PotatoChipz: Does with_lock automatically reloads the instance locked?
[13:27:51] pawnbox: has joined #RubyOnRails
[13:28:07] xall: has joined #RubyOnRails
[13:28:26] AmiMoench: has joined #RubyOnRails
[13:28:46] jetpackj1: has joined #RubyOnRails
[13:29:26] pawnbox: has joined #RubyOnRails
[13:29:40] matthewd: potatochipz: Yes; it locks the object by calling #lock!
[13:32:24] King_Rex: has joined #RubyOnRails
[13:32:46] Zackio: has joined #RubyOnRails
[13:39:11] workmad3: has joined #RubyOnRails
[13:39:27] sergio_101: has joined #RubyOnRails
[13:41:12] PotatoChipz: matthewd: interesting. 'cos I tried wrapping my codes using @instance.with_lock and i ran two servers to test it.... when both processes got the instance. they have the same values. When I actually puts inside the lock they have different values. The second instance already has the updated value from the first lock.
[13:42:02] PotatoChipz: so is it safe to assume that... while inside the @instance.with_lock do # Rails reloaded here??? end
[13:44:25] xall: has joined #RubyOnRails
[13:44:29] SteenJobs: has joined #RubyOnRails
[13:44:40] wilsonc91: has joined #RubyOnRails
[13:44:41] rbr: has joined #RubyOnRails
[13:45:34] terrabl: has joined #RubyOnRails
[13:47:49] rafaelfranca: has joined #RubyOnRails
[13:49:26] dblessing: has joined #RubyOnRails
[13:49:41] rubyonrailed: has joined #RubyOnRails
[13:52:20] Pazician: has joined #RubyOnRails
[13:52:21] Pazician: has joined #RubyOnRails
[13:52:55] rikkipitt: has joined #RubyOnRails
[13:53:46] yellow5: has joined #RubyOnRails
[13:54:34] emilkarl: has joined #RubyOnRails
[13:56:10] benlieb: has joined #RubyOnRails
[13:58:10] diegoviola: has joined #RubyOnRails
[13:58:26] macsteps: has joined #RubyOnRails
[14:01:50] artto: has joined #RubyOnRails
[14:02:23] rafaelfranca: has joined #RubyOnRails
[14:02:24] rafaelfranca: has joined #RubyOnRails
[14:03:23] chouhoulis: has joined #RubyOnRails
[14:03:28] itsmeduncan: has joined #RubyOnRails
[14:08:58] pawnbox: has joined #RubyOnRails
[14:10:08] Leepoff: has joined #RubyOnRails
[14:11:19] Ergo: has joined #RubyOnRails
[14:14:04] snowy: has joined #RubyOnRails
[14:15:29] agent_white: has joined #RubyOnRails
[14:16:48] diegoviola: has joined #RubyOnRails
[14:16:56] xall: has joined #RubyOnRails
[14:18:27] braincrash: has joined #RubyOnRails
[14:19:08] centrx: has joined #RubyOnRails
[14:22:43] clandry94: has joined #RubyOnRails
[14:24:02] existensil: has joined #RubyOnRails
[14:26:31] pontiki: good morning, agent_white
[14:26:43] artto: has joined #RubyOnRails
[14:28:22] adavia: has joined #RubyOnRails
[14:29:08] fox_mulder_cp: agent_white: good morning from fbi :)
[14:32:40] aegis3121: has joined #RubyOnRails
[14:33:09] xall: has joined #RubyOnRails
[14:34:48] douglascorrea: has joined #RubyOnRails
[14:35:11] fox_mulder_cp: folks, have a offtop qa - in my country when u register at service u must agree with EULA and second agreement is for operation your personal data - name, address, phone, how to i can name this agreement check?
[14:35:48] dminuoso: fox_mulder_cp: Why don't you ask your lawyer?
[14:36:38] fox_mulder_cp: dminuoso: i know how to it names in my country, i'm intrested for its name in other countries
[14:36:59] fox_mulder_cp: may be default short name, such as EULA for license
[14:37:03] dminuoso: fox_mulder_cp: You said "must" - that implies it's a legal issue to which nobody here is qualified to to answer.
[14:37:49] dminuoso: Ask your lawyer.
[14:38:59] dminuoso: fox_mulder_cp: The moment where you realize that you may have legal obligations, things become a lot more interesting when your services are provided to other countries. So really. Ask your lawyer.
[14:39:22] rafaelfranca: has joined #RubyOnRails
[14:39:23] rafaelfranca: has joined #RubyOnRails
[14:39:29] braincrash: has joined #RubyOnRails
[14:39:32] harfangk: has joined #RubyOnRails
[14:39:37] dminuoso: Since you have an EULA, you surely already have a legal expert who advised you on this - right?
[14:39:48] emiltin: has joined #RubyOnRails
[14:40:38] fox_mulder_cp: dminuoso: i know, that i as user must agre with my personal data serving by my water, gas, bank and etc operators
[14:40:41] centrx: fox_mulder_cp: non-disclosure agreement
[14:40:57] pacMakaveli: has joined #RubyOnRails
[14:41:00] fox_mulder_cp: centrx: NDA - no, it's not...
[14:41:10] dminuoso: fox_mulder_cp: Ask your lawyer.
[14:41:30] centrx: I am his lawyer
[14:41:33] dminuoso: fox_mulder_cp: Seriously, we live in a world where even the title can make a difference about the validity of a document - possibly. Ask your lawyer.
[14:42:03] dminuoso: And since this seems to be about privacy, it is even more important that you... hold on... ask your lawyer.
[14:42:10] centrx: This is a private attorney-client conversation. How'd you get in here?
[14:42:36] fox_mulder_cp: centrx: i'm intrester in term name, such as EUAL
[14:42:54] dminuoso: fox_mulder_cp: Before you start naming things, start talking to a lawyer what it must contain.
[14:43:02] dminuoso: He or she can also tell you how its called.
[14:43:25] arBmind: has joined #RubyOnRails
[14:43:44] centrx: fox_mulder_cp: Your description of what the document does is pretty vague
[14:43:50] dminuoso: The fact that you don't know what its called shows that you have not talked to a lawyer yet. Something you really ought to do when it comes to licensing agreements, data and privacy.
[14:44:01] yellow5: has joined #RubyOnRails
[14:44:02] dminuoso: So one last time. Ask your lawyer.
[14:44:33] centrx: I think he's asking for an English translation of the name, not for legal purposes
[14:44:55] dminuoso: centrx: End user licensing agreements, data privacy - how is that not about legal issues?
[14:45:06] dminuoso: In any conceivable way.. please enlighten me.
[14:45:38] fox_mulder_cp: centrx: u right. i ask for english translation of thi therm
[14:46:22] dminuoso: fox_mulder_cp: Do you ask becuase you might have international users?
[14:46:24] centrx: dminuoso: "End user license agreement" is a common term that people know, it's not special legal knowledge. And he's not asking for a purpose that would be used in court, it sounds like he's just curious as a matter of language in the English translation
[14:46:50] dminuoso: centrx: end user license agreements is not a "common term" - it is a form of contract.
[14:46:55] fox_mulder_cp: dminuoso: i planned for it, yes
[14:47:06] dminuoso: fox_mulder_cp: Talk to your lawyer then.
[14:47:13] dminuoso: Why the fuck are we having this discussion.
[14:47:50] braincrash: has joined #RubyOnRails
[14:48:08] nettoweb: has joined #RubyOnRails
[14:48:55] fox_mulder_cp: i think, that when u develop apps, u may be knows, how to this agreement can be named
[14:49:08] dminuoso: fox_mulder_cp: It should not matter what its called, unless you need one.
[14:49:12] dminuoso: If you need one, ask your lawyer.
[14:49:26] xall: has joined #RubyOnRails
[14:49:45] pontiki: there's a question of whether what you name it is exposed to the user
[14:49:58] pontiki: if it's not, then it doesn't matter
[14:50:17] dminuoso: And if it is.. he needs to see a lawyer.
[14:50:39] pontiki: the question you *ask* is certainly exposed to the user, and that will still need legal vetting
[14:51:32] fox_mulder_cp: dminuoso: why are you angry?
[14:51:34] centrx: has joined #RubyOnRails
[14:52:05] dminuoso: fox_mulder_cp: Telling you to go see a lawyer is not being angry, it's being candid.
[14:52:53] fox_mulder_cp: dminuoso: smile, i know about consultaion with lavyer, but intrested in ubiquitous form of name
[14:53:12] SteenJobs: any library recommendations for handling payments done in installments? all payments are handled using stripe connect, but i need to break up the total payment into n installments/separate payments
[14:53:13] pontiki: "permission to use personal information"
[14:53:57] dminuoso: fox_mulder_cp: You already said this is for international customers - in which case absolutely every single bit about this needs to be covered by a lawyer. From the content to how you name things - possibly even how and when you present them.
[14:54:02] dminuoso: International law greatly differs from national law.
[14:54:55] fox_mulder_cp: dminuoso: i don't write content of something, which is not mine master knowledges...
[14:55:00] pontiki: there's no "ubiquitous" term, because there is no ubiquitous application of law, regulation, policy, etc
[14:55:14] pontiki: just call it what it is
[14:55:22] dminuoso: pontiki: There actually is. Its called privacy policy.
[14:55:30] dminuoso: Or at least thats how the big players call it.
[14:55:42] fox_mulder_cp: dminuoso: thanks
[14:55:57] dminuoso: fox_mulder_cp: Go see a lawyer.
[14:56:29] fox_mulder_cp: why we spent half an hour...
[14:56:30] pontiki: well, all right, i would accept that
[14:56:58] pontiki: but that's so broad, i thought fox_mulder_cp was after something different
[14:58:46] fox_mulder_cp: pontiki: This combination flew out of my head
[14:59:30] dminuoso: fox_mulder_cp: Go see a lawyer.
[14:59:56] pontiki: stop harping
[15:01:05] fox_mulder_cp: dminuoso: i know about serious problem when content of agreement is bad, thanks. question is answerred, so may be close this thread
[15:01:10] centrx: dminuoso must be a lawyer who is trying to drum up business
[15:01:21] polishdub: has joined #RubyOnRails
[15:02:54] itsmedun_: has joined #RubyOnRails
[15:04:06] itsmedun_: has joined #RubyOnRails
[15:04:21] rails23: has joined #RubyOnRails
[15:04:38] rbr: has joined #RubyOnRails
[15:05:06] rails23: I'm getting a "Must supply api_key" error when trying to upload an image using Cloudinary
[15:05:25] rails23: @post = Post.create(post_params) <-- this is the highlighted line in the error
[15:05:54] rails23: i already have the cloudinary.yml file in the config/ directory, so i don't know what api_key it's talking about
[15:05:56] xall: has joined #RubyOnRails
[15:05:58] fox_mulder_cp: rails23: u must get api key from Cloudinary and puts in into post_params
[15:07:29] mikecmpbll: note to self; don't tell rsyslog to send it's logs to itself :<
[15:07:35] rails23: @fox_mulder_cp Can you show where exactly in the post_params I'm supposed to put the api key?
[15:08:09] dminuoso: mikecmpbll: Did your log partition asplode?
[15:08:26] xpl0iter: has joined #RubyOnRails
[15:08:26] xpl0iter: Hi, I need to use Digest::MD5.hexdigest() in one of my action. So where do I put the require 'digest/md5' statement?
[15:08:26] xpl0iter: Should I put it in the same controller or somewhere else?
[15:08:30] diofeher: has joined #RubyOnRails
[15:08:34] mikecmpbll: all app servers became inaccessible haha
[15:08:35] diofeher: hello. I want to create a form that it isn't related to a model and I have two file fields that are required. I thought about creating a class and including ActiveRecord validations. Is there a better way to do that?
[15:08:41] pontiki: rails23: what version of Rails are you using?
[15:09:03] mikecmpbll: not sure literally what was going on but presumably they were getting in an infinite loop of sorts when logging to rsyslog, sigh.
[15:09:09] rails23: @pontiki 4.2.5
[15:09:17] pontiki: ok, good, not 2.3.x
[15:09:20] xpl0iter: Hi, I need to use Digest::MD5.hexdigest() in one of my action. So where do I put the require 'digest/md5' statement?
[15:09:21] xpl0iter: Should I put it in the same controller or somewhere else?
[15:09:44] mikecmpbll: shitty monday.
[15:10:12] pontiki: rails23: my first question is, did you restart your server after creating the config file? And if you're running spring, stop spring as well and restart the server?
[15:10:14] mikecmpbll: xpl0iter : controller is fine.
[15:10:23] xpl0iter: mikecmpbll, ok thanks
[15:12:01] rails23: @pontiki ahh silly me; restarting the server fixed it! thanks!
[15:12:32] fox_mulder_cp: rails23: configs not auto reloaded
[15:12:45] pontiki: rails23: remember this: the server doesn't generally re-read the config folder to pick up new files after it starts. it doesn't necessary re-read existing files either
[15:14:12] zave: has joined #RubyOnRails
[15:14:14] pontiki: routes.rb is re-read, and *existing* locale files, but don't count on anything else
[15:14:56] yellow5: has joined #RubyOnRails
[15:15:07] aegis3121: has joined #RubyOnRails
[15:15:26] fox_mulder_cp: pontiki: hm, seems that new added local files reads properly, but rereading configs may crash app
[15:15:58] chouhoulis: has joined #RubyOnRails
[15:19:33] CausaMortis: has joined #RubyOnRails
[15:19:55] rails23: @pontiki thanks! i'll remember from now on :)
[15:20:10] rails23: also, image_tag(post.picture_url, :alt => post.short_name) <-- in this line, what does :alt mean?
[15:20:30] rails23: is it just a name for referring to the image?
[15:20:31] jgt2: has joined #RubyOnRails
[15:22:09] xall: has joined #RubyOnRails
[15:22:25] fox_mulder_cp: rails23: alt tag
[15:22:35] fox_mulder_cp: for tex descriprion, i mean
[15:23:03] mcr-credil: has joined #RubyOnRails
[15:24:03] alfiemax: has joined #RubyOnRails
[15:24:47] yellow5: has joined #RubyOnRails
[15:27:23] pontiki: s/tex/text/
[15:27:34] artto: has joined #RubyOnRails
[15:28:00] brettu: has joined #RubyOnRails
[15:30:15] constantinexvi: has joined #RubyOnRails
[15:30:36] sadaf2605: has joined #RubyOnRails
[15:31:31] pawnbox: has joined #RubyOnRails
[15:33:21] fox_mulder_cp: pontiki: s/descriprion/description/ too :)
[15:33:23] artto_: has joined #RubyOnRails
[15:34:41] itsmeduncan: has joined #RubyOnRails
[15:34:50] workmad3: has joined #RubyOnRails
[15:35:20] braincrash: has joined #RubyOnRails
[15:35:49] disgrntld: has joined #RubyOnRails
[15:36:52] Malgorath: has joined #RubyOnRails
[15:37:01] AdamOnRails: has joined #RubyOnRails
[15:37:18] AdamOnRails: So I have a creative issue.
[15:37:47] AdamOnRails: I have a Product model and a Site model. Product habtm Sites, and vice versa.
[15:38:22] xall: has joined #RubyOnRails
[15:38:32] Malgorath: Odd question but I feel since you guys do a lot of web development you might have a good idea how to help me find a solution to this. My laptop died on me and I'd like to get a new one, I'm not stinkin' rich so pretty sure most apple laptops are out, are there any suggestions? Would prefer something that plays nice with linux since OSX is beyond my reach(looking to spend maybe $500)
[15:38:59] AdamOnRails: I have a big "Product list" view page. On this page, is a giant list of all the products. They each have "Active product?" checkboxes next to them. If they are ticked when the form is submitted, my app will populate the join table accordingly.
[15:39:26] fryguy: Malgorath: thinkpad x220 or similar
[15:40:09] AdamOnRails: I feel it would really be inefficient to check every product in the primary product list, against every product_site join, in order to work out if I should include "checked" in the html.
[15:40:16] AdamOnRails: Anyone think of a better way to do it?
[15:40:17] Malgorath: fryguy, thanks, just looked that up on amazon, not bad at all
[15:41:06] agent_white: has joined #RubyOnRails
[15:44:16] fryguy: i still have a T530 from when I started this job a few years ago. they'll buy me anew whatever I want, but I prefer this thing
[15:44:47] CausaMortis: has joined #RubyOnRails
[15:46:48] danny__: has joined #RubyOnRails
[15:47:05] danny__: hi...can someone help me get ajax working in my rails app?
[15:49:13] adre: has joined #RubyOnRails
[15:51:19] artto: has joined #RubyOnRails
[15:51:21] jhass: you may not find out if you don't describe what's broken
[15:52:06] danny__: im doing remote:true on my form, it's posting correctly (i can see in the network console), and i created a new view file named after my action (still don't understand why exactly that's required)
[15:52:17] danny__: in my network console, i see the response to the ajax request is my entire page
[15:52:39] danny__: like my original view rendered all over again, not just the partial view / new template i made named after the action
[15:52:43] danny__: so not sure what im doing wrong
[15:54:07] sadaf2605: has joined #RubyOnRails
[15:54:16] jhass: https://github.com/rails/jquery-ujs/wiki/ajax
[15:54:38] xall: has joined #RubyOnRails
[15:54:42] macsteps: has joined #RubyOnRails
[15:54:45] Malgorath: Danny__, asking for help is pointless usually, state your issue, post gists and wait for the tidal wave of answers
[15:56:28] jowiar: has joined #RubyOnRails
[15:56:51] jhass: https://github.com/rails/jquery-ujs/wiki/External-articles
[15:56:53] aegis3121: has joined #RubyOnRails
[15:57:30] Cache_Money: has joined #RubyOnRails
[15:57:39] jhass: and to some degree http://guides.rubyonrails.org/working_with_javascript_in_rails.html
[15:59:01] jhass: section 4 in particular
[15:59:20] lxsameer: has joined #RubyOnRails
[16:02:43] clandry94: has joined #RubyOnRails
[16:02:46] diegoviola: has joined #RubyOnRails
[16:02:47] rikkipitt: has joined #RubyOnRails
[16:02:53] davidw: has joined #RubyOnRails
[16:04:18] braincrash: has joined #RubyOnRails
[16:04:29] FrankD: has joined #RubyOnRails
[16:06:17] Cervajz: has joined #RubyOnRails
[16:06:17] Cervajz: has joined #RubyOnRails
[16:07:36] douglascorrea: has joined #RubyOnRails
[16:11:03] xall: has joined #RubyOnRails
[16:11:52] jgt2: has joined #RubyOnRails
[16:12:31] partialTerror: has joined #RubyOnRails
[16:13:59] SteenJobs: has joined #RubyOnRails
[16:14:17] tfitts: has joined #RubyOnRails
[16:14:19] conta: has joined #RubyOnRails
[16:14:44] SteenJobs: what would be the best way to schedule payments - i need to split up a stripe payment into separate installments, so they need to be processed as individual stripe calls? resque?
[16:16:21] tfitts: I have models called Product and Order. I also have a module/namespace of Shopify which has classes of Shopify::Product and Shopify::Order. I've copied the code exactly from the Shopify::Product class to Shopify::Order class but I'm still having an issue where calling Shopify::Product works but Shopify::Order gives NameError: uninitialized constant
[16:16:21] tfitts: Shopify::Order
[16:16:55] tfitts: copied exactly while changing the name of the file to order.rb and the class from Product to Order
[16:17:42] tbuehlmann: tfitts: wanna show the code so we can have a glimpse?
[16:17:49] tfitts: yeah, one sec
[16:18:32] nogic: has joined #RubyOnRails
[16:20:46] fujinuma: I have two models. Site and ApiKey
[16:20:53] fujinuma: Site has one api_key
[16:21:02] tfitts: https://gist.github.com/tfitts/0d44e56e00069dfd93fa9e1636340408 these are all under /lib/shopify
[16:21:10] fujinuma: ApiKey belongs to site
[16:21:15] fujinuma: is that correct?
[16:21:55] fujinuma: then I should add ApiKey access_token column to site or vice versa ?
[16:22:16] tbuehlmann: tfitts: can you add the error you get and the code that raises the error?
[16:23:04] tildes: has joined #RubyOnRails
[16:24:11] centrx: has joined #RubyOnRails
[16:24:43] fujinuma: can some one help me?
[16:24:45] Mutter: has joined #RubyOnRails
[16:24:48] tfitts: tbuehlmann: updated
[16:26:08] tbuehlmann: tfitts: oh? don't see it
[16:26:32] tfitts: whoops, now it is.
[16:26:38] partialTerror: has joined #RubyOnRails
[16:27:25] tfitts: what the freak. It keeps adding an empty file and then giving an error that it can't be empty. one sec.
[16:27:45] wilsonc91: has joined #RubyOnRails
[16:27:48] tfitts: ok, it went that time
[16:28:35] jhass: fujinuma: I would imagine the token column to be in the ApiKey model. But then you might not even need an extra model if there's only ever one token per site
[16:28:51] tbuehlmann: tfitts: in what directory are these files?
[16:29:28] tfitts: they're all in /lib/shopify
[16:30:19] tbuehlmann: and you added lib to the autoload/eagerload path?
[16:30:39] tbuehlmann: just a guess: name the class `class Shopify::Order`
[16:33:10] xall: has joined #RubyOnRails
[16:33:49] tfitts: that doesn't do it either. It's strange because Shopify::Product (and actually several others work fine, but Product and Order are the only two I have under both namespaces)
[16:33:52] fujinuma: jhass: yeah
[16:34:17] tbuehlmann: tfitts: hm? what do you mean "both namespaces"?
[16:34:36] tbuehlmann: ooohh, are you reopening/monkeypatching the classes?
[16:35:04] nettoweb: has joined #RubyOnRails
[16:36:30] tfitts: well, a regular activerecord model called Product and Order, and then the two under shopify/
[16:37:22] tfitts: well, a regular activerecord model called Product and Order, and then the two under shopify/
[16:37:30] tfitts: not monkey patching either
[16:37:31] SirOliver: has joined #RubyOnRails
[16:37:41] pydave6367: has joined #RubyOnRails
[16:37:42] reckoner: has joined #RubyOnRails
[16:37:44] tfitts: whoops, sorry for the double post
[16:38:19] reckoner: i'm working on a large application that is using nested models. e.g. models/foo/foo_notification.rb
[16:38:30] reckoner: i think it's large because of sprawl.
[16:38:40] reckoner: didn't nested models go out of vogue?
[16:40:37] Devalo: has joined #RubyOnRails
[16:41:17] pontiki: that's not nesting, that's namespacing
[16:41:18] moeabdol: has joined #RubyOnRails
[16:41:57] tbuehlmann: tfitts: "works for me" :\
[16:42:30] tweeeaks: has joined #RubyOnRails
[16:42:47] reckoner: pontiki, namespacing then. didn't this go out of style?
[16:44:41] pontiki: not that i've heard
[16:44:53] pontiki: where did you hear that?
[16:45:27] reckoner: i haven't seen namespaced application in a long time. i thought i read it somewhere too.
[16:46:28] pontiki: i'm sure that's an opinion
[16:46:35] pontiki: but so is everything else
[16:46:40] tbuehlmann: tfitts: can you add a minimal reproduction repository on github?
[16:47:16] CausaMortis: has joined #RubyOnRails
[16:47:33] tfitts: ugh, I figured it out. I was running it under a different path than I was making changes to. so the model didn't actually exist. I haven't made that mistake in like a year :P
[16:48:09] pontiki: at a guess, i could see namespaced arrangements taking more time on startup, but i have no data whatsoever
[16:49:33] sadaf2605: has left #RubyOnRails: ()
[16:49:34] ych: has joined #RubyOnRails
[16:51:44] aegis3121: has joined #RubyOnRails
[16:54:27] boogeyman: has joined #RubyOnRails
[16:55:08] itsmeduncan: has joined #RubyOnRails
[16:55:38] emiltin: has joined #RubyOnRails
[16:56:56] whathappens: has joined #RubyOnRails
[16:57:48] djbkd: has joined #RubyOnRails
[16:59:11] weckl: has joined #RubyOnRails
[16:59:54] weckl: has joined #RubyOnRails
[16:59:56] reckoner: has left #RubyOnRails: ()
[17:00:35] dc2: has joined #RubyOnRails
[17:01:52] SteenJobs: anyone feel like helping me spec out using resque to create recurring stripe payments :D
[17:02:00] SteenJobs: i don’t have a rubber duck w me atm
[17:02:09] weh: has joined #RubyOnRails
[17:03:08] clandry94: has joined #RubyOnRails
[17:06:48] meoblast001: has joined #RubyOnRails
[17:08:07] itsmeduncan: has joined #RubyOnRails
[17:09:28] cnk: has joined #RubyOnRails
[17:10:48] mixnblend: has joined #RubyOnRails
[17:11:10] sergey_makagon: has joined #RubyOnRails
[17:11:17] jenrzzz: has joined #RubyOnRails
[17:11:59] DoctorMonocular: has joined #RubyOnRails
[17:13:12] siaw23: has joined #RubyOnRails
[17:13:59] pLaToOn: has joined #RubyOnRails
[17:16:17] mikecmpbll: has joined #RubyOnRails
[17:17:53] hahuang61: has joined #RubyOnRails
[17:19:20] quazimodo: has joined #RubyOnRails
[17:20:36] SirOliver: has joined #RubyOnRails
[17:22:17] pilne: has joined #RubyOnRails
[17:23:17] yopp: has left #RubyOnRails: ("woop-woop-woop")
[17:23:35] douglascorrea: has joined #RubyOnRails
[17:24:37] matthias_: has joined #RubyOnRails
[17:26:38] Ergo: has joined #RubyOnRails
[17:28:29] zave: has joined #RubyOnRails
[17:30:25] sneakers: has joined #RubyOnRails
[17:31:06] dionysus69: has joined #RubyOnRails
[17:39:31] itsmeduncan: has joined #RubyOnRails
[17:43:17] chouhoulis: has joined #RubyOnRails
[17:43:51] adre: has joined #RubyOnRails
[17:44:20] fujinuma: jhass: are you still there?
[17:44:42] jhass: fujinuma: ask the channel, not people within it
[17:45:15] fujinuma: I'm going to create a smiley face rating system
[17:45:35] arup_r: has joined #RubyOnRails
[17:46:16] pontiki: fujinuma: how's this? :D
[17:47:09] fujinuma: I defined the models in this way:
[17:47:32] fujinuma: and also that system provides a widget for its users
[17:47:56] fujinuma: but I stock at implementing it.
[17:48:03] fujinuma: I already have diagram.
[17:48:27] fujinuma: User has many Sites (user can add different sites)
[17:49:18] fujinuma: Site has one ApiKey (to being identified which user's site has comment and rate)
[17:49:44] fujinuma: and A WidgetController
[17:49:48] sypheren: has joined #RubyOnRails
[17:50:33] SirOliver: has joined #RubyOnRails
[17:50:57] fujinuma: every time a user add its site with the domain then it gets a widget with an API key
[17:51:00] prgmmr: has joined #RubyOnRails
[17:51:28] itsmeduncan: has joined #RubyOnRails
[17:51:30] arthurl: has joined #RubyOnRails
[17:51:33] skroon: I need to check if an image url exist, and if not fallback to default image in .haml file... can I do a block of ruby in haml?
[17:52:13] pontiki: skroon: you can, but i wouldn't. implement a helper instead
[17:53:00] cschneid_: has joined #RubyOnRails
[17:53:15] pontiki: the helper should be able to manage checking the existance and provide the url or the default image tag
[17:54:04] macsteps: has joined #RubyOnRails
[17:54:05] pontiki: your view should have any logic like that in it at all
[17:54:39] oystersauce8: has joined #RubyOnRails
[17:57:15] gusrub: has joined #RubyOnRails
[17:57:44] skroon: pontiki: thanks
[17:57:45] ftj: has joined #RubyOnRails
[17:58:42] jhass: fujinuma: what's the question?
[17:59:19] netzfisch: has joined #RubyOnRails
[17:59:46] skroon: is there a way with capistrano to have specific environment variables on the remote, just like heroku does?
[18:00:40] arup_r: has joined #RubyOnRails
[18:02:07] pontiki: skroon: i meant your view should NOT have any logic like that in it at all
[18:02:49] SirOliver: has joined #RubyOnRails
[18:08:28] rafaelfranca: has joined #RubyOnRails
[18:09:24] arthurl: has joined #RubyOnRails
[18:14:40] fox_mulder_cp: fujinuma: may i interest - what app u write>?
[18:15:09] whathappens: has joined #RubyOnRails
[18:19:31] dannyh: has joined #RubyOnRails
[18:19:59] rogue_koder: has joined #RubyOnRails
[18:20:05] dannyh: after a post to a controller action where there are errors, im losing all the values in my form fields. can i set a global variable that will be used to re-populate all the form fields with the previously submitted values?
[18:20:07] hahuang61: has joined #RubyOnRails
[18:21:10] sergey_makagon: has joined #RubyOnRails
[18:21:37] baweaver: Danny_: First step is to prevent that data from getting to the controller
[18:21:39] Dimik: has joined #RubyOnRails
[18:21:51] baweaver: Form validations on the views should do the trick
[18:21:59] fox_mulder_cp: Danny_: hmm... create new app for test, and make rails g scaffold your_model prop1:string prop2:int
[18:22:16] fox_mulder_cp: Danny_: and see, how to rails generate it for u
[18:22:28] dannyh: i wanted to use client-side validation, but my fellow developers at my company said that the controller/model should be responsible for validation, since the validation logic is usually in the model
[18:22:30] fox_mulder_cp: and take this as example of code :)
[18:22:54] baweaver: Danny_: You're talking user experience at that level.
[18:23:09] baweaver: so it should be in the views. It should also be validated in the backend
[18:23:24] baweaver: but you should visibly indicate improper data to the user in the views
[18:23:28] fox_mulder_cp: Danny_: really, make this, and inspect, what code is generated, i think, that code help u
[18:23:57] jenrzzz: has joined #RubyOnRails
[18:23:58] jenrzzz: has joined #RubyOnRails
[18:23:58] baweaver: Danny_: So short answer is that you need both
[18:24:06] dannyh: im indicating it in the view, by setting a flash[:error] and redirecting them back to the page
[18:24:22] ftj: has joined #RubyOnRails
[18:24:22] dannyh: the validation handling and user messaging works fine, im just frustrated that when they're taken back, all the form fields are reset
[18:24:28] baweaver: no no, as they fill out the form
[18:24:35] fox_mulder_cp: Danny_: and after rails scaffold add in model some example validation, such as name presence:trut
[18:24:41] dannyh: i wanted to use ajax but again, no go with my fellow dev's
[18:24:46] baweaver: prevent submission until it's valid.
[18:25:10] kztd: has joined #RubyOnRails
[18:25:39] baweaver: that requires no ajax.
[18:25:40] fox_mulder_cp: Danny_: in scaffolded coode rails generate very simple, but functional code for checking validations to, with errors showing in views after POST
[18:25:57] dannyh: what if the model validation changes?
[18:26:00] fox_mulder_cp: Danny_: and in scaffolded code ajax presence too
[18:26:03] dannyh: u always need to re-create the view with scaffolding?
[18:26:38] fox_mulder_cp: Danny_: please do it yourself and test. this example - basic in some manuals, which i read
[18:26:51] tubbo: Danny_: why do you want to use ajax?
[18:26:59] tubbo: like why does it matter
[18:27:03] wakawakawaka: has joined #RubyOnRails
[18:27:21] fox_mulder_cp: Danny_: just do it :) u answer for your question yourself :)
[18:27:30] baweaver: well, lunch for me. Be back later.
[18:27:32] douglascorrea: has joined #RubyOnRails
[18:28:01] wakawakawaka: has left #RubyOnRails: ()
[18:29:22] fujinuma: fox_mulder_cp: A smiley face rating system which provides a widget to rate to a specific site
[18:30:02] fujinuma: fox_mulder_cp: and also a comment
[18:30:20] fox_mulder_cp: fujinuma: oh, rate.. L) i now write apps hosting panel :) so think, may be u work as hostmaster and write this app too
[18:30:22] macsteps: has joined #RubyOnRails
[18:32:09] tubbo: fujinuma: kinda like the "reactions" thing you've seen on github, facebook, etc?
[18:32:17] whlai: has joined #RubyOnRails
[18:32:36] whlai: howdy everyone?
[18:32:44] whlai: ROR newb here
[18:32:51] whlai: need some help fixing my env
[18:33:08] whlai: "Could not find activesupport-4.2.3 in any of the sources"
[18:33:31] whlai: So I don't know about sources, environments, and all that
[18:33:33] fujinuma: tubbo: what do you mean by reactions?
[18:33:42] fox_mulder_cp: whlai: what system u use for ruby? rbenv? rvm?
[18:33:59] fox_mulder_cp: whlai: or apt|yum in your system?
[18:34:01] whlai: I had two Gem paths but I edited the user home bashrc to refer to the other path
[18:34:18] whlai: fox_mulder_cp I don't know
[18:34:29] whlai: how can I tell?
[18:34:38] tubbo: fujinuma: like instead of liking facebook posts, you can add different reactions like "sad" or "wow" or "angry"
[18:34:39] myworkaccount33: has joined #RubyOnRails
[18:34:52] jgt2: has joined #RubyOnRails
[18:34:57] fox_mulder_cp: whlai: really, 1st - read book about rails. i can recommend to you Agile development with rails 4 and Rails 4 in actions
[18:35:07] tubbo: fujinuma: same goes for github issues and comments, so instead of people posting "+1" and annoying maintainers, you can just "like" a particular issue.
[18:35:24] fujinuma: tubbo: yeah but through a widget
[18:35:24] tubbo: whlai: you should really check out bundler.
[18:35:26] whlai: http://pastebin.com/5Kkq4S4w
[18:35:27] tubbo: fujinuma: right
[18:35:37] whlai: fox_mulder_cp: http://pastebin.com/5Kkq4S4w
[18:35:49] tubbo: lol i have to fill out a captcha to see this
[18:35:51] tubbo: oughta be good
[18:36:00] whlai: fox_mulder_cp: can't read abook for this. it's just for a single app.
[18:36:03] whlai: just ned it working
[18:36:23] tubbo: whlai: are you using bundler?
[18:36:28] fujinuma: tubbo: I've already draw the diagram of models and a WidgetController
[18:36:39] whlai: http://pastebin.com/5Kkq4S4w
[18:36:40] fujinuma: tubbo: but I need to know if it's correct
[18:36:42] fox_mulder_cp: whlai: i have a quick guide for starting with rails and rbenv in my giithub. if you can't know how u create app and it's ruunning we can't help u
[18:36:58] whlai: It's just a bitnami redmine instance
[18:37:14] whlai: just trying to install plugin
[18:37:16] tubbo: whlai: please answer my question.
[18:37:25] fox_mulder_cp: whlai: seems that some rails gems not installed. in app_root try to use bundle update
[18:37:27] whlai: I think I made a booboo with my env at some point
[18:37:28] fujinuma: tubbo: would you do that?
[18:37:37] whlai: tubbo, I checked out
[18:37:51] whlai: Bundler version 1.12.5
[18:37:56] SirOliver: has joined #RubyOnRails
[18:37:56] whlai: trying to update it
[18:38:09] morfin: has joined #RubyOnRails
[18:38:14] tubbo: whlai: so in that case, you should really not edit the $GEM_HOME var in .bashrc
[18:38:32] tubbo: just let bundler handle your gem paths
[18:38:34] morfin: did any of you use COPY FROM in postgresql?
[18:38:40] tubbo: morfin: i have, yes
[18:38:42] morfin: and RoR application
[18:38:47] morfin: some gem?
[18:38:53] tubbo: morfin: `pg` ;)
[18:39:15] morfin: i thought it does not provide low level APIs
[18:39:16] tubbo: morfin: in other words, i wrote the sql directly
[18:39:32] whlai: fox_mulder_cp: I've run bundle update many times
[18:39:42] whlai: I get: An error occurred while installing rake (11.2.2), and Bundler cannot continue.
[18:39:42] whlai: Make sure that `gem install rake -v '11.2.2'` succeeds before bundling.
[18:39:46] morfin: so did not use AR actually
[18:39:59] whlai: and when I run `gem install rake -v '11.2.2', it goes through
[18:40:02] whlai: I get no errors
[18:40:06] tubbo: whlai: that's not the error though
[18:40:11] tubbo: there's another error
[18:40:18] morfin: use bundle exec?
[18:40:36] tubbo: whlai: paste the FULL output
[18:40:37] tubbo: into gist
[18:40:48] whlai: tubbo: full ooutput of which command?
[18:40:49] tubbo: whlai: not just a 1-line error, everything from when you ran `bundle update` to the error.
[18:41:13] morfin: usually this thing annoys me - "locked version have 11.2.1 but you got 11.2.2 use bundle exec to use version from bundle"
[18:41:17] morfin: or something like this
[18:41:32] tubbo: whlai: also...i just have to go out on a limb and say that if you're doing `bundle update` and not specifying a gem, you're gonna have a bad time.
[18:41:35] tubbo: unless you were just abbreviating :)
[18:41:42] whlai: tubbo: http://pastebin.com/qSjRB6qX
[18:41:44] tubbo: morfin: he's getting this on `bundle update`
[18:41:51] tubbo: haha really twicE?
[18:42:05] tubbo: whlai: hmm this seems interesting :P `Errno::EACCES: Permission denied - /opt/bitnami/apps/redmine/htdocs/bin/rake`
[18:42:09] morfin: haha nobody like pastebin
[18:42:20] SirOliver: has joined #RubyOnRails
[18:42:23] tubbo: so you fucked up permissions here buddy
[18:42:48] tubbo: whlai: you're also getting errors when building native extensions for mysql, probably also partially due to the permission erros.
[18:42:49] fox_mulder_cp: tubbo: redmine based on ror?
[18:42:53] tubbo: fox_mulder_cp: yup
[18:43:04] fox_mulder_cp: tubbo: not java? O_O
[18:43:21] tubbo: fox_mulder_cp: !g redmine :P
[18:43:26] tubbo: haha the ':P' made it in
[18:43:42] morfin: i start server on prod as rbenv exec bundle exec ...
[18:43:46] fox_mulder_cp: oh no, my world is revert
[18:44:38] whlai: any path forward tubbo?
[18:44:51] tubbo: whlai: yeah, fix your permissions.
[18:44:56] morfin: tubbo, you know that copy from could be implemented low level API without even SQL?
[18:45:00] fox_mulder_cp: morfin: rbenv? long, long command. see how to usr rbenv envs here, may be it help u http://github.com/foxmuldercp/blogapp
[18:45:02] whlai: I don't know what the errors are
[18:45:07] tubbo: morfin: i don't know what you mean
[18:45:07] morfin: i mean without calling SQL directly
[18:45:10] tubbo: whlai: yes you do.
[18:45:15] whlai: i.e. don't know what ownershipis off
[18:45:17] tubbo: whlai: 'Errno::EACCES: Permission denied - /opt/bitnami/apps/redmine/htdocs/bin/rake'
[18:45:24] whlai: who needs to be owner?
[18:45:26] tubbo: whlai: clearly the user you are using doesn't have access to execute that file.
[18:45:28] chouhoul_: has joined #RubyOnRails
[18:45:37] morfin: postgresql API provides function to start copying, copy data in some "buffer" and end copying
[18:45:46] whlai: that user is part of group "root"
[18:45:52] tubbo: whlai: well i assume that since these are files written and used by the redmine app, they're gonna need to be accessible from the redmine user.
[18:46:00] tubbo: whlai: uh oh, someone fucked up :)
[18:46:04] fox_mulder_cp: whlai: chmod 770 for /opt/bitnami/apps/redmine/htdocs/bin/rake ?
[18:46:04] tubbo: you don't want those files to be root
[18:46:07] morfin: end of copying means that you INSERT all that stuff into database
[18:46:19] tubbo: i bet your redmine's public/ folder is root 777, that means if i put a file there i could in theory get you to execute it.
[18:46:23] tubbo: like uploaded a file
[18:46:32] morfin: no idea could that be done with AR properly to trigger callbacks hmmmm
[18:46:34] tubbo: morfin: oh really? that's interesting.
[18:46:42] tubbo: morfin: i've been using COPY FROM or COPY TO CSV
[18:46:53] tubbo: just to get data in a CSV into my database. easiest and fastest way to import.
[18:46:58] neha-: has joined #RubyOnRails
[18:47:10] chouhoul_: has joined #RubyOnRails
[18:47:23] morfin: because you bulk insert lots of stuff and no idea how callbacks could be even called for that
[18:48:23] jenrzzz: has joined #RubyOnRails
[18:49:13] diegoviola: has joined #RubyOnRails
[18:49:46] AmiMoench: has joined #RubyOnRails
[18:50:33] whlai: i see that: Errno::EACCES: Permission denied - /opt/bitnami/apps/redmine/htdocs/bin/bundler
[18:51:00] whlai: ownership is bitnami:daemon
[18:51:19] whlai: user running bundler update is part of group "daemon"
[18:51:43] Leepoff: has joined #RubyOnRails
[18:52:04] morfin: https://github.com/ged/ruby-pg/blob/master/lib/pg/connection.rb#L150
[18:52:05] fox_mulder_cp: whlai: chmod 700 /opt/bitnami/apps/redmine/htdocs/bin/*
[18:52:52] dannyh: has joined #RubyOnRails
[18:53:02] whlai: chmod 700 +x /opt/bitnami/apps/redmine/htdocs/bin/*
[18:54:13] whlai: http://pastie.org/private/yc2hyok35b4yijo5yurphg
[18:56:07] fox_mulder_cp: whlai: http://stackoverflow.com/questions/8127849/rails-3-1-errnoeacces-permission-denied
[18:57:07] whlai: so, basically add apache to the relevant owner groups?
[18:57:54] fox_mulder_cp: read apche's logs, as example :)
[18:59:18] pontiki: has joined #RubyOnRails
[19:02:02] SirOliver: has joined #RubyOnRails
[19:02:13] hahuang65: has joined #RubyOnRails
[19:04:36] morfin: tubbo, did you somehow validate input data?
[19:04:58] mdw: has joined #RubyOnRails
[19:05:14] tubbo: morfin: TIL :)
[19:05:34] tubbo: morfin: !g TIL
[19:05:53] tubbo: i didn't know the postgres driver had a copy_data helper method
[19:06:13] morfin: well, this is not safe i think hmm
[19:06:14] jgt2: has joined #RubyOnRails
[19:06:40] tubbo: morfin: no, it definitely wouldn't validate any data. you'd have to do that yourself. i didn't really need to because i knew all the data in there was valid.
[19:07:44] CausaMortis: has joined #RubyOnRails
[19:08:27] morfin: and now i see where custom validator classes could be used)
[19:09:46] morfin: i was looking at validations using SimpleDelegator which could be used everywhere in application, in controller, in code using such lower level APIs, etc
[19:10:31] fox_mulder_cp: now i write classic rails app. translate this code in the engine mode is difficult?
[19:11:32] xall: has joined #RubyOnRails
[19:18:19] AmiMoench: has joined #RubyOnRails
[19:19:31] jgt2: has joined #RubyOnRails
[19:20:53] hahuang61: has joined #RubyOnRails
[19:21:32] dminuoso: has joined #RubyOnRails
[19:25:06] p1k: is there a module which has a list of http status codes as constants ?
[19:26:05] context: net/http ?
[19:26:14] context: oops wrong channel
[19:26:31] pontiki: still a possibly good answer!
[19:26:55] morfin: it have 451?
[19:27:02] pontiki: context is always in context :D
[19:28:13] havenwood: p1k: Rack::Utils::HTTP_STATUS_CODES
[19:28:43] havenwood: p1k: or: SYMBOL_TO_STATUS_CODE
[19:28:57] context: hah. kind of funny net/http doesnt have it
[19:29:18] context: when i say funny i mean sad. very sad.
[19:29:25] context: depressing.
[19:29:40] morfin: why there is no code 451?
[19:30:16] fujinuma: has joined #RubyOnRails
[19:30:22] tubbo: p1k: sorta
[19:30:35] tubbo: oh shit i never knew about Rack::Utils::HTTP_STATUS_CODES
[19:30:38] fujinuma: is this correct way to generating random secret keys? http://vpaste.net/IgAsM
[19:30:46] tubbo: been using this http://billpatrianakos.me/blog/2013/10/13/list-of-rails-status-code-symbols/
[19:31:14] JesseH: has joined #RubyOnRails
[19:31:16] context: morfin: cause, this is ruby.
[19:31:45] morfin: that was even added into RFC
[19:31:50] tubbo: fujinuma: sorta, you might wanna take a look at ln 20 of https://gist.github.com/josevalim/fb706b1e933ef01e4fb6 to see ane xample
[19:32:14] morfin: and is a reference to the Fahrenheit 451
[19:32:15] context: if it makes you feel better python doesnt have 451 either
[19:32:22] tubbo: morfin: you might wanna also check out ActiveModel::Validations
[19:32:23] zave: has joined #RubyOnRails
[19:32:33] tubbo: if you wanna create an object that needs to validate shit
[19:32:44] morfin: tubbo btw in example you inherit from that)
[19:33:10] morfin: SimpleDelegator is used when you need to combine several validations for same field
[19:33:42] tubbo: yeah, SimpleDelegator is just an implementation of Delegator.
[19:34:06] morfin: no, not inherit but include
[19:34:10] morfin: http://blog.arkency.com/2014/05/mastering-rails-validations-objectify/
[19:35:43] rails918: has joined #RubyOnRails
[19:36:17] rafaelfranca: has joined #RubyOnRails
[19:36:54] matthias_: has joined #RubyOnRails
[19:37:30] rails918: I have two tables, one with players, one with stats. I have one to many relationship with players to stats. I'm trying to take the latest stat of the current month subtract it from the last stat of the previous month. I'd assume it'd look something like this but I can't seem to figure out the ruby way to do it. Any ideas? https://gist.github.com/rivacom/d5646cd762767cac81694bdafeb7704f
[19:37:41] tubbo: morfin: yeah i mean you can make the object however you like...as long as it has ActiveModel::Validations included, it will respond to valid? and have an errors object, as well as accept `validates` calls.
[19:39:35] p1k: havenwood: no I mean the opposite of that, e.g. I'd prefer to write ::HTTP_ACCEPTED in my code rather than 202, it's easier for reading
[19:40:01] morfin: magic numbers are bad
[19:40:11] morfin: in any language
[19:41:19] GodFather: has joined #RubyOnRails
[19:41:54] Dimik: has joined #RubyOnRails
[19:42:26] dminuoso: p1k: And I consider capitalized contants hard to read. Short concise symbols such as :accepted or :forbidden are much easier on the eyes.
[19:42:55] havenwood: p1k: Rack::Utils::SYMBOL_TO_STATUS_CODE
[19:43:13] havenwood: p1k: or yeah, for screaming snakes: Rack::Utils::SYMBOL_TO_STATUS_CODE.map { |k, v| [k.upcase, v] }.to_h
[19:44:18] xall: has joined #RubyOnRails
[19:44:31] qejk: has joined #RubyOnRails
[19:44:40] Darmani: has joined #RubyOnRails
[19:48:56] Axsuul: has joined #RubyOnRails
[19:49:52] djbkd: has joined #RubyOnRails
[19:50:06] jenrzzz: has joined #RubyOnRails
[19:50:11] emiltin: has joined #RubyOnRails
[19:50:14] blackmesa: has joined #RubyOnRails
[19:50:33] fujinuma: I submit a from with two fileds name and domain
[19:51:44] fujinuma: I submit two fields name and domain but this code doesn't set secret field: http://vpaste.net/r7G9N
[19:52:21] fujinuma: I want to only submit name and domain then secret column automatically set
[19:52:53] carlosd: has joined #RubyOnRails
[19:54:25] pontiki: what is that while thing supposed to be doing?
[19:54:49] rafaelfranca: has joined #RubyOnRails
[19:55:24] pontiki: my guess is that its returning a nil
[19:56:09] pontiki: so your generate_secret method also returns a nil, which is what self.secret is being set to in ensure_secret
[19:56:45] sadaf2605: has joined #RubyOnRails
[19:56:59] xall: has joined #RubyOnRails
[19:57:22] danny__: has joined #RubyOnRails
[19:57:37] fujinuma: pontiki: it was scope. generate_secret should be private not ensure_secret ;)
[19:57:44] workmad3: has joined #RubyOnRails
[19:58:08] pontiki: callbacks can be privately scoped
[19:58:25] pontiki: in fact it's good practice to do so
[19:59:27] dminuoso: Marking any method that is not supposed to be visible is a good idea in fact.
[19:59:55] rails918: I have two tables, one with players, one with stats. I have one to many relationship with players to stats. I'm trying to take the latest stat of the current month subtract it from the last stat of the previous month. I'd assume it'd look something like this but I can't seem to figure out the ruby way to do it. Any ideas? https://gist.github.com/rivacom/d5646cd762767cac81694bdafeb7704f
[20:00:24] carlosd: just for curiosity, is there anyone that uses action.coffee as view templates? I can't think of any use for them, but after hitting my head with a problem related to this my curiosity is just killing me :D
[20:00:52] dminuoso: rails918: Is your enter key broken?
[20:01:24] dminuoso: carlosd: No! And neither should you.
[20:02:07] p1k: dminuoso: capitalized constants are standard accross C, Ruby etc. you might not like it but it's better to follow convention in this case
[20:02:29] carlosd: dminuoso: after renaming my file to action.js.coffee I get the response I want
[20:02:55] dminuoso: carlosd: Mind my asking, why do you have views containing JavaScript code?
[20:03:26] carlosd: but if it's called just .coffee and a HTML request is made and no .html.erb is present the .coffee is rendered in the response... I find it very crazy :D
[20:04:02] carlosd: dminuoso: for server generated JS
[20:04:08] dminuoso: p1k: I know, and I still think a plain "head :forbidden" reads nicer.
[20:04:18] dminuoso: carlosd: What is the specific use case?
[20:04:42] carlosd: there is no specific use case... it's just curiosity
[20:04:43] fujinuma: pontiki: somehow I cant call generate_secret in ensure_secret
[20:05:02] carlosd: I don't know why I named my file only create.coffee
[20:05:28] pawnbox: has joined #RubyOnRails
[20:05:32] frozenfoxx: has joined #RubyOnRails
[20:05:33] dminuoso: carlosd: JavaScript should be managed by your asset pipeline and has no business of being auto generated unless you have a special use case that depends on it.
[20:05:51] pontiki: fujinuma: i don't believe you
[20:06:01] dminuoso: carlosd: The great majority of people who ask about "JavaScript in views" just do not know how to write unobstrusive JavaScript which is how it should be done.
[20:06:22] dminuoso: Hence my question.
[20:06:24] fujinuma: pontiki: why?
[20:06:30] frozenfoxx: I have a question, would anyone be able to recommend a simple, straightforward way to include several directories of static content into my Rails application? I have some directories like "dir1, dir2" that I'd like accessed as "http://blahblah/dir1/index.html"
[20:07:02] frozenfoxx: I actually need each directory shared in its entirety, can I just copy each one into <basedir>/app/public/ can call it a day?
[20:07:05] dminuoso: frozenfoxx: Put them into your public directory so it can be served by your webserver?
[20:07:09] fujinuma: pontiki: when I change the code to this: http://vpaste.net/5neo7 everything works properly.
[20:07:16] dminuoso: frozenfoxx: Yeah.
[20:07:44] dminuoso: frozenfoxx: What kind of content is it?
[20:07:45] frozenfoxx: dminuoso: Haven't actually had a chance to try it yet (was building the rest of the app) and figured it's a dumb question but it's not very well documented anywhere else. Thanks much for the confirmation!
[20:08:20] frozenfoxx: dminuoso: each one is a directory containing an index.html and possibly some other files it references. Basically the directory name is a unique identifier in this case.
[20:08:40] frozenfoxx: dminuoso: it's hard to explain without going into a massive explanation of what I'm doing and didn't want to spam the channel.
[20:08:44] p1k: how come dasherize doesn't un-camelize :S
[20:08:50] p1k: .underscore.dasherize just looks weird
[20:09:49] SteenJobs: has joined #RubyOnRails
[20:09:52] xall: has joined #RubyOnRails
[20:10:05] dminuoso: frozenfoxx: Fair enough, can't judge what I don't know. :)
[20:10:05] aegis3121: has joined #RubyOnRails
[20:10:10] frozenfoxx: dminuoso: what would be *perfect* is if I could actually reference them from within the Rails app. The complete application structure is "/apptitle/<static directories>" and "/apptitle/rails/{app,db,etc}"
[20:10:54] frozenfoxx: dminuoso: If there's a way to dynamically serve a URL that points to "<railsapp directory base>/../<static directories>" that'd be amazing, but I don't know enough to do that.
[20:11:04] dminuoso: frozenfoxx: There is such a feature.
[20:11:11] workmad3: has joined #RubyOnRails
[20:11:38] arthurl: has joined #RubyOnRails
[20:11:44] dminuoso: frozenfoxx: Well, not entirely dynamic. But you can still just have some kind of "static_pages" controller, place the index.html as actual views...
[20:11:51] dminuoso: frozenfoxx: And suddenly it won't feel so strange anymore.
[20:13:13] frozenfoxx: dminuoso: Hmm, I'm terribly sorry but I don't think I entirely understand.
[20:13:54] pontiki: fujinuma: i don't believe you because this works just fine: https://gist.github.com/tamouse/a687634fd43156357bfc8250cda38240
[20:13:57] dminuoso: frozenfoxx: Is it just one html site per directory?
[20:13:57] douglascorrea: has joined #RubyOnRails
[20:14:05] myworkaccount33: has joined #RubyOnRails
[20:14:09] frozenfoxx: dminuoso: Part of the reason I'm doing this is because I'm creating a framework that people can drop arbitrary directories into the file structure, run a script that copies them into place, and then starts up the rails server to run the app
[20:14:13] frozenfoxx: dminuoso: Yes.
[20:14:57] dminuoso: frozenfoxx: Well Im just thinking that serving these html files from your a controller is more sensible.
[20:15:02] frozenfoxx: dminuoso: The rails app: https://github.com/frozenfoxx/hack-doom/tree/master/gloom. In the directory above it, the directories to be copied: https://github.com/frozenfoxx/hack-doom/tree/master/challenges
[20:15:10] danny__: has joined #RubyOnRails
[20:15:21] frozenfoxx: dminuoso: promise I'm not shilling for my project (I don't think anyone here would be interested), it's just a lot easier to explain.
[20:16:50] frozenfoxx: dminuoso: Problem is that I'd need to basically alter the Controller prior to startup dynamically because anyone should be able to copy this project, make a directory in the latter area, run the setup script, and start up rails.
[20:16:57] pontiki: frozenfoxx: getting to look at the whole app instead just a few files is better, IMHO, for helping solve a problem
[20:17:28] jenrzzz_: has joined #RubyOnRails
[20:17:36] frozenfoxx: pontiki: I agree, but I don't want to just spam a channel with my app as it can be kinda rude. :)
[20:17:46] dminuoso: Stop apologizing.
[20:17:59] pontiki: nah, it's not rude at all
[20:18:08] SteenJobs: getting a weird JS bug. the code, copy and pasted, works in console, but it’s not working otherwise
[20:18:27] dminuoso: Let's see if I can score 10 points.
[20:18:31] dminuoso: SteenJobs: Do you have turbolinks?
[20:18:43] dminuoso: Guess I scored nothing.
[20:18:47] SteenJobs: also let’s chill with the patronizing stuff :D
[20:18:50] pontiki: excellent attempt, tho
[20:19:06] SteenJobs: nah, i got rid of turbolinks as soon as i generated the app :)
[20:19:08] pawnbox: has joined #RubyOnRails
[20:19:32] dminuoso: SteenJobs: Gist away
[20:19:34] SteenJobs: honestly i wish that you would’ve scored those points
[20:20:01] pontiki: SteenJobs: do you know about --skip-turbolinks?
[20:20:02] SteenJobs: although here’s still hoping it’s something obvious i missed so that it’ll be easy to fix
[20:20:14] SteenJobs: it was just easier to get rid of it
[20:20:21] SteenJobs: because it was becoming a widespread issue
[20:20:34] SteenJobs: and it was off of a recommendation from Radar
[20:20:35] dminuoso: SteenJobs: Gist the code in its entirety from your asset, and mark the portion that you executed in your console.
[20:20:54] dminuoso: SteenJobs: Also note you can simply not use the rails gem, and then straight up control which bits and pieces you want. :)
[20:21:12] SteenJobs: ha this is true!
[20:21:12] pontiki: my .railsrc: --skip-bundle --skip-turbolinks --skip-spring
[20:21:37] hahuang61: has joined #RubyOnRails
[20:21:54] SteenJobs: oh oh i thought you were talking about something else
[20:22:06] SteenJobs: ha yea i found that out after i created the app, but i added it afterwards
[20:22:10] tubbo: SteenJobs: please don't take this as patronizing...but if you're asking basic JS questions in here, turbolinks is probably not for you. it's a lot easier to learn how to work with JS when an abstraction isn't in your way.
[20:22:14] dminuoso: SteenJobs: So is that gist coming or not?
[20:22:28] tubbo: personally i think you need an intermediate or possibly advanced knowledge of JS to use Turbolinks effectively..
[20:22:28] SteenJobs: tubbo: i’m pretty sure you totally misread the convo...
[20:22:37] whathappens: has joined #RubyOnRails
[20:22:59] tubbo: SteenJobs: you were saying that Radar told you not to use turbolinks?
[20:23:04] tubbo: so you didn't use turbolinks
[20:23:08] tubbo: and that's a good thing
[20:23:15] mdw: has joined #RubyOnRails
[20:23:20] SteenJobs: we were just having a discussion about it, that’s all
[20:23:29] wilsonc91: has joined #RubyOnRails
[20:23:35] SteenJobs: and i know JS pretty well, don’t think i’m asking a basic JS question
[20:23:55] dminuoso: SteenJobs: Can I go to bed, or will you be gisting soon? :o)
[20:24:25] SteenJobs: i’ve built in angular and node, wrote the js for an iOS rich view editor library, etc. but we’re all subject to silly mistakes and holes in our knowledge, especially myself
[20:24:30] SteenJobs: dminuoso: haha yea sorry. doing it now
[20:24:39] xall: has joined #RubyOnRails
[20:25:05] futilegames: has joined #RubyOnRails
[20:25:31] jgt3: has joined #RubyOnRails
[20:26:05] wilsonc91: has joined #RubyOnRails
[20:29:17] tubbo: true. i was trying to say that turbolinks isn't necessarily bad, imho.
[20:29:20] banister: has joined #RubyOnRails
[20:29:52] ur5us: has joined #RubyOnRails
[20:30:06] dminuoso: No but it has the taste of simply working out of the box without almost any additional work - until suddenly things horribly break.
[20:30:18] SteenJobs: dminuoso: https://gist.github.com/jesiegel1/debaaf2251a7d3c542ac8d3a842a7acb
[20:30:57] SteenJobs: that js for the iOS open source project was a nightmare - had to learn and hack around with the range api for hours.
[20:31:42] Leepoff: has joined #RubyOnRails
[20:32:57] dminuoso: SteenJobs: container.find('#tos'); can be written as $('#tos') by the way.
[20:33:43] SteenJobs: yea, some of the code i transcribed from something i found in coffeescript, havent taken the time to refactor it yet
[20:33:46] SteenJobs: but you’re right
[20:33:52] zave: has joined #RubyOnRails
[20:33:56] dminuoso: SteenJobs: is your setupManaged() called at all?
[20:34:13] SteenJobs: all of the console.logs print except for the one inside change()
[20:35:01] Devalo: has joined #RubyOnRails
[20:35:40] pontiki: SteenJobs: how does tosEl change?
[20:35:41] dminuoso: SteenJobs: Are the .btn elements actually present when document ready is fired?
[20:36:16] SteenJobs: pontiki: gets clicked - it’s a radio button (well a hidden one, with my replacement)
[20:36:21] SteenJobs: dminuoso: that’s what i think the problem is
[20:36:24] dminuoso: Or are you somehow plugging them into the DOM tree through some magical (hint: turbolinks!) mechanism?
[20:36:24] SteenJobs: because it’s in a modal
[20:36:34] SteenJobs: that’s what i’m doing
[20:36:37] dminuoso: There is your problem then.
[20:36:38] pontiki: but what *is* it?
[20:36:45] SteenJobs: yea i forgot that’s how i was presenting the modal
[20:37:15] dminuoso: SteenJobs: Either have that fire an event during which you set up the event handler, or make sure you have a full jquery selector that you can attach to your document instead.
[20:37:53] dminuoso: (I mean an event handler on your document that filters for that element through a a jquery selector)
[20:37:53] SteenJobs: because i wanted to render a different view’s template, i used an ajax call to append the view into the modal window
[20:38:16] SteenJobs: yea i totally forgot about that. thanks guys.
[20:38:24] dminuoso: SteenJobs: See, I actually get to earn 10 points after all.
[20:38:33] SteenJobs: and it’s a killer feeling
[20:38:46] SteenJobs: but wait - how can i make sure the modal has been presented before calling those functions?
[20:38:59] dminuoso: SteenJobs: You ditched turbolinks and tried to do something similar - and got the exact problems that Radar wanted you to avoid.
[20:39:06] dminuoso: SteenJobs: You cant.
[20:39:15] tildes: has joined #RubyOnRails
[20:39:29] pontiki: fire an event when the modal displays
[20:39:31] dminuoso: SteenJobs: You either have to work around a) events that get emitted when everything is ready (this is what turbolinks does)
[20:39:46] dminuoso: SteenJobs: Or you need to be identify them through a jquery selector.
[20:39:51] dminuoso: The second bit is tons easier.
[20:39:55] SteenJobs: pontiki: that’s what i tried, but it didn’t seem to work. although i’m gonna try it again
[20:40:34] pontiki: you do angular, yes? think about it like an angular module
[20:40:42] Leepoff: has joined #RubyOnRails
[20:41:03] macsteps: has joined #RubyOnRails
[20:41:04] SteenJobs: dminuoso: but i don’t see how the second would solve the issue
[20:41:12] SteenJobs: pontiki: what’s “it”?
[20:41:14] dminuoso: SteenJobs: event delegation.
[20:41:19] pontiki: your modal
[20:41:23] dminuoso: SteenJobs: Say your buttons have a class .magical_button
[20:41:31] SteenJobs: (to pontiki)
[20:41:54] dminuoso: SteenJobs: $(document).on('click', '.magical_button', handler) will work regardless of when you install that.
[20:42:10] SteenJobs: dminuoso: i mean i know how jquery selectors work…but if the they’re not present in the DOM yet, how would that work?
[20:42:28] dminuoso: SteenJobs: Don't say you are knowledged at JS when you are not please next time. ;-)
[20:42:48] SteenJobs: i mean i know JS, i didn’t say there are things i don’t know about it
[20:42:53] pontiki: the only selector dereferenced in dminuoso's example is document
[20:42:58] dminuoso: SteenJobs: Its called event delegation.
[20:43:52] SteenJobs: ha aright that’s where we were talking past each other
[20:43:57] SteenJobs: i just didn’t realize you can attach it to document
[20:44:06] SteenJobs: i know how event delegation works. has a similar structure to scopes in angular
[20:44:14] dminuoso: You attach an event handler to document every time you use $(document).ready
[20:44:36] SteenJobs: right - but for whatever reason i thought if i’m attaching to .ready, i can’t attach an additional event
[20:44:39] SteenJobs: but clearly that’s not the case
[20:46:42] tildes: has joined #RubyOnRails
[20:46:57] jhack: has joined #RubyOnRails
[20:47:14] yfeldblum: has joined #RubyOnRails
[20:47:31] pontiki: no, you can stack events to the stars
[20:47:50] dionysus69: has joined #RubyOnRails
[20:48:02] SteenJobs: word. for some reason i thought document was treated differently, but i obviously should’ve checked.
[20:48:21] SteenJobs: and dminuoso, just seems unecessary to try to prove i know or don’t know js…i could obviously link you to code i’ve contributed or written, but that seems a bit ridiculous to me at least
[20:48:37] SteenJobs: anyway, lemme go change it up and test it. thanks a billion
[20:49:52] SteenJobs: ha yea dminuoso, it’s right there in the docs
[20:50:18] SteenJobs: thanks as always for teaching me something new. ever since day 1 here.
[20:51:25] dminuoso: SteenJobs: I really don't mind inexperienced people, don't take it the wrong way. But please don't start by saying "you know JS pretty well" just to quickly demonstrate some basic knowledge.
[20:52:04] srinidhi: has joined #RubyOnRails
[20:53:01] SteenJobs: i recall the narrative a bit differently. i would never have said that without any prompting. not my jam.
[20:53:04] dc2: has joined #RubyOnRails
[20:53:12] SteenJobs: i was responding to something someone else had said
[20:53:49] dminuoso: 22:23 < SteenJobs> and i know JS pretty well, don’t think i’m asking a basic JS question
[20:53:58] dminuoso: After all, you were asking a very basic JS question. :-)
[20:54:11] dminuoso: Anyway. Enjoy your solution.
[20:54:53] SteenJobs: you’re skipping what was typed before that. that’s the only reason i said it. and because you opened up with your 10 points line without knowing anything about the issue at first.
[20:55:14] whathapp_: has joined #RubyOnRails
[20:55:15] dminuoso: Curiously, my instinct was real close regardless.
[20:55:25] SteenJobs: irrespective and unrelated
[20:55:48] SteenJobs: look dude. i have nothing to prove to anyone and therefore have no need to out of the blue announce knowing something. if anything, i love being here because i’m always learning, and i’ll be the first to admit i don’t know something so i can learn.
[20:56:34] SteenJobs: but let’s please not take what i said out of context.
[20:56:43] ndrst: has joined #RubyOnRails
[20:56:55] moeabdol: has joined #RubyOnRails
[20:58:33] Jon30: has joined #RubyOnRails
[20:58:50] tubbo: SteenJobs: i think he was doing that because having turbolinks enabled unknowingly is such a common reason why people get that error.
[20:59:03] tubbo: even if you're experienced in JS
[20:59:11] baweaver: In any case, let's keep the personal bits out of it.
[20:59:54] SteenJobs: but saying it that way is a bit patronizing. and then you either knowingly or mistakenly said your bit about basic JS questions, so i admittedly got a bit defensive.
[21:00:03] SteenJobs: agreed though, no need for anything personal
[21:03:10] sergio_101: has joined #RubyOnRails
[21:06:29] Axilla: has joined #RubyOnRails
[21:06:50] netzfisch: has joined #RubyOnRails
[21:08:00] cspivey: has joined #RubyOnRails
[21:08:11] dnewkerk: has joined #RubyOnRails
[21:08:16] apotry: has joined #RubyOnRails
[21:09:21] diegoviola: has joined #RubyOnRails
[21:11:09] Jayson_Virissimo: has joined #RubyOnRails
[21:11:43] neha-: has joined #RubyOnRails
[21:14:06] SteenJobs: oooo mutation observers!
[21:16:48] jenrzzz: has joined #RubyOnRails
[21:20:14] SteenJobs: dminuoso: dude have you read about mutation observers? it worked like a charm
[21:20:22] Jon30: has joined #RubyOnRails
[21:20:23] SteenJobs: pontiki: ^^
[21:20:53] mikecmpbll: has joined #RubyOnRails
[21:22:07] pontiki: SteenJobs: yeah, a lot of that is coming with the new Angular2/RxJs
[21:22:21] pontiki: makes me giddy :)
[21:22:22] hahuang61: has joined #RubyOnRails
[21:23:21] SteenJobs: yea it’s very cool. and it’s almost like why hasn’t this been a thing yet
[21:23:48] SteenJobs: i added the observer to my js file, wrapped my code inside the observer, and boom. works.
[21:24:17] carlosd_: has joined #RubyOnRails
[21:24:20] diegoviola: has joined #RubyOnRails
[21:24:58] Radar: good morning
[21:25:00] tubbo: SteenJobs: we've had that in ember.js for quite some time, not too shabby.
[21:25:07] FernandoBasso: has joined #RubyOnRails
[21:25:19] SteenJobs: nice! i haven’t gotten to use ember.js yet, but i hear great things. react is next on my list
[21:25:23] fox_mulder_cp: Radar: good night:)
[21:26:10] pontiki: i've been loving React as well
[21:26:16] pontiki: not tried any ember at all
[21:26:31] pontiki: i am really, *really* loving Angular2/RxJs
[21:26:46] kitsuneyo: has joined #RubyOnRails
[21:30:55] fox_mulder_cp: i'm very intrested in react.js
[21:30:58] SteenJobs: pontiki: what’d you think of the previous v of angular?
[21:31:36] pontiki: SteenJobs: it didn't make a lot of sense to me when i started working on projects using it, until i found out they were doing it rong and painting themselves into corners
[21:31:52] oystersauce8: has joined #RubyOnRails
[21:31:59] pawnbox: has joined #RubyOnRails
[21:32:16] SteenJobs: they meaning the developers?
[21:32:25] pontiki: um, yeah, my project mates
[21:32:36] SteenJobs: oh that’s what you meant
[21:32:40] rafaelfranca: has joined #RubyOnRails
[21:32:42] SteenJobs: and then what did you think of it?
[21:32:55] baweaver: Angular 1 was a giant mess
[21:32:56] pontiki: it made sense when i took a couple of courses from Scott Moss
[21:33:09] pontiki: then, whoa, it made sense, but not the projects
[21:33:23] pontiki: and Angular2 makes a ton ofsense to me now
[21:33:32] baweaver: Angular 2 is a lot better, but is starting to look a LOT like Java
[21:33:45] pontiki: with TypeScript, yeah
[21:34:12] fox_mulder_cp: in my frontend 'scope' of friends - all try to use react + redux
[21:34:32] Parker0: has joined #RubyOnRails
[21:34:42] pontiki: fox_mulder_cp: look into react-rails
[21:35:23] SteenJobs: pontiki: i felt at first when i was learning angular that it was trying to do a lot of things differently…but for the sake of being different. it didn’t feel like it added so much for me. but i’m not expert.
[21:35:51] SteenJobs: my guess is i’d feel differently if i took those courses
[21:36:10] pontiki: what are you comparing it to?
[21:37:02] arBmind: has joined #RubyOnRails
[21:40:47] Darmani: Radar: Ello friend
[21:40:59] Radar: Good morning Darmani
[21:41:08] Radar: I'm not around for long this morning. Got things to do before work.
[21:41:23] Radar: Darmani: There's plenty of other people who can answer your questions.]
[21:41:23] Darmani: Ummmmmm. Mehhh. Uhhh well....
[21:41:50] Darmani: Radar: Yeah... I'll ask them. I don't want to bother ^^
[21:43:30] Symbiosisz: has joined #RubyOnRails
[21:43:52] Darmani: Okay question to anyone who's around...
[21:44:26] Darmani: I'm building a t-shirt website, I made a member action to my (order) routes but I'm not sure what to do with the controller.
[21:44:27] Darmani: https://gist.github.com/mfifth/20f8e664b3944a7154ca0d7199360c3c
[21:44:42] Parker0_: has joined #RubyOnRails
[21:44:47] wilsonc91: has joined #RubyOnRails
[21:44:48] Darmani: It sounds kinda vague I know. I want to be able to add a shirt to an order.
[21:45:04] borkdude: has joined #RubyOnRails
[21:46:26] Parker0__: has joined #RubyOnRails
[21:46:29] Parker0__: has left #RubyOnRails: ()
[21:46:46] Parker0__: has joined #RubyOnRails
[21:47:21] neha-: has joined #RubyOnRails
[21:47:26] Sero: has joined #RubyOnRails
[21:47:57] sypheren: has joined #RubyOnRails
[21:48:26] diegoviola: has joined #RubyOnRails
[21:49:08] fox_mulder_cp: pontiki i'm newbie in javascript, create easy todolist, but this magic - very hard for me (
[21:50:31] macsteps: has joined #RubyOnRails
[21:50:32] Parker0_: has joined #RubyOnRails
[21:50:57] fox_mulder_cp: seems, that ~1 litre of very good wine make good evening and a non-working
[21:51:42] fox_mulder_cp: so good night, my dear friends :) syl!
[21:52:27] macsteps: has joined #RubyOnRails
[21:55:53] pur3eval: has joined #RubyOnRails
[21:57:23] douglascorrea: has joined #RubyOnRails
[21:58:43] AntiSpamMeta: has joined #RubyOnRails
[21:59:00] workmad3: has joined #RubyOnRails
[21:59:16] jenrzzz: has joined #RubyOnRails
[21:59:16] jenrzzz: has joined #RubyOnRails
[22:01:15] mdw7: has joined #RubyOnRails
[22:01:19] zave: has joined #RubyOnRails
[22:03:04] Jasaka: has joined #RubyOnRails
[22:04:24] macsteps: has joined #RubyOnRails
[22:07:10] pur3eval: has joined #RubyOnRails
[22:20:52] lxsameer: has joined #RubyOnRails
[22:21:13] rikkipitt: has joined #RubyOnRails
[22:23:07] hahuang61: has joined #RubyOnRails
[22:25:00] JesseH: has joined #RubyOnRails
[22:25:27] nofxx: has joined #RubyOnRails
[22:25:42] jenrzzz: has joined #RubyOnRails
[22:25:42] jenrzzz: has joined #RubyOnRails
[22:27:16] rafaelfranca: has joined #RubyOnRails
[22:28:03] nettoweb: has joined #RubyOnRails
[22:28:51] DoctorMonocular: has joined #RubyOnRails
[22:29:52] RickHull: has joined #RubyOnRails
[22:30:19] RickHull: Hi, I'm having trouble with Arel generating correct sql (consumed by MySQL) for e.g. SELECT count(*)
[22:32:05] wethu: has joined #RubyOnRails
[22:32:45] RickHull: https://gist.github.com/rickhull/6967b5d61838e5cc8a973572bd5bc923
[22:33:39] mello: has joined #RubyOnRails
[22:33:42] dvinciguerra_: has joined #RubyOnRails
[22:33:56] rafaelfranca: has joined #RubyOnRails
[22:34:43] whathappens: has joined #RubyOnRails
[22:36:39] rikkipitt: has joined #RubyOnRails
[22:39:00] ensyde__: has joined #RubyOnRails
[22:39:20] yaw: has joined #RubyOnRails
[22:40:17] SirOliver: has joined #RubyOnRails
[22:40:41] rikkipitt: has joined #RubyOnRails
[22:40:59] whathapp_: has joined #RubyOnRails
[22:41:29] cnk: RickHull: how about counting 'id' - assuming your table uses id for its primary key
[22:43:40] wilsonc91: has joined #RubyOnRails
[22:46:02] nettoweb: has joined #RubyOnRails
[22:48:03] SteenJobs: has anyone run into an issue using resque where self.perform() isn’t being called?
[22:48:23] pawnbox: has joined #RubyOnRails
[22:48:41] RickHull: cnk: yeah, that makes more sense anyway. but still I wonder if the sql generation is an issue
[22:49:19] DoctorMonocular: has joined #RubyOnRails
[22:49:23] cnk: It looks to me like AREL just did what you asked - and ignored that your MySQL didn't like it
[22:49:46] cnk: But, was that syntax legal in other versions of MySQL? I don't know
[22:49:52] RickHull: yeah, and that makes sense enough, I think
[22:50:11] Developer001: I'm having some trouble debugging the output of an rspec test.
[22:50:22] Developer001: expected: "http://example.org/api/teams?size=2" -- >got: "http://example.org/api/teams/?size=2"
[22:50:41] Developer001: What could cause that trailing slash? I didn't change any of the relevant files.
[22:51:41] Developer001: This is the exact rspec test from the same boiler plate as I'm using: https://github.com/dblock/slack-ruby-bot-server/blob/master/spec/support/api/endpoints/it_behaves_like_a_cursor_api.rb
[22:52:10] cnk: please show your code, not what you are trying to copy
[22:52:32] Darmani: has joined #RubyOnRails
[22:53:15] Developer001: I haven't changed any of it.
[22:53:22] Developer001: It seems to test against this file: https://github.com/dblock/slack-ruby-bot-server/blob/master/lib/slack-ruby-bot-server/api/endpoints/teams_endpoint.rb
[22:53:58] Developer001: I've got to get the base working before I start working on anything on top, right?
[22:54:16] Darmani: Could someone help me figure out how to define an action in my controller?
[22:54:16] Darmani: https://gist.github.com/mfifth/20f8e664b3944a7154ca0d7199360c3c
[22:56:07] chintanparikh: has joined #RubyOnRails
[22:56:12] jenrzzz: has joined #RubyOnRails
[22:56:12] jowiar: has joined #RubyOnRails
[22:56:12] jenrzzz: has joined #RubyOnRails
[22:57:41] dminuoso: has joined #RubyOnRails
[22:58:58] yaw: Darmani: what action?
[22:59:19] Darmani: yaw: https://gist.github.com/mfifth/20f8e664b3944a7154ca0d7199360c3c
[22:59:20] Developer001: cnk: Is that acceptable?
[22:59:39] cnk: is what acceptable?
[22:59:42] Darmani: yaw: https://gist.github.com/mfifth/20f8e664b3944a7154ca0d7199360c3c#file-order_controller-rb-L4
[23:00:02] cnk: I looked at what you posted but it isn't rails and I am hunting for what sets the routes
[23:00:17] yaw: Darmani: You want implementation to add item to an order?
[23:00:23] tildes: has joined #RubyOnRails
[23:00:33] Developer001: Ah, th #ruby channel told me to come here last night if I was ever working with a web framework
[23:00:38] Darmani: yaw: Yeah that's the idea.
[23:00:43] Developer001: Is their advice incorrect?
[23:00:57] cnk: Developer001: it is ..... hit and miss
[23:01:07] yaw: Developer001: Rails related stuff. Don't know if you can ask about other Ruby frameworks
[23:01:24] cnk: but if you are not using rails, you need to provide more context, like where to find what defines your url patterns
[23:02:04] yaw: Darmani: Do you have an item model?
[23:02:17] Developer001: has left #RubyOnRails: ("My whole life has been unlimited code works.")
[23:02:21] Darmani: yaw: Oh yeah, hang on I'll add it to the gist.
[23:02:34] yaw: what's the relationship between an order and the items in it? an order has many items?
[23:03:37] Darmani: yaw: https://gist.github.com/mfifth/20f8e664b3944a7154ca0d7199360c3c
[23:04:13] sypheren: has joined #RubyOnRails
[23:04:31] Darmani: an order belongs to a user and has many shirts ^.^
[23:05:30] yaw: So an item is basically a shirt? let's call it that way. it's less confusing
[23:05:45] Darmani: yaw: Sure.. Yeah an item is a shirt.
[23:05:55] ferr1: has joined #RubyOnRails
[23:05:56] yaw: which means the `add_item` action can be (probably should be) renamed to add shirt
[23:06:15] rafaelfranca: has joined #RubyOnRails
[23:06:16] rafaelfranca: has joined #RubyOnRails
[23:06:18] Darmani: yaw: Sure I can do that.
[23:07:07] yaw: what's the HTML for add_item like?
[23:07:28] Darmani: yaw: What do you mean? o.o
[23:07:59] yaw: oh, I think I just saw the form in show.html.erb
[23:08:07] ensyde: has joined #RubyOnRails
[23:09:02] yaw: what's the URL that the post request from the form is sent to?
[23:09:46] Darmani: yaw: Well that's where I get a bit mixed up actually...
[23:10:54] yaw: run `bin/rake routes | grep add_item` to find the appropriate prefix for the URL method
[23:11:21] yaw: I doubt it will be add_item_order_path
[23:11:51] DoctorMonocular: has joined #RubyOnRails
[23:12:01] Darmani: yaw: Well I changed it to add_shirt
[23:12:06] Darmani: So it's add_shirt_order_path now.
[23:13:14] yaw: You should change it in the routes file too
[23:13:31] jenrzzz: has joined #RubyOnRails
[23:13:37] Darmani: yaw: I did... It's all changed. I can change it in the Gist for you too if that helps.
[23:13:51] havenwood: https://github.com/bundler/postit
[23:13:56] yaw: after that run `bin/rake routes | grep add_shirt` let's see what's the correct prefix
[23:14:00] yaw: Darmani: ^^
[23:14:28] Darmani: add_shirt_order POST /orders/:id/add_shirt(.:format) orders#add_shirt
[23:16:56] Darmani: I'm just not sure what the action would look like in my orders controller...
[23:16:57] yaw: Darmani: ok
[23:17:26] yaw: that's the orders#add_shirt part. the add_shirt method of the OrdersController will be called
[23:17:54] yaw: with the data submitted via the form
[23:18:18] Darmani: yaw: So what do I write there?
[23:18:42] tfitts: I have a plain old ruby object that I've included ActiveModel::Model in. I'm able to build the model I want using Model.new(attributes_hash), but when I try something like attributes = new_attributes_hash it seems to ignore it (though no errors)
[23:18:49] ur5us: has joined #RubyOnRails
[23:19:12] dalbusch1t: has joined #RubyOnRails
[23:19:13] zave: has joined #RubyOnRails
[23:19:18] yaw: for example, color = params[:color], size = [:size]
[23:19:34] yaw: but you won't get the shirt's id. which you'll need
[23:19:49] xall: has joined #RubyOnRails
[23:20:15] Darmani: ACTION is a bit lost.
[23:20:36] Rodya_: has joined #RubyOnRails
[23:21:01] yaw: so the id of the @shirt won't be submitted as part of the params
[23:21:05] Radar: tfitts: Did you mean self.attributes = new_attributes_hash?
[23:21:20] yaw: if you want it you could store it in a hidden input field in the form
[23:21:35] Radar: add_shirt_order_path(shirt_id: @shirt.id)
[23:21:37] helpa: Next question, please!
[23:21:37] yaw: all other properties set in the form will be available in params
[23:21:45] tfitts: I will double check but I think I tried that.
[23:21:51] Darmani: Radar: lmao
[23:22:54] yaw: or in the query string, as Radar suggests
[23:23:36] Darmani: yaw: Okay but then it says I'm missing a view for the "add_item" action. How do I get it to just redirect to the order itself?
[23:23:38] yaw: wait, you should pass the order object to the url helper instead, not @shrit
[23:23:49] hahuang61: has joined #RubyOnRails
[23:25:58] xlegoman: has joined #RubyOnRails
[23:27:16] Darmani: https://gist.github.com/mfifth/20f8e664b3944a7154ca0d7199360c3c#file-order_controller-rb-L4
[23:27:20] Darmani: Does that work?
[23:28:03] tfitts: Radar: self.attributes = new_hash gives me an undefined method 'attributes=' error. It isn't an activerecord object, just a ruby object that imports ActiveModel::Model
[23:28:20] yaw: Darmani: where are you setting @order?
[23:28:38] Radar: tfitts: So what are you trying to do with attributes = ?
[23:28:45] Radar: tfitts: !rule0
[23:28:45] helpa: tfitts: Show rather than tell. Explaining your problem with code, stacktraces or errors is always preferred to explaining it with just text. Show us what's happening, rather than telling us. Put the code on https://gist.github.com and then give us the HTTP link to the Gist.
[23:29:00] Darmani: yaw: Well I wanted to do it within the action. It would either retrieve an existing order or create a new one with the item.
[23:29:45] yaw: it will always create a new one. it's not retrieving an existing order
[23:30:03] yaw: use params[:id] to find the existing order
[23:30:35] Radar: yaw: Shouldn't it fetch it from the session?
[23:31:55] yaw: Radar: it's already in the URL
[23:32:03] Radar: yaw: It shouldn't be in the URL.
[23:32:25] Radar: It should act based on the order_id which is in the session, or if there isn't one then it should create an order and then store that order's ID in the sesion
[23:32:35] Darmani: You guys are the experts I'm just trying to make the goddamn thing work -__-
[23:33:02] yaw: Radar: orders/:id/add_shirt
[23:33:35] Radar: yaw: Do you understand at all how ecommerce works?
[23:33:47] Radar: A user has a current order
[23:33:50] Radar: There is no ID.
[23:35:38] Darmani: Thanks guys. This has been very helpful.
[23:38:01] whathappens: has joined #RubyOnRails
[23:43:10] workmad3: has joined #RubyOnRails
[23:43:19] Darmani: has joined #RubyOnRails
[23:46:06] yaw: Darmani: I think you should do as Radar says. It means changing a lot of your current implementation but it's for the better
[23:49:48] xlegoman: has joined #RubyOnRails
[23:49:58] xall: has joined #RubyOnRails
[23:51:33] jenrzzz: has joined #RubyOnRails
[23:52:13] Radar: Going away because I'm too grumpy today to be on IRC
[23:58:26] dminuoso: has joined #RubyOnRails
[23:59:12] cnk: Radar: good plan. Feel better
[23:59:53] Leepoff: has joined #RubyOnRails