Skip to content
Snippets Groups Projects
Commit ce6ed498 authored by Marcela Ribeiro de Oliveira's avatar Marcela Ribeiro de Oliveira
Browse files

LearningObject default_types

parent 0df902c1
No related branches found
No related tags found
No related merge requests found
......@@ -22,8 +22,8 @@ class LearningObjectsController < ApplicationController
@learning_object = LearningObject.new
@school_levels = ['Educação Infantil', 'Ensino Fundamental', 'Ensino Médio']
# @subjects = Subject.default_list
@types = learning_object_repository.types
# @languages = language_repository.all
@types = LearningObject.default_types
@languages = Language.all
end
# GET /learning_objects/1/edit
......
......@@ -3,7 +3,7 @@ class SubjectsController < ApplicationController
# GET /subjects
# GET /subjects.json
def index
@subjects = subject_repository.all
@subjects = Topic.all
end
# GET /subjects/1
......
class Language
include ActiveModel::Model
class Language < ActiveRecord::Base
include RepositoriesProxy
include OrientDbSerializable
include Metadatable
attr_accessor :id, :name, :code
end
\ No newline at end of file
end
......@@ -49,6 +49,12 @@ class LearningObject < ActiveRecord::Base
get_metadata_value_of 'dc.object.url'
end
def self.default_types
Rails.cache.fetch("cache/object_type", expires_in: 24.hours) do
LearningObject.select(:object_type).uniq
end
end
##checks if learning object link to an url.
#returns boolean
def has_url_reference?
......
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