Skip to content

Instantly share code, notes, and snippets.

class MarkReceiptPaid < ActiveInteraction::Base
# Required Params
#----------------------------------------------------------------------------
model :receipt
# Validations
#----------------------------------------------------------------------------
validates :receipt, :presence => true
# Execution
@brycesenz
brycesenz / pay_stub.rb
Created January 8, 2016 20:18
Salaries
class PayStub
belongs_to :salary
attr_accessor :start_date, :end_date
end
@brycesenz
brycesenz / 1_context
Last active October 26, 2016 23:16
A better explanation
We are trying to lock down a communication pattern by which our back-end server (which processes the applications) will communicate with our front-end React templates. We have all agreed that the separation of responsibilities should be this:
1. Both the front-end and the back-end are aware of the full suite of React templates that exist. The front-end and the back-end agree on a set of keys that correspond to each template. For example, there may be templates for gathering personal information, bank account information, housing information, and employment information. Both parts of the system will agree that those can be referred to (as an example) as `identity_information`, `bank_information`, `housing_information`, and `employment_information`.
2. The server persists the application, and evaluations whether the application is fit to make a final decision yet.
3. The server tells the the front end which templates to render, and returns if there are any errors with the submitted data.
4. The front-end a
@brycesenz
brycesenz / has_one_through_failure.rb
Created November 11, 2016 19:09
Failing has_one through association
class Listing < ActiveRecord::Base
belongs_to :owner, polymorphic: true
belongs_to :property, polymorphic: true
validates :active, inclusion: { in: [true, false] }
end
class Car < ActiveRecord::Base
has_many :listings, as: :property, inverse_of: :property
end

Keybase proof

I hereby claim:

  • I am brycesenz on github.
  • I am brycesenz (https://keybase.io/brycesenz) on keybase.
  • I have a public key ASCO_PZJ8ArLOow_wHDr86Vu7IMxRjep4Hs_7KR8pKp7RQo

To claim this, I am signing this object: