Sha256: 4f59d215cc3a356808e0ae8ac7e852580f6a29f38d8d657a825826cbf191341d

Contents?: true

Size: 170 Bytes

Versions: 23

Compression:

Stored size: 170 Bytes

Contents

class Message < ActiveRecord::Base
  after_create :remove_old

  private

  def remove_old
    while Message.all.size > 100
      Message.first.destroy
    end
  end
end

Version data entries

23 entries across 23 versions & 2 rubygems

Version Path
pubnub-3.7.12 examples/pubnub_livestream/app/models/message.rb
pubnub-3.7.11 examples/pubnub_livestream/app/models/message.rb
pubnub-3.7.10 examples/pubnub_livestream/app/models/message.rb
pubnub-3.7.9 examples/pubnub_livestream/app/models/message.rb
pubnub-3.7.7 examples/pubnub_livestream/app/models/message.rb
pubnub-3.7.5 examples/pubnub_livestream/app/models/message.rb
pubnub-3.7.1 examples/pubnub_livestream/app/models/message.rb
pubnub-3.7.0 examples/pubnub_livestream/app/models/message.rb
pubnub-3.6.10 examples/pubnub_livestream/app/models/message.rb
pubnub-3.6.9 examples/pubnub_livestream/app/models/message.rb
pubnub-3.6.7 examples/pubnub_livestream/app/models/message.rb
pubnub-3.5.14 examples/pubnub_livestream/app/models/message.rb
pubnub-3.5.12 examples/pubnub_livestream/app/models/message.rb
pubnub-3.5.8 examples/pubnub_livestream/app/models/message.rb
pubnub-3.5.7 examples/pubnub_livestream/app/models/message.rb
pubnub-3.5.6 examples/pubnub_livestream/app/models/message.rb
pubnub-3.5.5 examples/pubnub_livestream/app/models/message.rb
pubnub-3.5.3 examples/pubnub_livestream/app/models/message.rb
pubnub-ruby-3.4.1 examples/pubnub_livestream/app/models/message.rb
pubnub-3.5.1 examples/pubnub_livestream/app/models/message.rb