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

NoMethodError: undefined method `attr_protected' for User:Class

    • Type: Icon: Task Task
    • Resolution: Done
    • 12_01_17
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None

      When I attempt to define User model like below

      class User
      include Mongoid::Document
      field :first_name, type: String
      field :password, type: String
      attr_protected :password # focus this
      end

      Then it throws the eroor NoMethodError of undefined method 'attr_protected'. Why?

      Once I create new rails project through invoking command 'rails new blog_api --skip-active-record'

            Assignee:
            Unassigned Unassigned
            Reporter:
            mingmingpao mingmingpao
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: