remetric 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2c25c7c747ca4f55f6842fcd45b1cbaab4ed7cd0
4
- data.tar.gz: 59dbb3448be5e0c4fbdae41764d2967d41b8a02d
3
+ metadata.gz: 77546f77d238fc45206765e8ae2551c59cb2fe90
4
+ data.tar.gz: de294904cd8dbaa5799a5d38ed04bc5696e95759
5
5
  SHA512:
6
- metadata.gz: db967d9df2a8fcbd257c1a4967ab84188b826932ceaa2c2f23ef3302df8558623bfa062fc46e812e96bd243d67c65514db1801f5abcf29c28c2fc358c993002c
7
- data.tar.gz: 76ffd2e8f33c48e18b794af6198b81cab687f653bbc2f8cacb3004f5dba1da15e2c9c70aca080a98814152eae1a7e294084f3a42c4eb5bc688fb3186872dc139
6
+ metadata.gz: 5120d49244db7e3a5dcc7411a75a38911960983dc86bc1670932a92b66c790a1b9747c087a5505b77e436a9c2c50f2a7b43d63f0559dead1021f3d09e8411c40
7
+ data.tar.gz: 47635a8dc7ef151eff22df0f3e9b3a9c67998553dc99adb9b16bbe7ece6f096a902a6275aa3e16c0adaafa5781b04bd975741823f1821eb6cdf41932c40c42d9
@@ -6,9 +6,10 @@
6
6
  @Remetric.load = ->
7
7
  $(window).resize()
8
8
 
9
- $(".table").on "click", "td", ->
10
- checkbox = $(this).find("input[type='checkbox']")
11
- checkbox.prop "checked", !checkbox.prop("checked")
9
+ $(".table").on "click", "td", (e) ->
10
+ unless $(e.target).is("input[type='checkbox']")
11
+ checkbox = $(this).find("input[type='checkbox']")
12
+ checkbox.prop "checked", !checkbox.prop("checked")
12
13
 
13
14
  $ ->
14
15
  Remetric.dialog.events()
@@ -6,6 +6,8 @@ module Remetric
6
6
 
7
7
  field :description
8
8
 
9
+ index({ description: 1 }, { unique: true, name: "event_description_index" })
10
+
9
11
  validates_presence_of :description
10
12
 
11
13
  before_create :attach_trackable_models
@@ -0,0 +1,7 @@
1
+ <% cache event do %>
2
+ <tr>
3
+ <td><%= event.linked_story.html_safe %></td>
4
+ <td style="display: none; "><%= event.to_json %></td>
5
+ <td><%= link_to "&rarr;".html_safe, event %></td>
6
+ </tr>
7
+ <% end %>
@@ -18,13 +18,7 @@
18
18
  </thead>
19
19
 
20
20
  <tbody>
21
- <% @events.each do |event| %>
22
- <tr>
23
- <td><%= event.linked_story.html_safe %></td>
24
- <td style="display: none; "><%= event.to_json %></td>
25
- <td><%= link_to "&rarr;".html_safe, event %></td>
26
- </tr>
27
- <% end %>
21
+ <%= render @events %>
28
22
  </tbody>
29
23
  </table>
30
24
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  <h1><%= @event.story %></h1>
4
4
 
5
- <p><%= @event.to_json %></p>
5
+ <pre><%= JSON.pretty_generate @event.attributes %></pre>
6
6
 
7
7
  <%= link_to 'Back', events_path %>
@@ -1,7 +1,9 @@
1
- <tr>
2
- <td><%= check_box_tag "trackable_#{trackable.id}", trackable.id, nil, class: "trackable_checkbox" %></td>
1
+ <% cache trackable do %>
2
+ <tr>
3
+ <td><%= check_box_tag "trackable_#{trackable.id}", trackable.id, nil, class: "trackable_checkbox" %></td>
3
4
 
4
- <% @cols.each do |c| %>
5
- <td><%= link_to trackable.data[c].to_s, trackable_path(trackable.model.pluralize, trackable.key) %></td>
6
- <% end %>
7
- </tr>
5
+ <% @cols.each do |c| %>
6
+ <td><%= link_to trackable.data[c].to_s, trackable_path(trackable.model.pluralize, trackable.key) %></td>
7
+ <% end %>
8
+ </tr>
9
+ <% end %>
@@ -2,6 +2,6 @@
2
2
 
3
3
  <h1><%= @trackable.key %></h1>
4
4
 
5
- <p><%= @trackable.data.to_json %></p>
5
+ <pre><%= JSON.pretty_generate @trackable.data %></pre>
6
6
 
7
7
  <%= link_to 'Back', :back %>
@@ -14,4 +14,12 @@ module Remetric
14
14
  Event.create data
15
15
  }
16
16
  end
17
+
18
+ def self.track_synchronous data = {}
19
+ Event.create data
20
+ end
21
+
22
+ def self.track! data = {}
23
+ Event.create! data
24
+ end
17
25
  end
@@ -1,3 +1,3 @@
1
1
  module Remetric
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.9"
3
3
  end
@@ -465,3 +465,15 @@ Remetric::EventTest: test_the_truth
465
465
  ------------------------
466
466
  RemetricTest: test_truth
467
467
  ------------------------
468
+ SQL (29.3ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"
469
+ SQL (0.3ms) CREATE EXTENSION IF NOT EXISTS "hstore"
470
+  (37.6ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL) 
471
+  (4.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
472
+  (0.8ms) SELECT version FROM "schema_migrations"
473
+  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
474
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
475
+ ActiveRecord::SchemaMigration Load (0.7ms) SELECT "schema_migrations".* FROM "schema_migrations"
476
+ SQL (0.8ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"
477
+ SQL (0.3ms) CREATE EXTENSION IF NOT EXISTS "hstore"
478
+  (0.2ms) SELECT version FROM "schema_migrations"
479
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
@@ -0,0 +1,13 @@
1
+ require 'test_helper'
2
+
3
+ class RemetricTest < ActiveSupport::TestCase
4
+ test "sdfds" do
5
+ Remetric.track description: "Awesome", user: User.last
6
+ assert_equal 1, Remetric::Event.count
7
+ end
8
+
9
+ test "sdfds" do
10
+ Remetric.track description: "Awesome", user: User.last
11
+ assert_equal 1, Remetric::Event.count
12
+ end
13
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: remetric
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dallas Read
@@ -155,6 +155,7 @@ files:
155
155
  - app/views/remetric/application/_nav.html.erb
156
156
  - app/views/remetric/dashboard/index.html.erb
157
157
  - app/views/remetric/dashboard/settings.html.erb
158
+ - app/views/remetric/events/_event.html.erb
158
159
  - app/views/remetric/events/index.html.erb
159
160
  - app/views/remetric/events/show.html.erb
160
161
  - app/views/remetric/trackables/_form.html.erb
@@ -329,6 +330,7 @@ files:
329
330
  - test/dummy/tmp/cache/assets/development/sprockets/ff91cdc7d41ec915a2db3524da4c962f
330
331
  - test/fixtures/remetric/people.yml
331
332
  - test/fixtures/remetric/trackables.yml
333
+ - test/integration/track_test.rb
332
334
  - test/models/remetric/event_test.rb
333
335
  - test/remetric_test.rb
334
336
  - test/test_helper.rb
@@ -512,6 +514,7 @@ test_files:
512
514
  - test/dummy/tmp/cache/assets/development/sprockets/ff91cdc7d41ec915a2db3524da4c962f
513
515
  - test/fixtures/remetric/people.yml
514
516
  - test/fixtures/remetric/trackables.yml
517
+ - test/integration/track_test.rb
515
518
  - test/models/remetric/event_test.rb
516
519
  - test/remetric_test.rb
517
520
  - test/test_helper.rb