« Back to channel list

#RubyOnRails - 15 March 2017

« Back 1 day Forward 1 day »
[00:00:24] cschneid_: has joined #RubyOnRails
[00:02:13] d3d1rty: has joined #RubyOnRails
[00:02:37] amincd: Guest49955: that's what I would do, but probably best to wait for someone more knowledgeable to answer
[00:03:24] pawnbox: has joined #RubyOnRails
[00:19:18] bruce_lee: has joined #RubyOnRails
[00:20:53] Rodya_: has joined #RubyOnRails
[00:25:43] FLeiXiuS: has joined #RubyOnRails
[00:42:36] pwnd_nsfw: has joined #RubyOnRails
[00:44:27] pawnbox: has joined #RubyOnRails
[00:46:58] xaviergmail_: has joined #RubyOnRails
[00:48:05] am55_: has joined #RubyOnRails
[00:50:05] Jameser: has joined #RubyOnRails
[00:52:45] pwnd_nsfw`: has joined #RubyOnRails
[01:04:33] pawnbox: has joined #RubyOnRails
[01:08:44] Robtop__: has joined #RubyOnRails
[01:08:45] chouhoulis: has joined #RubyOnRails
[01:11:07] prab97: has joined #RubyOnRails
[01:13:48] chouhoulis: has joined #RubyOnRails
[01:13:59] cschneid_: has joined #RubyOnRails
[01:24:12] hotpancakes: has joined #RubyOnRails
[01:28:10] coatezy: has joined #RubyOnRails
[01:29:38] HoierM: has joined #RubyOnRails
[01:32:02] benlieb: has joined #RubyOnRails
[01:34:12] pawnbox: has joined #RubyOnRails
[01:37:28] atlas___: has joined #RubyOnRails
[01:38:40] Ropeney: has joined #RubyOnRails
[01:40:56] Guest45614: has joined #RubyOnRails
[01:43:50] hahuang65: has joined #RubyOnRails
[01:44:15] am55_: has joined #RubyOnRails
[01:48:17] nya: has joined #RubyOnRails
[01:52:22] spicerack: has joined #RubyOnRails
[01:53:38] brent__: has joined #RubyOnRails
[02:01:59] provokeme: has joined #RubyOnRails
[02:02:35] ruurd: has joined #RubyOnRails
[02:03:33] hexkey[m]: Does anybody know what the .publish method in the icalendar gem actually does?
[02:03:40] hexkey[m]: https://github.com/icalendar/icalendar
[02:04:02] hexkey[m]: The documentation doesn't say, and it seems to have no effect
[02:05:43] roflmyeggo: has joined #RubyOnRails
[02:06:22] brent__: has joined #RubyOnRails
[02:10:14] davedo321: has joined #RubyOnRails
[02:12:05] mzo: isnt it funny how different communities have such different beliefs
[02:12:26] mzo: at the end of the day we are all trying to do the same thing
[02:13:02] dcope: has joined #RubyOnRails
[02:13:02] dcope: has joined #RubyOnRails
[02:13:03] mzo: how did we come to such different conclusions
[02:17:29] rfoust: has joined #RubyOnRails
[02:17:32] jdcauley: has joined #RubyOnRails
[02:17:52] xybr_: has joined #RubyOnRails
[02:18:41] pulkit4tech: has joined #RubyOnRails
[02:19:33] g3funk: has joined #RubyOnRails
[02:28:33] quazimodo: has joined #RubyOnRails
[02:32:11] irishfromua: has joined #RubyOnRails
[02:35:34] irishfromua: has joined #RubyOnRails
[02:38:48] _3dwardsharp: has joined #RubyOnRails
[02:43:17] xaviergmail_: has joined #RubyOnRails
[02:43:36] nya: has joined #RubyOnRails
[02:43:52] hahuang65: has joined #RubyOnRails
[02:47:30] \13k: has joined #RubyOnRails
[02:49:48] irishfromua: has joined #RubyOnRails
[02:50:29] ocpysh: has joined #RubyOnRails
[02:52:33] pickle_: has joined #RubyOnRails
[02:53:27] patarr: has joined #RubyOnRails
[02:55:14] jenrzzz: has joined #RubyOnRails
[02:57:15] Kovensky: has joined #RubyOnRails
[02:57:58] pickle_: has left #RubyOnRails: ()
[03:03:36] shinnya: has joined #RubyOnRails
[03:05:37] libastral: has joined #RubyOnRails
[03:08:09] zero1one0: has joined #RubyOnRails
[03:10:26] ahrs: has joined #RubyOnRails
[03:13:02] pawnbox: has joined #RubyOnRails
[03:17:56] eforbes: has joined #RubyOnRails
[03:18:49] xall: has joined #RubyOnRails
[03:20:23] hotpancakes: has joined #RubyOnRails
[03:24:54] nya: has joined #RubyOnRails
[03:27:08] dyyylan: has joined #RubyOnRails
[03:30:42] pwnd_nsfw`: has joined #RubyOnRails
[03:33:57] tanuki: has joined #RubyOnRails
[03:38:56] fourcolors: has joined #RubyOnRails
[03:39:58] gambl0re: has joined #RubyOnRails
[03:42:47] irishfromua: has joined #RubyOnRails
[03:42:52] pawnbox: has joined #RubyOnRails
[03:44:31] hahuang65: has joined #RubyOnRails
[03:56:43] raul782: has joined #RubyOnRails
[03:56:58] raul782: Hey guys, if I do audit_instance = self.audits.build(attrs), and then self.audits.create(attrs)
[03:57:21] raul782: why do you think, I'm seeing duplicated audit records?
[03:57:46] raul782: I thought build only produced a model object, and create was the one that actually saved it
[03:58:31] raul782: Is there a way to call something like self.audits.save
[04:04:21] DoctorMonocular: has joined #RubyOnRails
[04:08:30] benlieb: has joined #RubyOnRails
[04:09:12] cschneid_: has joined #RubyOnRails
[04:11:38] duderonomy: has joined #RubyOnRails
[04:18:18] raul782: has joined #RubyOnRails
[04:19:19] raul782: has joined #RubyOnRails
[04:21:27] eclecticjohny: has joined #RubyOnRails
[04:21:47] _3dwardsharp: raul782 is the attrs variable changing between .build & .create? if not then just call audit_instance.save?
[04:22:46] dionysus69: has joined #RubyOnRails
[04:25:16] raul782: _3dwardsharp: yes, they do change. audit_instance = self.audits.build(attrs) \n if audit_instance.auditable_id.nil? attrs[:auditable_type] = 'User' \n self.audits.create(attrs)
[04:26:12] kinda: has joined #RubyOnRails
[04:26:29] pawnbox: has joined #RubyOnRails
[04:29:12] roflmyeggo: has joined #RubyOnRails
[04:29:13] _3dwardsharp: hmm, well, why would you want to have a variable ref (audit_instance) when you are using self. references?
[04:30:26] _3dwardsharp: sorry, this doesn't make a lot of sense without the bigger context of what you are hoping to achieve. in essence, you don't need to call .build AND .create
[04:32:14] raul782: I'm patching a gem audited that is not behaving as expected when auditing the user model, other models work fine. So the only way I managed to accomplished that is by opening the module and overwriting this private method https://github.com/collectiveidea/audited/blob/3.0-stable/lib/audited/auditor.rb#L213 on my audit initializer.
[04:33:15] raul782: This is the code, https://gist.github.com/raul782/7fbcfb73cf5246974bd58ec558a8f8b9
[04:34:07] _3dwardsharp: yikes, all that actually makes me more confused :/
[04:35:05] Cohedrin: has joined #RubyOnRails
[04:35:43] raul782: _3dwardsharp: sorry about that, I guess the important question here is that if I use build, and then create. Can that lead to generating duplicating rows
[04:36:19] raul782: at least that's what It seems to happen when updating a user model.
[04:37:03] _3dwardsharp: yeah, don't do that
[04:37:26] raul782: So it seems like build(attrs) returns an audit object, and when I change or modify attrs and call create, rails creates another objects and save them both from memory
[04:37:34] raul782: ok so what would be the best way to avoid that
[04:38:41] _3dwardsharp: just call .save on whatever instance you setup with .build
[04:39:10] raul782: but how do I update the attrs that I first sent when they enter int othe if condition?
[04:40:07] raul782: That makes sense if there were no If, but inside the if should I call build again
[04:40:07] _3dwardsharp: well, update the attr(s) on the instance you setup with .build
[04:40:19] _3dwardsharp: no, don't call .build again
[04:40:48] raul782: ok, so I update directly the ref audit_instance?
[04:41:30] _djbkd: has joined #RubyOnRails
[04:41:41] fourcolors: has joined #RubyOnRails
[04:42:18] _3dwardsharp: yeah. tho there's probably a more clear way to specify your polymorphic type...
[04:44:39] pickle_: has joined #RubyOnRails
[04:45:17] hahuang65: has joined #RubyOnRails
[04:45:25] raul782: humm, self.audits.save gives me an undefined method
[04:46:16] raul782: I guess you meant audit_instance.save
[04:50:29] raul782: _3dwardsharp: thanks that did it
[04:51:00] raul782: If you have any more resources on how to clear a way for the polymorphic type, that would be great
[04:51:15] raul782: That's the only way I could come up with a solution.
[04:51:55] bruce_lee: has joined #RubyOnRails
[04:51:55] bruce_lee: has joined #RubyOnRails
[04:54:20] patarr: has joined #RubyOnRails
[05:01:54] Kovensky: has left #RubyOnRails: ("Textual IRC Client: www.textualapp.com")
[05:04:34] provokeme: has joined #RubyOnRails
[05:04:51] arefaslani: has joined #RubyOnRails
[05:06:10] pawnbox: has joined #RubyOnRails
[05:06:39] xaviergmail_: has joined #RubyOnRails
[05:10:34] pawnbox: has joined #RubyOnRails
[05:20:41] pawnbox: has joined #RubyOnRails
[05:23:46] fourcolors: has joined #RubyOnRails
[05:24:06] fourcolors: has joined #RubyOnRails
[05:25:33] keerthana: has joined #RubyOnRails
[05:42:08] Rodya_: has joined #RubyOnRails
[05:46:00] hahuang65: has joined #RubyOnRails
[05:49:38] lightheaded: has joined #RubyOnRails
[05:49:43] _3dwardsharp: has joined #RubyOnRails
[05:53:51] silverdust: has joined #RubyOnRails
[05:59:26] fourcolors: has joined #RubyOnRails
[05:59:59] dionysus69: has joined #RubyOnRails
[06:00:44] pawnbox: has joined #RubyOnRails
[06:03:28] MrJoshua: has joined #RubyOnRails
[06:11:29] arefaslani: has joined #RubyOnRails
[06:16:02] fourcolors: has joined #RubyOnRails
[06:25:15] Ergo: has joined #RubyOnRails
[06:36:12] pawnbox: has joined #RubyOnRails
[06:47:59] hahuang65: has joined #RubyOnRails
[06:55:13] patarr: has joined #RubyOnRails
[07:01:17] AnoHito: has joined #RubyOnRails
[07:04:26] pwnd_nsfw: has joined #RubyOnRails
[07:05:35] ericmathison: has joined #RubyOnRails
[07:11:47] dionysus69: has joined #RubyOnRails
[07:17:39] juggler: has joined #RubyOnRails
[07:29:52] lightheaded: has joined #RubyOnRails
[07:30:03] benlieb: has joined #RubyOnRails
[07:32:56] hotpancakes: has joined #RubyOnRails
[07:32:59] xall: has joined #RubyOnRails
[07:33:26] darutoko: has joined #RubyOnRails
[07:33:40] arBmind: has joined #RubyOnRails
[07:41:43] pLaTo0n: has joined #RubyOnRails
[07:42:32] pulkit4tech: has joined #RubyOnRails
[07:47:31] itsgokul: has joined #RubyOnRails
[07:48:42] hahuang65: has joined #RubyOnRails
[07:49:33] zpe: has joined #RubyOnRails
[07:50:02] pickle_: has joined #RubyOnRails
[07:51:15] conta: has joined #RubyOnRails
[07:52:58] xaviergmail_: has joined #RubyOnRails
[07:53:36] mark_66: has joined #RubyOnRails
[07:56:15] artto: has joined #RubyOnRails
[08:01:37] fabiob_: has joined #RubyOnRails
[08:02:41] artto: has joined #RubyOnRails
[08:03:15] hotpancakes: has joined #RubyOnRails
[08:06:56] paradisaeidae: has joined #RubyOnRails
[08:08:28] spicerack: has joined #RubyOnRails
[08:08:50] nOwz: has joined #RubyOnRails
[08:09:55] zpe: has joined #RubyOnRails
[08:12:59] shortCircuit__: has joined #RubyOnRails
[08:14:43] fox_mulder_cp: has joined #RubyOnRails
[08:14:49] pawnbox: has joined #RubyOnRails
[08:14:51] shortCircuit__: need some help with doing internalisation.. I am doing like this I18n.l(5.months.from_now, format: "%d %B %Y", locale: :id) .. but August is written as August .. not Augustus or whatever.. how to do this correctly
[08:15:26] aganov: has joined #RubyOnRails
[08:15:32] shortCircuit__: also tried setting I18n.locale = :id and l(5.months.from_now, format: ...) still same
[08:15:48] pawnbox: has joined #RubyOnRails
[08:16:27] shortCircuit__: do I have to add month names in id.yml?
[08:16:36] pawnbox: has joined #RubyOnRails
[08:39:53] pawnbox: has joined #RubyOnRails
[08:41:20] pickle_: has joined #RubyOnRails
[08:43:31] teddysmoker: has joined #RubyOnRails
[08:45:54] jordansz: has joined #RubyOnRails
[08:49:32] hahuang65: has joined #RubyOnRails
[08:56:05] patarr: has joined #RubyOnRails
[08:59:47] fox_mulder_cp: good morning. how i can fix this to proper working? DomainZone.joins(:zone_price).where(listed: true).where('zone_prices.count > 0') ?
[09:02:53] zpe: has joined #RubyOnRails
[09:03:24] pawnbox: has joined #RubyOnRails
[09:04:12] blackmesa: has joined #RubyOnRails
[09:04:16] AzaToth: has joined #RubyOnRails
[09:08:53] arBmind: has joined #RubyOnRails
[09:10:07] fox_mulder_cp: shortCircuit__ read, please, i18n giude. may be u skip one or more steps or don't restart app after update config
[09:14:18] ferr1: has joined #RubyOnRails
[09:14:54] username1: has joined #RubyOnRails
[09:21:45] artto: has joined #RubyOnRails
[09:27:20] artto: has joined #RubyOnRails
[09:28:07] kassav: has joined #RubyOnRails
[09:29:10] jsrn_: has joined #RubyOnRails
[09:32:26] _3dwardsharp: fox_mulder_cp do you want to use the SUM() sql function (not rails .count)
[09:35:06] jenrzzz: has joined #RubyOnRails
[09:35:12] workmad3: has joined #RubyOnRails
[09:42:29] blackhuey: has joined #RubyOnRails
[09:43:13] fox_mulder_cp: _3dwardsharp: mm?
[09:43:31] fox_mulder_cp: now i see, that this ok: DomainZone.joins(:zone_prices).where(listed: true, 'zone_prices.default': true)
[09:43:43] fox_mulder_cp: but i need zone_prices.count..
[09:44:16] tbuehlmann: fox_mulder_cp: have you thought about having a counter cache?
[09:44:37] tedwing: has joined #RubyOnRails
[09:44:40] kassav_: has joined #RubyOnRails
[09:45:28] fox_mulder_cp: tbuehlmann: i use redis as active model serializers cache, but how use it proper with AR?
[09:45:42] tbuehlmann: you want to count associated records, right?
[09:45:47] srinidhi: has joined #RubyOnRails
[09:46:05] _3dwardsharp: does where('SUM(zone_prices) > 0') work?
[09:46:37] _3dwardsharp: i think COUNT() is also a sql function you can use
[09:47:49] _3dwardsharp: is .having() still in ActiveRecord?
[09:47:51] patarr: has joined #RubyOnRails
[09:47:59] fox_mulder_cp: tbuehlmann: yes. i need create scope for DomainZone where listed is true and zone_prices association for each DomainZone item is not null (domain_zone.each {|z| z.zone_prices.count} has one or more that one item
[09:48:06] marr: has joined #RubyOnRails
[09:48:24] lxsameer: has joined #RubyOnRails
[09:48:58] tbuehlmann: so you want to get all domain zones with at least one zone price?
[09:49:20] fox_mulder_cp: tbuehlmann: yes. this variant fails: DomainZone.joins(:zone_prices).where(listed: true, 'SUM(zone_prices) > ?': 0).count
[09:49:46] tbuehlmann: the inner join already returns only those domain zones with at least one zone price
[09:50:37] hahuang65: has joined #RubyOnRails
[09:52:48] fox_mulder_cp: tbuehlmann: so, my idea that .. (.., 'zone_prices.default': true) is good for getting item with price.default = true. oh. thanks
[09:52:49] sjakalen: has joined #RubyOnRails
[09:53:15] fox_mulder_cp: tbuehlmann: but how i can count joined items in query in common way?
[09:53:45] Terens: has joined #RubyOnRails
[09:54:33] tbuehlmann: I probably would group by domain_zones.id and select an additional column using COUNT()
[09:54:44] sjakalen: If I say a = table.where(id: 1) and this returns [] is this the same as "nil" or "no object" and thus check "if a" ?
[09:56:31] tbuehlmann: sjakalen: what is it that you want to achieve?
[09:57:06] fox_mulder_cp: sjakalen: a) find(id). b) find_by(id: id) return to u only one object
[09:58:01] sjakalen: I want to create relations between two static tables based on their abbreviation, but if the abbreviation matches no abbreviation it should be put in collection
[09:58:14] sjakalen: So Courses has an abbreviation, and MainCourses as well
[09:58:32] sjakalen: But if "INF" does not match any MainCourse, it should be put in "All"
[09:58:36] fox_mulder_cp: sjakalen: post example of code to gist.github.com,. pleas
[10:00:25] stamina: has joined #RubyOnRails
[10:00:32] Technodrome: has joined #RubyOnRails
[10:01:52] sjakalen: fox_mulder_cp: Do I just share the link here?
[10:02:01] ocpysh: has joined #RubyOnRails
[10:02:30] sjakalen: https://gist.github.com/vebjornhaugland/b4ef64cd61f00ff10b66b4ccdaaaf997
[10:03:36] tbuehlmann: right, so MainCourse.where(abbreviation: abbreviation) returns a collection of objects, that won't work for Course.create(code: code, title: title, abbreviation: abbreviation)
[10:03:48] hotpancakes: has joined #RubyOnRails
[10:04:13] tbuehlmann: you want to only find one MainCourse, so you probably want to do MainCourse.find_by(abbreviation: abbreviation), which returns nil or a MainCourse
[10:05:02] sjakalen: Aaaahhh, alright. And then I can do a "if mc" ?
[10:05:40] sjakalen: Thanks a lot, by the way - very helpful. Had never used gist.github.com
[10:06:53] tbuehlmann: right, `if mc` would work then
[10:07:42] sjakalen: Best IRC I've ever been to
[10:08:48] eforbes: has joined #RubyOnRails
[10:12:28] Jameser: has joined #RubyOnRails
[10:18:51] fox_mulder_cp: hm. what callback i need to use when Model.new, but not Model.find() ?
[10:19:19] fox_mulder_cp: and Model.find and not Model.new?
[10:19:27] pwnd_nsfw`: has joined #RubyOnRails
[10:21:35] fox_mulder_cp: tbuehlmann: i need two different callback. one for Model.new but not for Model.find(..)
[10:21:44] tbuehlmann: what kind of callback? what shall it do?
[10:23:31] fox_mulder_cp: tbuehlmann: in :new i want set some instance properties for processing, but i don't set it when instance loaded from database
[10:23:50] tbuehlmann: are you talking about after_initialize?
[10:24:17] fox_mulder_cp: tbuehlmann: after_initialize called when :new and when .find() too
[10:24:39] fox_mulder_cp: and override my already existant properties (
[10:24:52] tbuehlmann: have a condition in it: `if new_record?` or `if persisted?`
[10:25:03] gndm: has joined #RubyOnRails
[10:25:13] tbuehlmann: if it's not important which one it is, this can work as well: `self.some_attribute ||= 'default'`
[10:25:34] fox_mulder_cp: wow. your idea for condition is great
[10:31:51] fox_mulder_cp: tbuehlmann: after_initialize: set_props, if new_record? fails to syntax
[10:33:28] artto: has joined #RubyOnRails
[10:34:41] fox_mulder_cp: tbuehlmann: oh. after_initialize: set_props, if: :new_record?
[10:40:16] xaviergmail_: has joined #RubyOnRails
[10:41:23] ferr1: https://gist.github.com/Fercell/88c8eeb5d3eb1bf751b92ebe5a242b0f any ideas why polymorphic assoc does not work?
[10:41:53] pickle_: has joined #RubyOnRails
[10:42:44] vinn: has joined #RubyOnRails
[10:43:08] fox_mulder_cp: ferr1: read guides for polymorphic relations.
[10:43:21] fox_mulder_cp: seems, that u miss one or more steps.
[10:44:22] fox_mulder_cp: ooh. i really, really need a tests for my panel (
[10:46:12] vinn: Hello. How are the job opportunities in ruby on rails
[10:48:37] eforbes1: has joined #RubyOnRails
[10:49:54] sjakalen: when I have a has_many -- belongs_to relationship they don't have to share any columns, right? I get "can't write unknown attribute" upon trying to create the realtion
[10:51:18] hahuang65: has joined #RubyOnRails
[10:54:55] xpl0iter: has joined #RubyOnRails
[10:56:23] hotpancakes: has joined #RubyOnRails
[10:58:10] ferr1: fox_mulder_cp: I did not miss any step, it should have been has_many :gps_logs, as: :gps_logeable, class_name: 'GpsProvider'
[11:02:06] xhoy: hi there@ i have a mysql model, with a field " properties" this contains a hash (so Object.properites returns a hash) is there an 'easy' way of doing Object.where(properties['field']: 'value') ?
[11:03:27] irishfromua: has joined #RubyOnRails
[11:04:06] tbuehlmann: xhoy: depends on how that's implemented. how is that saved in the database?
[11:04:29] xhoy: well its a nested model to make it even more complicated
[11:04:42] xhoy: serialize :properties, Hash
[11:04:50] xhoy: i guess its a string
[11:05:13] xhoy: so i could do something like where("properties LIKE ?", 'field')?
[11:05:23] tbuehlmann: you could, but meh
[11:05:36] tbuehlmann: what RDBMS do you use?
[11:05:51] Fernando-Basso: has joined #RubyOnRails
[11:06:22] bbrowning: has joined #RubyOnRails
[11:06:34] xhoy: innodb and activerecord
[11:06:48] xhoy: could that be done in mariadb...
[11:07:06] tbuehlmann: no idea about mariadb json querying, but you could serialize as JSON and query via that
[11:07:46] xhoy: thanks, ill look in to that!
[11:07:58] xhoy: neverthought to look at mariadb for anwsers :)
[11:09:23] xhoy: great reason to upgrade to rails 5!
[11:09:30] xhoy: https://github.com/rails/rails/pull/21110 << json datatype support
[11:10:18] fox_mulder_cp: ferr1: ..., polymorphic: true..
[11:10:57] kassav_: has joined #RubyOnRails
[11:11:00] fox_mulder_cp: xhoy: mysql can't use hash by default. json storage is presented in postgresql
[11:11:08] fox_mulder_cp: and array in string
[11:11:36] jordansz: has joined #RubyOnRails
[11:11:48] fox_mulder_cp: tbuehlmann: by the way - .includes(:nester) work as .joins(:nested) as join too?
[11:11:50] xhoy: fox_mulder_cp: seems to be since version 5.7.6 https://github.com/rails/rails/pull/21110/files#diff-e7dead35794529e0cc5d0b2d788f8235
[11:11:56] arBmind: has joined #RubyOnRails
[11:11:57] xhoy: fox_mulder_cp: no
[11:11:59] xhoy: fox_mulder_cp: moment
[11:12:13] xhoy: fox_mulder_cp: https://www.foraker.com/blog/active-record-includes-query-logic
[11:12:34] tbuehlmann: fox_mulder_cp: serializing as Hash/JSON works pretty much everywhere because it's just a string/text column
[11:16:54] xhoy: seems to be working SELECT * FROM `book`
[11:16:55] xhoy: WHERE JSON_CONTAINS(tags, '["JavaScript"]');
[11:17:08] jordansz: has joined #RubyOnRails
[11:17:16] xhoy: but cant find anything on the mariadb side, this is only the mysql 5.7 part
[11:17:20] pawnbox: has joined #RubyOnRails
[11:17:40] xhoy: ow mariadb only supports this from 10.2.3 forward
[11:18:10] fox_mulder_cp: wow, wow. i'm idiotto %) add .includes(:all, :my, :nested) in pundit policy scope with use redis as cache and AMS optimize my json rendering for ~1500 objects from 9 seconds to 3.4
[11:24:36] Terens: I want to change the type of a collumn
[11:24:41] Terens: integer to string
[11:24:51] Terens: Is it better to remove it and add it again in migration ?
[11:24:55] Terens: or change it
[11:24:59] Terens: I dont care about the data
[11:34:04] matthewd: terens: It doesn't really matter, then
[11:34:48] am55_: has joined #RubyOnRails
[11:35:20] niknam: has joined #RubyOnRails
[11:36:09] intuxicated: has joined #RubyOnRails
[11:36:09] intuxicated: has joined #RubyOnRails
[11:40:03] d0nn1e: has joined #RubyOnRails
[11:41:01] stamina: has joined #RubyOnRails
[11:42:30] xall: has joined #RubyOnRails
[11:43:24] hotpancakes: has joined #RubyOnRails
[11:46:14] treefrob: has joined #RubyOnRails
[11:47:07] intuxicated: Hi, I'm trying to select table X and join table Y with limit 10 and offset 0. the query work perfect. everything is ok until I add an order with value 'Y.z asc'. now I see an error "missing FROM-clause entry for table "supplier_product"'
[11:48:59] intuxicated: table "Y"*, which is unexpected because I have join the Y table. when I look at the debug output, I see a distinct query before my query which is trying to find all records in table X first.
[11:49:13] intuxicated: any idea how I can disable this behavior?
[11:54:55] armyriad: has joined #RubyOnRails
[11:55:55] tvw: has joined #RubyOnRails
[12:00:01] fox_mulder_cp: intuxicated: a.joins(:b).where(prop: value, 'b.some': true), than sort|order, than limit/offset
[12:00:18] ocpysh: has joined #RubyOnRails
[12:00:58] xall: has joined #RubyOnRails
[12:01:37] fox_mulder_cp: terens: http://api.rubyonrails.org/classes/ActiveRecord/Migration.html
[12:02:10] HoierM: has joined #RubyOnRails
[12:02:15] pawnbox: has joined #RubyOnRails
[12:03:35] sjakalen: Is there any way to reset the id-field of a table?¨
[12:03:58] artto: has joined #RubyOnRails
[12:06:20] Technodrome: has joined #RubyOnRails
[12:06:29] fox_mulder_cp: sjakalen: pgsql can reset id counter field, but i can drop consistance of data
[12:07:29] pwnd_nsfw: has joined #RubyOnRails
[12:07:45] Jasaka: has joined #RubyOnRails
[12:10:01] intuxicated: fox_mulder_cp: I don't have any where condition. I did swap the code position of sort and limit/offset. result is the same. I think I found a bug
[12:11:02] fox_mulder_cp: offset must be before limit )
[12:14:19] username1: has joined #RubyOnRails
[12:15:38] hahuang65: has joined #RubyOnRails
[12:22:19] intuxicated: fox_mulder_cp: still same error. error is only depend on order('Y.z asc'), If i remove it, its work fine. but I need it :S
[12:23:10] pawnbox: has joined #RubyOnRails
[12:26:20] fox_mulder_cp: intuxicated: Model.all.order('name asc') ?
[12:27:15] intuxicated: fox_mulder_cp: Model.all.order('association.name asc') ?
[12:27:33] lightheaded: has joined #RubyOnRails
[12:28:26] lightheaded: has joined #RubyOnRails
[12:31:01] DaveTaboola: has joined #RubyOnRails
[12:31:22] eforbes: has joined #RubyOnRails
[12:32:53] fox_mulder_cp: may be u need Associated.join(:model).order ?
[12:33:00] hotpancakes: has joined #RubyOnRails
[12:33:06] fox_mulder_cp: or order associated in view
[12:33:25] ocpysh: has joined #RubyOnRails
[12:33:46] fox_mulder_cp: what is inverse_of field name for has_and_belongs_to_many? modeL or modelS?
[12:38:55] rfoust: has joined #RubyOnRails
[12:41:24] Mohan: has joined #RubyOnRails
[12:41:57] netzfisch: has joined #RubyOnRails
[12:46:52] Guest11068: while am trying to import CSV with 1k rows, i get "something went wrong" error but when check in production server with tail -f production.log, i am able to see the rows being insert into db.
[12:47:13] Guest11068: i guess screen getting timed out.
[12:47:34] Guest11068: how to avoid time out error until all rows are imported?
[12:50:25] tbuehlmann: do you import via your rails server? or in a rails console?
[12:52:33] dminuoso: tbuehlmann! I have finally found a simple explanations for monads.
[12:52:37] dminuoso: A monad is just a monoid in the category of endofunctors.
[12:52:43] dminuoso: It's so clear now.
[12:52:50] tbuehlmann: I'm so happy for you
[12:54:20] Guest11068: @ tbuehlmann i am importing via rails interface
[12:55:10] fourcolors: has joined #RubyOnRails
[12:56:01] tbuehlmann: what's the rails interface? do you mean the rails console?
[12:56:02] Guest11068: in order to identify why it throws error, i tried to watch production log where i can see the import process still in progress where as the interface in browser with "something went wrong"
[12:57:17] pulkit4tech: has joined #RubyOnRails
[12:58:05] Guest11068: user can choose the csv file and click "import" via post request which is processed in a function.
[12:59:22] tbuehlmann: okay, so you're importing via the rails _server_
[12:59:27] manzo: has joined #RubyOnRails
[12:59:50] tbuehlmann: are you on heroku? do you use something that setups a timeout like rack timeout? a unicorn setting?
[13:00:28] Guest11068: @tbuehlmann yes....sorry for my lengthy explaintion. in a vps box with nginx and puma
[13:00:34] hotpancakes: has joined #RubyOnRails
[13:01:16] tbuehlmann: if you haven't setup nginx otherwise, there's definitively a timeout
[13:01:53] tildes: has joined #RubyOnRails
[13:01:53] ramortegui: has joined #RubyOnRails
[13:03:20] Guest11068: when i look into nginx log, i get " *324 upstream timed out (110: Connection timed out) while reading response header from upstream"
[13:03:41] lightheaded: has joined #RubyOnRails
[13:05:58] HoierM_: has joined #RubyOnRails
[13:07:19] hotpancakes: has joined #RubyOnRails
[13:07:57] Guest11068: @tbuehlmann thanks. I hope increasing time out time will help.
[13:12:23] DrYockel: has joined #RubyOnRails
[13:13:37] totimkopf: has joined #RubyOnRails
[13:15:50] am55_: has joined #RubyOnRails
[13:17:22] bauruine: has joined #RubyOnRails
[13:20:14] srinidhi: has joined #RubyOnRails
[13:20:18] doodlehaus: has joined #RubyOnRails
[13:21:15] Coldblackice: has joined #RubyOnRails
[13:22:14] bauruine: has joined #RubyOnRails
[13:24:13] rgr: has joined #RubyOnRails
[13:27:44] lightheaded: has joined #RubyOnRails
[13:29:02] hotpancakes: has joined #RubyOnRails
[13:30:07] rgr: Hi folks. My first visit here. I desperately need some help. Im trying to "reverse engineer" a friends mothballed web. Somehow a URL is being served by his server but I cant see how : there is no vhost.conf in sites-enabled that matches the url. ins his vidoes.conf the hostname is set as videos.blah.domain.com but the url served successfully is actually videos.domain.com (missing the blah component). In the /var/www di
[13:30:07] rgr: a "videos" directory which appears to be a ruby on rails app. Other than the vhost file how is this app being used to serve by apache2 if the url is not matching that vhost specifier? If you feel you could help maybe slash msg me as I really need some hand holding. I have installed passenger and bundler and installed everything from the app's Gemfile in my local "copy" but my local setup is not serving that url.
[13:32:44] matthewd: rgr: If apache gets a request for a hostname that doesn't match any defined vhost, it'll be served by the first vhost that was defined
[13:33:59] newalexandria: has joined #RubyOnRails
[13:34:11] rgr: first vhost being defined as alphanumerical order?
[13:36:00] matthewd: Technically config order, but in a standard modern setup, yes, I think that'll mean alphanum order of the filename in sites-enabled
[13:36:50] agent_white: has joined #RubyOnRails
[13:38:43] DLSteve: has joined #RubyOnRails
[13:39:25] srinidhi: has joined #RubyOnRails
[13:40:24] rgr: the real example matthewd is : whats being thrown on the "Live system" up says its url is videos.vollfilm.com/blah but there is no vhost domain match in any of the sites-enabled. There is a videos.old.vollfilm.com, videos.staging.vollfilm.com but no videos.vollfilm.com. Can you suggest how I can see how the live site is serving this videos.vollfilm.com/blah url please? Ive even done a recursive greo for "videos.vollfi
[13:40:24] rgr: and nothing is there. It's confusing the hell out of me. The real URL is : (for example) http://videos.vollfilm.com/person/6695/videos/10
[13:40:43] rgr: s/greo/grep
[13:43:45] artto: has joined #RubyOnRails
[13:45:49] mikecmpbll: has joined #RubyOnRails
[13:46:05] matthewd: rgr: Try disabling sites one at a time until it stops working?
[13:47:23] matthewd: I think the apache log format can be configured to log both the requested host and the primary name of the vhost that's serving the request..
[13:51:44] agent_white: Mornin' folks
[13:52:37] xaviergmail_: has joined #RubyOnRails
[13:52:55] rgr: OK I shall google that. thanks for taking the time to reply.
[13:54:27] matthewd: No worries! Hopefully we can be of a bit more help once you get through the apache layer and have the actual running rails app to look at :)
[13:55:06] mkozjak: has joined #RubyOnRails
[13:55:18] rgr: problem is that I really dont want to do anything to his live system. I wouldnt be surprised if the way it was left then an apache restart sees it not working at all.
[13:56:24] hotpancakes: has joined #RubyOnRails
[13:56:51] mkozjak: i have some kind of a race condition while using ActionDispatch::IntegrationTest where i would create a new entry into the sqlite3 db (test env). seems like teardown do User.destroy_all; end doesn't really work, since I get 'ActiveRecord::RecordNotUnique: SQLite3::ConstraintException: UNIQUE constraint failed'... kinda got short on debugging. any ideas?
[13:58:30] mkozjak: if i try printing all the records before doing a new entry, they definitely exist. seems like destroy didn't really work...
[13:59:00] artto: has joined #RubyOnRails
[13:59:51] spicerack: has joined #RubyOnRails
[14:00:26] mkozjak: if i do a destroy in that test, it works. is something wrong with my teardown usage?
[14:00:57] mkozjak: it's fixture data that i'm using
[14:00:58] BSaboia: has joined #RubyOnRails
[14:00:59] spicerack: I am trying to install Bootstrap and when I run bundle install it gives me these error messages, are they errors or can I still work with it and it's basically telling me my version of rails is not the most recent? The Bootstrap I am using for gemfile is https://github.com/seyhunak/twitter-bootstrap-rails
[14:01:28] spicerack: These are the errors: https://www.dropbox.com/s/16suaygdfvap2o0/170315-ckck4.png?dl=0
[14:06:42] am55_: has joined #RubyOnRails
[14:08:06] sjakalen: As I can't use collection_select to create my drop down menus, is there a way to group my select_tag drop downs like the collection_select grouping?
[14:08:17] sjakalen: https://gist.github.com/vebjornhaugland/f8da12eebeccec47b51137fb4bb49d09
[14:08:40] sjakalen: I want the courses chosen to be reliant on the maincourse chosen
[14:12:13] cschneid_: has joined #RubyOnRails
[14:13:28] xpl0iter: has joined #RubyOnRails
[14:16:23] hahuang65: has joined #RubyOnRails
[14:19:48] patarr: has joined #RubyOnRails
[14:20:42] mikecmpbll: has joined #RubyOnRails
[14:21:38] brent__: has joined #RubyOnRails
[14:23:15] manzo: has left #RubyOnRails: ()
[14:27:44] soahccc^: Is it like a known caveat that constant lookup (at least in development) is broken when done in a thread? It appears to deadlock without noticing and just running forever... Took me like 3 hours to figure out
[14:28:20] blackmesa: has joined #RubyOnRails
[14:28:56] Voker57|2: has joined #RubyOnRails
[14:29:09] soahccc^: Shall I add, it just so happens when done in a controller, console or delayed_job works without an issue
[14:30:39] artto: has joined #RubyOnRails
[14:30:40] chouhoulis: has joined #RubyOnRails
[14:30:42] am55_: has joined #RubyOnRails
[14:32:02] Qchmqs: has joined #RubyOnRails
[14:36:38] hotpancakes: has joined #RubyOnRails
[14:36:56] AndroUser2: has joined #RubyOnRails
[14:37:04] am55_: has joined #RubyOnRails
[14:37:12] jordansz: has joined #RubyOnRails
[14:39:14] jsrn__: has joined #RubyOnRails
[14:41:11] HoierM: has joined #RubyOnRails
[14:41:43] matthewd: soahccc_: https://github.com/rails/rails/pull/27494 -- I really should get that finished and merged :|
[14:42:16] am55_: has joined #RubyOnRails
[14:43:20] alex88: has joined #RubyOnRails
[14:44:35] workmad3: has joined #RubyOnRails
[14:48:05] envint: has joined #RubyOnRails
[14:48:33] cschneid_: has joined #RubyOnRails
[14:49:17] artto: has joined #RubyOnRails
[14:50:41] soahccc^: matthewd: that looks a bit complicated. The executor for example. when do I consider my component not to be application code? it's a loose component but inside app/lib. It seems as wrapping the thread joining into a permit_concurrent_loads block would already solve everything
[14:52:54] elaptics: has joined #RubyOnRails
[14:52:55] matthewd: Non-application code is basically the outermost long-running stuff -- the web server, the job queue processor
[14:53:42] am55_: has joined #RubyOnRails
[14:53:46] matthewd: If there's a request waiting for it (or it's doing something only application code is allowed to do, like triggering an autoload), then it's application code
[14:53:47] invalidusrname: has joined #RubyOnRails
[14:56:24] soahccc^: thanks :) so code reloading is request safe I assume? Otherwise I can't explain why my workaround worked by just "void" using the constant in "main thread" before using it in a child thread.
[15:01:24] polishdub: has joined #RubyOnRails
[15:02:36] doodlehaus: has joined #RubyOnRails
[15:04:05] lightheaded: has joined #RubyOnRails
[15:05:15] artto: has joined #RubyOnRails
[15:06:32] elaptics: has joined #RubyOnRails
[15:09:05] artto: has joined #RubyOnRails
[15:09:39] roadrunneratwast: has joined #RubyOnRails
[15:10:22] envint: has joined #RubyOnRails
[15:10:49] roadrunneratwast: hi. i am on the learn-rails book and am having trouble with rails generate figaro:install. I am told . Could not find generator 'figaro:install'
[15:12:02] Technodrome: has joined #RubyOnRails
[15:13:11] spicerack: cool i'm installing from that book right now too
[15:13:21] hotpancakes: has joined #RubyOnRails
[15:14:03] doodleha_: has joined #RubyOnRails
[15:15:05] roadrunneratwast: spicerack. i am stuck on chapter 13. let me know if you figure it out. thanks
[15:15:50] spicerack: i'm not sure if i'll get that far
[15:17:00] pawnbox: has joined #RubyOnRails
[15:17:11] hahuang65: has joined #RubyOnRails
[15:17:44] spicerack: i'll have to work on it again tomorrow
[15:17:49] spicerack: i'm just trying to update rail actually
[15:19:21] roadrunneratwast: the setup is so intense for rails.
[15:19:41] xall: has joined #RubyOnRails
[15:20:23] nettoweb: has joined #RubyOnRails
[15:21:07] pawnbox: has joined #RubyOnRails
[15:24:07] jordansz: has joined #RubyOnRails
[15:24:33] jordansz: hi everyone i currently build related models inside registration. controller for devise like so https://gist.github.com/jordanlance/207299b9ff72ac2976cfaaaddb456997
[15:24:34] Sigyn: has joined #RubyOnRails
[15:24:58] jordansz: i was wondering could i place this creation of related tables in the model instead? so when a user gets initiated the related tables will be build there?
[15:25:18] jordansz: this also would allow me to just load my seeds and the model will generate everything, feels much cleaner also
[15:25:27] jordansz: what would be approach to move this code to the model layer?
[15:27:37] envint: has joined #RubyOnRails
[15:29:18] helloc: has joined #RubyOnRails
[15:32:05] benlieb: has joined #RubyOnRails
[15:32:28] workmad3: has joined #RubyOnRails
[15:32:48] envint: has joined #RubyOnRails
[15:35:02] helloc: hello, how can I customize my bootstrap variables if I use the boostrap-rubygem gem?
[15:35:23] jordansz: nobody can point me how to create associated relations from model best practice?
[15:35:42] brent__: has joined #RubyOnRails
[15:35:44] jordansz: hello_ probably there is an initializer in config/initializers
[15:35:45] helloc: jordansz: in the rails guides i assume?
[15:36:35] helloc: jordansz: none that I can see.
[15:36:57] brent__: has joined #RubyOnRails
[15:37:47] hotpancakes: has joined #RubyOnRails
[15:39:33] roadrunneratwast: hey all. i am trying to do the learn-rails tutorial and get the error: Could not find generator 'figaro:install'.
[15:39:36] nya: has joined #RubyOnRails
[15:39:43] phon: has joined #RubyOnRails
[15:39:59] pawnbox: has joined #RubyOnRails
[15:43:01] dopamean_: has joined #RubyOnRails
[15:43:14] username1: has joined #RubyOnRails
[15:43:18] Kuukunen: has joined #RubyOnRails
[15:46:13] harfangk: has joined #RubyOnRails
[15:47:57] GeorgesLeYeti: has joined #RubyOnRails
[15:48:00] xall: has joined #RubyOnRails
[15:49:23] GeorgesLeYeti: I would like to order my record in 2 steps. 1st order by position number and then add at 1st place the records where key is like "en-"
[15:50:02] pawnbox: has joined #RubyOnRails
[15:52:57] vedu: has joined #RubyOnRails
[15:53:38] sjakalen: has joined #RubyOnRails
[15:54:04] sjakalen: Is there a way to group select_tag just as you can group collection_select easily?
[15:54:14] sjakalen: https://gist.github.com/vebjornhaugland/f8da12eebeccec47b51137fb4bb49d09
[15:56:04] hakash: has joined #RubyOnRails
[15:57:23] dminuoso: GeorgesLeYeti: Just supply multiple conditions: Model.order(:price, :age, other: :asc)
[15:57:40] nOwz: has joined #RubyOnRails
[15:57:50] dminuoso: GeorgesLeYeti: You can also chain them because its just arel: Model.order(:price).order(:age)
[15:58:02] envint: has joined #RubyOnRails
[16:00:24] DoubleMalt: has joined #RubyOnRails
[16:01:31] chouhoulis: has joined #RubyOnRails
[16:01:43] keerthana: has joined #RubyOnRails
[16:02:37] pulkit4tech: has joined #RubyOnRails
[16:06:16] envint: has joined #RubyOnRails
[16:11:36] Zort0n: has joined #RubyOnRails
[16:11:58] [Butch]: has joined #RubyOnRails
[16:16:44] habitullence: has joined #RubyOnRails
[16:17:42] hotpancakes: has joined #RubyOnRails
[16:18:00] hahuang65: has joined #RubyOnRails
[16:21:07] hotpancakes: has joined #RubyOnRails
[16:27:56] xaviergmail_: has joined #RubyOnRails
[16:31:34] envint: has joined #RubyOnRails
[16:32:16] Emily_: has joined #RubyOnRails
[16:34:08] gusrub: has joined #RubyOnRails
[16:36:29] hahuang65: has joined #RubyOnRails
[16:36:55] Zort0n: has joined #RubyOnRails
[16:37:03] hotpancakes: has joined #RubyOnRails
[16:41:08] Hello: has joined #RubyOnRails
[16:45:35] Hello: Where do I customize variables when using bootstrap-rubygem?
[16:52:48] envint: has joined #RubyOnRails
[16:53:13] xpl0iter: has joined #RubyOnRails
[16:54:20] linoge: has joined #RubyOnRails
[16:55:00] linoge: has left #RubyOnRails: ()
[16:55:42] Suslov: has joined #RubyOnRails
[16:58:40] lightheaded: has joined #RubyOnRails
[16:59:54] mdhas: has joined #RubyOnRails
[17:00:26] gusrub: has joined #RubyOnRails
[17:03:28] ldnunes: has joined #RubyOnRails
[17:08:26] meoblast001: has joined #RubyOnRails
[17:08:59] xall: has joined #RubyOnRails
[17:10:53] nOwz: has joined #RubyOnRails
[17:11:24] Derperperd: has joined #RubyOnRails
[17:12:45] zacts: has joined #RubyOnRails
[17:14:00] pawnbox_: has joined #RubyOnRails
[17:21:24] rogue_koder: has joined #RubyOnRails
[17:23:45] SteenJobs: has joined #RubyOnRails
[17:24:28] irishfromua: has joined #RubyOnRails
[17:25:21] Cohedrin: has joined #RubyOnRails
[17:27:10] duderonomy: has joined #RubyOnRails
[17:34:35] envint: has joined #RubyOnRails
[17:34:41] hotpancakes: has joined #RubyOnRails
[17:35:17] bennyzr: has joined #RubyOnRails
[17:35:30] guacamole: has joined #RubyOnRails
[17:35:51] gusrub: has joined #RubyOnRails
[17:37:33] bennyzr: Hi, I want a model to have 2 addresses, business & mailing. What is better, 2 has_one relationships named business_address & mailing address or a has_many relationship with 2 methods with the same names?
[17:39:07] gusrub: has joined #RubyOnRails
[17:45:04] Suslov: has joined #RubyOnRails
[17:47:53] blackmesa: has joined #RubyOnRails
[17:53:12] johnchan: has joined #RubyOnRails
[17:53:23] Suslov: has joined #RubyOnRails
[17:53:54] Suslo: has joined #RubyOnRails
[17:55:11] envint: has joined #RubyOnRails
[17:55:22] tbuehlmann: bennyzr: I'd prefer having two has_one associations
[17:56:33] bennyzr: tbuehlmann: thanks, sounds cleaner.
[17:58:57] dminuoso: I love rails.
[17:59:16] dminuoso: I just submitted a POST request with a body (I have even wiresharked this to be sure), but rails acts like there's nothing..
[17:59:55] gusrub: has joined #RubyOnRails
[18:01:02] jordansz: has joined #RubyOnRails
[18:03:31] dminuoso: The issue was just the missing Content-Type header, I just assumed that settings a defaults { format: :json } in the route was enough..
[18:03:36] hahuang65: has joined #RubyOnRails
[18:04:30] dionysus69: has joined #RubyOnRails
[18:08:27] baweaver: https://github.com/rails/rails/pull/27365/files
[18:09:19] xall: has joined #RubyOnRails
[18:09:40] dminuoso: baweaver: Do you feel like this should also automatically do the request body interpretation thing if the format is set to json?
[18:11:04] hahuang61: has joined #RubyOnRails
[18:12:47] baweaver: ACTION is running about doing work stuffs
[18:13:02] fourcolors: has joined #RubyOnRails
[18:13:42] mr-spoon: has joined #RubyOnRails
[18:16:03] spicerack: has joined #RubyOnRails
[18:23:14] xaviergmail_: has joined #RubyOnRails
[18:23:38] djbkd: has joined #RubyOnRails
[18:23:42] jordansz: has joined #RubyOnRails
[18:23:49] juggler: has joined #RubyOnRails
[18:24:18] jordansz: hi everyone, anyone really good with haml? i try to make .col-lg-4.col-lg-offset-4.col-md-4.col-md-offset-4.col-sm-5.col-sm-offset-4.col-xs-12 a multiline
[18:24:32] jordansz: now i found the | seperator but this does not work for class as i assume
[18:24:47] jordansz: my goal is to have .col-lg-2 then on a new line col-sm-2
[18:29:32] envint: has joined #RubyOnRails
[18:32:07] tedwing: has joined #RubyOnRails
[18:35:17] mdhas: has joined #RubyOnRails
[18:35:52] matthewd: dminuoso: "Please give me a JSON response" and "I am sending JSON input" really aren't the same thing
[18:38:28] hotpancakes: has joined #RubyOnRails
[18:48:59] [Butch]_: has joined #RubyOnRails
[18:50:32] DoctorMonocular: has joined #RubyOnRails
[18:51:48] bruce_lee: has joined #RubyOnRails
[18:58:07] dminuoso: matthewd: Mmmm.
[19:00:07] netzfisch: has joined #RubyOnRails
[19:00:31] blackmesa: has joined #RubyOnRails
[19:02:04] hotpanca_: has joined #RubyOnRails
[19:04:33] martin76: has joined #RubyOnRails
[19:06:47] martin76: What document oriented database would you propose to work with rails?
[19:06:55] mchelen2: has joined #RubyOnRails
[19:07:59] amperry: has joined #RubyOnRails
[19:08:06] dminuoso: martin76: mongodb
[19:08:32] dminuoso: martin76: There's a pretty extensive ODM called mongoid.
[19:08:48] dminuoso: I think it's pretty much the de-facto standard for rails.
[19:09:41] martin76: dminuoso: It was my first choice, but I found so many bad opinions about this engine. Do you use mongodb without bigger problems?
[19:10:11] ocpysh: has joined #RubyOnRails
[19:10:26] dminuoso: martin76: What issues have you heard about?
[19:11:06] martin76: dminuoso: I have seen many article about why not to use mongodb on the internet
[19:11:56] djbkd: has joined #RubyOnRails
[19:12:33] dminuoso: martin76: Well you can definitely go for raw PostgreSQL which is rock solid.
[19:12:58] dminuoso: martin76: But I have no experience or knowledge whether there are any ODMs for JSONB focused postgres usage
[19:13:01] tbuehlmann: why not postgres? I mean, mongo is powered by postgres :)
[19:13:17] Suslov: has joined #RubyOnRails
[19:13:55] martin76: tbuehlmann: my database model perfectly fits to denormalized document store
[19:14:11] martin76: going with postgresql I will have multiple joinssss
[19:15:21] dminuoso: martin76: Anything you can do in mongo, you can do in postgres
[19:16:35] blackmes1: has joined #RubyOnRails
[19:17:03] martin76: dminuoso: what do you mean ? There is json column but it is limited
[19:17:07] Suslo: has joined #RubyOnRails
[19:17:22] martin76: json column type, but it has many limitations*
[19:17:36] Suslov_: has joined #RubyOnRails
[19:17:58] hotpancakes: has joined #RubyOnRails
[19:18:24] tvw: has joined #RubyOnRails
[19:18:36] amperry: hi folks, got a question that might be pretty basic html about creating multi-tiered tables from data. Gist here: https://gist.github.com/amp108/a84ab62a10f0e68bb22dcce59e87680d
[19:19:52] netzfisch: has joined #RubyOnRails
[19:22:35] NoGodDamnIdea: has joined #RubyOnRails
[19:23:27] bennyzr: How would I get this to work: has_one :primary_address, -> { where primary: true }, through: :addressables, source: :addressable? Where addressable is a polymorphic belongs_to in Address.
[19:24:37] bennyzr: What would addressables be? a has_many relationship in the same model or a many-to-many table?
[19:25:28] bennyzr: source: http://apidock.com/rails/ActiveRecord/Associations/ClassMethods/has_one
[19:28:16] hotpancakes: has joined #RubyOnRails
[19:29:34] doodlehaus: has joined #RubyOnRails
[19:30:22] doodlehaus: has joined #RubyOnRails
[19:36:00] Jasaka: has joined #RubyOnRails
[19:36:29] envint: has joined #RubyOnRails
[19:37:24] Fischmiep: has joined #RubyOnRails
[19:37:37] Jasaka|NA: has joined #RubyOnRails
[19:37:53] srinidhi: has joined #RubyOnRails
[19:40:04] Technodrome: has joined #RubyOnRails
[19:45:35] pixilla: has joined #RubyOnRails
[19:46:10] Fischmiep: has joined #RubyOnRails
[19:48:12] hotpancakes: has joined #RubyOnRails
[19:48:38] rgr: has joined #RubyOnRails
[19:49:09] rgr: desperately trying to get ruby/r working. follwing rvm instructions but getting version problems. I set my ruby to 2.0 to install compass but when I put ruby back to 1.9.3 thats compatible with this project rake fails : http://imgur.com/a/pUqJo . I must admit to being like a rabbit in the headlights with rvm and gems.
[19:50:25] pixilla: has left #RubyOnRails: ()
[19:50:40] matthewd: rgr: You need it to be compatible with all the libraries at the same time ;)
[19:51:07] pixilla: has joined #RubyOnRails
[19:51:45] tdy: has joined #RubyOnRails
[19:51:56] matthewd: rgr: If you already have a production deploy, you should be able to match the ruby version from that, and (if it's not committed for some reason) copy the Gemfile.lock from there too
[19:51:59] hotpanca_: has joined #RubyOnRails
[19:54:01] rgr: there is a gemfile.lock yes. but... well. I'm lost ;)
[19:54:26] rgr: so I gem install the lock file? I can google.
[19:55:35] matthewd: The Gemfile.lock lists the exact versions of all the gems. As they were obviously previously installed in production, they must be compatible with the ruby version running there.
[19:56:03] matthewd: That's what `bundle install` uses, as long as you haven't done a `bundle update` or something.
[19:56:08] ocpysh: has left #RubyOnRails: ("Textual IRC Client: www.textualapp.com")
[19:56:36] rgr: could you save me googling through a gazillion half arsed tutorials maybe? in my release dir. there is a gemfile and gemfile.lock. shouldnt it be enought to "bundle install"? Its that thats falling over.
[19:56:57] Cohedrin_: has joined #RubyOnRails
[19:57:18] username1: has joined #RubyOnRails
[19:57:43] habitullence_: has joined #RubyOnRails
[19:58:14] rgr: ok. seem to have some success. thanks.
[19:59:03] hahuang65: has joined #RubyOnRails
[20:00:40] patarr1: has joined #RubyOnRails
[20:01:53] pixilla: has left #RubyOnRails: ()
[20:02:01] dminuoso: https://gist.github.com/dminuoso/2887ac17a63a18cd17ac9e92a3e71ebe
[20:02:06] dminuoso: https://github.com/plataformatec/responders/issues/174
[20:03:05] Fischmiep: has joined #RubyOnRails
[20:04:10] agent_white: has joined #RubyOnRails
[20:05:03] dminuoso: And this was even documented behavior "However, note that these options are ignored after an unsuccessful attempt to save a resource, e.g. when automatically rendering :new after a post request."
[20:15:05] szulak: has joined #RubyOnRails
[20:17:55] nOwz: has joined #RubyOnRails
[20:31:54] hotpancakes: has joined #RubyOnRails
[20:32:49] Derperperd: has joined #RubyOnRails
[20:35:26] lightheaded: has joined #RubyOnRails
[20:42:21] Fischmiep: has joined #RubyOnRails
[20:46:02] mdhas: has joined #RubyOnRails
[20:47:08] envint: has joined #RubyOnRails
[20:47:46] tenderlove: has joined #RubyOnRails
[20:48:26] codelahoma: has joined #RubyOnRails
[20:48:53] NoGodDamnIdea: has joined #RubyOnRails
[20:48:53] NoGodDamnIdea: has joined #RubyOnRails
[20:48:54] bennyzr: Any ideas? This is not working: has_one :mailing_address, -> { where(address_type: "Mailing") }, as: :addressable. With Address belongs_to :addressable, polymorphic: true
[20:51:46] hotpancakes: has joined #RubyOnRails
[21:00:28] patarr: has joined #RubyOnRails
[21:01:01] gusrub: has joined #RubyOnRails
[21:02:37] boxmein: having a really odd syntaxerror
[21:02:48] boxmein: so I'm using ES6 classes without a worry in the world in one of my scripts
[21:03:01] boxmein: and I didn't add a transpiler for them
[21:03:49] boxmein: getting this error: https://hastebin.com/idijafutan.txt
[21:03:57] boxmein: ActionView::Template::Error (SyntaxError: Unexpected token: name (SensorChart)):
[21:04:03] boxmein: where SensorChart is the name of an ES6 class
[21:06:52] jenrzzz: has joined #RubyOnRails
[21:07:21] chouhoul_: has joined #RubyOnRails
[21:08:47] artto: has joined #RubyOnRails
[21:10:20] Crivotz: has joined #RubyOnRails
[21:12:14] mdhas: has joined #RubyOnRails
[21:12:22] Crivotz: has joined #RubyOnRails
[21:14:09] envint: has joined #RubyOnRails
[21:14:30] Crivotz: has joined #RubyOnRails
[21:15:21] Crivotz: has joined #RubyOnRails
[21:16:03] codelahoma: has joined #RubyOnRails
[21:16:41] boxmein: seems like it's related to js_compressor = :uglifier
[21:17:03] boxmein: if I include sprockets/es6 will it start supporting? time to find out.
[21:17:09] workmad3: has joined #RubyOnRails
[21:18:14] Crivotz: has joined #RubyOnRails
[21:22:54] Duckily: has joined #RubyOnRails
[21:26:23] Crivotz: has joined #RubyOnRails
[21:26:40] envint: has joined #RubyOnRails
[21:37:36] FLeiXiuS: has joined #RubyOnRails
[21:37:36] FLeiXiuS: has joined #RubyOnRails
[21:38:12] Technodrome: has joined #RubyOnRails
[21:40:37] WinterBluFox: has joined #RubyOnRails
[21:43:53] hotpanca_: has joined #RubyOnRails
[21:44:01] bryanthompson: has joined #RubyOnRails
[21:52:15] djbkd: has joined #RubyOnRails
[21:53:34] amperry: has joined #RubyOnRails
[21:54:20] amperry: Hi folks, I'm trying to grab a set of records and associations within a date range, but it seems like date-excluded records are finding their way in: https://gist.github.com/amp108/848dccc3cedba0b4bcd1800282f66f08
[21:57:45] envint: has joined #RubyOnRails
[21:59:25] hotpancakes: has joined #RubyOnRails
[21:59:55] gusrub: has joined #RubyOnRails
[22:02:25] bryanthompson: has left #RubyOnRails: ()
[22:04:08] boxmein: so I fixed it by setting up sprockets properly (by using .es6 file extensions for es6-) and requiring the libs in application.rb
[22:04:10] rikkipitt: has joined #RubyOnRails
[22:04:29] fourcolors: has joined #RubyOnRails
[22:05:11] meoblast001: has joined #RubyOnRails
[22:05:33] Crivotz: has joined #RubyOnRails
[22:07:07] hotpancakes: has joined #RubyOnRails
[22:08:34] cseder: has joined #RubyOnRails
[22:09:07] Crivotz: has joined #RubyOnRails
[22:11:18] mauro_: has joined #RubyOnRails
[22:12:34] xaviergmail_: has joined #RubyOnRails
[22:18:39] djbkd: has joined #RubyOnRails
[22:20:20] Derperperd: has joined #RubyOnRails
[22:21:27] Technodrome: has joined #RubyOnRails
[22:22:30] ajsharma: has joined #RubyOnRails
[22:22:42] Crivotz: has joined #RubyOnRails
[22:24:41] pawnbox: has joined #RubyOnRails
[22:25:05] djbkd: has joined #RubyOnRails
[22:26:26] amperry: If anyone was looking, I've discovered my error: putting restrictions on an associated model restricts the result set returned by the the AR query, but if you call the association subsequently, it knows nothing about the restriction unless you specify it again.
[22:27:14] gambl0re: has joined #RubyOnRails
[22:27:15] djbkd: has joined #RubyOnRails
[22:28:20] amperry: e.g., if you have a set of Articles with Comments and you restrict the Comment date, you'll get a subset of Articles; but if any of those Articles has a Comment outside the date range and you call article.comments, you'll get all of the comments unless you restrict the date range again.
[22:29:14] rikkipitt: hey folks, i'm receiving a webhook that doesn't have a root in the params, can I add one manually in Rails 5 so I can use them directly in a sanitizer (require/permit) for saving a model?
[22:31:36] nOwz: has joined #RubyOnRails
[22:34:43] mzo: has joined #RubyOnRails
[22:45:55] _3dwardsharp: has joined #RubyOnRails
[22:49:44] timdotrb: has joined #RubyOnRails
[22:50:52] timdotrb: Afternoon, all
[22:51:02] timdotrb: I’m getting a strange error when checking if a cookie exists
[22:51:13] timdotrb: undefined local variable or method `cookes'
[22:52:12] mzo: afternoon timdotrb
[22:52:22] jordansz: has joined #RubyOnRails
[22:52:25] iliketurtles: has joined #RubyOnRails
[22:53:07] timdotrb: Here’s a gist of the relevant code: https://gist.github.com/willc0de4food/4f48252f4810f499f5002e5d7ec27d7e
[22:53:11] timdotrb: mzo: Howdy :)
[22:54:19] joaumg: has joined #RubyOnRails
[22:54:26] pawnbox: has joined #RubyOnRails
[22:55:37] mzo: timdotrb: surely you just need to change cookes to cookies on line 9 of application_controller.rb?
[22:55:39] timdotrb: Nevermind, spelling error
[22:55:46] timdotrb: -_- fail so hard
[22:55:50] mzo: hehe :p
[22:56:03] timdotrb: That’s embarassing lol
[22:56:06] joaumg: has joined #RubyOnRails
[22:56:13] joaumg: has joined #RubyOnRails
[22:56:18] bungoman_: has joined #RubyOnRails
[22:56:36] hahuang65: has joined #RubyOnRails
[22:59:43] jhack: has joined #RubyOnRails
[23:05:17] cseder: How is the RoR job market these days?
[23:08:52] agent_white: has joined #RubyOnRails
[23:13:02] cschneid_: has joined #RubyOnRails
[23:17:33] timdotrb_: has joined #RubyOnRails
[23:24:09] pawnbox: has joined #RubyOnRails
[23:26:37] Technodrome: has joined #RubyOnRails
[23:27:59] quazimodo: has joined #RubyOnRails
[23:28:20] cucho: has joined #RubyOnRails
[23:29:34] cseder: has left #RubyOnRails: ("Textual IRC Client: www.textualapp.com")
[23:31:28] hotpancakes: has joined #RubyOnRails
[23:48:03] rfoust: has joined #RubyOnRails
[23:50:12] beatdown: has joined #RubyOnRails
[23:50:24] gusrub: has joined #RubyOnRails
[23:58:46] AndroUser2: has joined #RubyOnRails