activities 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/README.rdoc +26 -13
  2. data/Rakefile +0 -1
  3. data/lib/activities/version.rb +1 -1
  4. metadata +11 -17
@@ -6,18 +6,31 @@ Activities is a gem that enables social activities in ActiveRecord objects.
6
6
 
7
7
  sudo gem install activities
8
8
 
9
- You have to create a migration with the following code:
10
-
11
- create_table :activities do |t|
12
- t.references :tracker, :polymorphic => true, :null => false
13
- t.references :trackable, :polymorphic => true, :null => false
14
- t.string :action, :null => false
15
- t.text :data, :null => true
16
- t.timestamps
17
- end
9
+ You have to create a migration.
10
+
11
+ * Rails 2: <tt>script/generate migration create_activities</tt>
12
+ * Rails 3: <tt>rails generate migration create_activities</tt>
13
+
14
+ Then paste the following code.
15
+
16
+ class CreateActivities < ActiveRecord::Migration
17
+ def self.up
18
+ create_table :activities do |t|
19
+ t.references :tracker, :polymorphic => true, :null => false
20
+ t.references :trackable, :polymorphic => true, :null => false
21
+ t.string :action, :null => false
22
+ t.text :data, :null => true
23
+ t.timestamps
24
+ end
18
25
 
19
- add_index :activities, [:tracker_id, :trackable_id]
20
- add_index :activities, [:tracker_id, :trackable_id, :action]
26
+ add_index :activities, [:tracker_id, :trackable_id]
27
+ add_index :activities, [:tracker_id, :trackable_id, :action]
28
+ end
29
+
30
+ def self.down
31
+ drop_table :activities
32
+ end
33
+ end
21
34
 
22
35
  If you want the source go to http://github.com/fnando/activities
23
36
 
@@ -59,7 +72,7 @@ To display the activities, you should use the helper +render_activity+.
59
72
  <% end %>
60
73
 
61
74
  The +render_activity+ helper will render a partial as <tt>app/views/activities/TRACKABLE_TYPE/ACTION</tt>.
62
- So, if you want to render activities fro that project, you should create the following files:
75
+ So, if you want to render activities for that project, you should create the following files:
63
76
 
64
77
  app/views/activities/project/_renamed.html.erb
65
78
  app/views/activities/project/_create.html.erb
@@ -80,7 +93,7 @@ The activity object will be available and you can display something like this:
80
93
 
81
94
  Copyright © 2010:
82
95
 
83
- * Nando Vieira - http://simplesideias.com.br
96
+ * Nando Vieira - http://nandovieira.com.br
84
97
 
85
98
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ‘Software’), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
86
99
 
data/Rakefile CHANGED
@@ -36,7 +36,6 @@ JEWEL = Jeweler::Tasks.new do |gem|
36
36
  gem.authors = ["Nando Vieira"]
37
37
  gem.version = Activities::Version::STRING
38
38
  gem.summary = "A framework for aggregating social activity."
39
- gem.add_dependency "activerecord"
40
39
  gem.files = FileList["{README,CHANGELOG}.rdoc", "{lib,test}/**/*", "Rakefile"]
41
40
  end
42
41
 
@@ -2,7 +2,7 @@ module Activities
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 1
5
- PATCH = 0
5
+ PATCH = 1
6
6
  STRING = "#{MAJOR}.#{MINOR}.#{PATCH}"
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activities
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 25
4
5
  prerelease: false
5
6
  segments:
6
7
  - 0
7
8
  - 1
8
- - 0
9
- version: 0.1.0
9
+ - 1
10
+ version: 0.1.1
10
11
  platform: ruby
11
12
  authors:
12
13
  - Nando Vieira
@@ -14,21 +15,10 @@ autorequire:
14
15
  bindir: bin
15
16
  cert_chain: []
16
17
 
17
- date: 2010-04-13 00:00:00 -03:00
18
+ date: 2010-07-19 00:00:00 -03:00
18
19
  default_executable:
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
21
- name: activerecord
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
24
- requirements:
25
- - - ">="
26
- - !ruby/object:Gem::Version
27
- segments:
28
- - 0
29
- version: "0"
30
- type: :runtime
31
- version_requirements: *id001
20
+ dependencies: []
21
+
32
22
  description:
33
23
  email: fnando.vieira@gmail.com
34
24
  executables: []
@@ -62,23 +52,27 @@ rdoc_options:
62
52
  require_paths:
63
53
  - lib
64
54
  required_ruby_version: !ruby/object:Gem::Requirement
55
+ none: false
65
56
  requirements:
66
57
  - - ">="
67
58
  - !ruby/object:Gem::Version
59
+ hash: 3
68
60
  segments:
69
61
  - 0
70
62
  version: "0"
71
63
  required_rubygems_version: !ruby/object:Gem::Requirement
64
+ none: false
72
65
  requirements:
73
66
  - - ">="
74
67
  - !ruby/object:Gem::Version
68
+ hash: 3
75
69
  segments:
76
70
  - 0
77
71
  version: "0"
78
72
  requirements: []
79
73
 
80
74
  rubyforge_project:
81
- rubygems_version: 1.3.6
75
+ rubygems_version: 1.3.7
82
76
  signing_key:
83
77
  specification_version: 3
84
78
  summary: A framework for aggregating social activity.