Sha256: 5004e95d65a91647ee0ff97c893806d997361ae53984291df30eaa7a8df28bf9

Contents?: true

Size: 577 Bytes

Versions: 11

Compression:

Stored size: 577 Bytes

Contents

class NotifyUser::NotificationSerializer < ActiveModel::Serializer
  require 'cgi'
  root :notifications

  attributes :id, :type, :message, :read, :params, :created_at

  def message
    string = options[:template_renderer].render_to_string(:template => object.class.views[:mobile_sdk][:template_path].call(object),
                                                 :locals => {params: object.params},
                                                 :layout => false, :formats => [:html])
    return ::CGI.unescapeHTML("#{string}")
  end

  def read
    object.read?
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
notify_user-0.1.4 app/serializers/notify_user/notification_serializer.rb
notify_user-0.1.3 app/serializers/notify_user/notification_serializer.rb
notify_user-0.1.2 app/serializers/notify_user/notification_serializer.rb
notify_user-0.1.1 app/serializers/notify_user/notification_serializer.rb
notify_user-0.0.30 app/serializers/notify_user/notification_serializer.rb
notify_user-0.0.29 app/serializers/notify_user/notification_serializer.rb
notify_user-0.0.28 app/serializers/notify_user/notification_serializer.rb
notify_user-0.0.27 app/serializers/notify_user/notification_serializer.rb
notify_user-0.0.26 app/serializers/notify_user/notification_serializer.rb
notify_user-0.0.25 app/serializers/notify_user/notification_serializer.rb
notify_user-0.0.24 app/serializers/notify_user/notification_serializer.rb