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

The word scopes cannot be used as an attribute on a model

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

      When the word scopes is used as an attribute on a model class, it is overriden by the class method scopes.

      Code sample:

      Class Video
        include Mongoid::Document
        field :scopes, type: String
      end
      
      v = Video.new(scopes: 'kids')
      v.scopes returns nil instead of 'kids'
      

            Assignee:
            durran Durran Jordan
            Reporter:
            jmao jmao
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: