Class: Leva::Dataset
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Leva::Dataset
- Defined in:
- app/models/leva/dataset.rb
Instance Method Summary collapse
-
#add_record(record) ⇒ Leva::DatasetRecord?
Adds a record to the dataset if it doesn’t already exist.
Instance Method Details
#add_record(record) ⇒ Leva::DatasetRecord?
Adds a record to the dataset if it doesn’t already exist
22 23 24 25 26 |
# File 'app/models/leva/dataset.rb', line 22 def add_record(record) dataset_records.find_or_create_by(recordable: record) do |dr| dr.recordable = record end end |