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



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

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

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

- (Object) set_data_model (protected)

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



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

def set_data_model
  @data_model = controller_name.classify.constantize
end

- (Object) set_hub_model_metadata (protected)



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

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

- (Object) set_is_data_controller (protected)



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

def set_is_data_controller 
  @is_data_controller = true
end