Module: Auth::Concerns::ActivityControllerConcern

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

Instance Method Summary collapse

Instance Method Details

#get_activitiesObject

@used_in: jquery.calendario.js @param : params should have range key(which is itself a hash, and a user_id key which is a string.), {“from” => date[format: ], “to” => date[format: ], user_id: String} @return: timestamp => activity_object hashified.



14
15
16
17
18
# File 'app/controllers/auth/concerns/activity_controller_concern.rb', line 14

def get_activities
	filt_test = permitted_params
	activities_hash = model.get_in_range(filt_test)
	respond_with activities_hash
end

#modelObject

gives the model class from the underlying controller



24
25
26
# File 'app/controllers/auth/concerns/activity_controller_concern.rb', line 24

def model
	Object.const_get(controller_name.classify)
end

#permitted_paramsObject



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

def permitted_params
	params.permit(:user_id, range: [:from, :to], only: [])
end