Method: EasyData.refresh_information

Defined in:
lib/easy_data.rb

.refresh_informationObject



67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# File 'lib/easy_data.rb', line 67

def self.refresh_information
   rdf = ModelRdf.new
   models = DataModels.load_models

   unless self.info_update?(models,rdf)
     rdf_models = rdf.get_models.keys

     #Add the new models to rdf's information file
     models.each do |model|
      unless rdf_models.keys.include? model
       model_data = DataModels.get_model_data(model)
       if model_data.respond_to?:columns 
         rdf.add_model(model,EasyData.yaml_description_model(eval model))
       end
      end
     end

     #Delete the models how they had deleted
     rdf_models.each do |model|
      unless models.include?model
        rdf.delete_model model
      end
     end

     rdf.save       
   end
end