ewilliam

Activity Graph

Page 1 of 3 | Next »

2018-05-04

[05:15:43] ewilliam: *.net *.split

2018-04-25

[12:25:53] ewilliam: *.net *.split
[12:27:19] ewilliam: has joined #ruby
[12:27:33] ewilliam: has joined #RubyOnRails
[15:01:24] ewilliam: *.net *.split
[15:03:05] ewilliam: has joined #RubyOnRails
[15:03:18] ewilliam: has joined #ruby

2018-04-11

[20:28:33] ewilliam: *.net *.split

2018-03-25

[19:31:03] ewilliam: hi, i'm dealing with weird dependent: destroy behavior. Scheme::Step is a polymorphic model that can be either Screen or Screen::Group. a Scheme can have many Scheme::Steps. however when i delete a Screen, the Scheme's Screen::Steps are still intact, and errors out because of a nonexistent Screen record.
[19:31:07] ewilliam: code: https://gist.github.com/ewilliam/b2f9b84e6f81d8e596bf750e2feaff46
[19:31:53] ewilliam: i dont think `belongs_to :steppable, polymorphic: true, dependent: destroy` is a thing or is it?
[19:33:17] ewilliam: how can i ensure that when a Screen is deleted, all of its polymorphic instances are also deleted
[19:54:49] ewilliam: `belongs_to :steppable, polymorphic: true, dependent: destroy` doesnt work
[19:54:53] ewilliam: help appreciated
[22:31:47] ewilliam: can anyone help with my problem ^^^
[22:31:55] ewilliam: im willing to clarify if its not clear enough
[23:39:28] ewilliam: solved my problem. never mind about it
[23:39:48] ewilliam: Screen needed to know about its associations

2018-03-02

[04:11:06] ewilliam: Read error: Connection reset by peer
[04:18:37] ewilliam: has joined #ruby
[04:18:37] ewilliam: has joined #RubyOnRails

2018-02-09

[12:58:11] ewilliam: has joined #ruby
[12:58:11] ewilliam: has joined #RubyOnRails

2018-02-07

[04:31:41] ewilliam: anyone understand why this happens: https://gist.github.com/ewilliam/2b05291f02624af1fb82016897d07e74
[04:32:01] ewilliam: trying to call polymorphic relations via has_many through
[04:32:58] ewilliam: the SQL is off. should be "steps" instead of "scheme_steps"
[04:33:09] ewilliam: for the scheme.steps call
[04:34:36] ewilliam: the SELECT FROM statement
[04:34:50] ewilliam: compare that one to the scheme.step_groups call
[04:35:03] ewilliam: it looks at "step_groups" table which is correct
[04:38:03] ewilliam: bummer.. im suspecting it might be a conflict between Step.rb and Scheme::Step.rb
[04:43:05] ewilliam: :: breaks query
[04:43:05] ewilliam: Radar: https://gist.github.com/ewilliam/2b05291f02624af1fb82016897d07e74#file-rails-console-2
[04:44:18] ewilliam: but because the array input changes, it breaks
[04:44:44] ewilliam: that part, sorry
[04:45:15] ewilliam: is that a bug?
[04:45:41] ewilliam: i'll need to try this in a clean app
[04:46:22] ewilliam: ok ill report back. thanks
[17:47:25] ewilliam: hi, i've been trying to figure out whats going on here with has_many relation calls not bringing up objects from the database. but it works with only objects added in memory https://gist.github.com/ewilliam/2b05291f02624af1fb82016897d07e74
[17:47:48] ewilliam: seems simple, i might be missing something

2018-01-18

[01:55:16] ewilliam: *.net *.split
[01:56:15] ewilliam: has joined #ruby
[01:56:15] ewilliam: has joined #RubyOnRails

2017-12-29

[01:53:20] ewilliam: Ping timeout: 252 seconds
[01:54:31] ewilliam: has joined #ruby
[01:54:31] ewilliam: has joined #RubyOnRails

2017-12-21

[06:26:11] ewilliam: *.net *.split
[06:31:47] ewilliam: has joined #RubyOnRails
[06:31:49] ewilliam: has joined #ruby
[06:48:31] ewilliam: *.net *.split
[07:26:18] ewilliam: has joined #ruby
[07:26:18] ewilliam: has joined #RubyOnRails

2017-12-09

[05:06:12] ewilliam: *.net *.split
[05:39:53] ewilliam: has joined #ruby

2016-07-20

[06:49:53] ewilliam: is it ok to ask ruby questions here?
[06:59:01] ewilliam: vedu: thanks. i think it's simple enough but lets see
[06:59:23] ewilliam: im trying to DRY this up with an conditional assignment based on nil: https://gist.github.com/ewilliam/94b266c29455ed7997b428c1a42d9c19
[07:00:15] ewilliam: how should i write it? something like if @assignment_view = instance_variable_get
[07:00:25] ewilliam: but only not nil
[07:01:09] ewilliam: sorry im tripping over myself
[07:02:32] ewilliam: i meant, i want something like @assignment_view ||= instance_variable_get. but only assign the value if instance_variable_get is not nil
[07:03:58] ewilliam: basically i want to do instance_variable_get only once.
[07:10:21] ewilliam: anything. makes sense?
[07:10:21] ewilliam: lizard2010: lol. what i mean - it should first check @assignment_view, then instance_variable_get. if both return nothing, it goes on to execute the code inside the condition. if @assignment_view is nil but instance_variable is not, then @assignment_view gets assigned to the value of instance_variable_get. if @assignment_view is not nil, it doesnt do
[07:12:31] ewilliam: if you look at the gist, ull see that im currently just checking instance_variable_get and then later i run instance_variable_get again for @assignment_view to be assigned to it
[07:12:55] ewilliam: i want to do instance_variable_get once

2016-07-19

[04:16:07] ewilliam: has joined #ruby

2016-07-03

[10:38:19] ewilliam: has joined #RubyOnRails

2016-07-02

[05:04:50] ewilliam: *.net *.split

2016-07-01

[19:41:52] ewilliam: Ping timeout: 252 seconds
[19:43:30] ewilliam: has joined #RubyOnRails

2016-06-09

[05:24:32] ewilliam: Ping timeout: 260 seconds
[05:34:41] ewilliam: has joined #RubyOnRails

2016-05-18

[08:45:40] ewilliam: Ping timeout: 250 seconds

2016-05-08

[01:44:45] ewilliam: Ping timeout: 250 seconds
[01:46:30] ewilliam: has joined #RubyOnRails

2016-05-06

[16:25:41] ewilliam: Read error: Connection reset by peer
[16:26:18] ewilliam: has joined #RubyOnRails

2016-04-20

[04:10:27] ewilliam: what's the idiomatic way to do bring up a specific association without doing something like user.wallets.find_by(wallet_type_id: 1) there's 2 wallet types, and i want to do something like user.customer_account or user.merchant_account. decorators? helpers?
[04:11:40] ewilliam: Radar: nice. thanks!
[22:11:04] ewilliam: anyone understand why this piece of code wont return a flash message
[22:11:14] ewilliam: https://www.irccloud.com/pastebin/wUXZlzON/
[22:11:28] ewilliam: gist: https://gist.github.com/ewilliam/caf20f5117331b4c1c02d5130be1e85a
[22:17:05] ewilliam: smathy: i added the error to the wallet
[22:17:08] ewilliam: https://www.irccloud.com/pastebin/KQHa9QEk/
[22:17:12] ewilliam: shouldnt that suffice?
[22:17:25] ewilliam: i tested in pry, and the errors is in wallet
[22:17:47] ewilliam: sorry i meant this bit
[22:17:52] ewilliam: https://www.irccloud.com/pastebin/bQ7hflJI/
[22:18:38] ewilliam: in update_account! method from StripeManagedService
[22:19:44] ewilliam: even if i tried something like 'flash.now.alert = "WTF"' it doesnt work
[22:19:57] ewilliam: nothing shows up at all

2016-04-17

[08:37:21] ewilliam: Read error: Connection reset by peer
[08:39:03] ewilliam: has joined #RubyOnRails

2016-03-31

[03:32:49] ewilliam: Ping timeout: 246 seconds

2016-03-15

[19:53:16] ewilliam: Ping timeout: 264 seconds
[19:54:28] ewilliam: has joined #RubyOnRails

2016-03-12

[16:12:19] ewilliam: Ping timeout: 246 seconds

2016-03-10

[08:36:15] ewilliam: Ping timeout: 250 seconds
[08:43:14] ewilliam: has joined #RubyOnRails

2016-02-18

[20:14:36] ewilliam: Ping timeout: 250 seconds
[20:17:17] ewilliam: has joined #RubyOnRails

2016-02-17

[09:52:49] ewilliam: *.net *.split
[10:02:13] ewilliam: has joined #RubyOnRails

2016-02-01

[00:09:27] ewilliam: Ping timeout: 250 seconds
[00:10:48] ewilliam: has joined #RubyOnRails

2016-01-31

[12:25:26] ewilliam: *.net *.split
[12:28:19] ewilliam: has joined #RubyOnRails

2016-01-15

[03:27:02] ewilliam: has joined #RubyOnRails

2015-11-27

[10:58:33] ewilliam: Ping timeout: 325 seconds
[11:00:29] ewilliam: has joined #RubyOnRails

2015-11-21

[17:44:46] ewilliam: Ping timeout: 240 seconds
[17:47:32] ewilliam: has joined #RubyOnRails

2015-11-17

[05:25:22] ewilliam: *.net *.split
[05:28:31] ewilliam: has joined #RubyOnRails

2015-11-16

[07:15:48] ewilliam: Ping timeout: 448 seconds

2015-11-14

[05:51:09] ewilliam: Ping timeout: 250 seconds
[05:58:19] ewilliam: has joined #RubyOnRails

2015-11-06

[04:41:22] ewilliam: https://www.irccloud.com/pastebin/lPPZZhU8/
[04:41:44] ewilliam: how does that happen?
[04:41:50] ewilliam: params.merge not working
[04:49:21] ewilliam: ah gotcha. returns a new hash, instead of modifying it, duh
[04:50:24] ewilliam: Ropeney: thanks
[04:51:57] ewilliam: ah that doesnt work. ill just do it inside the new call
[05:13:53] ewilliam: yes, got it. thanks sevenseacat

2015-11-05

[00:52:27] ewilliam: other ways - use a settings library that handles global and per-user settings, or add a type column in the addresses table.
[00:52:27] ewilliam: any best practices in mind? prima facie i would setup address and user relations and then set shipping_addy_id and billing_addy_id in a settings or profiles table row with user_id.
[00:52:27] ewilliam: orders, shipments, chargecards, bankaccounts all have addresses. however i want each user to set own shipping and billing addresses for future use.
[00:52:27] ewilliam: y'all i have a data modeling ? regarding addresses. addresses table has polymorphic relations via addressable_id and addressable_type columns.
[01:48:30] ewilliam: https://www.irccloud.com/pastebin/bA89pLsI/
[01:48:42] ewilliam: can anyone help me?
[04:08:47] ewilliam: information in the addresses table with type column (ie shipping or business), or specifying the id of address record in a separate table like Settings
[04:08:47] ewilliam: Radar: you misunderstood me, addresses are definitely their own records. they are associated with various records via addressable_type and addressable_id. polymorphic relations. however, if a user wanted to add another credit card, s/he should have the option of using the saved billing_address or just create a new one. was wondering whether to put that
[04:09:04] ewilliam: adding type column to addresses table seemed the simplest solution but i was afraid that would be bad for normalization
[04:09:12] ewilliam: but i consulted with a friend, its not that big of a deal
[04:09:22] ewilliam: Radar: oh? why is that?
[04:10:11] ewilliam: okay, what settings table for other things like notifications? Radar
[04:10:36] ewilliam: heh well thanks anyway Radar

2015-11-04

[04:11:29] ewilliam: Ping timeout: 240 seconds

2015-10-31

[16:39:26] ewilliam: Ping timeout: 240 seconds
[16:42:15] ewilliam: has joined #RubyOnRails

2015-10-30

[03:05:31] ewilliam: Read error: Connection reset by peer
[03:08:04] ewilliam: has joined #RubyOnRails

2015-10-28

[18:18:10] ewilliam: hi all, how do you implement form_for magic for form_objects? here's my code: https://gist.github.com/ewilliam/a2e2e1328014669f811e
[18:46:21] ewilliam: hi, how do you implement form_for magic for form_objects? i cant figure out how to map the form_for form object to an existing record so it will show existing model field inputs in the view, and PERSIST inputted user data when errors show. here's my code: https://gist.github.com/ewilliam/a2e2e1328014669f811e

2015-10-26

[20:11:29] ewilliam: hi, how do you strong params permit nested attributes for a form object? this is my code, with screenshot https://gist.github.com/ewilliam/105debb228c2834d4610
[20:12:00] ewilliam: ive tried :dob, :dob_attrs => [], etc, no go
[20:47:14] ewilliam: smathy: ok updated here: https://gist.github.com/ewilliam/105debb228c2834d4610
[20:51:29] ewilliam: smathy: yes i tried that. i put dob_attrs in there too for illustration
[20:52:52] ewilliam: smathy: i updated the gist to clarify. there's only :dob in the params method
[20:55:43] ewilliam: smathy: i tested it again to be extra sure. the problem persists.
[21:03:10] ewilliam: smathy: thanks

2015-10-18

[05:02:53] ewilliam: *.net *.split
[05:13:58] ewilliam: has joined #RubyOnRails

2015-10-16

[00:19:53] ewilliam: has joined #RubyOnRails

2015-10-12

[21:21:43] ewilliam: Read error: Connection reset by peer
[22:28:49] ewilliam: has joined #RubyOnRails

2015-10-11

[02:28:45] ewilliam: Read error: Connection reset by peer
[03:14:48] ewilliam: has joined #RubyOnRails
[08:36:07] ewilliam: Remote host closed the connection
[08:56:29] ewilliam: has joined #RubyOnRails

2015-10-09

[09:34:30] ewilliam: Read error: Connection reset by peer
[10:20:39] ewilliam: has joined #RubyOnRails

2015-10-08

[07:47:50] ewilliam: does anyone have an idea why this wont work?
[07:47:54] ewilliam: https://www.irccloud.com/pastebin/ZckzEwmx/
[07:48:05] ewilliam: i cant display the error in a flash message
[07:48:16] ewilliam: @wallet.errors comes up empty
[07:48:57] ewilliam: rvanlieshout: well this actually limits the number of records with a specific field
[07:49:26] ewilliam: mikecmpbll: yes, i removed the condition to test it
[07:49:31] ewilliam: because i thought i had the wrong condition
[07:49:35] ewilliam: but its not showing up AT ALL
[07:49:42] ewilliam: no errrors at all
[07:49:50] ewilliam: wallet.errors comes up with an empty hash
[07:50:40] ewilliam: in command line, things work
[07:53:30] ewilliam: rvanlieshout: https://gist.github.com/ewilliam/22a98a7c3d398cf82c8e
[07:54:36] ewilliam: wondering why this bit doesnt work https://www.irccloud.com/pastebin/ZckzEwmx/
[07:55:59] ewilliam: because users typically have 2 wallets. i plan to implement limits on specific kind of wallets, i.e., customer_account and merchant_account
[07:56:15] ewilliam: the method name is just a placeholder. im trying to test it
[07:56:33] ewilliam: rvanlieshout: ^^
[07:57:21] ewilliam: that's interesting rvanlieshout will try that
[07:57:29] ewilliam: but do you undertand why this doesnt work?
[07:57:34] ewilliam: it should, its simple enough
[07:58:47] ewilliam: craysiii: the resource is created in StripeCustomerService.create_customer
[07:59:40] ewilliam: rvanlieshout: rest well
[08:08:50] ewilliam: craysiii: hmm that wouldnt work, because the wallet resource isnt saved? wallet = Wallet.create would fail already
[08:09:42] ewilliam: return wallet || Wallet.new?
[08:10:48] ewilliam: you're right. let me investigate why its returning false
[08:16:13] ewilliam: ah duh craysiii its because of the wallet.charge_cards.create relation
[08:16:34] ewilliam: no, not webhook
[08:24:52] ewilliam: craysiii even after wallet.create fails? hmm
[08:24:59] ewilliam: https://www.dropbox.com/s/l7as7lxdegbkr7u/Screenshot%202015-10-08%2001.21.30.png?dl=0
[08:25:11] ewilliam: https://www.dropbox.com/s/325t2o3qiru2qof/Screenshot%202015-10-08%2001.24.34.png?dl=0
[08:25:35] ewilliam: yeah but parent needs to be saved to create an association on its behalf, no?
[08:28:03] ewilliam: this is so weird. i'm going to try the uniqueness validator and see. sigh
[08:32:54] ewilliam: craysiii: that makes sense. so i gotta try move the create method to the controller, or have @wallet be assigned to the returned wallet value of create_customer_account
[08:36:32] ewilliam: yeah, that's more elegant - trying that. thanks craysiii
[09:00:16] ewilliam: craysiii: oh wow. it now shows up in logs with Rails.logger but flash no go
[09:00:17] ewilliam: https://gist.github.com/ewilliam/22a98a7c3d398cf82c8e
[09:00:41] ewilliam: tested it in pry, @wallet.errors showed up all right
[09:01:02] ewilliam: https://www.dropbox.com/s/myjft9kyj0xf89v/Screenshot%202015-10-08%2002.00.55.png?dl=0
[09:02:32] ewilliam: craysiii: just tried that, doesnt work still
[09:03:06] ewilliam: tried flash.now.alert, flash.alert, flash[:alert], redirect_to page, alert: message, render etc
[09:07:08] ewilliam: craysiii: ah this is stupid
[09:07:20] ewilliam: its because i didnt do @wallet.errors.full_messages.to_sentence
[09:07:27] ewilliam: even @wallet.errors.full_messages didnt work
[09:07:53] ewilliam: anyways, thanks for your help!
[09:09:35] ewilliam: craysiii: not sure what u mean. these are the results of .errors https://www.dropbox.com/s/js1bxcpm9a3iqq9/Screenshot%202015-10-08%2002.09.13.png?dl=0
[09:11:29] ewilliam: craysiii: yeah, right that's why i was so confused
[09:12:00] ewilliam: nothing showed up AT ALL
[09:12:31] ewilliam: mhmm yes thanks for pointing that out
[09:15:07] ewilliam: hmm i need ELSE in IF statements that involve ELSIF?

2015-10-06

[20:43:46] ewilliam: *.net *.split
[20:46:17] ewilliam: has joined #RubyOnRails

2015-09-25

[03:38:48] ewilliam: hi, question about service objects - is it conventionally ok to have a service object create records unrelated to itself in the database?
[03:39:21] ewilliam: for example for a PaymentCardService service object which talks to Stripe. after creating a customer/card on Stripe, it creates a ChargeCard in the database
[03:39:29] ewilliam: https://www.irccloud.com/pastebin/uMMRIoZA/
[03:39:43] ewilliam: or should i handle that in the controller?
[03:40:06] ewilliam: note creation of Wallet and ChargeCard records
[03:46:01] ewilliam: rhizome: hmm?
[03:46:27] ewilliam: awesome, thanks
[03:51:12] ewilliam: didn't mean to be cold, just wasn't sure what you meant :) again, thanks!
[03:57:59] ewilliam: http://brewhouse.io/blog/2014/04/30/gourmet-service-objects.html
[03:57:59] ewilliam: dnewkerk: sure, here's a couple - https://blog.engineyard.com/2014/keeping-your-rails-controllers-dry-with-services https://netguru.co/blog/service-objects-in-rails-will-help http://blog.arkency.com/2013/09/services-what-they-are-and-why-we-need-them/ http://blog.carbonfive.com/2012/01/10/does-my-rails-app-need-a-service-layer/
[04:03:13] ewilliam: oh, i just removed those for legibility
[04:03:34] ewilliam: https://www.irccloud.com/pastebin/cCARIh0U/
[04:03:47] ewilliam: the engine yard article covers that i believe
[04:04:19] ewilliam: dnewkerk: ^^

2015-09-22

[09:54:05] ewilliam: has joined #RubyOnRails

2015-08-20

[19:27:49] ewilliam: Ping timeout: 244 seconds
[19:32:22] ewilliam: has joined #RubyOnRails

2015-08-14

[17:15:36] ewilliam: what is the point of nested routes/resources, other than generating /resource1/:id/resource2/ urls? is there any situations that i SHOULD use nested resources rather than flat ones?
[17:29:07] ewilliam: what is the point of nested routes/resources, other than generating /resource1/:id/resource2/ urls? is there any situations that i SHOULD use nested resources rather than flat ones?
[17:36:14] ewilliam: smathy: all right thanks :)

2015-07-29

[16:13:25] ewilliam: Remote host closed the connection
[16:48:45] ewilliam: has joined #RubyOnRails

2015-07-23

[15:48:36] ewilliam: has joined #RubyOnRails

2015-07-14

[18:30:51] ewilliam: *.net *.split
[20:02:21] ewilliam: has joined #RubyOnRails

2015-07-13

[15:36:58] ewilliam: *.net *.split
[15:44:29] ewilliam: has joined #RubyOnRails