Skip to content
Snippets Groups Projects
Commit ac22772e authored by Israel Barreto Sant'Anna's avatar Israel Barreto Sant'Anna
Browse files

Adapted serializers

parent d7be4768
No related branches found
No related tags found
No related merge requests found
class FollowSerializer < ActiveModel::Serializer class FollowSerializer < ActiveModel::Serializer
has_one :followable attributes :id, :user_id, :followable
attributes :id, :user_id
end end
class PublicActivity::ActivitySerializer < ActiveModel::Serializer class PublicActivity::ActivitySerializer < ActiveModel::Serializer
attributes :id, :owner, :trackable, :trackable_type, :recipient, :parameters, :created_at attributes :id, :trackable_type, :recipient, :parameters, :created_at
has_one :owner
has_one :trackable
end end
...@@ -12,7 +12,7 @@ class ReviewSerializer < ActiveModel::Serializer ...@@ -12,7 +12,7 @@ class ReviewSerializer < ActiveModel::Serializer
object.user_approves? current_user object.user_approves? current_user
end end
attributes :id, :name, :description, :pros, :cons, :rating_average, :rates_count, :created_at, :updated_at, :reviewable, :rated, :approves attributes :id, :name, :description, :pros, :cons, :rating_average, :rates_count, :created_at, :updated_at, :reviewable, :reviewable_type, :rated, :approves
has_many :review_ratings has_many :review_ratings
belongs_to :user belongs_to :user
end end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment