app/models/user.rb
# NOTE - default level implies that user.grant_curator means that they're supposed to be a full curator.  Makes
# sense to me.  :P
default level implies that user.grant_curator means that they're supposed to be a full curator.  Makes
sense to me.  :P
default level implies that user . grant_curator means that they ' re supposed to be a full curator . Makes sense to me . : P
def grant_curator(level = :full, options = {})
    level = CuratorLevel.send(level)
    unless curator_level_id == level.id
      was_curator = self.is_curator?
      self.curator_level_id = level.id
      if options[:by]
        self.curator_verdict_by = options[:by]
        self.curator_verdict_at = Time.now
        self.curator_approved   = 1
        self.credentials ||= "Approved by admin" 
        self.curator_scope ||= "N/A"             
      end
      self.save
      Notifier.curator_approved(self).deliver unless $LOADING_BOOTSTRAP || Rails.env.development?
      join_curator_community_if_curator unless was_curator
    end
    self.update_attributes(requested_curator_level_id: nil) 
    self
  end
def grant_curator ( level = :full , options = { } ) level = CuratorLevel . send ( level ) unless curator_level_id == level . id was_curator = self . is_curator? self . curator_level_id = level . id if options [ :by ] self . curator_verdict_by = options [ :by ] self . curator_verdict_at = Time . now self . curator_approved = 1 self . credentials ||= "Approved by admin" self . curator_scope ||= "N/A" end self . save Notifier . curator_approved ( self ) . deliver unless $LOADING_BOOTSTRAP || Rails . env . development? join_curator_community_if_curator unless was_curator end self . update_attributes ( requested_curator_level_id : nil ) self end
NOTE - default level implies that user.grant_curator means that they're supposed to be a full curator.
NOTE - default level implies that user . grant_curator means that they ' re supposed to be a full curator .
# NOTE - ASSUMING this method is admin-only! # NOTE - same... # Not using validations; don't care if user is valid
level
<not_specific>
options
<not_specific>