1 |
commit: 2a18ee45abf989b67ac868ee2fc2b81293a7e74a |
2 |
Author: Joachim Filip Ignacy Bartosik <jbartosik <AT> gmail <DOT> com> |
3 |
AuthorDate: Thu Jul 21 11:13:32 2011 +0000 |
4 |
Commit: Petteri Räty <betelgeuse <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Jul 25 13:32:20 2011 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/council-webapp.git;a=commit;h=2a18ee45 |
7 |
|
8 |
Add summary field |
9 |
|
10 |
--- |
11 |
site/app/models/agenda.rb | 1 + |
12 |
site/db/schema.rb | 11 ++++++----- |
13 |
site/spec/models/agenda_spec.rb | 11 +++++++++++ |
14 |
3 files changed, 18 insertions(+), 5 deletions(-) |
15 |
|
16 |
diff --git a/site/app/models/agenda.rb b/site/app/models/agenda.rb |
17 |
index 680773a..bf38838 100644 |
18 |
--- a/site/app/models/agenda.rb |
19 |
+++ b/site/app/models/agenda.rb |
20 |
@@ -6,6 +6,7 @@ class Agenda < ActiveRecord::Base |
21 |
meeting_time :datetime |
22 |
email_reminder_sent :boolean |
23 |
meeting_log :text |
24 |
+ summary :text |
25 |
timestamps |
26 |
end |
27 |
|
28 |
|
29 |
diff --git a/site/db/schema.rb b/site/db/schema.rb |
30 |
index 641ac4b..a6232e1 100644 |
31 |
--- a/site/db/schema.rb |
32 |
+++ b/site/db/schema.rb |
33 |
@@ -10,13 +10,13 @@ |
34 |
# |
35 |
# It's strongly recommended to check this file into your version control system. |
36 |
|
37 |
-ActiveRecord::Schema.define(:version => 20110711074750) do |
38 |
+ActiveRecord::Schema.define(:version => 20110721103758) do |
39 |
|
40 |
create_table "agenda_items", :force => true do |t| |
41 |
- t.string "title", :default => "", :null => false |
42 |
- t.string "discussion", :default => "", :null => false |
43 |
- t.text "body", :default => "", :null => false |
44 |
- t.boolean "rejected", :default => false, :null => false |
45 |
+ t.string "title", :default => "", :null => false |
46 |
+ t.string "discussion", :default => "", :null => false |
47 |
+ t.text "body", :default => "", :null => false |
48 |
+ t.boolean "rejected", :default => false, :null => false |
49 |
t.datetime "created_at" |
50 |
t.datetime "updated_at" |
51 |
t.integer "user_id" |
52 |
@@ -36,6 +36,7 @@ ActiveRecord::Schema.define(:version => 20110711074750) do |
53 |
t.datetime "key_timestamp" |
54 |
t.boolean "email_reminder_sent", :default => false, :null => false |
55 |
t.text "meeting_log", :default => "", :null => false |
56 |
+ t.text "summary" |
57 |
end |
58 |
|
59 |
add_index "agendas", ["state"], :name => "index_agendas_on_state" |
60 |
|
61 |
diff --git a/site/spec/models/agenda_spec.rb b/site/spec/models/agenda_spec.rb |
62 |
index f0dc747..00165d1 100644 |
63 |
--- a/site/spec/models/agenda_spec.rb |
64 |
+++ b/site/spec/models/agenda_spec.rb |
65 |
@@ -41,6 +41,17 @@ describe Agenda do |
66 |
end |
67 |
end |
68 |
|
69 |
+ it 'should allow council memebers to change summaries of old meetings' do |
70 |
+ a = Factory(:agenda, :state => 'old') |
71 |
+ a.summary = 'changed' |
72 |
+ |
73 |
+ for u in users_factory(:council, :council_admin) |
74 |
+ a.should be_editable_by(u) |
75 |
+ a.should be_editable_by(u, :summary) |
76 |
+ a.should be_updatable_by(u) |
77 |
+ end |
78 |
+ end |
79 |
+ |
80 |
def test_migration(object, migration, prohibited, allowed, final_state) |
81 |
# object - object to migrate |
82 |
# migration - migration name |