Sha256: c47450d24c141be205d2c6f3a82c913918fe5923ed19174e4cf1b632057abb71

Contents?: true

Size: 321 Bytes

Versions: 1

Compression:

Stored size: 321 Bytes

Contents

class FeedbackSerializer < ActiveModel::Serializer
  attributes :id, :feedback_type, :user_id, :user_slug, :user_name, :name, :slug, :text, :mood_type, :mood_text, :positive, :likes_count, :dislikes_count, :created_at

  def user_slug
    object.user.try(:slug)
  end

  def user_name
    object.user.try(:name)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
voluntary_feedback-0.1.0 app/serializers/feedback_serializer.rb