diff options
Diffstat (limited to 'app/models/concerns')
-rw-r--r-- | app/models/concerns/has_whatnot.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/app/models/concerns/has_whatnot.rb b/app/models/concerns/has_whatnot.rb new file mode 100644 index 0000000..a4dcfa0 --- /dev/null +++ b/app/models/concerns/has_whatnot.rb @@ -0,0 +1,9 @@ +module HasWhatnot + extend ActiveSupport::Concern + + included do + def whatnot + @whatnot ||= super.is_a?(Hash) ? super.deep_symbolize_keys! : nil + end + end +end |