I have a User model which embeds a Profile:
# app/models/user.rb
class User
embeds_one :profile
end
# app/models/profile.rb
class Profile
embedded_in :user, inverse_of: :profile
field :age, type: integer
end
Now I want to declare a scope in User which can list out all users whose profile.age is > 18.