tawork 0.0.27 → 0.0.28

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MjVlMjAxYTU3YmZkNGI2NmI1YzBmNDMyMzFhYjM1MTFiYTg5N2ZkNw==
4
+ ZWE0YjRhNmIyNzQwY2YyMjczNDgzYWJmYjM0ZjZjN2FjMWQyMDhlYw==
5
5
  data.tar.gz: !binary |-
6
- ZDJlMTc1MDUyOGMyMjExNzVhYTRjYWFjNzA4YmE0NjhkYmMyMTk1ZQ==
6
+ OWRlNGYwNDE2N2FhM2QxMGI0N2QyZDdjYzczZTRmMTkxN2JiMzFlOQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ODljMDdlMTA2ZWEwM2MxZWE1OTE0Y2IxMDE5OTJiZjhmYzFlYzFlNDUxN2Fl
10
- MWM1MTU0ZmYyYmJiYzE1NWM5YWNjZTVmMTYxYWZkM2I4YzMwY2YwMmEwYjc0
11
- ZGI5M2I1YmUzOTJhMWJiOWI2M2ZjN2Q2YzM4Y2Q0YTEyYjBlZWY=
9
+ OTkwNmQxNDBjN2IwMzQ5MmI0YjBmMzEwZGU4ZGI2MzVhZTczY2ZjOTNhMGVl
10
+ NTMzNTI3ODE5NjdkYzM2ZmI2MjUxNTBhYjEyOGFlNzdhZWI0MTAzZjA5Yzhk
11
+ ZGVlMTljZWU1OWU0MjIzYzgwNmUyMWE3ODdjMjQyZDUxOTljNDU=
12
12
  data.tar.gz: !binary |-
13
- ODk3NjIwZTVkOWI2MDk5MDkxNzllYTk3Y2VlOGIxNjJmM2RkOWZkNzEzYTc0
14
- OWFkMjc0YWExZTQ1ZmM0MGE2OWQ0YWE1ODMyMDU2MGI3MTkzZjAyOTQxZWYy
15
- NWZkMDMwNWM2NTA3NDI5NGY0MjczNGZmM2EzZjAyYWYxZTRmNWE=
13
+ N2JjOTc0YjBiMTY5Y2JlYjY5YmJmNTIxNzNiNzY3NWNlYWI5ZmU1MDVhM2Fm
14
+ YmJkMTdhMjMxMGYwODNlM2I1NjdlMzk2NDkyOTliYTEzY2QwMzg0YmExYTRh
15
+ NTFiMjUyNjI2NDM1ZDhkYzg4ZjE4N2U1MjJmMDJiZTM0ZjM1OWQ=
@@ -15,7 +15,7 @@ class SearchController < ApplicationController
15
15
  search_group = "attachments"
16
16
  end
17
17
 
18
- q = ["title:#{q}*", "filename:#{q}*", "name:#{q}*", "email:#{q}*"].join(" OR ")
18
+ q = ["title:#{q}", "filename:#{q}", "name:#{q}", "email:#{q}"].join(" OR ")
19
19
  @searcher = Searcher.search q: q, search_group: search_group
20
20
 
21
21
  results = []
@@ -17,10 +17,4 @@ module ApplicationHelper
17
17
  )
18
18
  end
19
19
  end
20
-
21
- def link_to_trackable activity, path
22
- link = send(:"#{path}_path", (activity.trackable || "deleted-#{activity.trackable_id}"))
23
-
24
- link_to((activity.trackable.try(:title) || "[Deleted Page]"), link)
25
- end
26
20
  end
@@ -1,4 +1,4 @@
1
1
  - content_for :action, flush: true do
2
- added attachment to page #{link_to_trackable activity, "wiki_page"}
2
+ added attachment to page #{link_to activity.trackable.title, wiki_page_path(activity.trackable)}
3
3
 
4
4
 
@@ -1,4 +1,4 @@
1
1
  - content_for :action, flush: true do
2
- created page #{link_to_trackable activity, "wiki_page"}
2
+ created page #{link_to activity.trackable.title, wiki_page_path(activity.trackable)}
3
3
 
4
4
 
@@ -1,2 +1,2 @@
1
1
  - content_for :action, flush: true do
2
- reordered the page: #{link_to_trackable activity, "wiki_page"}
2
+ reordered the page: #{link_to activity.trackable.title, wiki_page_path(activity.trackable)}
@@ -1,4 +1,4 @@
1
1
  - content_for :action, flush: true do
2
- updated page #{link_to_trackable activity, "wiki_page"}
2
+ updated page #{link_to activity.trackable.title, wiki_page_path(activity.trackable)}
3
3
 
4
4
 
@@ -0,0 +1 @@
1
+ require 'extensions'
@@ -0,0 +1,30 @@
1
+ require 'public_activity/models/activity'
2
+
3
+ module PublicActivity
4
+ class Activity
5
+ def trackable
6
+ track = super
7
+ track = DeletedTrackable.new(self) if !track
8
+
9
+ track
10
+ end
11
+ end
12
+
13
+ class DeletedTrackable
14
+ def initialize(activity)
15
+ @activity = activity
16
+ end
17
+
18
+ def id
19
+ @activity.trackable_id
20
+ end
21
+
22
+ def to_param
23
+ ["deleted", @activity.trackable_id].join("-")
24
+ end
25
+
26
+ def title
27
+ "[Deleted #{@activity.trackable_type}]"
28
+ end
29
+ end
30
+ end
data/lib/extensions.rb ADDED
@@ -0,0 +1,2 @@
1
+ puts "YEEE"
2
+ require 'ext/public_activity'
@@ -1,3 +1,3 @@
1
1
  module Tawork
2
- VERSION = '0.0.27'
2
+ VERSION = '0.0.28'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tawork
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.27
4
+ version: 0.0.28
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adnan Ali
@@ -193,6 +193,7 @@ files:
193
193
  - config/initializers/config.rb
194
194
  - config/initializers/devise.rb
195
195
  - config/initializers/elasticsearch.rb
196
+ - config/initializers/extensions.rb
196
197
  - config/initializers/filter_parameter_logging.rb
197
198
  - config/initializers/gollum.rb
198
199
  - config/initializers/haml_gfm.rb
@@ -230,6 +231,8 @@ files:
230
231
  - db/seeds.rb
231
232
  - init.rb
232
233
  - lib/assets/.keep
234
+ - lib/ext/public_activity.rb
235
+ - lib/extensions.rb
233
236
  - lib/searcher.rb
234
237
  - lib/tasks/.keep
235
238
  - lib/tawork.rb