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
# 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: sessions_current_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



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

def set_data_model
  @data_model = controller_name.classify.constantize
end

- (Object) set_hub_model_metadata (protected)



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

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

- (Object) set_is_data_controller (protected)



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

def set_is_data_controller
  @is_data_controller = true
end