-
Notifications
You must be signed in to change notification settings - Fork 44
Open
Description
# foo.rb
class Foo < ApplicationRecord
enum day: [:sunday, :monday, :tuesday, :wednesday, :thursday, :friday, :saturday]
validates :start_time, :end_time, overlap: {
scope: [:day, :another_column]
}
endHere's what I got when validation fails:
undefined method `[]' for nil:NilClass
Extracted source (around line #184):
#182
#183 if is_enum_attribute?(record, attr_name)
*184 value = record.class.defined_enums[attr_name][value]
#185 end
#186
#187 value
...
I think you need to cast the attr_name to string something like this attr_name.to_s
| value = record.class.defined_enums[attr_name][value] |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels