⌘T | go to file |
⌘⌃P | go to project |
⌘R | go to methods |
⌃G | go to line |
⌘KB | toggle side bar |
⌘⇧P | command prompt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#-----数据库schema | |
#attachable 为虚拟属性,为兼容以后的私信notif之类的 | |
create_table :notifications do |t| | |
t.belongs_to :user | |
t.references :attachable, :polymorphic => true | |
t.text :content | |
t.timestamps | |
end | |
add_index :notifications, :user_id | |
add_index :notifications, [:attachable_id, :attachable_type] |