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

Fix Persistence#touch for aliased fields

    • Type: Icon: Task Task
    • Resolution: Done
    • 4.0.0 final
    • Affects Version/s: None
    • Component/s: None
    • None

      Before:

      class A
        include Mongoid::Document
      
        field :at, as: :aliased_timestamp, type: Time
      end
      
      a = A.create
      a.touch(:aliased_timestamp)
      a.reload.aliased_timestamp # => nil
      

      After:

      class A
        include Mongoid::Document
      
        field :at, as: :aliased_timestamp, type: Time
      end
      
      a = A.create
      a.touch(:aliased_timestamp)
      a.reload.aliased_timestamp # => Time
      

            Assignee:
            durran Durran Jordan
            Reporter:
            niels Niels Ganser
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: