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:
I hereby claim:
To claim this, I am signing this object:
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 |
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 |
class PayStub | |
belongs_to :salary | |
attr_accessor :start_date, :end_date | |
end |
class MarkReceiptPaid < ActiveInteraction::Base | |
# Required Params | |
#---------------------------------------------------------------------------- | |
model :receipt | |
# Validations | |
#---------------------------------------------------------------------------- | |
validates :receipt, :presence => true | |
# Execution |
class Person < ActiveRecord::Base | |
has_one :phone | |
has_many :dogs | |
attr_accessible :name | |
end | |
class Phone < ActiveRecord::Base | |
attr_accessible :phone_number | |
end |
I have a time range, ex: ["02:15", "04:30"] which shows a session begin and end time.
I need to break that down by the hour. End result would be: 2: 2700 3: 3600 4: 1800
The way I thought about doing this was breaking this down into the following array: ["02:15", "03:00", "04:00", "04:15"] and getting the time difference between the elements.. ie difference between 03:00 and 02:15 which results in 2700s, etc.
Any suggestions on something better? more efficient?
# app/serializers/customer_serializer_spec.rb | |
class CustomerSerializer < ActiveModel::Serializer | |
attributes :customer_number, :email, :username | |
def customer_number | |
object.account_number | |
end | |
def merchant_id |
#------------------------------------------------------------ | |
# View | |
#------------------------------------------------------------ | |
= form_for(claim...) do |f| | |
= text_field :user_lookup # An existing reference or data to create a new one | |
= text_field :provider_lookup # An existing reference or data to create a new one | |
= text_field :claim_name | |
= text_field :claim_amount | |
= text_area :claim_description |