Sha256: c69d1ebc58cb7b84525bb5f9ebf83dee14f3a277462b98af410cf67f52469305

Contents?: true

Size: 334 Bytes

Versions: 5

Compression:

Stored size: 334 Bytes

Contents

class SeapigRouterSession < ActiveRecord::Base

	has_many :seapig_router_session_states

	def self.generate
		session = SeapigRouterSession.new
		begin
			session.key = (('a'..'z').to_a + ('A'..'Z').to_a + (0..9).to_a).shuffle[0..10].join('')
			session.save!
		rescue ActiveRecord::RecordNotUnique
			retry
		end
		session
	end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
seapig-rails-0.1.4 app/models/seapig_router_session.rb
seapig-rails-0.1.3 app/models/seapig_router_session.rb
seapig-rails-0.1.2 app/models/seapig_router_session.rb
seapig-rails-0.1.0 app/models/seapig_router_session.rb
seapig-rails-0.0.7 app/models/seapig_router_session.rb