lib/rrj/models/mongoid.rb in ruby_rabbitmq_janus-2.2.0.pre.161 vs lib/rrj/models/mongoid.rb in ruby_rabbitmq_janus-2.2.0.pre.164
- old
+ new
@@ -9,13 +9,14 @@
include Mongoid::Document
include RubyRabbitmqJanus::Models::JanusInstanceCallbacks
include RubyRabbitmqJanus::Models::JanusInstanceMethods
include RubyRabbitmqJanus::Models::JanusInstanceValidations
- field :_id, type: String, as: :instance
- field :session, type: Integer
+ field :session, type: Integer, as: :session_id
field :enable, type: Boolean
- field :thread, type: Integer
+ field :thread, type: Integer, as: :thread_id
+
+ alias_attribute :instance, :_id
set_callback(:create, :after) { callback_create_after }
set_callback(:update, :after) { callback_update_after }
set_callback(:destroy, :after) { callback_destroy_after }
end