We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9699067 commit c19a0b7Copy full SHA for c19a0b7
app/models/open_startup/metric.rb
@@ -2,7 +2,7 @@ module OpenStartup
2
class Metric < ApplicationRecord
3
self.table_name = "open_startup_metrics"
4
5
- store :data, accessors: %i[mrr visitors], coder: JSON
+ store_accessor :data, :mrr, :visitors
6
7
validates :occurred_on, presence: true
8
test/fixtures/open_startup/metrics.yml
@@ -1,3 +1,5 @@
1
one:
occurred_on: 2022-01-01
- data: "{\"mrr\": 1000, \"visitors\": 5000}"
+ data:
+ mrr: 1000
+ visitors: 5000
0 commit comments