Skip to content
Snippets Groups Projects
Commit e96f1ae0 authored by Mauricio Giacomini Girardello's avatar Mauricio Giacomini Girardello
Browse files

Merge branch 'fix-activerecord-migration'

parents 3a1f5d99 13180f08
No related branches found
No related tags found
No related merge requests found
...@@ -111,7 +111,7 @@ class LearningObjectsController < ApplicationController ...@@ -111,7 +111,7 @@ class LearningObjectsController < ApplicationController
def build_subjects(subjects) def build_subjects(subjects)
subjects.map do |subject| subjects.map do |subject|
subject_repository.find subject Topic.find subject
end end
end end
......
class SearchController < ApplicationController class SearchController < ApplicationController
def index def index
@types = learning_object_repository.types @types = LearningObject.default_types
@subjects = Topic.default_list @subjects = Topic.default_list
......
class Language < ActiveRecord::Base class Language < ActiveRecord::Base
include RepositoriesProxy
include Metadatable
attr_accessor :id, :name, :code has_many :learning_object
end end
...@@ -13,6 +13,8 @@ class LearningObject < ActiveRecord::Base ...@@ -13,6 +13,8 @@ class LearningObject < ActiveRecord::Base
belongs_to :publisher, polymorphic: true belongs_to :publisher, polymorphic: true
belongs_to :language
validates_presence_of :name, :id_dspace validates_presence_of :name, :id_dspace
validates_uniqueness_of :id_dspace validates_uniqueness_of :id_dspace
......
class CreateLanguages < ActiveRecord::Migration
def change
create_table :languages do |t|
t.string :name
t.timestamps null: false
end
end
end
class RemoveLanguageFromLearningObject < ActiveRecord::Migration
def change
remove_column :learning_objects, :language, :string
end
end
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