aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoachim Filip Ignacy Bartosik <jbartosik@gmail.com>2011-07-21 13:13:32 +0200
committerJoachim Filip Ignacy Bartosik <jbartosik@gmail.com>2011-07-25 15:32:20 +0200
commit2a18ee45abf989b67ac868ee2fc2b81293a7e74a (patch)
treeccb9b94c2e88ded4621bc0d6846f4ce324d45399
parentImprove tests coverage (diff)
downloadcouncil-webapp-2a18ee45abf989b67ac868ee2fc2b81293a7e74a.tar.gz
council-webapp-2a18ee45abf989b67ac868ee2fc2b81293a7e74a.tar.bz2
council-webapp-2a18ee45abf989b67ac868ee2fc2b81293a7e74a.zip
Add summary field
-rw-r--r--site/app/models/agenda.rb1
-rw-r--r--site/db/schema.rb11
-rw-r--r--site/spec/models/agenda_spec.rb11
3 files changed, 18 insertions, 5 deletions
diff --git a/site/app/models/agenda.rb b/site/app/models/agenda.rb
index 680773a..bf38838 100644
--- a/site/app/models/agenda.rb
+++ b/site/app/models/agenda.rb
@@ -6,6 +6,7 @@ class Agenda < ActiveRecord::Base
meeting_time :datetime
email_reminder_sent :boolean
meeting_log :text
+ summary :text
timestamps
end
diff --git a/site/db/schema.rb b/site/db/schema.rb
index 641ac4b..a6232e1 100644
--- a/site/db/schema.rb
+++ b/site/db/schema.rb
@@ -10,13 +10,13 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20110711074750) do
+ActiveRecord::Schema.define(:version => 20110721103758) do
create_table "agenda_items", :force => true do |t|
- t.string "title", :default => "", :null => false
- t.string "discussion", :default => "", :null => false
- t.text "body", :default => "", :null => false
- t.boolean "rejected", :default => false, :null => false
+ t.string "title", :default => "", :null => false
+ t.string "discussion", :default => "", :null => false
+ t.text "body", :default => "", :null => false
+ t.boolean "rejected", :default => false, :null => false
t.datetime "created_at"
t.datetime "updated_at"
t.integer "user_id"
@@ -36,6 +36,7 @@ ActiveRecord::Schema.define(:version => 20110711074750) do
t.datetime "key_timestamp"
t.boolean "email_reminder_sent", :default => false, :null => false
t.text "meeting_log", :default => "", :null => false
+ t.text "summary"
end
add_index "agendas", ["state"], :name => "index_agendas_on_state"
diff --git a/site/spec/models/agenda_spec.rb b/site/spec/models/agenda_spec.rb
index f0dc747..00165d1 100644
--- a/site/spec/models/agenda_spec.rb
+++ b/site/spec/models/agenda_spec.rb
@@ -41,6 +41,17 @@ describe Agenda do
end
end
+ it 'should allow council memebers to change summaries of old meetings' do
+ a = Factory(:agenda, :state => 'old')
+ a.summary = 'changed'
+
+ for u in users_factory(:council, :council_admin)
+ a.should be_editable_by(u)
+ a.should be_editable_by(u, :summary)
+ a.should be_updatable_by(u)
+ end
+ end
+
def test_migration(object, migration, prohibited, allowed, final_state)
# object - object to migrate
# migration - migration name