spec/controllers/home_controller_spec.rb
# Returns the set of student ids, used
# to check authorization
Returns the set of student ids, used
to check authorization
Returns the set of student ids used to check authorization
def feed_student_ids(json)
        student_ids = json['feed_cards'].map do |card|
          if card['type'] == 'birthday_card'
            card['json']['id']
          elsif card['type'] == 'event_note_card'
            card['json']['student']['id']
          else
            nil
          end
        end
        student_ids.compact.uniq
      end
def feed_student_ids ( json ) student_ids = json [ 'feed_cards' ] . map do | card | if card [ 'type' ] == 'birthday_card' card [ 'json' ] [ 'id' ] elsif card [ 'type' ] == 'event_note_card' card [ 'json' ] [ 'student' ] [ 'id' ] else nil end end student_ids . compact . uniq end
Returns the set of student ids, used
to check authorization
Returns the set of student ids used to check authorization
json
<not_specific>