Sha256: 617c8e5e60ec156db8fa46ba37605b394d4215628d22dce3ba508c63a6f8d309

Contents?: true

Size: 557 Bytes

Versions: 7

Compression:

Stored size: 557 Bytes

Contents

require 'mongoid'

Mongoid.configure do |config|
  config.connect_to('statesman_test')
end

class MyMongoidModel
  include Mongoid::Document

  field :current_state, type: String

  has_many :my_mongoid_model_transitions
end

class MyMongoidModelTransition
  include Mongoid::Document

  field :to_state, type: String
  field :sort_key, type: Integer
  field :statesman_metadata, type: Hash

  index(sort_key: 1)

  belongs_to :my_mongoid_model, index: true

  alias_method :metadata, :statesman_metadata
  alias_method :metadata=, :statesman_metadata=
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
statesman-1.2.2 spec/support/mongoid.rb
statesman-1.2.1 spec/support/mongoid.rb
statesman-1.2.0 spec/support/mongoid.rb
statesman-1.1.0 spec/support/mongoid.rb
statesman-1.0.0 spec/support/mongoid.rb
statesman-1.0.0.beta2 spec/support/mongoid.rb
statesman-1.0.0.beta1 spec/support/mongoid.rb