Skip to content

Instantly share code, notes, and snippets.

View smcabrera's full-sized avatar
🐶

Stephen Mariano Cabrera smcabrera

🐶
View GitHub Profile
def build_leads_attributes(raw_data, proposal_request)
raw_data['properties'].map do |property|
{
source_property_id: property['id'],
checking_in_on: raw_data['search_params']['check_in'],
checking_out_on: raw_data['search_params']['check_out'],
number_of_guests: raw_data['search_params']['people'],
quoted_price: property['rate'],
currency: property['currency'],
rooms: raw_data['search_params']['rooms'],
@smcabrera
smcabrera / osx-10.10-setup.md
Last active November 16, 2015 06:56 — forked from kevinelliott/osx-10.10-setup.md
Mac OS X 10.10 Yosemite Setup

Mac OS X 10.10 Yosemite

This is forked from someone else; I've yet to go through this and fully customize it but I thought it was such a great idea I had to steal it.

Custom recipe to get OS X 10.10 Yosemite running from scratch, setup applications and developer environment. I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install. On average, I reinstall each computer from scratch every 6 months, and I do not perform upgrades between distros.

This keeps the system performing at top speeds, clean of trojans, spyware, and ensures that I maintain good organizational practices for my content and backups. I highly recommend this.

You are encouraged to fork this and modify it to your heart's content to match your own needs.

def thirty_days_before_checkin_or_tomorrow
if checking_in_on.present?
date = checking_in_on - 30.days
if (date.to_i < created_at.to_i)
date = created_at + 1.day
end
date
else
'-'
end
def has_specific_event_space_end_date?(event_space_end_date)
within '[data-role="event-space-end-date"]' do
page.has_content? event_space_end_date
end
end
properties_by_chains = @@clients_properties_data[:property_chain_codes].map do |chain_id|
  Property.unscoped.joins(:property_chain).where(property_chains: {code: chain_id})
end.flatten

(property_group.properties + properties_by_chains).uniq

This is what is displaying the check in date for the sleeping rooms in the sleeping rooms tab {{friendlyTime checkingInAt}} on {{friendlyDate checkingInOn}} While this is what is displaying the check in date for the panel at the top. {{friendlyDate dateCheckIn}}

I'd like to say th bottom one is wrong and it should be changed but I wonder if I'm missing something...surely dateCheckIn exists for a reason...right?

Here are the steps to change things on the UI for the leads on the prm

  1. Add to the serializer which lives here: app/serializers/base_lead_serializer.rb
  2. Add to params list in the controller here: app/controllers/leads_controller.rb
  3. Add to ember model here: app/assets/javascripts/models/lead.js.coffee
  4. Add to ember controller here: app/assets/javascripts/controllers/lead_controller.js.coffee
  5. Add to the view template in the appropriate file in this folder: app/assets/javascripts/templates/lead_details/tabs/ like app/assets/javascripts/templates/lead_details/tabs/_concessions.handlebars
  6. Make sure to also change in the edit template as well (they end in -edit.handlebars)
def has_event_space_start_date?(date)
lead.reload
within '[data-role=event_space_start_date]' do
page.has_content?(date) && lead.event_space_start_date == date
end
end
<p class="group-option-value" data-role="event-space-comments">
{{eventSpaceComments}}
</p>
scenario 'views event space details with function date as a date' do
booking_request = build(
:booking_request,
event_space_comments: 'I need a lot of room'
)
lead = create(:lead,
booking_request: booking_request,
event_space_start_date: Date.new(2015, 27, 10)
)
user = create_user_for_lead(lead)