Skip to content

Instantly share code, notes, and snippets.

View dgoscn's full-sized avatar

Diego Amaral dgoscn

View GitHub Profile
class Administration::ContractsController < Administration::BaseController
def new
@company = Company.find(params[:company_id])
@contract = Contract.new
@contract.distance_fees.build
@contract.contract_authorizations.build
binding.pry
@contract.initial_charge = current_admin_user.levoo_unit.present? == true ? current_admin_user.levoo_unit.setting.initial_charge : Setting.first.initial_charge
@contract.extra_mileage_threshold = current_admin_user.levoo_unit.present? == true ? current_admin_user.levoo_unit.setting.extra_mileage_threshold : Setting.first.extra_mileage_threshold