First of all great work. Great performance gains with clear and concise DSL. 👍
Currently the function for conditionally rendering attributes can easily get out of hand if you have a few checks. They don't quite feel right inside a proc. example
show_if -> (model, options) { model.published? && options[:current_user].admin? && options[:current_user].active? && options[:current_user].id == model.user_id } do
serialize :published_at
end
Can we have something like rails callback filters, the above example would become
show if: :include_published_at? do
serialize :published_at
end
def include_published_at?
model.published? &&
options[:current_user].admin? &&
options[:current_user].active? &&
options[:current_user].id == model.user_id
end
First of all great work. Great performance gains with clear and concise DSL. 👍
Currently the function for conditionally rendering attributes can easily get out of hand if you have a few checks. They don't quite feel right inside a proc. example
Can we have something like rails callback filters, the above example would become