Skip to content
Snippets Groups Projects
Commit 0c4db024 authored by Mauricio Giacomini Girardello's avatar Mauricio Giacomini Girardello
Browse files

adding public activity gem and database migrations

parent d7b7f06b
No related branches found
No related tags found
No related merge requests found
......@@ -142,3 +142,4 @@ gem 'active_model_serializers'
# limit the number of requests by user to api
gem 'redis-throttle', git: 'git://github.com/lelylan/redis-throttle.git'
gem 'public_activity'
\ No newline at end of file
# Migration responsible for creating a table with activities
class CreateActivities < ActiveRecord::Migration
# Create table
def self.up
create_table :activities do |t|
t.belongs_to :trackable, :polymorphic => true
t.belongs_to :owner, :polymorphic => true
t.string :key
t.text :parameters
t.belongs_to :recipient, :polymorphic => true
t.timestamps
end
add_index :activities, [:trackable_id, :trackable_type]
add_index :activities, [:owner_id, :owner_type]
add_index :activities, [:recipient_id, :recipient_type]
end
# Drop table
def self.down
drop_table :activities
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment