Module: Promiscuous::Publisher::Model::Mock
- Extended by:
- ActiveSupport::Concern
- Includes:
- Ephemeral
- Defined in:
- lib/promiscuous/publisher/model/mock.rb
Defined Under Namespace
Modules: ClassMethods
Instance Attribute Summary
Attributes included from Ephemeral
#destroyed, #id, #new_record
Instance Method Summary
collapse
Methods included from Ephemeral
#attributes, #destroy, #save, #update_attributes
Methods included from Base
#promiscuous, #valid?
Instance Method Details
#__get_new_id ⇒ Object
15
16
17
18
19
20
21
22
23
|
# File 'lib/promiscuous/publisher/model/mock.rb', line 15
def __get_new_id
if self.class.mock_options[:id] == :bson
BSON::ObjectId.new
else
@@next_id ||= 1
@@next_id += 1
end
end
|
#initialize(attrs = {}) ⇒ Object
10
11
12
13
|
# File 'lib/promiscuous/publisher/model/mock.rb', line 10
def initialize(attrs={})
self.id = __get_new_id
super
end
|
#save_operation(operation) ⇒ Object