Class: MemberNumberGenerator
- Inherits:
-
Object
- Object
- MemberNumberGenerator
- Defined in:
- app/models/member_number_generator.rb
Class Method Summary collapse
Class Method Details
.next_number_for(organization) ⇒ Object
2 3 4 5 6 7 |
# File 'app/models/member_number_generator.rb', line 2 def self.next_number_for(organization) next_number = organization.last_member_number + 1 organization.update_column(:last_member_number, next_number) padded_number = "%05d" % next_number member_number = organization.id.to_s + "A" + padded_number end |