Class: Auth::System::Instant

Inherits:
Object
  • Object
show all
Includes:
Mongoid::Document
Defined in:
app/models/auth/system/instant.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.build_instants(start_date, end_date, product_ids) ⇒ Object



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'app/models/auth/system/instant.rb', line 18

def self.build_instants(start_date,end_date,product_ids)
	product_ids.each do |product_id|
		begin
			product = Auth.configuration.product_class.constantize.find(product_id)

			product.max_at_any_instant.times do |product_count|

				## so the first step is to pass a fictional product count to the products

				## we will have to iterate wherever that entity was being used in those minutes -> there it will have to 
				## this could become hundreds of thousands of updates
				## that doesnt make sense
				## actually
				## ideally we should only be booking that entity.
				## and later on doing some kind of join.
				## so suppose i search for just the capacity
				## for some minute brackets, for those capacities, they get taken
				## if you only want to update the minute based schedules when something changes, then 


			end


		rescue Mongoid::Errors::DocumentNotFound

		end 
	end 
end

Instance Method Details

#geomObject

the location data for this thing.



15
# File 'app/models/auth/system/instant.rb', line 15

field :geom, type: Array

#product_countObject

it can have a product count



9
# File 'app/models/auth/system/instant.rb', line 9

field :product_count, type: Integer

#product_idObject

it will have a product id.



12
# File 'app/models/auth/system/instant.rb', line 12

field :product_id, type: String