fluke/devops-service/db/mongo/models/statistic.rb
Tim Lianov 03dc3d8d99 v3
2018-04-04 22:44:39 +03:00

28 lines
548 B
Ruby

require "mongoid"
module Devops
module Model
class Statistic
include ::Mongoid::Document
include ::Mongoid::Timestamps::CreatedInt
include ::ActiveModel::Validations
store_in collection: "statistic"
field :user, type: String
field :path, type: String
field :method, type: String
field :body, type: String
field :response_code, type: Integer
def to_hash
hash = self.attributes.clone
hash["id"] = hash.delete("_id").to_s
hash
end
end
end
end