Module: DataControllerConfiguration

Extended by:
ActiveSupport::Concern
Defined in:
app/controllers/concerns/data_controller_configuration.rb

Defined Under Namespace

Modules: ProjectDataControllerConfiguration, SharedDataControllerConfiguration

Instance Method Summary collapse

Instance Method Details



10
11
12
13
14
15
16
17
18
# File 'app/controllers/concerns/data_controller_configuration.rb', line 10

def related
  if @data_model.is_community?
    @object = @data_model.find(params[:id])
  else
    @object = @data_model.where(project_id: sessions_current_project_id).find(params[:id])
  end

  render '/shared/data/project/related'
end

#set_data_modelObject (protected)

!! This needs to be redefined in STI model controllers (e.g. see Georeferences::GeoLocates controller) !! TODO- merge this into hub_model_metadata



28
29
30
# File 'app/controllers/concerns/data_controller_configuration.rb', line 28

def set_data_model
  @data_model = controller_name.classify.safe_constantize # was constantize
end

#set_hub_model_metadataObject (protected)



32
33
34
# File 'app/controllers/concerns/data_controller_configuration.rb', line 32

def 
  @hub_model_metadata = Hub::Data::BY_NAME[@data_model.name]
end

#set_is_data_controllerObject (protected)



22
23
24
# File 'app/controllers/concerns/data_controller_configuration.rb', line 22

def set_is_data_controller
  @is_data_controller = true
end