« Back to channel list

#RubyOnRails - 13 November 2017

« Back 1 day Forward 1 day »
[00:03:54] apeiros: has joined #RubyOnRails
[00:13:17] mikecmpbll: has joined #RubyOnRails
[00:25:40] apeiros: has joined #RubyOnRails
[00:31:21] sevenseacat: has joined #RubyOnRails
[00:35:52] Ropeney: has joined #RubyOnRails
[00:36:21] guacamole: has joined #RubyOnRails
[00:48:53] one_zero: has joined #RubyOnRails
[00:51:05] apeiros: has joined #RubyOnRails
[00:59:03] jfelchner: has joined #RubyOnRails
[00:59:39] dviola: has joined #RubyOnRails
[01:02:08] Exhiled: has joined #RubyOnRails
[01:07:37] Welcius: has joined #RubyOnRails
[01:08:08] Welcius: Hello :) Does anyone have experience using omniauth-twitter gem by any chance?
[01:12:11] Welcius: or auth with twitter...?
[01:19:16] helpa: Don't ask "does anyone use <thing>?". It's better to just state your problem and if anyone has used <thing> they will most likely answer.
[01:35:33] Jameser: has joined #RubyOnRails
[01:39:31] Welcius: I am trying to set twitter auth to my app but I keep getting an error 401 Unauthorized
[01:39:52] Welcius: The odd thing is that a few hours ago it worked properly and I dont think I have changed anything since then
[01:41:33] Welcius: The callback url on twitter and the api keys are set properly
[01:41:59] sevenseacat: getting the error where? got some logs to show?
[01:42:07] Welcius: yes, one sec
[01:42:29] Welcius: https://imgur.com/a/5GZCd
[01:42:43] Welcius: i don't get to even see the twitter auth page
[01:43:20] sevenseacat: can you gist the logs for that request from your server?
[01:43:49] Welcius: im a bit newbie on rails, its the log file right?
[01:44:35] sevenseacat: in your terminal where you started the rails server, the last part for the request you just made
[01:45:23] sevenseacat: it'll start something like 'Started POST "/" for ::1...."
[01:45:24] Welcius: https://gist.github.com/Welcius/e9652f9a727e686ae9059a4bcd08f6ab
[01:45:52] Technodrome: has joined #RubyOnRails
[01:46:29] Jameser: has joined #RubyOnRails
[01:46:30] Welcius: I've tried like, regenerating the api keys and so on, but hasnt worked
[01:48:18] Welcius: the app in twitter is set to access level: read-only and callback url (port 8080because it is the one im using)
[01:50:20] sevenseacat: seems to be credentials issue
[01:50:33] Welcius: how can i fix that?
[01:51:19] sevenseacat: double check your access keys and how you're including them in your app
[01:51:55] Welcius: im setting them at secrets.yml
[01:52:03] Welcius: twitter_api_key and twitter_api_secret
[01:52:21] Welcius: the strings are the same as the ones in the twitter app page
[01:52:42] Welcius: then i use provider :twitter, Rails.application.secrets.twitter_api_key, Rails.application.secrets.twitter_api_secret
[01:53:01] Welcius: in config/initializers/omniauth.rb
[01:55:52] dviola: has joined #RubyOnRails
[02:00:06] Welcius: any idea? :c
[02:01:52] c0dec: has joined #RubyOnRails
[02:01:57] Exhiled: has joined #RubyOnRails
[02:03:03] sevenseacat: without seeing the code and having a poke around myself, not really
[02:05:19] dviola: has joined #RubyOnRails
[02:27:37] irishfromua: has joined #RubyOnRails
[02:47:55] knight33: has joined #RubyOnRails
[03:08:19] chouhoulis: has joined #RubyOnRails
[03:13:50] MrCrackPotBuilde: has joined #RubyOnRails
[03:16:18] Technodrome: has joined #RubyOnRails
[03:16:40] wethu: has joined #RubyOnRails
[03:23:00] one_zero: has joined #RubyOnRails
[03:28:00] s2013: has joined #RubyOnRails
[03:36:09] dviola: has joined #RubyOnRails
[03:40:08] emers2n: has joined #RubyOnRails
[03:58:27] weathermaker1: has joined #RubyOnRails
[04:42:36] guacamole: has joined #RubyOnRails
[05:13:02] Dimik: has joined #RubyOnRails
[05:28:42] ali_g: ali [11:17 PM]
[05:28:43] ali_g: hi everyone! I'm having a hard time iterating a parsed json. If I do
[05:28:43] ali_g: a = a[0]['name']
[05:28:43] ali_g: i'll get the proper value. But if I do:
[05:28:43] ali_g: a.each do |x|
[05:28:43] ali_g: puts x['name']
[05:28:44] ali_g: i'll just get the whole array.
[05:28:45] ali_g: puts a[x]['name'] returns an error
[05:28:45] ali_g: anybody knows why would that be?
[05:28:46] ChanServ: +q *!*@gateway/web/irccloud.com/x-bhjxnnlkxjhycjyl
[05:28:51] Radar: ali_g: can you not
[05:28:57] dax: has joined #RubyOnRails
[05:28:59] Radar: ali_g: Gist next time please
[05:29:24] Radar: ali_g: and where are you running this code?
[05:31:29] iamarun: has joined #RubyOnRails
[05:35:00] Radar: -q *!*@gateway/web/irccloud.com/x-bhjxnnlkxjhycjyl
[05:35:10] ali_g: Thanks Radar, and I'm sorry. This is a plain ruby file.
[05:35:19] Radar: ali_g: can you gist the whole thing?
[05:39:27] moei: has joined #RubyOnRails
[05:45:18] ali_g: sharing gist, thanks https://gist.github.com/ponentesincausa/8115dc5c9e2643de48bdc0b2a7213c19
[05:45:48] Radar: thank you
[05:46:11] Radar: self.each there? Seems strange.
[05:46:26] Radar: Do you have an example of how you're calling these read + seed methods?
[05:46:35] andrew91841: has joined #RubyOnRails
[05:47:11] ali_g: a = ApiRead.new]
[05:47:17] ali_g: sorry wait
[05:47:29] ali_g: a = ApiRead.new
[05:47:41] Radar: But then how does the data from read get to seed?
[05:51:40] ali_g: This is how https://www.irccloud.com/pastebin/PgmXBZoN/
[05:52:17] ali_g: The on irb I try this https://www.irccloud.com/pastebin/0lvWJKwB/
[05:52:32] Radar: ali_g: On line 4 of that first irccloud pastebin thing, you're re-assigning a.
[05:52:42] Radar: a.seed is calling seed on the Array.
[05:53:02] Radar: But your seed method is defined on instances of ApiRead.
[05:54:05] Radar: You probably want to do something like this: https://gist.github.com/radar/797e5474e6f04711fe54de06402f4933
[06:00:27] ali_g: hey that looks much cleaner! and I see I was missing the attr_reader
[06:02:16] ali_g: so I'm running it like this reader = ApiRead.new(http://theurl) and it seems it runs up until line 10 which is the parsing I get 10:in `[]': no implicit conversion of String into Integer (TypeError)
[06:02:46] ali_g: so perhaps it's the format it parses to?
[06:04:03] ali_g: thanks for the correction btw it makes more sense to structure it that way
[06:10:14] srinidhi: has joined #RubyOnRails
[06:14:32] Technodrome: has joined #RubyOnRails
[06:15:39] acosonic: has joined #RubyOnRails
[06:18:40] ali_g: Ok I've got it 😁 https://stackoverflow.com/a/19549575
[06:27:58] thatkid: has joined #RubyOnRails
[06:38:42] codelahoma: has joined #RubyOnRails
[06:39:35] guacamole: has joined #RubyOnRails
[06:52:41] dminuoso: Mmm, does Rails have some canonical way of exporting a route manifest to the JS world?
[07:02:38] FrankD: has joined #RubyOnRails
[07:11:41] LateralOctober: has joined #RubyOnRails
[07:25:06] wethu: has joined #RubyOnRails
[07:35:39] dionysus69: has joined #RubyOnRails
[07:39:01] hammer065: has joined #RubyOnRails
[07:40:22] conta: has joined #RubyOnRails
[07:47:34] ferr: has joined #RubyOnRails
[08:18:05] iamarun: has joined #RubyOnRails
[08:18:15] DrYockel: has joined #RubyOnRails
[08:23:05] nk121: has joined #RubyOnRails
[08:34:10] Technodrome: has joined #RubyOnRails
[08:36:01] dminuoso: Completed 200 OK in 843ms (Views: 114.7ms | ActiveRecord: 1.9ms)
[08:36:05] dminuoso: I love you rails.
[08:38:38] marr: has joined #RubyOnRails
[08:44:28] dionysus69: and the potential issue is?
[08:53:33] iamarun: has joined #RubyOnRails
[08:56:04] tpendragon: has joined #RubyOnRails
[08:56:06] defsdoor: has joined #RubyOnRails
[09:01:37] Doldge: has joined #RubyOnRails
[09:02:38] alfiemax: has joined #RubyOnRails
[09:05:55] arBmind: has joined #RubyOnRails
[09:07:50] mikecmpbll: has joined #RubyOnRails
[09:26:44] Technodrome: has joined #RubyOnRails
[09:27:45] kapil___: has joined #RubyOnRails
[09:30:00] francuz: has joined #RubyOnRails
[09:51:04] BloodyMer: has joined #RubyOnRails
[10:18:44] egray: has joined #RubyOnRails
[10:23:34] ShalokShalom: has joined #RubyOnRails
[10:25:37] workmad3: has joined #RubyOnRails
[10:28:16] solars: has joined #RubyOnRails
[10:31:12] crst: has joined #RubyOnRails
[10:34:48] crst: I just can't get my railsapp to run under systemd. I tried multiple things similar to https://stackoverflow.com/a/38330456. When I run systemctl it fails on load :(
[10:43:35] solars: hey, I'm using ActiveRecord::Base.connection.exec_query(query) but keep getting strings for integer types (see https://gist.github.com/solars/026ee1c7e5072c088483d40173b543cd) - can anyone tell me how to avoid this?
[10:46:50] xco: has joined #RubyOnRails
[11:00:12] roshanavand: has joined #RubyOnRails
[11:15:42] srinidhi: has joined #RubyOnRails
[11:19:54] Doldge: has joined #RubyOnRails
[11:20:49] kapil___: what logger library is use to properly show arguments passed to controller?
[11:24:28] alfiemax: has joined #RubyOnRails
[11:34:47] ferr: has left #RubyOnRails: ("WeeChat 1.9.1")
[11:56:09] Ergo: has joined #RubyOnRails
[11:57:11] alfiemax: has joined #RubyOnRails
[12:17:38] zathras: has joined #RubyOnRails
[12:25:58] zathras7: has joined #RubyOnRails
[12:43:04] argoneus: has joined #RubyOnRails
[12:46:16] francuz: has joined #RubyOnRails
[12:47:14] megan1993: has joined #RubyOnRails
[12:48:07] megan1993: Hello, I have this query command: App.where("url IS NOT NULL").joins(:another_app).joins(:tokens).where(resource_owner_id: self.id). But the .joins(:tokens) is being ran on "app" and not on "another_app", which results in an association not found. How can I fix this?
[12:48:31] megan1993: So basically I want to run joins on another column
[12:53:04] ferr: has joined #RubyOnRails
[12:53:18] ferr: has left #RubyOnRails: ()
[12:56:54] quazimodo: has joined #RubyOnRails
[13:04:14] cheeti: has joined #RubyOnRails
[13:06:08] workmad3: megan1993: .joins(another_app: :tokens)
[13:07:22] megan1993: So simple, thanks @workmad3!
[13:08:44] dviola: has joined #RubyOnRails
[13:09:02] conta1: has joined #RubyOnRails
[13:12:06] nzst-: has joined #RubyOnRails
[13:15:01] cheeti: hi i am using https://gist.github.com/entersoftapps/48b4b48114458515d8d022e798018a0c code but ADD NEW TAG link not able to add fields dymnamically
[13:22:36] tcopeland: has joined #RubyOnRails
[13:24:58] cheeti: hi i am using https://gist.github.com/entersoftapps/48b4b48114458515d8d022e798018a0c code but ADD NEW TAG link not able to add fields dymnamically
[13:34:58] drale2k_: has joined #RubyOnRails
[13:35:58] drale2k_: I am using jbuilder and i am accessing a has_many association which works fine but i would like to call a scope on jobs, to only include jobs that are pending . Any idea how i can do that with jbuilder? using this atm "json.jobs agent.jobs, :id"
[13:37:08] alfiemax: has joined #RubyOnRails
[13:37:35] Kutakizukari: has joined #RubyOnRails
[13:38:05] xco: has joined #RubyOnRails
[13:41:12] dionysus69: drale2k_: you can scope instance variable inside a controller and then use that inside jbuilder
[13:42:08] dionysus69: the way you are doing it should also work though, is it not working?
[13:47:25] nzst-: http://guides.rubyonrails.org/active_record_querying.html#scopes
[13:51:19] alfiemax: has joined #RubyOnRails
[13:58:46] drale2k_: has joined #RubyOnRails
[14:03:11] s2013: has joined #RubyOnRails
[14:04:55] tycoon177: how much slower would having rails handle serving assets in production be? i'm having trouble figuring out how i'll share the assets across docker containers with the possibility of having multiple docker containers up at once
[14:06:43] dminuoso: tycoon177: It just increases worker contention.
[14:07:32] tycoon177: oh okay. so it's no different from any other request. it just uses up a worker while serving any static assets?
[14:07:50] tycoon177: in that case, it wouldn't be an issue for this use case, i don't think
[14:07:55] dminuoso: tycoon177: Yeah.
[14:09:37] dminuoso: tycoon177: Here we have one docker container running an nginx tls termination proxy, which then forwards requests to any of 3 applications listening on unix domain sockets, as well as serving static assets for all of them.
[14:12:27] tycoon177: dminuoso: do you have all 3 applications share their assets through volumes with nginx or do you just have one of them do that? that's the only part i'm struggling with currently :/
[14:16:18] argoneus: hello, I have a bit of a technical question. I get how respond_to works, but I don't understand how it works internally, e.g. respond_to do |format| format.xml { code } end
[14:16:32] argoneus: what exactly is format.xml? I found that 'format' is some Collector but I'm not sure how that works
[14:16:36] argoneus: and I couldn't find any documentation on this
[14:17:45] dminuoso: tycoon177: Yes, we use docker compose for that.
[14:18:21] dminuoso: tycoon177: The second you have multiple docker containers that somehow need to interact or share, compose has your back.
[14:18:36] dminuoso: argoneus: Which particular part are you curious about?
[14:18:48] argoneus: I'm not sure what the .xml part exactly is
[14:18:57] srinidhi: has joined #RubyOnRails
[14:18:58] cheeti: hi i am using https://gist.github.com/entersoftapps/48b4b48114458515d8d022e798018a0c code but ADD NEW TAG link not able to add fields dymnamically
[14:18:59] dminuoso: argoneus: It's just using the Smalltalk interface.
[14:19:03] argoneus: I'd understand if it was assigning some lambda
[14:19:12] argoneus: but it's just a block
[14:19:14] argoneus: smalltalk interface?
[14:19:17] dminuoso: argoneus: Ruby at the low level differentiates between messages and methods.
[14:19:25] dminuoso: foo.bar is not a method call, its actually sending a message :bar to foo.
[14:19:45] dminuoso: Now foo may respond to that in any of 3 ways: By calling a corresponding method, invoking the generic "method_missing handler" or throwing an exception.
[14:19:59] dminuoso: The second is what lets you tap into this generic "how do I deal with arbitrary messages"
[14:20:10] tycoon177: dminuoso: i'll do some reading. it might just work how i want it to and i'm just overthinking it. my thought is if i run docker-compose to share the volume and scale the rails app to lets say 2 or 3 instances, i worry that it'd share the volume multiple times and cause havoc.
[14:20:22] dminuoso: argoneus: The bit at the end is not a lambda, its just a plan block that is passed to the .xml message
[14:20:35] dminuoso: (Though that is just semantics, the difference between a proc/lambda block are miniscule)
[14:21:02] dminuoso: tycoon177: Dont worry about it. You just need clear semantics about who is responsible for maintaining that shared volume.
[14:21:13] dminuoso: i.e. dont try and have all docker containers compile assets into it.
[14:22:16] tycoon177: ideally, the nginx server would just have access to the rails /app/public/ folder no matter what version of the rails app is running
[14:22:17] dminuoso: argoneus: https://github.com/rails/rails/blob/b383b346600d5325a211376837bc83b7ae472f46/actionpack/lib/action_controller/metal/mime_responds.rb#L292-L294
[14:22:20] argoneus: sending a block that is passed into the .xml message... this is still a bit confusing to me :( so the 'format' object is sent a message :xml which is a block?
[14:22:22] dminuoso: argoneus: this is the magic bit that makes .xml work.
[14:22:31] dminuoso: argoneus: no, :xml itself *is* the message
[14:22:45] argoneus: ohhhh, so the block is like an argument?
[14:22:46] dminuoso: argoneus: messages may have arguments (and a block is a kind of argument)
[14:22:55] dminuoso: Much like array.map { |a| a * e }
[14:23:05] argoneus: damn, this is some magic (for now)
[14:23:12] dminuoso: semantically the block is just an argument. you can think of it like array.map(-> (e) { e * 2 })
[14:23:31] dminuoso: Except blocks are a bit special because they are a low level optimization.
[14:23:53] argoneus: so the entire idea is that I tell it "if people send a request for xml, then do this and return xml"
[14:23:59] dminuoso: argoneus: Exactly.
[14:24:10] argoneus: except it's not limited to just xml, json, etc. but I can feed it format.my_custom_format
[14:24:19] argoneus: and a block as argument?
[14:24:20] dminuoso: argoneus: Its limited to whatever mimetypes have been registered.
[14:24:39] dminuoso: argoneus: You can see this in the github link I gave you
[14:24:56] dminuoso: argoneus: Those @variants are set in here: https://github.com/rails/rails/blob/b383b346600d5325a211376837bc83b7ae472f46/actionpack/lib/action_controller/metal/mime_responds.rb#L233-L238
[14:25:21] dminuoso: argoneus: This type of programming is called a "DSL"
[14:25:51] dminuoso: argoneus: So the Rails team has constructed a series of objects that is not used in a programmatic sense, but rather in a domain-specific language. Another example where Rails does this, is your config/routes.rb
[14:27:08] argoneus: I see, or rather, this is a bit too complicated to understand for me right now
[14:27:17] argoneus: but it's making a lot more sense than before, thanks a lot for your answer!
[14:30:20] argoneus: I wasn't sure what you meant before, but now I see
[14:30:45] argoneus: basically format.xml doesn't exist as a method, so it will invoke method_missing with the block as an argument, which is then saved as the respective mime type handler and called if needed
[14:32:41] dminuoso: argoneus: Exactly.
[14:32:57] dminuoso: argoneus: Another place where this is used in jbuilder.
[14:33:20] dminuoso: Where you do json.visistors @message.visistors.count
[14:34:25] dminuoso: "which is then saved as the respective mime type handler and called if needed"
[14:35:51] dminuoso: argoneus: respond_to prepares a Collector object, and yields it to the block you give it.
[14:37:20] dminuoso: argoneus: At that point the mime registration is already done. Effectively you are given the ability to tag each mime handler with a corresponding render action.
[14:39:22] dminuoso: argoneus: You could trivially rename `format` to `when`, perhaps this makes it a bit more obvious.
[14:39:39] alfiemax: has joined #RubyOnRails
[14:40:01] dminuoso: argoneus: Or wait.. mmm.
[14:43:36] srinidhi: has joined #RubyOnRails
[14:51:37] iamarun: has joined #RubyOnRails
[14:53:25] drale2k_: has joined #RubyOnRails
[14:58:21] cheeti: hi i am using https://gist.github.com/entersoftapps/48b4b48114458515d8d022e798018a0c code but ADD NEW TAG link not able to add fields dymnamically
[15:04:27] mikecmpb_: has joined #RubyOnRails
[15:07:10] dionysus69: actions under module Api module V1 arent looking up for the right view to render, shouldn't it default to the view with dir /api/v1/action.json.jbuilder ?
[15:07:40] cheeti: hi nested attributed add dinamically not can any one help https://gist.github.com/entersoftapps/48b4b48114458515d8d022e798018a0c
[15:20:01] arBmind: has joined #RubyOnRails
[15:30:42] marahin: has joined #RubyOnRails
[15:33:40] marahin: Hello! I'm having an issue getting starte dwith rswag (https://github.com/domaindrivendev/rswag). I created a sample application in API only mode in Rails. Code is: https://gist.github.com/anonymous/5b3a44d6d459106f6bbc1268f1f7fb14
[15:36:19] mikecmpbll: has joined #RubyOnRails
[15:36:20] marahin: Does anyone have any idea what I may be doing wrong?
[15:46:13] fschuindt: has joined #RubyOnRails
[15:46:18] fschuindt: has left #RubyOnRails: ()
[15:48:49] creature: marahin: It looks like `response` isn't set, according to that error. I'm taking a complete shot in the dark as to the cause, but: does RSpec know that your test is a controller test? If not, it might not make a `response` object available.
[15:49:17] creature: So I think you should be able to do `describe 'People API', type: :controller` to "force" it, or make sure it's under spec/controllers.
[15:49:36] marahin: creature I just managed to fix it. I had ApiHelper and RequestHelper that, it seems, monkey patched the response object, thus leading to it being inaccessible (?). After just removing them (and `includes` of those) it started working properly. :)
[15:52:43] creature: Nice! I'm glad you got it working. :)
[15:55:54] marahin: creature so am I. Following up with next question - do you have an idea on how to represent nested schema in rswag? :)
[15:56:32] marahin: So if I have response: { "links": [ "string", "string2" ], "data": { "type": "classname", "name": "someName", ... } } how would I represent it in the spec file?
[15:59:08] c0dec: has joined #RubyOnRails
[16:03:23] brendan-: has joined #RubyOnRails
[16:07:15] ahrs: has joined #RubyOnRails
[16:12:45] alfiemax: has joined #RubyOnRails
[16:19:02] brycesenz: has joined #RubyOnRails
[16:22:29] brycesenz: So, more of a UI question - I have a quiz app that I'm building, and am worried about how to set up the navigation. I can foresee questions being skipped/taken out of order, so I want to provide a clear way for the user to go to either the next question, or the next unanswered question, and quickly be able to track back to find any unanswered questions. Has anyone seen an elegant solution to this problem?
[16:22:59] Saukk: has joined #RubyOnRails
[16:26:11] xco: need some insight. how will i test such model (Redis) with RSpec, would be easier if it was a normal AR model, this is beyond me :D
[16:26:12] creature: marahin: No idea there, I'm afraid. I've never used rswag.
[16:26:13] xco: https://gist.github.com/xcobar/53575d8c391febfd5bb3e106318fc911
[16:29:28] dgsan: has joined #RubyOnRails
[16:35:09] Technodrome: has joined #RubyOnRails
[16:36:28] blitz: I have a gem that's trying to use active_mode assign_attributes, but something isn't permitted, so it's throwing a ForbiddenAttributesError - but I have no idea how to debug this to figure out exactly what is being passed
[16:36:34] blitz: active_model*
[16:39:56] cagomez: has joined #RubyOnRails
[16:39:59] xco: blitz: are the attribs you’re assigning permitted? assuming you’re using strong params?
[16:40:21] blitz: I mean, obviously something isn't permitted
[16:40:27] blitz: but I don't know what the gem is trying to assign
[16:41:05] blitz: how do I inject a byebug line into a gem
[16:41:12] xco: i’d pry at the point where the assignment happens
[16:41:20] xco: that should get your close to where you’re going
[16:41:49] blitz: hmm, problem is all of this is autogenerated oauth by the gem - literally doesn't touch any of my rails code afaict
[16:43:04] blitz: the application trace is blank lol
[16:50:00] Kutakizukari: has joined #RubyOnRails
[16:58:39] urk187: has joined #RubyOnRails
[17:01:22] mikecmpb_: has joined #RubyOnRails
[17:01:39] AzaToth: has joined #RubyOnRails
[17:06:22] Exhiled: has joined #RubyOnRails
[17:13:26] ahrs: has joined #RubyOnRails
[17:14:47] [Butch]: has joined #RubyOnRails
[17:19:47] Papierkorb: has joined #RubyOnRails
[17:20:22] Exhiled: has joined #RubyOnRails
[17:20:38] blitz: I got pry remote binding working in the gem
[17:22:38] conta1: has joined #RubyOnRails
[17:22:49] one_zero: has joined #RubyOnRails
[17:26:19] DTZUZO: has joined #RubyOnRails
[17:36:55] cagomez: has joined #RubyOnRails
[17:40:40] airdisa: has joined #RubyOnRails
[17:42:06] orbyt_: has joined #RubyOnRails
[17:42:24] mikecmpbll: has joined #RubyOnRails
[17:44:34] ur5us: has joined #RubyOnRails
[17:52:53] xco: has joined #RubyOnRails
[17:53:25] xco: has joined #RubyOnRails
[17:54:14] xco: has joined #RubyOnRails
[17:55:12] xco: has joined #RubyOnRails
[17:55:39] roshanavand: has joined #RubyOnRails
[17:56:01] xco: has joined #RubyOnRails
[17:59:02] kies: has joined #RubyOnRails
[17:59:51] NoGodDamnIdea: has joined #RubyOnRails
[18:03:54] joshsmith: has joined #RubyOnRails
[18:05:40] dionysus69: has joined #RubyOnRails
[18:06:57] airdisa_: has joined #RubyOnRails
[18:15:38] drale2k_: has joined #RubyOnRails
[18:27:33] cagomez: has joined #RubyOnRails
[18:34:52] cagomez: has joined #RubyOnRails
[18:39:21] troys: has joined #RubyOnRails
[18:41:59] uks: has joined #RubyOnRails
[18:42:43] kinduff: has joined #RubyOnRails
[18:45:31] xco: has joined #RubyOnRails
[18:46:47] zave: has joined #RubyOnRails
[18:46:54] zave: has left #RubyOnRails: ()
[18:50:42] kapil___: has joined #RubyOnRails
[18:51:00] kapil___: how to name isdesabled column?
[18:51:42] Exhiled: has joined #RubyOnRails
[18:52:43] cagomez: has joined #RubyOnRails
[18:53:13] acosonic: has joined #RubyOnRails
[18:55:31] Scient: has joined #RubyOnRails
[18:56:01] sinduck: has joined #RubyOnRails
[18:56:02] nzst-: If you name it disabled and give it boolean type, you can refer to it as disabled? and it will return true or false
[18:56:08] Technodrome: has joined #RubyOnRails
[18:57:06] kapil___: should I use name disabled or active?
[18:57:57] nzst-: either one would probably work
[18:58:09] kapil___: ok thanks..
[18:58:59] kapil___: Hey I am not understanding, inverse of. in many to many relationships. still i am using it.
[18:59:42] Exhiled: has joined #RubyOnRails
[19:00:42] cagomez: has joined #RubyOnRails
[19:00:54] cagomez: has joined #RubyOnRails
[19:01:52] NoGodDamnIdea: has joined #RubyOnRails
[19:04:10] roshanavand: has joined #RubyOnRails
[19:06:07] cagomez: is it possible to get a response object's JSON payload, put it into a key, and then remove it from the main body?
[19:07:22] cagomez: eg instead of [{a:1}, {b:2}], return {users: [{a:1}, {b:2}] }
[19:11:30] Exhiled: has joined #RubyOnRails
[19:14:25] conta2: has joined #RubyOnRails
[19:16:43] tcopeland: has joined #RubyOnRails
[19:17:10] kapil___: I have Json Like Data. how to save it . it contain models and its relationships data.
[19:17:27] Dimik: has joined #RubyOnRails
[19:18:54] Technodrome: has joined #RubyOnRails
[19:24:26] Exhiled: has joined #RubyOnRails
[19:25:49] nogic: has joined #RubyOnRails
[19:33:54] cseder: has joined #RubyOnRails
[19:36:12] tcopeland: has joined #RubyOnRails
[19:36:27] cseder: has joined #RubyOnRails
[19:41:43] ur5us: has joined #RubyOnRails
[19:48:27] FrostCandy: has joined #RubyOnRails
[19:49:11] FrostCandy: I'm using Json.parse but my string has encapsulating quotes like "["t":"y"]" and of course it breaks, but is there an easy fix?
[19:52:31] FrostCandy: can't find an idomatic trim()
[19:52:57] Technodrome: has joined #RubyOnRails
[19:53:42] mtkd: has joined #RubyOnRails
[20:00:54] urkle: has joined #RubyOnRails
[20:04:02] airdisa: has joined #RubyOnRails
[20:09:13] tcopeland: has joined #RubyOnRails
[20:14:30] borodin: has joined #RubyOnRails
[20:15:12] borodin: I wrote a module called AwsTools defined in a file aws_tools.rb which begins "module AwsTools"...
[20:15:21] borodin: I would like to use that module in my rails 5 app
[20:15:25] borodin: I can't figure out how to do that
[20:15:26] kapil___: tableize() reverse function?
[20:16:31] borodin: I put aws_tools.rb in /lib and added config.autoload_paths += %W(#{config.root}/lib) to development.rb
[20:17:03] borodin: and I get an error "uninitialized constant CfRun::AwsTools"
[20:17:51] borodin: my model CfRun has a line near the top include AwsTools
[20:18:37] conta2: has joined #RubyOnRails
[20:30:26] nzst-: try include ::AwsTools
[20:37:35] dminuoso: FrostCandy, str[1..-2]
[20:38:24] FrostCandy: dminuoso: oh wow so good. It' wouldn't check to see if it was removing my encapsulation character, but it would do for my current propblem.
[20:38:26] airdisa: has joined #RubyOnRails
[20:43:04] tcopeland: has joined #RubyOnRails
[21:18:54] orbyt_: has joined #RubyOnRails
[21:21:51] NoGodDamnIdea: has joined #RubyOnRails
[21:31:38] nzst-: has left #RubyOnRails: ("Using Circe, the loveliest of all IRC clients")
[21:34:56] cagomez: has joined #RubyOnRails
[21:40:08] starseed00: has joined #RubyOnRails
[21:40:37] starseed00: What do you call all the services that make up your "website", ie resque, redis, db, rails, angular?
[21:40:46] starseed00: What is that group of things called?
[21:46:32] creature: "Stack" is a pretty common term.
[21:46:42] starseed00: That's what I was thinking
[21:46:46] starseed00: creature: So riddle me this
[21:46:47] Lloyd__: has joined #RubyOnRails
[21:46:48] nickenchuggets_: has joined #RubyOnRails
[21:46:59] starseed00: I have a "production" stack and a "staging" stack
[21:47:10] auv5: has joined #RubyOnRails
[21:47:18] starseed00: And I have a CI/CD pipeline that runs through them
[21:47:40] starseed00: What are those stacks inside of?
[21:49:02] tcopeland: has joined #RubyOnRails
[21:49:56] creature: Do you have different setups for production and staging?
[21:50:49] starseed00: creature: Well - that's a good question they have different data sources -
[21:50:51] starseed00: But should they?
[21:51:07] starseed00: I would think staging data should always be separate from production
[21:51:55] starseed00: Other than that they are exactly the same
[21:52:04] creature: Because I'd say your stack is "Resque, Redis, the DB, Rails, and Angular", and then you have "a staging environment" and "a production environment". Which each have their own instances of that stack.
[21:52:15] fryguy: it's often referred to as a stack
[21:52:30] bazzy: has joined #RubyOnRails
[21:52:54] starseed00: See here is what messes with me
[21:53:16] starseed00: Because abstracting out of that a little I also have production vs development infrastructure that hosts all that
[21:54:16] starseed00: And I would say that my cd ci pipeline is in that scope, since in the "production" infrasructure it would deploy to staging first, then production, but in the "development" infrastructure it would just go straight to the "production" server of my "development" infrastructure
[21:54:24] starseed00: And that's when my head implodes
[21:55:53] starseed00: so I have an infrastructure stack that has one or more environment stacks
[21:56:59] starseed00: What would the infrastructure instance be called?
[21:57:44] creature: I wouldn't worry too much about making it all fit neatly into a Venn diagram, personally.
[21:58:09] starseed00: creature: Unfortunately I am using terraform, so that's exactly what I have to worry about!
[21:58:12] fryguy: starseed00: what are you trying to do
[21:58:29] creature: I'd say "You have a Resque/Redis/DB/Rails/Angular stack, with separate production and staging environments, and you use Jenkins to promote builds from staging to production."
[21:58:36] starseed00: fryguy: Just trying to envision how I should structure my terraform stuff
[21:58:44] fryguy: starseed00: well how do you want to structure it
[21:58:59] starseed00: creature: I think that sounds pretty good
[21:59:23] starseed00: fryguy: Well - I want to be able to have any dev fire up "everything" concerning our "flagship"
[21:59:41] starseed00: So that when a commit is built, and entire environment can spawn for testing
[22:00:20] starseed00: But that whole environment that is able to spawn is part of an infrastructure that should also have a production and a development
[22:00:26] starseed00: Which is where it gets messy
[22:00:36] fryguy: why do devs need their own production environment
[22:01:09] starseed00: fryguy: Why not? Cloud is cheap, takes 5 minutes to spin up, and everything can be destroyed.
[22:01:24] fryguy: starseed00: ??
[22:01:28] fryguy: that answer does not make any sense
[22:01:49] starseed00: Why wouldn't you want to test your code in the environment it would be running in on production?
[22:02:19] fryguy: because testing in production is an atrociously bad idea?
[22:02:19] starseed00: This way our tests are run in a real cloud infrastructure
[22:02:29] starseed00: fryguy: It's not "production"
[22:02:45] starseed00: It's the same code running on the same hardware with different data
[22:03:00] starseed00: It's just an in the cloud environment
[22:03:06] fryguy: i think you are really abusing some terminology here
[22:03:08] starseed00: That spins up and down on demand
[22:03:30] starseed00: fryguy: Well if you take note I came here for terminology because I don't feel line mine is working.
[22:03:37] starseed00: So here we are.
[22:04:09] fryguy: ok, so let's go back to my previous question, and let me rephrase it
[22:04:13] fryguy: why do devs need 2 environments
[22:04:43] fryguy: oh, i misunderstood you then when you they "should also have a production and a development
[22:04:51] starseed00: What I meant:
[22:04:54] fryguy: err, when you said they*
[22:05:14] starseed00: My "production" infrastructure is composed of a "production" site and a "staging site"
[22:06:29] starseed00: Additionally - I want the ability to spin up new "infrastructures" on demand - one for disaster recovery, two for developers to make their own enviroment to test certain things
[22:06:53] starseed00: But for the one off testing/qa there doesn't need to be the production/staging thing
[22:07:19] fryguy: conceptually grouping production and staging like you are is probably a bad idea
[22:07:21] starseed00: So one infrastucture is prod and staging, and another infrastructure is develoment with a develoment env
[22:07:36] starseed00: fryguy: I agree
[22:07:48] starseed00: And that's where terraform is making my life hard
[22:08:12] starseed00: Because to spin up a ci/cd pipeline that spans production and staging I need to abstact that whole thing into a unit
[22:08:22] fryguy: that unit is called a module
[22:08:25] fryguy: in terraform
[22:08:35] fryguy: are you using modules yet?
[22:08:36] starseed00: Sure, yes, a module
[22:08:43] fryguy: are you using nested modules?
[22:08:49] starseed00: But you get my point?
[22:09:05] fryguy: I do, i've built all of this
[22:09:06] starseed00: I have a stack module, one prod one staginge
[22:09:10] tcopeland: has joined #RubyOnRails
[22:09:21] starseed00: they both are in another module with the ci/cd
[22:09:28] starseed00: so they ar all grouped into a thing
[22:09:39] fryguy: you should separate them
[22:09:39] starseed00: And that thing is what I am calling 'infrastructure'
[22:10:10] starseed00: What do you mean "separate"
[22:10:19] starseed00: into their own terraform states?
[22:10:27] starseed00: so I would have three terraform "blasts"
[22:10:34] starseed00: one production stack
[22:10:36] fryguy: you'd have many more than 3, but sure
[22:10:36] starseed00: one staging stack
[22:11:35] starseed00: Why would I have more than three?
[22:11:46] starseed00: I blast production up
[22:11:51] starseed00: I blast staging up
[22:12:01] starseed00: I blast a ci/cd module that references their names
[22:14:09] fryguy: you have infrastructure for the app, the app itself, stage versions of each, "devops" infrastructure, ci/cd stuff, probably a global state for things that span all of this (iam roles for example), things for uat environments, etc.
[22:14:52] blackmesa: has joined #RubyOnRails
[22:15:25] apofis: has joined #RubyOnRails
[22:16:04] starseed00: fryguy: Stage version of each app you mean?
[22:16:18] fryguy: oh underlying infrastructure and teh app
[22:19:04] starseed00: fryguy: So I guess my only question would be, is there a better word for infrastructure?
[22:19:30] starseed00: Probably not
[22:19:46] fryguy: maybe not
[22:20:18] fryguy: our top-level module for it is called "infra"
[22:21:06] starseed00: fryguy: So you have basically an "infra" a "production" and a "staging" - with prod and staging calling the infra module?
[22:22:59] fryguy: well we have more than that because of different regions too
[22:23:06] fryguy: and infra is a module that contains other modules
[22:24:35] starseed00: fryguy: Well I think I have a little more clear of a head here, thanks for the time!
[22:32:00] knight33: has joined #RubyOnRails
[22:34:39] xco: i have a question, i’m doing ‘require ‘csv’’ in my rails up. wasn’t csv included automatically in Rails 5?
[22:36:46] fryguy: xco: remove the require and see if it still works
[22:41:38] arBmind: has joined #RubyOnRails
[22:43:22] dviola: has joined #RubyOnRails
[22:45:04] dgsan: has joined #RubyOnRails
[22:46:44] knight33_: has joined #RubyOnRails
[22:56:42] moei: has joined #RubyOnRails
[22:58:21] dgsan: has joined #RubyOnRails
[22:58:25] mtkd: has joined #RubyOnRails
[22:58:42] Kutakizukari: has joined #RubyOnRails
[23:04:06] Exhiled: has joined #RubyOnRails
[23:10:36] knight33: has joined #RubyOnRails
[23:13:32] one_zero: has joined #RubyOnRails
[23:49:52] Exhiled: has joined #RubyOnRails
[23:53:23] mikecmpbll: has joined #RubyOnRails