mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 15:23:06 +00:00
Refactor: introduce lazy association
This commit is contained in:
22
lib/active_model/serializer/lazy_association.rb
Normal file
22
lib/active_model/serializer/lazy_association.rb
Normal file
@@ -0,0 +1,22 @@
|
||||
module ActiveModel
|
||||
class Serializer
|
||||
class LazyAssociation < Field
|
||||
|
||||
def serializer
|
||||
options[:serializer]
|
||||
end
|
||||
|
||||
def include_data?
|
||||
options[:include_data]
|
||||
end
|
||||
|
||||
def virtual_value
|
||||
options[:virtual_value]
|
||||
end
|
||||
|
||||
def reflection
|
||||
options[:reflection]
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user