Sha256: 7ae1505545335141384d8411e1a39d769fb94c4de00fe494992c0308422e1d02
Contents?: true
Size: 677 Bytes
Versions: 83
Compression:
Stored size: 677 Bytes
Contents
module RailsOps::ModelMixins::VirtualAttributes extend ActiveSupport::Concern included do include ActiveType::VirtualAttributes end # rubocop: disable Style/PredicateName # TODO: Document this. Why is this necessary and not part of ActiveType? def has_attribute?(name) return true if self.class._has_virtual_column?(name) return super end # rubocop: enable Style/PredicateName # TODO: Document this. Why is this necessary and not part of ActiveType? def column_for_attribute(name) if self.class._has_virtual_column?(name) return VirtualColumnWrapper.new(singleton_class._virtual_column(name)) else super end end end
Version data entries
83 entries across 83 versions & 1 rubygems