Sha256: 3623b21a6e22ac5cb5dcfc965f4a1371c8ca73b715347e226505489e0415e2e2

Contents?: true

Size: 460 Bytes

Versions: 27

Compression:

Stored size: 460 Bytes

Contents

# frozen_string_literal: true

class Actor
  include Mongoid::Document
  field :name
  field :after_custom_count, type: Integer, default: 0
  has_and_belongs_to_many :tags
  embeds_many :things, validate: false, cascade_callbacks: true
  accepts_nested_attributes_for :things, allow_destroy: true

  define_model_callbacks :custom

  def do_something
    run_callbacks(:custom) do
      self.name = "custom"
    end
  end
end

require "support/models/actress"

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
mongoid-8.1.9 spec/support/models/actor.rb
mongoid-8.0.9 spec/support/models/actor.rb
mongoid-8.1.8 spec/support/models/actor.rb
mongoid-8.1.7 spec/support/models/actor.rb
mongoid-8.1.6 spec/support/models/actor.rb
mongoid-8.0.8 spec/support/models/actor.rb
mongoid-8.1.5 spec/support/models/actor.rb
mongoid-8.1.4 spec/support/models/actor.rb
mongoid-8.0.7 spec/support/models/actor.rb
mongoid-8.1.3 spec/support/models/actor.rb
mongoid-8.1.2 spec/support/models/actor.rb
mongoid-8.0.6 spec/support/models/actor.rb
mongoid-7.5.4 spec/support/models/actor.rb
mongoid-8.1.1 spec/support/models/actor.rb
mongoid-8.0.5 spec/support/models/actor.rb
mongoid-8.1.0 spec/support/models/actor.rb
mongoid-7.5.3 spec/support/models/actor.rb
mongoid-8.0.4 spec/support/models/actor.rb
mongoid-8.0.3 spec/support/models/actor.rb
mongoid-7.5.2 spec/support/models/actor.rb