Removed "notification type" since WAGNI (yet)

We figured that doing without it was more like the simplest thing that
could possibly work.

Note that we edited the migration in place after rolling back.  This
would cause problems if anyone had downloaded the code from pozorvlak's
repo the other day and run it, but we're assuming they didn't (since
they wouldn't have got anything interesting out of it anyway.)
This commit is contained in:
Skud committed 2013-02-15 23:58:27 +11:00
1 parent e41f70db71
commit a2cfd44de4
11 files changed
+10 -57

No files matched your search

+1 -2
View File
@@ -1,7 +1,6 @@
class Notification < ActiveRecord::Base
attr_accessible :to_id, :from_id,
:subject, :body, :post_id,
:notification_type, :read
:subject, :body, :post_id, :read
belongs_to :sender, :class_name => 'Member', :foreign_key => 'from_id'
belongs_to :recipient, :class_name => 'Member', :foreign_key => 'to_id'
-3
View File
@@ -21,9 +21,6 @@
.field
= f.label :read
= f.check_box :read
.field
= f.label :notification_type
= f.number_field :notification_type
.field
= f.label :post_id
= f.number_field :post_id
-2
View File
@@ -7,7 +7,6 @@
%th Subject
%th Body
%th Read
%th Notification type
%th Post
%th
%th
@@ -20,7 +19,6 @@
%td= notification.subject
%td= notification.body
%td= notification.read
%td= notification.notification_type
%td= notification.post_id
%td= link_to 'Show', notification
%td= link_to 'Edit', edit_notification_path(notification)
-3
View File
@@ -15,9 +15,6 @@
%p
%b Read:
= @notification.read
%p
%b Notification type:
= @notification.notification_type
%p
%b Post:
= @notification.post_id
@@ -6,7 +6,6 @@ class CreateNotifications < ActiveRecord::Migration
t.string :subject
t.text :body
t.boolean :read
t.integer :notification_type
t.integer :post_id
t.timestamps
+9 -36
View File
@@ -11,14 +11,14 @@
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20130214034838) do
ActiveRecord::Schema.define(:version => 20130212123628) do
create_table "comments", :force => true do |t|
t.integer "post_id", :limit => 255, :null => false
t.integer "author_id", :limit => 255, :null => false
t.text "body", :limit => 255, :null => false
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.integer "post_id", :null => false
t.integer "author_id", :null => false
t.text "body", :null => false
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "crops", :force => true do |t|
@@ -32,14 +32,6 @@ ActiveRecord::Schema.define(:version => 20130214034838) do
add_index "crops", ["slug"], :name => "index_crops_on_slug", :unique => true
add_index "crops", ["system_name"], :name => "index_crops_on_system_name"
create_table "forums", :force => true do |t|
t.string "name", :null => false
t.text "description", :null => false
t.integer "owner_id", :null => false
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "gardens", :force => true do |t|
t.string "name", :null => false
t.integer "owner_id"
@@ -76,9 +68,6 @@ ActiveRecord::Schema.define(:version => 20130214034838) do
t.string "slug"
t.boolean "tos_agreement"
t.boolean "show_email"
t.string "location"
t.float "latitude"
t.float "longitude"
end
add_index "members", ["confirmation_token"], :name => "index_users_on_confirmation_token", :unique => true
@@ -87,23 +76,15 @@ ActiveRecord::Schema.define(:version => 20130214034838) do
add_index "members", ["slug"], :name => "index_users_on_slug", :unique => true
add_index "members", ["unlock_token"], :name => "index_users_on_unlock_token", :unique => true
create_table "members_roles", :force => true do |t|
t.integer "member_id"
t.integer "role_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "notifications", :force => true do |t|
t.integer "from_id"
t.integer "to_id", :null => false
t.integer "to_id", :null => false
t.string "subject"
t.text "body"
t.boolean "read"
t.integer "notification_type"
t.integer "post_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "plantings", :force => true do |t|
@@ -126,19 +107,11 @@ ActiveRecord::Schema.define(:version => 20130214034838) do
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.string "slug"
t.integer "forum_id"
end
add_index "posts", ["created_at", "author_id"], :name => "index_updates_on_created_at_and_user_id"
add_index "posts", ["slug"], :name => "index_updates_on_slug", :unique => true
create_table "roles", :force => true do |t|
t.string "name", :null => false
t.text "description"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "scientific_names", :force => true do |t|
t.string "scientific_name", :null => false
t.integer "crop_id", :null => false
-1
View File
@@ -7,7 +7,6 @@ FactoryGirl.define do
subject "MyString"
body "MyText"
read false
notification_type 1
post
end
end
@@ -8,7 +8,6 @@ describe "notifications/edit" do
:subject => "MyString",
:body => "MyText",
:read => false,
:notification_type => 1,
:post_id => 1
))
end
@@ -23,7 +22,6 @@ describe "notifications/edit" do
assert_select "input#notification_subject", :name => "notification[subject]"
assert_select "textarea#notification_body", :name => "notification[body]"
assert_select "input#notification_read", :name => "notification[read]"
assert_select "input#notification_notification_type", :name => "notification[notification_type]"
assert_select "input#notification_post_id", :name => "notification[post_id]"
end
end
@@ -9,7 +9,6 @@ describe "notifications/index" do
:subject => "Subject",
:body => "MyText",
:read => false,
:notification_type => 3,
:post_id => 4
),
stub_model(Notification,
@@ -18,7 +17,6 @@ describe "notifications/index" do
:subject => "Subject",
:body => "MyText",
:read => false,
:notification_type => 3,
:post_id => 4
)
])
@@ -32,7 +30,6 @@ describe "notifications/index" do
assert_select "tr>td", :text => "Subject".to_s, :count => 2
assert_select "tr>td", :text => "MyText".to_s, :count => 2
assert_select "tr>td", :text => false.to_s, :count => 2
assert_select "tr>td", :text => 3.to_s, :count => 2
assert_select "tr>td", :text => 4.to_s, :count => 2
end
end
@@ -8,7 +8,6 @@ describe "notifications/new" do
:subject => "MyString",
:body => "MyText",
:read => false,
:notification_type => 1,
:post_id => 1
).as_new_record)
end
@@ -23,7 +22,6 @@ describe "notifications/new" do
assert_select "input#notification_subject", :name => "notification[subject]"
assert_select "textarea#notification_body", :name => "notification[body]"
assert_select "input#notification_read", :name => "notification[read]"
assert_select "input#notification_notification_type", :name => "notification[notification_type]"
assert_select "input#notification_post_id", :name => "notification[post_id]"
end
end
@@ -8,7 +8,6 @@ describe "notifications/show" do
:subject => "Subject",
:body => "MyText",
:read => false,
:notification_type => 3,
:post_id => 4
))
end
@@ -21,7 +20,6 @@ describe "notifications/show" do
rendered.should match(/Subject/)
rendered.should match(/MyText/)
rendered.should match(/false/)
rendered.should match(/3/)
rendered.should match(/4/)
end
end