From a82b0048d86796cb6b91ac8882b7580f0078843e Mon Sep 17 00:00:00 2001 From: Connor Turland Date: Sun, 27 Mar 2016 00:14:22 -0700 Subject: [PATCH] don't need sequenced --- Gemfile | 1 - app/models/event.rb | 3 --- db/migrate/20160312234946_create_events.rb | 2 -- 3 files changed, 6 deletions(-) diff --git a/Gemfile b/Gemfile index 3eab4256..1a129d7b 100644 --- a/Gemfile +++ b/Gemfile @@ -19,7 +19,6 @@ gem 'uservoice-ruby' gem 'dotenv' gem 'snorlax' gem 'httparty' -gem 'sequenced', '~> 2.0.0' gem 'active_model_serializers', '~> 0.8.1' gem 'delayed_job', '~> 4.0.2' gem 'delayed_job_active_record', '~> 4.0.1' diff --git a/app/models/event.rb b/app/models/event.rb index b49b4856..6dfb7e26 100644 --- a/app/models/event.rb +++ b/app/models/event.rb @@ -6,7 +6,6 @@ class Event < ActiveRecord::Base belongs_to :map belongs_to :user - scope :sequenced, -> { where('sequence_id is not null').order('sequence_id asc') } scope :chronologically, -> { order('created_at asc') } after_create :notify_webhooks!, if: :map @@ -14,8 +13,6 @@ class Event < ActiveRecord::Base validates_inclusion_of :kind, :in => KINDS validates_presence_of :eventable - acts_as_sequenced scope: :map_id, column: :sequence_id, skip: lambda {|e| e.map.nil? || e.map_id.nil? } - #def notify!(user) # notifications.create!(user: user) #end diff --git a/db/migrate/20160312234946_create_events.rb b/db/migrate/20160312234946_create_events.rb index 7ab71099..4ce01e35 100644 --- a/db/migrate/20160312234946_create_events.rb +++ b/db/migrate/20160312234946_create_events.rb @@ -5,9 +5,7 @@ class CreateEvents < ActiveRecord::Migration t.references :eventable, polymorphic: true, index: true t.references :user, index: true t.references :map, index: true - t.integer :sequence_id, index: true, default: nil, null: true t.timestamps end - add_index :events, [:map_id, :sequence_id], unique: true end end