Skip to content

Commit 1512cf2

Browse files
authored
Merge pull request rails#46576 from gregmolnar/greg-enum-docs
document instance_methods option on enum [ci-skip]
2 parents 89c3746 + c63e2ea commit 1512cf2

File tree

1 file changed

+5
-0
lines changed
  • activerecord/lib/active_record

1 file changed

+5
-0
lines changed

activerecord/lib/active_record/enum.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,11 @@ module ActiveRecord
111111
#
112112
# conversation.comments_inactive!
113113
# conversation.comments_active? # => false
114+
#
115+
# If you want to disable the auto-generated methods on the model, you can do
116+
# so by setting the +:instance_methods+ option to false:
117+
#
118+
# enum :status, [ :active, :archived ], instance_methods: false
114119
module Enum
115120
def self.extended(base) # :nodoc:
116121
base.class_attribute(:defined_enums, instance_writer: false, default: {})

0 commit comments

Comments
 (0)