Lose the hash rocket, use symbols

This commit is contained in:
2026-01-29 22:52:17 -05:00
parent fa72b1c837
commit e0a23bac20
13 changed files with 27 additions and 27 deletions

View File

@@ -23,7 +23,7 @@ class VehiclesController < ApplicationController
def index def index
if params[:customer_id] if params[:customer_id]
begin begin
@vehicles = Customer.find_by_id(params[:customer_id]).vehicles.paginate(:page => params[:page]) @vehicles = Customer.find_by_id(params[:customer_id]).vehicles.paginate(page: params[:page])
rescue ActiveRecord::RecordNotFound rescue ActiveRecord::RecordNotFound
render_404 render_404
end end
@@ -31,7 +31,7 @@ class VehiclesController < ApplicationController
# search for a vehicle by vin # search for a vehicle by vin
if params[:search] if params[:search]
@vehicles = Vehicle.search(params[:search]).paginate(:page => params[:page]) @vehicles = Vehicle.search(params[:search]).paginate(page: params[:page])
if only_one_non_zero?(@vehicles) if only_one_non_zero?(@vehicles)
redirect_to @vehicles.first redirect_to @vehicles.first
end end

View File

@@ -1,5 +1,5 @@
<h4><%=t(:field_vehicles)%>:</h4> <h4><%=t(:field_vehicles)%>:</h4>
<%= render :partial => 'vehicles/list', :locals => { :vehicles => customer.vehicles.paginate(:page => params[:page]) } %> <%= render partial: 'vehicles/list', locals: { vehicles: customer.vehicles.paginate(page: params[:page]) } %>
<div style="float: right;"> <div style="float: right;">
<%= button_to t(:button_new_vehice), new_customer_vehicle_path(customer), method: :get %> <%= button_to t(:button_new_vehice), new_customer_vehicle_path(customer), method: :get %>
</div> </div>

View File

@@ -6,43 +6,43 @@
<div class="clearfix"> <div class="clearfix">
<%=t(:field_customer)%>: <%=t(:field_customer)%>:
<div class="input"> <div class="input">
<%= f.autocomplete_field :customer, autocomplete_customer_name_customers_path, :value => @customer.name, :update_elements => {:id => '#customer_id', :value => '#issue_customer'}, :required => true %> <%= f.autocomplete_field :customer, autocomplete_customer_name_customers_path, value: @customer.name, update_elements: {id: '#customer_id', value: '#issue_customer'}, required: true %>
<%= f.hidden_field :customer_id, :id => "customer_id", :value => @customer.id %> <%= f.hidden_field :customer_id, id: "customer_id", value: @customer.id %>
</div> </div>
</div> </div>
<div class="clearfix"> <div class="clearfix">
<%=t(:label_year)%>: <%=t(:label_year)%>:
<div class="input"> <div class="input">
<%= f.number_field :year, :autocomplete => "off" %> <%= f.number_field :year, autocomplete: "off" %>
</div> </div>
</div> </div>
<div class="clearfix"> <div class="clearfix">
<%=t(:label_make)%>: <%=t(:label_make)%>:
<div class="input"> <div class="input">
<%= f.text_field :make, :autocomplete => "off" %> <%= f.text_field :make, autocomplete: "off" %>
</div> </div>
</div> </div>
<div class="clearfix"> <div class="clearfix">
<%=t(:label_model)%>: <%=t(:label_model)%>:
<div class="input"> <div class="input">
<%= f.text_field :model, :autocomplete => "off" %> <%= f.text_field :model, autocomplete: "off" %>
</div> </div>
</div> </div>
<div class="clearfix"> <div class="clearfix">
<%=t(:field_vin)%>: <%=t(:field_vin)%>:
<div class="input"> <div class="input">
<%= f.text_field :vin , :autofocus => true %> <%= f.text_field :vin , autofocus: true %>
</div> </div>
</div> </div>
<div class="clearfix"> <div class="clearfix">
<%=t(:field_notes)%>: <%=t(:field_notes)%>:
<div class="input"> <div class="input">
<%= f.text_area :notes, :cols => 60, :rows => 10, :no_label => true %> <%= f.text_area :notes, cols: 60, rows: 10, no_label: true %>
</div> </div>
</div> </div>

View File

@@ -1,4 +1,4 @@
<%= form_tag(vehicles_path, :method => "get", id: "search-form") do %> <%= form_tag(vehicles_path, method: "get", id: "search-form") do %>
<%= text_field_tag :search, params[:search], placeholder: t(:label_search_vin), :autocomplete => "off" %> <%= text_field_tag :search, params[:search], placeholder: t(:label_search_vin), autocomplete: "off" %>
<%= submit_tag t(:label_search) %> <%= submit_tag t(:label_search) %>
<% end %> <% end %>

View File

@@ -1,3 +1,3 @@
<h1><%=t(:label_edit_customer_vehicle)%></h1> <h1><%=t(:label_edit_customer_vehicle)%></h1>
<br/> <br/>
<%= render :partial => 'vehicles/form' %> <%= render partial: 'vehicles/form' %>

View File

@@ -1,4 +1,4 @@
<h2><%=t(:label_cusomer_vehicles)%> <span style="float:right"> <%= render :partial => 'vehicles/search' %> </span> </h2> <h2><%=t(:label_cusomer_vehicles)%> <span style="float:right"> <%= render partial: 'vehicles/search' %> </span> </h2>
<br/> <br/>
<%= render :partial => 'vehicles/list', locals: {vehicles: @vehicles} %> <%= render partial: 'vehicles/list', locals: {vehicles: @vehicles} %>

View File

@@ -1,3 +1,3 @@
<h2><%=t(:label_new_vehicle)%></h2> <h2><%=t(:label_new_vehicle)%></h2>
<br/> <br/>
<%= render :partial => 'vehicles/form' %> <%= render partial: 'vehicles/form' %>

View File

@@ -1,11 +1,11 @@
<h2><%=t(:field_vehicle)%> #<%=@vehicle.id%></h2> <h2><%=t(:field_vehicle)%> #<%=@vehicle.id%></h2>
<%= render :partial => 'vehicles/details', locals: {vehicle: @vehicle} %> <%= render partial: 'vehicles/details', locals: {vehicle: @vehicle} %>
<h3><%=@issues.open.count%> <%=t(:label_open_issues)%></h3> <h3><%=@issues.open.count%> <%=t(:label_open_issues)%></h3>
<%= render :partial => 'issues/list_simple', locals: {issues: @issues.open} %> <%= render partial: 'issues/list_simple', locals: {issues: @issues.open} %>
<h3><%=@closed_issues.count%> <%=t(:label_closed_issues)%></h3> <h3><%=@closed_issues.count%> <%=t(:label_closed_issues)%></h3>
<%= render :partial => 'issues/list_simple', locals: {issues: (@closed_issues)} %> <%= render partial: 'issues/list_simple', locals: {issues: (@closed_issues)} %>

View File

@@ -11,7 +11,7 @@
# Nest Vehicles under customers # Nest Vehicles under customers
resources :customers do resources :customers do
resources :vehicles resources :vehicles
get :autocomplete_customer_name, :on => :collection get :autocomplete_customer_name, on: :collection
end end
#allow for just vehicles too #allow for just vehicles too

View File

@@ -17,7 +17,7 @@ Redmine::Plugin.register :redmine_qbo_vehicles do
version '2026.1.1' version '2026.1.1'
url 'https://github.com/rickbarrette/redmine_qbo_vehicles' url 'https://github.com/rickbarrette/redmine_qbo_vehicles'
author_url 'https://barrettefabrication.com' author_url 'https://barrettefabrication.com'
requires_redmine :version_or_higher => '6.1.0' requires_redmine version_or_higher: '6.1.0'
# Ensure redmine_qbo is installed # Ensure redmine_qbo is installed
begin begin
@@ -30,10 +30,10 @@ Redmine::Plugin.register :redmine_qbo_vehicles do
Issue.safe_attributes 'vehicle_id' Issue.safe_attributes 'vehicle_id'
# Permissions for security # Permissions for security
permission :view_vehicles, :vehicles => :new, :public => false permission :view_vehicles, vehicles: :new, public: false
# Register top menu items # Register top menu items
menu :top_menu, :vehicles, { :controller => :vehicles, :action => :index }, :caption => 'Vehicles', :if => Proc.new { User.current.logged? } menu :top_menu, :vehicles, { controller: :vehicles, action: :index }, caption: 'Vehicles', if: Proc.new { User.current.logged? }
end end

View File

@@ -19,7 +19,7 @@ module Vehicles
# Pass all prebuilt form components to our partial # Pass all prebuilt form components to our partial
context[:controller].send(:render_to_string, { context[:controller].send(:render_to_string, {
:partial => 'customers/show_hook', locals: { customer: context[:customer] } partial: 'customers/show_hook', locals: { customer: context[:customer] }
}) })
end end

View File

@@ -36,11 +36,11 @@ module Vehicles
end end
# Generate the drop down list of vehicles # Generate the drop down list of vehicles
vehicle = f.select :vehicle_id, vehicles, :selected => selected_vehicle, include_blank: true vehicle = f.select :vehicle_id, vehicles, selected: selected_vehicle, include_blank: true
# Pass all prebuilt form components to our partial # Pass all prebuilt form components to our partial
context[:controller].send(:render_to_string, { context[:controller].send(:render_to_string, {
:partial => 'issues/form_hook_vehicles', partial: 'issues/form_hook_vehicles',
locals: { locals: {
vehicle: vehicle vehicle: vehicle
} }

View File

@@ -30,7 +30,7 @@ module Vehicles
split_vin = vin.scan(/.{1,9}/) if vin split_vin = vin.scan(/.{1,9}/) if vin
context[:controller].send(:render_to_string, { context[:controller].send(:render_to_string, {
:partial => 'issues/show_issue_view_right', partial: 'issues/show_issue_view_right',
locals: { locals: {
vehicle: vehicle, vehicle: vehicle,
split_vin: split_vin, split_vin: split_vin,