Aggregates with resource relationships
Hello!
So maybe there's something I'm not quite understanding from the documentation, but say I have a State and City. A state can have many cities, so:
And a city belongs to a state:
Now for a state, say I want an aggregate for the number of cities in the state. Do I have an
Also, could this be a oneliner as just
Thanks!
So maybe there's something I'm not quite understanding from the documentation, but say I have a State and City. A state can have many cities, so:
And a city belongs to a state:
Now for a state, say I want an aggregate for the number of cities in the state. Do I have an
aggregates block like the following?Also, could this be a oneliner as just
count :number_of_cities, :cities? No do ... end? Thanks!
