Skip to content

Commit 89c6cb8

Browse files
committed
Merge branch 'patch-1' of git://github.com/mixan946/sync into mixan946-patch-1
2 parents 68e5623 + ca9c810 commit 89c6cb8

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

lib/sync/partial.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def sync(action)
3030
end
3131

3232
def message(action)
33-
Sync.client.build_message channel_for_action(action),
33+
Sync.client.build_message channel_for_action(action),
3434
html: (render_to_string unless action.to_s == "destroy")
3535
end
3636

@@ -71,8 +71,7 @@ def path
7171

7272
def locals
7373
locals_hash = {}
74-
locals_hash[resource.name.to_sym] = resource.model
75-
74+
locals_hash[resource.base_name.to_sym] = resource.model
7675
locals_hash
7776
end
7877

lib/sync/resource.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ def id
5151
def name
5252
model.class.model_name.to_s.underscore
5353
end
54+
55+
def base_name
56+
name.split('/').last
57+
end
5458

5559
def plural_name
5660
name.pluralize

0 commit comments

Comments
 (0)