Skip to content
Snippets Groups Projects
Commit 29f77c7a authored by Mateus Rambo Strey's avatar Mateus Rambo Strey
Browse files

change LearningObject's metadata column to jsonb

parent 29b358d0
No related branches found
No related tags found
No related merge requests found
......@@ -9,8 +9,8 @@ module Metadatable
def get_metadata_values_of key
values = []
if metadata.is_a? String
JSON.parse(metadata).each do |m|
unless metadata.blank?
metadata.each do |m|
m = m.with_indifferent_access
values << m["value"] if m["key"] == key
end
......
......@@ -7,10 +7,10 @@ class CreateLearningObjects < ActiveRecord::Migration
t.text :description
t.datetime :published_at
t.string :object_type
t.integer :score
t.integer :score, default: 0
t.integer :school_level
t.string :language
t.text :metadata
t.jsonb :metadata, default: {}
t.text :bitstreams
t.string :thumbnail
t.text :keywords
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment