Skip to content
This repository has been archived by the owner on Jan 19, 2019. It is now read-only.

Commit

Permalink
Merge pull request Team254#13 from morops/master
Browse files Browse the repository at this point in the history
added part revision letters
  • Loading branch information
morops authored Dec 27, 2017
2 parents 8bf693a + 27c1954 commit a2de788
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
*.log
*.pid
*.swp
vendor
config.json
1 change: 1 addition & 0 deletions db/migrations/005_add_material_and_priority_to_parts.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Binary file removed models/.part.rb.swp
Binary file not shown.
12 changes: 12 additions & 0 deletions models/part.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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




5 changes: 3 additions & 2 deletions parts_server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,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
Expand Down
1 change: 1 addition & 0 deletions views/part.erb
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
<% end %>
<tr><td><b>Quantity required</b></td><td><%= @part.quantity %></td></tr>
<tr><td><b>Drawing created?</b></td><td><%= (@part.drawing_created == 1) ? "Yes" : "No" %></td></tr>
<tr><td><b>Revision Letter</b></td><td><%= @part.rev %></td></tr>
<tr><td><b>Priority</b></td><td><%= Part::PRIORITY_MAP[@part.priority] %></td></tr>
</table>
<% if @user.can_edit? %>
Expand Down

0 comments on commit a2de788

Please sign in to comment.