Sha256: 8ccd86b6c46e4cf03a7fb0c051c4b329c2b081c6bca625f26ca17411ebf25bab

Contents?: true

Size: 762 Bytes

Versions: 59

Compression:

Stored size: 762 Bytes

Contents

module Auth::Concerns::ActivityControllerConcern
	
	extend ActiveSupport::Concern

	included do 

		respond_to :html,:json,:js

	end

	##@used_in: jquery.calendario.js
	##@param[Hash] : params should have range key(which is itself a hash, and a user_id key which is a string.), {range: {"from" => date[format: ], "to" => date[format: ]}, user_id: String}
	##@return[Hash]: timestamp => activity_object hashified.
	def get_activities
		filt_test = permitted_params
		activities_hash = model.get_in_range(filt_test)
		respond_with activities_hash
	end

	
	

	##gives the model class from the underlying controller
	def model
		Object.const_get(controller_name.classify)
	end

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

end

Version data entries

59 entries across 59 versions & 1 rubygems

Version Path
wordjelly-auth-1.6.0 app/controllers/auth/concerns/activity_controller_concern.rb
wordjelly-auth-1.5.9 app/controllers/auth/concerns/activity_controller_concern.rb
wordjelly-auth-1.5.8 app/controllers/auth/concerns/activity_controller_concern.rb
wordjelly-auth-1.5.7 app/controllers/auth/concerns/activity_controller_concern.rb
wordjelly-auth-1.5.6 app/controllers/auth/concerns/activity_controller_concern.rb
wordjelly-auth-1.5.5 app/controllers/auth/concerns/activity_controller_concern.rb
wordjelly-auth-1.5.4 app/controllers/auth/concerns/activity_controller_concern.rb
wordjelly-auth-1.5.3 app/controllers/auth/concerns/activity_controller_concern.rb
wordjelly-auth-1.5.2 app/controllers/auth/concerns/activity_controller_concern.rb
wordjelly-auth-1.5.1 app/controllers/auth/concerns/activity_controller_concern.rb
wordjelly-auth-1.5.0 app/controllers/auth/concerns/activity_controller_concern.rb
wordjelly-auth-1.4.9 app/controllers/auth/concerns/activity_controller_concern.rb
wordjelly-auth-1.4.8 app/controllers/auth/concerns/activity_controller_concern.rb
wordjelly-auth-1.4.7 app/controllers/auth/concerns/activity_controller_concern.rb
wordjelly-auth-1.4.6 app/controllers/auth/concerns/activity_controller_concern.rb
wordjelly-auth-1.4.5 app/controllers/auth/concerns/activity_controller_concern.rb
wordjelly-auth-1.4.4 app/controllers/auth/concerns/activity_controller_concern.rb
wordjelly-auth-1.4.3 app/controllers/auth/concerns/activity_controller_concern.rb
wordjelly-auth-1.4.2 app/controllers/auth/concerns/activity_controller_concern.rb
wordjelly-auth-1.4.0 app/controllers/auth/concerns/activity_controller_concern.rb