CoslaDigital / consul

Consul - Open Government and E-Participation Web Software
https://consulproject.org
GNU Affero General Public License v3.0
0 stars 7 forks source link

Assign geozone id to user #51

Open coslajohn opened 1 year ago

coslajohn commented 1 year ago

Describe the solution you'd like populate geozone_id in user model so that geozones can be implemented properly

Describe alternatives you've considered Stage 1: assign geozone from lacode

geozone = Geozone.find_by(external_code: oauth_lacode)

oauth_user.geozone_id = geozone.id if geozone.present?

oauth_user || User.new(

... existing code ...

)

Stage 2: extend the definition of geozone by adding list of postcodes to the geozone model and then something like geozone = Geozone.find_by(postcode: oauth_postcode)