Sha256: 56caff0ddd82c358b5f9d5aa9f351b4b813415f669e29be4d9a2cf3815be9336
Contents?: true
Size: 679 Bytes
Versions: 11
Compression:
Stored size: 679 Bytes
Contents
module RailsOps::ModelMixins::VirtualAttributes extend ActiveSupport::Concern included do include ActiveType::VirtualAttributes end # rubocop: disable Naming/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 Naming/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
11 entries across 11 versions & 1 rubygems