Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP finishing Feature/ra #9

Open
wants to merge 55 commits into
base: feature/ra
Choose a base branch
from

Conversation

eronisko
Copy link
Contributor

@eronisko eronisko commented May 3, 2017

Dokoncenie #1


change: nil,
district_object: Ra::District.find(4764),
municipality: Ra::Municipality.find(92),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tu nema byt _object tiez?

Copy link
Contributor Author

@eronisko eronisko May 4, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_object suffix som daval len k modelom naviazanym cez object_id.

Dalsou moznostou by bolo tie object_id asociacie spravit cez nieco ako objekt_id a objekt. Tym padom by sme to mali priblizne konzistentne a bez kolizii s Rails/Ruby keywordami.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aha, uz chapem terajsi change_id je vlastne objectId z xmlka? rozmyslam ci tam nedame nieco ako object_identifier kedze to nie je cudzi kluc nikam, je to nejake ich id. Tym by sa vyriesila nasty kolizia s Ruby object_id

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Praveze objectId je cudzi kluc, ktory pouzivame, akurat sa momentalne pri kazdom modeli vola inak. Napr pri DistrictChange sa vola DistrictChange.district_id a je naviazany na District.id. Pristup k objektu je potom DistrictChange#district_object.

changeId z XMLka je potom change_id, napr v Ra::DistrictChange.change_id -> Ra::Change.id. T.j. vsetky Ra::{District,Region,...}Change modely maju naviazanie na Ra::Change

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aha, uz si spominam. Jasne. Moze byt.

@eronisko
Copy link
Contributor Author

eronisko commented May 4, 2017

@jsuchal Niektore atributy z XMLka nie su namapovane 1:1. Napr

  • effectiveDate sa u nas vola effective_on
  • buildingNumberIdentifier je building_number_id
  • streetNameIdentifier je street_name_id

Je to takto zamerne alebo to mam namapovat blizsie k tej originalnej scheme?

@jsuchal
Copy link
Member

jsuchal commented May 4, 2017

@eronisko je to naschval, nech je Rails konvencia.

@@ -23,5 +24,6 @@ class Application < Rails::Application
# -- all .rb files in that directory are automatically loaded.

config.active_record.schema_format = :sql
config.time_zone = "Europe/Bratislava"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Toto nie je dobry napad, my chceme aby app robila v UTC a ak chceme ine formaty, tak to uvedieme explicitne. Tvoja skusenost je aka?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pri registri adries chybaju casove zony a Rails pouzije pri Time.parse casovu zonu systemu na ktorom bezi. Tomu som sa chcel vyhnut, ale suhlasim ze mozno to nemalo ist az do globalneho configu. Na druhej strane, vacsina dat v harvestri bude zrejme specificka pre Slovensko, takze aj lokalna casova zona mi dava zmysel.

FWIW, data sa stale ukladaju v UTC. Ak ich chceme aj prezentovat v UTC, mozem ten config zrusit a byt explicitny len pri parsovani registra adries. Chces to radsej defaultne v UTC?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Best practice pre api je mat vsetko v UTC. Cize dajme tak.

@eronisko
Copy link
Contributor Author

@jsuchal spominal si ze tu este nieco treba, vies zistit ze co?

@jsuchal
Copy link
Member

jsuchal commented Dec 22, 2017 via email

@jsuchal
Copy link
Member

jsuchal commented Feb 3, 2018

Nasiel som taky lepsi endpoint na zmenove davky https://data.gov.sk/api/2/search/resource?name=zmenov%C3%A1%20d%C3%A1vka&all_fields=1&order_by=-last_modified

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants