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

respond_to? dynamic field writer returning false

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

      Both accessors work but respond_to? returns false for writer. Here is an example:

      class Person
        include Mongoid::Document
      end
      
      me = Person.new
      me.respond_to?(:gender)   # => false
      me.respond_to?(:gender=)  # => false
      me[:gender] = "Male"
      me.respond_to?(:gender)   # => true
      me.respond_to?(:gender=)  # => false # why?
      me.gender = "Unspecified" # works
      

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

              Created:
              Updated:
              Resolved: