From 27c19548c48d1ddb35fec716aa8938537bc510f0 Mon Sep 17 00:00:00 2001 From: Matt Moropoulos Date: Wed, 27 Dec 2017 02:26:46 -0800 Subject: [PATCH] added part revision letters --- .gitignore | 1 + .../005_add_material_and_priority_to_parts.rb | 1 + models/.part.rb.swp | Bin 12288 -> 0 bytes models/part.rb | 12 ++++++++++++ parts_server.rb | 5 +++-- views/part.erb | 1 + 6 files changed, 18 insertions(+), 2 deletions(-) delete mode 100644 models/.part.rb.swp diff --git a/.gitignore b/.gitignore index 3ce9241..a8e58c7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ *.log *.pid +*.swp vendor config.json diff --git a/db/migrations/005_add_material_and_priority_to_parts.rb b/db/migrations/005_add_material_and_priority_to_parts.rb index 30d50f3..1d0e19f 100644 --- a/db/migrations/005_add_material_and_priority_to_parts.rb +++ b/db/migrations/005_add_material_and_priority_to_parts.rb @@ -6,6 +6,7 @@ add_column :quantity, String, :null => false add_column :priority, Integer, :null => false add_column :drawing_created, Integer, :null => false + add_column :rev, String, :null => false end end end diff --git a/models/.part.rb.swp b/models/.part.rb.swp deleted file mode 100644 index b80a71461981afaf5bbde155e99f8dd53083ad88..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12288 zcmeHNJ&YSg6rP0N1QHNbbdR+nv-Y&3oT_^JcBv zcJ=B?onERO7r34k;@HJAZ~gh5Wy=Dn|L;asPu zR6LpuWn|*HzIK%#&vBy?wf9zKXIKU-0}sr=A+fkHUuCh9^CCU}+?5B`UUFsSOzQu4r^7=02z&*6 z2`m8r;+ui*fIGldzyW@LT8K{p2{^#tPYLlYa2q%elz@K@3h^881MoHQ5pV}+11|#v z><9J%-y9Gk1T^ph@XM1zd1e7{xfE-Xv9mN2FQlTPtm zs-0vdc~2$q{8Lz}iiL{Zo;w3QM1dL}WevH>nRwnTLw)L3D^s0$>A4t6ojOT;FDL49 zKB(vj9jnoNwVF)WK2W0ue~8xge4`@RvG-CF{$?tDd1IUHGeoy;(QLjHzH?Jk)?{O{ zZrXKC(Fv6W;u_kCG*n(UAv(#Tq&qR9s4UGosud0XzXV_n zMQ4h7*r@x_;qeyW9F3LVt!$`3MbfA|`DNg?I*~%p(JZj#G*gPI*|ica$Fa8Xsh zQ07Nl#>yofkm;#RhM+WMfgd7e22mo0G)_{9bUWFEc$cBZ+REj%mFBfpeYpXDZekB$ zZ#Wmcjh<7c`J}O`qrUXfTu7Ri^w6QL#H6|mLoe7M-K8+{bmW;4d4W+IDx%ov2$p#P zxzb2BlZ>WePa5)Ka=ke8

kd$)*ot6;*^daDbdp`(E5r*y?ObW8B(GM^IR{9r`CQ9>uBfY zxMK&-CQlri9oM8FBzoVJp5d@{bwuM*TNb4qQmEL>8)l~F6vgs^sZwD=dMdQ0q&rGh zN_&$~u*#{DGSIH~eio03Xx=?lChlm{>9vu3nOxD%^<;4N)ns(4_)z)oR2TDssZu)= zq`2l}j5wNI*+D|2F7IY|`;2ke$3nb;P#HEN6;BU8iieAXlDA4q7&g>IDJS&qMcqga z$3CwrRMnKM<+D1|Jo#(7JkWp!}t!I)B-Y-?_A=@Y)sQ z1&Gg+7_8)!6-okAjl(8;nGq$3ot6XB!<0~((?C~xQCkL^m5%Py(S`)SolQEI_0B-x mj1ET;4iiHQ)%gW#D%q!n6UQsG?EAFF12Jqt?Z2+viuey7+gXtS diff --git a/models/part.rb b/models/part.rb index 2db3d12..d2e824d 100644 --- a/models/part.rb +++ b/models/part.rb @@ -58,4 +58,16 @@ def self.generate_number_and_create(project, type, parent_part) def full_part_number "#{project.part_number_prefix}-#{type == "assembly" ? "A" : "P"}-%04d" % part_number end + + def increment_revision(rev) + if rev == "" + return "A" + else + return rev.next + end + end end + + + + diff --git a/parts_server.rb b/parts_server.rb index 0593a8a..0bd1757 100644 --- a/parts_server.rb +++ b/parts_server.rb @@ -210,8 +210,9 @@ def send_email(to, subject, body) part = Part.generate_number_and_create(project, params[:type], parent_part) part.name = params[:name].gsub("\"", """) part.status = "designing" - part.mfg_method = "manual" - part.finish = "none" + part.mfg_method = "Manual" + part.finish = "None" + part.rev = "" part.quantity = "" part.priority = 1 part.drawing_created = 0 diff --git a/views/part.erb b/views/part.erb index 7aa9173..58c24b2 100644 --- a/views/part.erb +++ b/views/part.erb @@ -53,6 +53,7 @@ <% end %> Quantity required<%= @part.quantity %> Drawing created?<%= (@part.drawing_created == 1) ? "Yes" : "No" %> + Revision Letter<%= @part.rev %> Priority<%= Part::PRIORITY_MAP[@part.priority] %> <% if @user.can_edit? %>