rails/extensions/read_only_attributes.rb
##
# Records the attribues as read only then stores them as attributes
#
# See
# ActiveModel::Serializer.attributes
Records the attribues as read only then stores them as attributes
See
ActiveModel::Serializer.attributes
Records the attribues as read only then stores them as attributes See ActiveModel :: Serializer . attributes
def read_only(*attrs)
      normalized_attrs = attrs.map { |a| a.to_s.gsub(/\?$/,'').to_sym }
      self._read_only = _read_only.dup
      self._read_only.push(*normalized_attrs).uniq
      attributes(*attrs)
    end
def read_only ( * attrs ) normalized_attrs = attrs . map { | a | a . to_s . gsub ( / \? $ / , '' ) . to_sym } self . _read_only = _read_only . dup self . _read_only . push ( * normalized_attrs ) . uniq attributes ( * attrs ) end
Records the attribues as read only then stores them as attributes
See
ActiveModel::Serializer.attributes
Records the attribues as read only then stores them as attributes See ActiveModel :: Serializer . attributes
# strip predicate '?' marks of and convert them to symbols # record which attributes will be read only # pass them off to attributes to do all the work
attrs
<not_specific>