Skip to content

Commit 733e052

Browse files
committed
SiteNode 的 counter_cache 去掉,没用处,外加上目前 Mongoid 在这里有个 的 Bug;
1 parent 7becefa commit 733e052

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

app/assets/javascripts/app.coffee

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ window.App =
3535
faye_server_url : ''
3636
asset_url : ''
3737
root_url : ''
38-
38+
3939
isLogined : ->
4040
App.current_user_id != null
4141

@@ -66,7 +66,7 @@ window.App =
6666
if !App.isLogined()
6767
location.href = "/account/sign_in"
6868
return false
69-
69+
7070
$el = $(el)
7171
likeable_type = $el.data("type")
7272
likeable_id = $el.data("id")
@@ -154,7 +154,6 @@ window.App =
154154
$(document).attr("title", new_title)
155155
true
156156

157-
158157
init : () ->
159158
App.initForDesktopView()
160159
FormStorage.restore()

app/models/site.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ class Site
1111
field :desc
1212

1313
belongs_to :site_node
14-
counter_cache :name => :site_node, :inverse_of => :sites
1514
belongs_to :user
1615

1716
validates_presence_of :url, :name, :site_node_id

app/models/site_node.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ class SiteNode
44
include Mongoid::BaseModel
55

66
field :name
7-
field :sites_count, :type => Integer
8-
field :sort, :type => Integer, :default => 0
7+
field :sort, type: Integer, default: 0
98
has_many :sites
109

1110
validates_presence_of :name

0 commit comments

Comments
 (0)