Commit 4b3950456d666bc92fcf123532e73ae82c3c5e12

Authored by Dmitriy Zaporozhets
1 parent cf6d4dc1

notification level for user

app/models/user.rb
... ... @@ -54,6 +54,13 @@ class User < ActiveRecord::Base
54 54  
55 55  
56 56 #
  57 + # Notification levels
  58 + #
  59 + N_DISABLED = 0
  60 + N_PARTICIPATING = 1
  61 + N_WATCH = 2
  62 +
  63 + #
57 64 # Relations
58 65 #
59 66  
... ...
db/migrate/20130325173941_add_notification_level_to_user.rb 0 → 100644
... ... @@ -0,0 +1,5 @@
  1 +class AddNotificationLevelToUser < ActiveRecord::Migration
  2 + def change
  3 + add_column :users, :notification_level, :integer, null: false, default: 1
  4 + end
  5 +end
... ...
db/schema.rb
... ... @@ -11,7 +11,7 @@
11 11 #
12 12 # It's strongly recommended to check this file into your version control system.
13 13  
14   -ActiveRecord::Schema.define(:version => 20130318212250) do
  14 +ActiveRecord::Schema.define(:version => 20130325173941) do
15 15  
16 16 create_table "events", :force => true do |t|
17 17 t.string "target_type"
... ... @@ -270,6 +270,7 @@ ActiveRecord::Schema.define(:version =&gt; 20130318212250) do
270 270 t.boolean "can_create_team", :default => true, :null => false
271 271 t.string "state"
272 272 t.integer "color_scheme_id", :default => 1, :null => false
  273 + t.integer "notification_level", :default => 1, :null => false
273 274 end
274 275  
275 276 add_index "users", ["admin"], :name => "index_users_on_admin"
... ...