Skip to content

Commit c19a0b7

Browse files
authored
remove handcoded json (joemasilotti#575)
1 parent 9699067 commit c19a0b7

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

app/models/open_startup/metric.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module OpenStartup
22
class Metric < ApplicationRecord
33
self.table_name = "open_startup_metrics"
44

5-
store :data, accessors: %i[mrr visitors], coder: JSON
5+
store_accessor :data, :mrr, :visitors
66

77
validates :occurred_on, presence: true
88

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
one:
22
occurred_on: 2022-01-01
3-
data: "{\"mrr\": 1000, \"visitors\": 5000}"
3+
data:
4+
mrr: 1000
5+
visitors: 5000

0 commit comments

Comments
 (0)