Commit Graph

3 Commits

Author SHA1 Message Date
Javi Martín
b27d0a8e92 Add and apply ConstantDefinitionInBlock rule
This rule was added in Rubocop 0.91.0. A similar rule named
LeakyConstantDeclaration was added in rubocop-rspec 1.34.0.

Note using the FILENAMES constant did not result in an offense using the
ConstantDefinitionInBlock rule but did result in an offense using the
LeakyConstantDeclaration rule. I've simplified the code to get rid of
the constant; not sure why we were adding a constant with `||=` in the
middle of a spec.
2020-10-23 12:04:22 +02:00
Javi Martín
ae4cd06c24 Include no geozone in no demographic data 2019-05-21 13:50:18 +02:00
Javi Martín
793bfed372 Display only existing stats
So if we don't have information regarding gender, age or geozone, stats
regarding those topics will not be shown.

Note we're using `spec/models/statisticable_spec.rb` because having the
same file in `spec/models/concerns` caused the tests to be executed
twice.

Also note the implementation behind the `gender?`, `age?` and `geozone?`
methods is a bit primitive. We might need to make it more robust in the
future.
2019-05-21 13:50:18 +02:00