Sha256: 731ba41a6bea842a160ceeedb290f6698a61fa44974202d726bb9f4c539b22f0

Contents?: true

Size: 301 Bytes

Versions: 28

Compression:

Stored size: 301 Bytes

Contents

class MemberNumberGenerator
  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
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
artfully_ose-1.2.0 app/models/member_number_generator.rb
artfully_ose-1.2.0.beta.1 app/models/member_number_generator.rb
artfully_ose-1.2.0.alpha.2 app/models/member_number_generator.rb
artfully_ose-1.2.0.alpha.1 app/models/member_number_generator.rb
artfully_ose-1.2.0.pre.27 app/models/member_number_generator.rb
artfully_ose-1.2.0.pre.26 app/models/member_number_generator.rb
artfully_ose-1.2.0.pre.24 app/models/member_number_generator.rb
artfully_ose-1.2.0.pre.23 app/models/member_number_generator.rb
artfully_ose-1.2.0.pre.21 app/models/member_number_generator.rb
artfully_ose-1.2.0.pre.20 app/models/member_number_generator.rb
artfully_ose-1.2.0.pre.19 app/models/member_number_generator.rb
artfully_ose-1.2.0.pre.18 app/models/member_number_generator.rb
artfully_ose-1.2.0.pre.17 app/models/member_number_generator.rb
artfully_ose-1.2.0.pre.16 app/models/member_number_generator.rb
artfully_ose-1.2.0.pre.15 app/models/member_number_generator.rb
artfully_ose-1.2.0.pre.12 app/models/member_number_generator.rb
artfully_ose-1.2.0.pre.11 app/models/member_number_generator.rb
artfully_ose-1.2.0.pre.10 app/models/member_number_generator.rb
artfully_ose-1.2.0.pre.9 app/models/member_number_generator.rb
artfully_ose-1.2.0.pre.8 app/models/member_number_generator.rb