Uploaded image for project: 'Mongoid'
  1. Mongoid
  2. MONGOID-4741

Include Mongoid::Timestamps in generated models by default

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 7.1.0.rc0
    • Affects Version/s: None
    • Component/s: None

      In Rails 5.2, when one generates a model using rails g model foo, the model gets the timestamps added by default to it in the generated migration.

      Mongoid by default currently does not add timestamps by adding include Mongoid::Timestamps to the model. This behavior can be requested by specifying --timestamps option to rails g model.

      To be consistent with Rails/ActiveRecord, Mongoid will also enable timestamps by default. The legacy behavior can be obtained by passing --no-timestamps to rails g model.

            Assignee:
            oleg.pudeyev@mongodb.com Oleg Pudeyev (Inactive)
            Reporter:
            oleg.pudeyev@mongodb.com Oleg Pudeyev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: