From 41d562a1bd6f0e17bfe4539ba00e9995920c95aa Mon Sep 17 00:00:00 2001 From: tmfrnz Date: Mon, 11 Jan 2021 18:12:28 +0100 Subject: [PATCH 01/24] add SDS, disable categories --- db/seeds.rb | 1848 ++++++++++++++++++++++++++------------------------- 1 file changed, 947 insertions(+), 901 deletions(-) diff --git a/db/seeds.rb b/db/seeds.rb index 62d22bfd..97badc73 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -44,13 +44,23 @@ def base_seeds! has_response: false, ) sdgfw.save! + // + sdsfw = Framework.new( + title: 'Strategy for the Development of Samoa', + short_title: 'SDS', + has_indicators: true, + has_measures: true, + has_response: false, + ) + sdsfw.save! # Set up taxonomies - # Global taxonomy + # 1. Global taxonomy body = FactoryGirl.create( :taxonomy, framework:hr, title: 'Human rights body', + tags_measures: false, tags_users: false, allow_multiple: false, has_manager: true, @@ -63,11 +73,12 @@ def base_seeds! framework:hr, taxonomy:body, ) - # Global taxonomy + # 2. Global taxonomy cycle = FactoryGirl.create( :taxonomy, framework:hr, title: 'Cycle', + tags_measures: false, tags_users: false, allow_multiple: false, priority: 2, @@ -82,7 +93,7 @@ def base_seeds! taxonomy:cycle, ) - # Global taxonomy + # 3. Global taxonomy right = FactoryGirl.create( :taxonomy, framework:hr, @@ -99,7 +110,7 @@ def base_seeds! taxonomy:right, ) - # Global taxonomy + # 4. Global taxonomy persons = FactoryGirl.create( :taxonomy, framework:hr, @@ -115,7 +126,7 @@ def base_seeds! framework:hr, taxonomy:persons, ) - # Country specific taxonomy + # 5. Country specific taxonomy cluster = FactoryGirl.create( :taxonomy, title: 'Thematic cluster', @@ -137,8 +148,13 @@ def base_seeds! framework:sdgfw, taxonomy:cluster, ) + FactoryGirl.create( + :framework_taxonomy, + framework:sdsfw, + taxonomy:cluster, + ) - # Samoa specific taxonomy + # 6. Samoa specific taxonomy org = FactoryGirl.create( :taxonomy, title: 'Organisation', @@ -149,18 +165,7 @@ def base_seeds! is_smart: false, ) - FactoryGirl.create( - :framework_taxonomy, - framework:hr, - taxonomy:org, - ) - FactoryGirl.create( - :framework_taxonomy, - framework:sdgfw, - taxonomy:org, - ) - - # Global taxonomy + # 7. Global taxonomy sdg = FactoryGirl.create( :taxonomy, framework:sdgfw, @@ -169,7 +174,6 @@ def base_seeds! allow_multiple: false, priority: 7, is_smart: false, - groups_sdgtargets_default: 1 ) FactoryGirl.create( @@ -183,895 +187,937 @@ def base_seeds! taxonomy:sdg, ) - # Set up categories - # Human Rights Bodies http://www.ohchr.org/EN/HRBodies/Pages/HumanRightsBodies.aspx - FactoryGirl.create( - :category, - taxonomy:body, - title:'Universal Periodic Review', - short_title:'UPR', - description:'', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:body, - title:'Human Rights Committee', - short_title:'CCPR', - description:'', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:body, - title:'Committee on Economic, Social and Cultural Rights', - short_title:'CESCR', - description:'', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:body, - title:'Committee on the Elimination of Racial Discrimination', - short_title:'CERD', - description:'', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:body, - title:'Committee on the Elimination of Discrimination against Women', - short_title:'CEDAW', - description:'', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:body, - title:'Committee against Torture', - short_title:'CAT', - description:'', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:body, - title:'Subcommittee on Prevention of Torture', - short_title:'SPT', - description:'', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:body, - title:'Committee on the Rights of the Child', - short_title:'CRC', - description:'', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:body, - title:'Committee on Migrant Workers', - short_title:'CMW', - description:'', - url:'' + # 8. Progress + progress = FactoryGirl.create( + :taxonomy, + title: 'Progress status', + tags_measures: true, + allow_multiple: false, + priority: 8, + is_smart: false, ) - FactoryGirl.create( - :category, - taxonomy:body, - title:'Committee on the Rights of Persons with Disabilities', - short_title:'CRPD', - description:'', - url:'' + # 9. SDS priority area + priorityArea = FactoryGirl.create( + :taxonomy, + framework:sdsfw, + title: 'Priority area', + tags_measures: false, + allow_multiple: false, + priority: 9, + is_smart: false, ) FactoryGirl.create( - :category, - taxonomy:body, - title:'Committee on Enforced Disappearances', - short_title:'CED', - description:'', - url:'' - ) + :framework_taxonomy, + framework:sdsfw, + taxonomy:priorityArea, + ) - # Human Rights Issues (level 2 http://uhri.ohchr.org/search/guide) - # TODO level 2 and 3 human rights - FactoryGirl.create( - :category, - taxonomy:right, - title:'Scope of international obligations', - short_title:'Int. obligations', - reference:'A1', - description:'', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:right, - title:'Cooperation with human rights mechanisms and institutions', - short_title:'Cooperation ', - reference:'A2', - description:'', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:right, - title:'Inter-State cooperation & development assistance', - short_title:'Inter-State cooperation', - reference:'A3', - description:'', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:right, - title:'Legal, institutional and policy framework', - short_title:'Framework', - reference:'A4', - description:'', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:right, - title:'Human rights education, trainings and awareness raising', - short_title:'HR education', - reference:'A5', - description:'', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:right, - title:'Context, statistics, budget, civil society', - short_title:'Context', - reference:'A6', - description:'', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:right, - title:'International criminal and humanitarian law', - short_title:'Int. law', - reference:'B1', - description:'', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:right, - title:'Right to self-determination', - short_title:'Self-determination', - reference:'B2', - description:'', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:right, - title:'Equality and non-discrimination', - short_title:'Equality', - reference:'B3', - description:'', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:right, - title:'Right to development', - short_title:'Development', - reference:'B4', - description:'', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:right, - title:'Right to a remedy', - short_title:'Remedy', - reference:'B5', - description:'', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:right, - title:'Business & Human Rights', - short_title:'Business', - reference:'B6', - description:'', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:right, - title:'Human rights and environmental issues', - short_title:'Environment', - reference:'B7', - description:'', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:right, - title:'Human rights & counter-terrorism', - short_title:'Counter-terrorism', - reference:'B8', - description:'', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:right, - title:'Human rights & use of mercenaries', - short_title:'Mercenaries', - reference:'B9', - description:'', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:right, - title:'Civil & political rights - general measures of implementation', - short_title:'Civil & political', - reference:'D1', - description:'', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:right, - title:'Right to physical and moral integrity', - short_title:'Integrity', - reference:'D2', - description:'', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:right, - title:'Liberty and security of the person', - short_title:'Liberty', - reference:'D3', - description:'', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:right, - title:'Fundamental freedoms', - short_title:'Freedoms', - reference:'D4', - description:'', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:right, - title:'Administration of justice', - short_title:'Justice', - reference:'D5', - description:'', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:right, - title:'Rights related to name, identity, nationality', - short_title:'Identity', - reference:'D6', - description:'', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:right, - title:'Right to participation in public affairs and right to vote', - short_title:'Participation', - reference:'D7', - description:'', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:right, - title:'Rights related to marriage & family', - short_title:'Family', - reference:'D8', - description:'', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:right, - title:'Economic, social & cultural rights - general measures of implementation', - short_title:'Economic, social & cultural', - reference:'E1', - description:'', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:right, - title:'Right to an adequate standard of living', - short_title:'Standard of living', - reference:'E2', - description:'', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:right, - title:'Labour rights', - short_title:'Labour rights', - reference:'E3', - description:'', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:right, - title:'Right to health', - short_title:'Health', - reference:'E4', - description:'', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:right, - title:'Right to education', - short_title:'Education', - reference:'E5', - description:'', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:right, - title:'Rights to protection of property; financial credit', - short_title:'Property', - reference:'E6', - description:'', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:right, - title:'Cultural rights', - short_title:'Cultural rights', - reference:'E7', - description:'', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:right, - title:'Women', - short_title:'Women', - reference:'F1', - description:'', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:right, - title:'Children', - short_title:'Children', - reference:'F3', - description:'', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:right, - title:'Persons with disabilities', - short_title:'Persons with disabilities', - reference:'F4', - description:'', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:right, - title:'Members of minorities', - short_title:'Minorities', - reference:'G1', - description:'', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:right, - title:'Indigenous peoples', - short_title:'Indigenous peoples', - reference:'G3', - description:'', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:right, - title:'Migrants', - short_title:'Migrants', - reference:'G4', - description:'', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:right, - title:'Refugees & asylum seekers', - short_title:'Refugees', - reference:'G5', - description:'', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:right, - title:'Internally displaced persons', - short_title:'Internally displaced', - reference:'G5', - description:'', - url:'' + # 10. SDS priority area + outcome = FactoryGirl.create( + :taxonomy, + framework:sdsfw, + title: 'Key outcome', + tags_measures: false, + allow_multiple: false, + priority: 9, + is_smart: false, + parent_id: 9 ) FactoryGirl.create( - :category, - taxonomy:right, - title:'Human rights defenders', - short_title:'HR defenders', - reference:'H1', - description:'', - url:'' - ) - + :framework_taxonomy, + framework:sdsfw, + taxonomy:outcome, + ) - # Affected Persons (http://uhri.ohchr.org/search/annotations) - FactoryGirl.create( - :category, - taxonomy:persons, - title:'Children', - short_title:'Children', - description:'', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:persons, - title:'Children in street situations', - short_title:'CSS', - description:'', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:persons, - title:'Disappeared persons', - short_title:'Disappeared', - description:'', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:persons, - title:'Educational staff', - short_title:'Edu', - description:'', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:persons, - title:'General', - short_title:'General', - description:'', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:persons, - title:'Girls', - short_title:'Girls', - description:'', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:persons, - title:'Human rights defenders', - short_title:'HRD', - description:'', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:persons, - title:'Indigenous peoples', - short_title:'Indigenous', - description:'', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:persons, - title:'Internally displaced persons', - short_title:'IDP', - description:'', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:persons, - title:'Judges, lawyers and prosecutors', - short_title:'JLP', - description:'', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:persons, - title:'Law enforcement / police officials', - short_title:'Law', - description:'', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:persons, - title:'Lesbian, gay, bisexual and transgender and intersex persons (LGBTI)', - short_title:'LGBTI', - description:'', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:persons, - title:'Media', - short_title:'Media', - description:'', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:persons, - title:'Medical staff', - short_title:'Medical', - description:'', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:persons, - title:'Mercenaries', - short_title:'Mercenaries', - description:'', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:persons, - title:'Migrants', - short_title:'Migrants', - description:'', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:persons, - title:'Military staff', - short_title:'Military', - description:'', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:persons, - title:'Minorities / racial, ethnic, linguistic, religious or descent-based groups', - short_title:'Minorities', - description:'', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:persons, - title:'Non-citizens', - short_title:'Non-citizens', - description:'', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:persons, - title:'Older persons', - short_title:'Old', - description:'', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:persons, - title:'Persons affected by armed conflict', - short_title:'Armed conflict', - description:'', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:persons, - title:'Persons deprived of their liberty', - short_title:'Liberty', - description:'', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:persons, - title:'Persons living in poverty', - short_title:'Poverty', - description:'', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:persons, - title:'Persons living in rural areas', - short_title:'Rural', - description:'', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:persons, - title:'Persons living with HIV/AIDS', - short_title:'HIV', - description:'', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:persons, - title:'Persons with disabilities', - short_title:'Disabilities', - description:'', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:persons, - title:'Prison officials', - short_title:'Prison officials', - description:'', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:persons, - title:'Private security', - short_title:'Private security', - description:'', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:persons, - title:'Public officials', - short_title:'Public officials', - description:'', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:persons, - title:'Refugees & asylum seekers', - short_title:'Refugees', - description:'', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:persons, - title:'Rural women', - short_title:'Rural women', - description:'', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:persons, - title:'Social workers', - short_title:'Social workers', - description:'', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:persons, - title:'Stateless persons', - short_title:'Stateless', - description:'', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:persons, - title:'Vulnerable persons/groups', - short_title:'Vulnerable', - description:'', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:persons, - title:'Women', - short_title:'Women', - description:'', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:persons, - title:'Youth', - short_title:'Youth', - description:'', - url:'' - ) - # SDGs - FactoryGirl.create( - :category, - taxonomy:sdg, - description:'End poverty in all its forms everywhere', - title:'No poverty', - reference: 1, - short_title:'SDG 1', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:sdg, - description:'End hunger, achieve food security and improved nutrition and promote sustainable agriculture', - title:'Zero hunger', - reference: 2, - short_title:'SDG 2', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:sdg, - description:'Ensure healthy lives and promote well-being for all at all ages', - title:'Good Health and Well-being', - reference: 3, - short_title:'SDG 3', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:sdg, - description:'Ensure inclusive and equitable quality education and promote lifelong learning opportunities for all', - title:'Quality Education', - reference: 4, - short_title:'SDG 4', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:sdg, - description:'Achieve gender equality and empower all women and girls', - title:'Gender Equality', - reference: 5, - short_title:'SDG 5', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:sdg, - description:'Ensure availability and sustainable management of water and sanitation for all', - title:'Clean Water and Sanitation', - reference: 6, - short_title:'SDG 6', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:sdg, - description:'Ensure access to affordable, reliable, sustainable and modern energy for all', - title:'Affordable and Clean Energy', - reference: 7, - short_title:'SDG 7', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:sdg, - description:'Promote sustained, inclusive and sustainable economic growth, full and productive employment and decent work for all', - title:'Decent Work and Economic Growth', - reference: 8, - short_title:'SDG 8', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:sdg, - description:'Build resilient infrastructure, promote inclusive and sustainable industrialization and foster innovation', - title:'Industry, Innovation and Infrastructure', - reference: 9, - short_title:'SDG 9', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:sdg, - description:'Reduce income inequality within and among countries', - title:'Reduced Inequalities', - reference: 10, - short_title:'SDG 10', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:sdg, - description:'Make cities and human settlements inclusive, safe, resilient and sustainable', - title:'Sustainable Cities and Communities', - reference: 11, - short_title:'SDG 11', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:sdg, - description:'Ensure sustainable consumption and production patterns', - title:'Responsible Consumption and Production', - reference: 12, - short_title:'SDG 12', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:sdg, - description:'Take urgent action to combat climate change and its impacts by regulating emissions and promoting developments in renewable energy', - title:'Climate Action', - reference: 13, - short_title:'SDG 13', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:sdg, - description:'Conserve and sustainably use the oceans, seas and marine resources for sustainable development', - title:'Life Below Water', - reference: 14, - short_title:'SDG 14', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:sdg, - description:'Protect, restore and promote sustainable use of terrestrial ecosystems, sustainably manage forests, combat desertification, and halt and reverse land degradation and halt biodiversity loss', - title:'Life on Land', - reference: 15, - short_title:'SDG 15', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:sdg, - description:'Promote peaceful and inclusive societies for sustainable development, provide access to justice for all and build effective, accountable and inclusive institutions at all levels', - title:'Peace, Justice and Strong Institutions', - reference: 16, - short_title:'SDG 16', - url:'' - ) - FactoryGirl.create( - :category, - taxonomy:sdg, - description:'Strengthen the means of implementation and revitalize the global partnership for sustainable development', - title:'Partnerships for the Goals', - reference: 17, - short_title:'SDG 17', - url:'' - ) + # Set up categories + # Human Rights Bodies http://www.ohchr.org/EN/HRBodies/Pages/HumanRightsBodies.aspx + # FactoryGirl.create( + # :category, + # taxonomy:body, + # title:'Universal Periodic Review', + # short_title:'UPR', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:body, + # title:'Human Rights Committee', + # short_title:'CCPR', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:body, + # title:'Committee on Economic, Social and Cultural Rights', + # short_title:'CESCR', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:body, + # title:'Committee on the Elimination of Racial Discrimination', + # short_title:'CERD', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:body, + # title:'Committee on the Elimination of Discrimination against Women', + # short_title:'CEDAW', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:body, + # title:'Committee against Torture', + # short_title:'CAT', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:body, + # title:'Subcommittee on Prevention of Torture', + # short_title:'SPT', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:body, + # title:'Committee on the Rights of the Child', + # short_title:'CRC', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:body, + # title:'Committee on Migrant Workers', + # short_title:'CMW', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:body, + # title:'Committee on the Rights of Persons with Disabilities', + # short_title:'CRPD', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:body, + # title:'Committee on Enforced Disappearances', + # short_title:'CED', + # description:'', + # url:'' + # ) + # + # # Human Rights Issues (level 2 http://uhri.ohchr.org/search/guide) + # # TODO level 2 and 3 human rights + # FactoryGirl.create( + # :category, + # taxonomy:right, + # title:'Scope of international obligations', + # short_title:'Int. obligations', + # reference:'A1', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:right, + # title:'Cooperation with human rights mechanisms and institutions', + # short_title:'Cooperation ', + # reference:'A2', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:right, + # title:'Inter-State cooperation & development assistance', + # short_title:'Inter-State cooperation', + # reference:'A3', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:right, + # title:'Legal, institutional and policy framework', + # short_title:'Framework', + # reference:'A4', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:right, + # title:'Human rights education, trainings and awareness raising', + # short_title:'HR education', + # reference:'A5', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:right, + # title:'Context, statistics, budget, civil society', + # short_title:'Context', + # reference:'A6', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:right, + # title:'International criminal and humanitarian law', + # short_title:'Int. law', + # reference:'B1', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:right, + # title:'Right to self-determination', + # short_title:'Self-determination', + # reference:'B2', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:right, + # title:'Equality and non-discrimination', + # short_title:'Equality', + # reference:'B3', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:right, + # title:'Right to development', + # short_title:'Development', + # reference:'B4', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:right, + # title:'Right to a remedy', + # short_title:'Remedy', + # reference:'B5', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:right, + # title:'Business & Human Rights', + # short_title:'Business', + # reference:'B6', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:right, + # title:'Human rights and environmental issues', + # short_title:'Environment', + # reference:'B7', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:right, + # title:'Human rights & counter-terrorism', + # short_title:'Counter-terrorism', + # reference:'B8', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:right, + # title:'Human rights & use of mercenaries', + # short_title:'Mercenaries', + # reference:'B9', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:right, + # title:'Civil & political rights - general measures of implementation', + # short_title:'Civil & political', + # reference:'D1', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:right, + # title:'Right to physical and moral integrity', + # short_title:'Integrity', + # reference:'D2', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:right, + # title:'Liberty and security of the person', + # short_title:'Liberty', + # reference:'D3', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:right, + # title:'Fundamental freedoms', + # short_title:'Freedoms', + # reference:'D4', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:right, + # title:'Administration of justice', + # short_title:'Justice', + # reference:'D5', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:right, + # title:'Rights related to name, identity, nationality', + # short_title:'Identity', + # reference:'D6', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:right, + # title:'Right to participation in public affairs and right to vote', + # short_title:'Participation', + # reference:'D7', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:right, + # title:'Rights related to marriage & family', + # short_title:'Family', + # reference:'D8', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:right, + # title:'Economic, social & cultural rights - general measures of implementation', + # short_title:'Economic, social & cultural', + # reference:'E1', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:right, + # title:'Right to an adequate standard of living', + # short_title:'Standard of living', + # reference:'E2', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:right, + # title:'Labour rights', + # short_title:'Labour rights', + # reference:'E3', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:right, + # title:'Right to health', + # short_title:'Health', + # reference:'E4', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:right, + # title:'Right to education', + # short_title:'Education', + # reference:'E5', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:right, + # title:'Rights to protection of property; financial credit', + # short_title:'Property', + # reference:'E6', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:right, + # title:'Cultural rights', + # short_title:'Cultural rights', + # reference:'E7', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:right, + # title:'Women', + # short_title:'Women', + # reference:'F1', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:right, + # title:'Children', + # short_title:'Children', + # reference:'F3', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:right, + # title:'Persons with disabilities', + # short_title:'Persons with disabilities', + # reference:'F4', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:right, + # title:'Members of minorities', + # short_title:'Minorities', + # reference:'G1', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:right, + # title:'Indigenous peoples', + # short_title:'Indigenous peoples', + # reference:'G3', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:right, + # title:'Migrants', + # short_title:'Migrants', + # reference:'G4', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:right, + # title:'Refugees & asylum seekers', + # short_title:'Refugees', + # reference:'G5', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:right, + # title:'Internally displaced persons', + # short_title:'Internally displaced', + # reference:'G5', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:right, + # title:'Human rights defenders', + # short_title:'HR defenders', + # reference:'H1', + # description:'', + # url:'' + # ) + # + # + # # Affected Persons (http://uhri.ohchr.org/search/annotations) + # FactoryGirl.create( + # :category, + # taxonomy:persons, + # title:'Children', + # short_title:'Children', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:persons, + # title:'Children in street situations', + # short_title:'CSS', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:persons, + # title:'Disappeared persons', + # short_title:'Disappeared', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:persons, + # title:'Educational staff', + # short_title:'Edu', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:persons, + # title:'General', + # short_title:'General', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:persons, + # title:'Girls', + # short_title:'Girls', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:persons, + # title:'Human rights defenders', + # short_title:'HRD', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:persons, + # title:'Indigenous peoples', + # short_title:'Indigenous', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:persons, + # title:'Internally displaced persons', + # short_title:'IDP', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:persons, + # title:'Judges, lawyers and prosecutors', + # short_title:'JLP', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:persons, + # title:'Law enforcement / police officials', + # short_title:'Law', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:persons, + # title:'Lesbian, gay, bisexual and transgender and intersex persons (LGBTI)', + # short_title:'LGBTI', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:persons, + # title:'Media', + # short_title:'Media', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:persons, + # title:'Medical staff', + # short_title:'Medical', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:persons, + # title:'Mercenaries', + # short_title:'Mercenaries', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:persons, + # title:'Migrants', + # short_title:'Migrants', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:persons, + # title:'Military staff', + # short_title:'Military', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:persons, + # title:'Minorities / racial, ethnic, linguistic, religious or descent-based groups', + # short_title:'Minorities', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:persons, + # title:'Non-citizens', + # short_title:'Non-citizens', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:persons, + # title:'Older persons', + # short_title:'Old', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:persons, + # title:'Persons affected by armed conflict', + # short_title:'Armed conflict', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:persons, + # title:'Persons deprived of their liberty', + # short_title:'Liberty', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:persons, + # title:'Persons living in poverty', + # short_title:'Poverty', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:persons, + # title:'Persons living in rural areas', + # short_title:'Rural', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:persons, + # title:'Persons living with HIV/AIDS', + # short_title:'HIV', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:persons, + # title:'Persons with disabilities', + # short_title:'Disabilities', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:persons, + # title:'Prison officials', + # short_title:'Prison officials', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:persons, + # title:'Private security', + # short_title:'Private security', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:persons, + # title:'Public officials', + # short_title:'Public officials', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:persons, + # title:'Refugees & asylum seekers', + # short_title:'Refugees', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:persons, + # title:'Rural women', + # short_title:'Rural women', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:persons, + # title:'Social workers', + # short_title:'Social workers', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:persons, + # title:'Stateless persons', + # short_title:'Stateless', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:persons, + # title:'Vulnerable persons/groups', + # short_title:'Vulnerable', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:persons, + # title:'Women', + # short_title:'Women', + # description:'', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:persons, + # title:'Youth', + # short_title:'Youth', + # description:'', + # url:'' + # ) + # # SDGs + # FactoryGirl.create( + # :category, + # taxonomy:sdg, + # description:'End poverty in all its forms everywhere', + # title:'No poverty', + # reference: 1, + # short_title:'SDG 1', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:sdg, + # description:'End hunger, achieve food security and improved nutrition and promote sustainable agriculture', + # title:'Zero hunger', + # reference: 2, + # short_title:'SDG 2', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:sdg, + # description:'Ensure healthy lives and promote well-being for all at all ages', + # title:'Good Health and Well-being', + # reference: 3, + # short_title:'SDG 3', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:sdg, + # description:'Ensure inclusive and equitable quality education and promote lifelong learning opportunities for all', + # title:'Quality Education', + # reference: 4, + # short_title:'SDG 4', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:sdg, + # description:'Achieve gender equality and empower all women and girls', + # title:'Gender Equality', + # reference: 5, + # short_title:'SDG 5', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:sdg, + # description:'Ensure availability and sustainable management of water and sanitation for all', + # title:'Clean Water and Sanitation', + # reference: 6, + # short_title:'SDG 6', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:sdg, + # description:'Ensure access to affordable, reliable, sustainable and modern energy for all', + # title:'Affordable and Clean Energy', + # reference: 7, + # short_title:'SDG 7', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:sdg, + # description:'Promote sustained, inclusive and sustainable economic growth, full and productive employment and decent work for all', + # title:'Decent Work and Economic Growth', + # reference: 8, + # short_title:'SDG 8', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:sdg, + # description:'Build resilient infrastructure, promote inclusive and sustainable industrialization and foster innovation', + # title:'Industry, Innovation and Infrastructure', + # reference: 9, + # short_title:'SDG 9', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:sdg, + # description:'Reduce income inequality within and among countries', + # title:'Reduced Inequalities', + # reference: 10, + # short_title:'SDG 10', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:sdg, + # description:'Make cities and human settlements inclusive, safe, resilient and sustainable', + # title:'Sustainable Cities and Communities', + # reference: 11, + # short_title:'SDG 11', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:sdg, + # description:'Ensure sustainable consumption and production patterns', + # title:'Responsible Consumption and Production', + # reference: 12, + # short_title:'SDG 12', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:sdg, + # description:'Take urgent action to combat climate change and its impacts by regulating emissions and promoting developments in renewable energy', + # title:'Climate Action', + # reference: 13, + # short_title:'SDG 13', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:sdg, + # description:'Conserve and sustainably use the oceans, seas and marine resources for sustainable development', + # title:'Life Below Water', + # reference: 14, + # short_title:'SDG 14', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:sdg, + # description:'Protect, restore and promote sustainable use of terrestrial ecosystems, sustainably manage forests, combat desertification, and halt and reverse land degradation and halt biodiversity loss', + # title:'Life on Land', + # reference: 15, + # short_title:'SDG 15', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:sdg, + # description:'Promote peaceful and inclusive societies for sustainable development, provide access to justice for all and build effective, accountable and inclusive institutions at all levels', + # title:'Peace, Justice and Strong Institutions', + # reference: 16, + # short_title:'SDG 16', + # url:'' + # ) + # FactoryGirl.create( + # :category, + # taxonomy:sdg, + # description:'Strengthen the means of implementation and revitalize the global partnership for sustainable development', + # title:'Partnerships for the Goals', + # reference: 17, + # short_title:'SDG 17', + # url:'' + # ) # Countries # FactoryGirl.create( From a14502deb6e6758503e7dcc35370858f77c8b7d1 Mon Sep 17 00:00:00 2001 From: tmfrnz Date: Mon, 11 Jan 2021 18:54:24 +0100 Subject: [PATCH 02/24] reduce cluster priority --- db/seeds.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/seeds.rb b/db/seeds.rb index 97badc73..4040c956 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -133,7 +133,7 @@ def base_seeds! tags_measures: true, tags_users: false, allow_multiple: true, - priority: 5, + priority: 50, is_smart: false, groups_measures_default: 1 ) From 5dc9f130aaa3ef4aab18ea49eb9e9c89935e1190 Mon Sep 17 00:00:00 2001 From: tmfrnz Date: Tue, 12 Jan 2021 14:52:52 +0100 Subject: [PATCH 03/24] set up sds categories --- db/seeds.rb | 483 ++++++++++++++++++++++++++++++++-------------------- 1 file changed, 299 insertions(+), 184 deletions(-) diff --git a/db/seeds.rb b/db/seeds.rb index 4040c956..3a51afb7 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -22,214 +22,329 @@ def run_env_seeds! def base_seeds! # Set up user roles - Role.new(name: 'admin', friendly_name: 'Admin').save! - Role.new(name: 'manager', friendly_name: 'Manager').save! - Role.new(name: 'contributor', friendly_name: 'Contributor').save! - - # set up frameworks - hr = Framework.new( - title: 'International Human Rights Obligations', - short_title: 'HR', - has_indicators: false, - has_measures: true, - has_response: true, + # Role.new(name: 'admin', friendly_name: 'Admin').save! + # Role.new(name: 'manager', friendly_name: 'Manager').save! + # Role.new(name: 'contributor', friendly_name: 'Contributor').save! + # + # # set up frameworks + # hr = Framework.new( + # title: 'International Human Rights Obligations', + # short_title: 'HR', + # has_indicators: false, + # has_measures: true, + # has_response: true, + # ) + # hr.save! + # + # sdgfw = Framework.new( + # title: 'Sustainable Debelopment Goals', + # short_title: 'SDGs', + # has_indicators: true, + # has_measures: true, + # has_response: false, + # ) + # sdgfw.save! + # // + # sdsfw = Framework.new( + # title: 'Strategy for the Development of Samoa', + # short_title: 'SDS', + # has_indicators: true, + # has_measures: true, + # has_response: false, + # ) + # sdsfw.save! + # + # # Set up taxonomies + # # 1. Global taxonomy + # body = FactoryGirl.create( + # :taxonomy, + # framework:hr, + # title: 'Human rights body', + # tags_measures: false, + # tags_users: false, + # allow_multiple: false, + # has_manager: true, + # priority: 1, + # is_smart: false, + # groups_recommendations_default: 1 + # ) + # FactoryGirl.create( + # :framework_taxonomy, + # framework:hr, + # taxonomy:body, + # ) + # # 2. Global taxonomy + # cycle = FactoryGirl.create( + # :taxonomy, + # framework:hr, + # title: 'Cycle', + # tags_measures: false, + # tags_users: false, + # allow_multiple: false, + # priority: 2, + # is_smart: false, + # groups_recommendations_default: 2, + # parent_id: 1, + # has_date: true + # ) + # FactoryGirl.create( + # :framework_taxonomy, + # framework:hr, + # taxonomy:cycle, + # ) + # + # # 3. Global taxonomy + # right = FactoryGirl.create( + # :taxonomy, + # framework:hr, + # title: 'Human rights issue', + # tags_measures: true, + # tags_users: false, + # allow_multiple: true, + # priority: 3, + # is_smart: false + # ) + # FactoryGirl.create( + # :framework_taxonomy, + # framework:hr, + # taxonomy:right, + # ) + # + # # 4. Global taxonomy + # persons = FactoryGirl.create( + # :taxonomy, + # framework:hr, + # title: 'Affected persons', + # tags_measures: true, + # tags_users: false, + # allow_multiple: true, + # priority: 4, + # is_smart: false + # ) + # FactoryGirl.create( + # :framework_taxonomy, + # framework:hr, + # taxonomy:persons, + # ) + # # 5. Country specific taxonomy + # cluster = FactoryGirl.create( + # :taxonomy, + # title: 'Thematic cluster', + # tags_measures: true, + # tags_users: false, + # allow_multiple: true, + # priority: 50, + # is_smart: false, + # groups_measures_default: 1 + # ) + # + # FactoryGirl.create( + # :framework_taxonomy, + # framework:hr, + # taxonomy:cluster, + # ) + # FactoryGirl.create( + # :framework_taxonomy, + # framework:sdgfw, + # taxonomy:cluster, + # ) + # FactoryGirl.create( + # :framework_taxonomy, + # framework:sdsfw, + # taxonomy:cluster, + # ) + # + # # 6. Samoa specific taxonomy + # org = FactoryGirl.create( + # :taxonomy, + # title: 'Organisation', + # tags_measures: true, + # tags_users: true, + # allow_multiple: true, + # priority: 6, + # is_smart: false, + # ) + # + # # 7. Global taxonomy + # sdg = FactoryGirl.create( + # :taxonomy, + # framework:sdgfw, + # title: 'SDGs', + # has_manager: true, + # allow_multiple: false, + # priority: 7, + # is_smart: false, + # ) + # + # FactoryGirl.create( + # :framework_taxonomy, + # framework:hr, + # taxonomy:sdg, + # ) + # FactoryGirl.create( + # :framework_taxonomy, + # framework:sdgfw, + # taxonomy:sdg, + # ) + # + # # 8. Progress + # progress = FactoryGirl.create( + # :taxonomy, + # title: 'Progress status', + # tags_measures: true, + # allow_multiple: false, + # priority: 8, + # is_smart: false, + # ) + # # 9. SDS priority area + # priorityArea = FactoryGirl.create( + # :taxonomy, + # framework:sdsfw, + # title: 'Priority area', + # tags_measures: false, + # allow_multiple: false, + # priority: 9, + # is_smart: false, + # ) + # FactoryGirl.create( + # :framework_taxonomy, + # framework:sdsfw, + # taxonomy:priorityArea, + # ) + # + # # 10. SDS key outcome + # outcome = FactoryGirl.create( + # :taxonomy, + # framework:sdsfw, + # title: 'Key outcome', + # tags_measures: false, + # allow_multiple: false, + # priority: 9, + # is_smart: false, + # parent_id: 9 + # ) + # FactoryGirl.create( + # :framework_taxonomy, + # framework:sdsfw, + # taxonomy:outcome, + # ) + # Set up categories + # sds priority areas + FactoryGirl.create( + :category, + taxonomy_id:9, + title:'Economic', + reference: '1' ) - hr.save! - - sdgfw = Framework.new( - title: 'Sustainable Debelopment Goals', - short_title: 'SDGs', - has_indicators: true, - has_measures: true, - has_response: false, + FactoryGirl.create( + :category, + taxonomy_id:9, + title:'Social', + reference: '2' ) - sdgfw.save! - // - sdsfw = Framework.new( - title: 'Strategy for the Development of Samoa', - short_title: 'SDS', - has_indicators: true, - has_measures: true, - has_response: false, + FactoryGirl.create( + :category, + taxonomy_id:9, + title:'Infrastructure', + reference: '3' ) - sdsfw.save! - - # Set up taxonomies - # 1. Global taxonomy - body = FactoryGirl.create( - :taxonomy, - framework:hr, - title: 'Human rights body', - tags_measures: false, - tags_users: false, - allow_multiple: false, - has_manager: true, - priority: 1, - is_smart: false, - groups_recommendations_default: 1 + FactoryGirl.create( + :category, + taxonomy_id:9, + title:'Environment', + reference: '4' ) + # sds key outcomes FactoryGirl.create( - :framework_taxonomy, - framework:hr, - taxonomy:body, - ) - # 2. Global taxonomy - cycle = FactoryGirl.create( - :taxonomy, - framework:hr, - title: 'Cycle', - tags_measures: false, - tags_users: false, - allow_multiple: false, - priority: 2, - is_smart: false, - groups_recommendations_default: 2, - parent_id: 1, - has_date: true + :category, + taxonomy_id:10, + title:'Macroeconomic Resilience Increased and Sustained', + reference: '1' ) FactoryGirl.create( - :framework_taxonomy, - framework:hr, - taxonomy:cycle, - ) - - # 3. Global taxonomy - right = FactoryGirl.create( - :taxonomy, - framework:hr, - title: 'Human rights issue', - tags_measures: true, - tags_users: false, - allow_multiple: true, - priority: 3, - is_smart: false + :category, + taxonomy_id:10, + title:'Agriculture and Fisheries Productivity Increased', + reference: '2' ) FactoryGirl.create( - :framework_taxonomy, - framework:hr, - taxonomy:right, - ) - - # 4. Global taxonomy - persons = FactoryGirl.create( - :taxonomy, - framework:hr, - title: 'Affected persons', - tags_measures: true, - tags_users: false, - allow_multiple: true, - priority: 4, - is_smart: false + :category, + taxonomy_id:10, + title:'Export Products Increased', + reference: '3' ) FactoryGirl.create( - :framework_taxonomy, - framework:hr, - taxonomy:persons, - ) - # 5. Country specific taxonomy - cluster = FactoryGirl.create( - :taxonomy, - title: 'Thematic cluster', - tags_measures: true, - tags_users: false, - allow_multiple: true, - priority: 50, - is_smart: false, - groups_measures_default: 1 + :category, + taxonomy_id:10, + title:'Tourism Development and Performance Improved', + reference: '4' ) - FactoryGirl.create( - :framework_taxonomy, - framework:hr, - taxonomy:cluster, - ) + :category, + taxonomy_id:10, + title:'Participation of Private Sector in Development Enhanced', + reference: '5' + ) FactoryGirl.create( - :framework_taxonomy, - framework:sdgfw, - taxonomy:cluster, - ) + :category, + taxonomy_id:10, + title:'A Healthy Samoa and Well-being Promoted', + reference: '6' + ) FactoryGirl.create( - :framework_taxonomy, - framework:sdsfw, - taxonomy:cluster, - ) - - # 6. Samoa specific taxonomy - org = FactoryGirl.create( - :taxonomy, - title: 'Organisation', - tags_measures: true, - tags_users: true, - allow_multiple: true, - priority: 6, - is_smart: false, + :category, + taxonomy_id:10, + title:'Quality Education and Training Improved', + reference: '7' ) - - # 7. Global taxonomy - sdg = FactoryGirl.create( - :taxonomy, - framework:sdgfw, - title: 'SDGs', - has_manager: true, - allow_multiple: false, - priority: 7, - is_smart: false, + FactoryGirl.create( + :category, + taxonomy_id:10, + title:'Social Institutions Strengthened - Community Development Enhanced', + reference: '8a' ) - FactoryGirl.create( - :framework_taxonomy, - framework:hr, - taxonomy:sdg, - ) + :category, + taxonomy_id:10, + title:'Social Institutions Strengthened - Community Safety Improved', + reference: '8b' + ) FactoryGirl.create( - :framework_taxonomy, - framework:sdgfw, - taxonomy:sdg, - ) - - # 8. Progress - progress = FactoryGirl.create( - :taxonomy, - title: 'Progress status', - tags_measures: true, - allow_multiple: false, - priority: 8, - is_smart: false, + :category, + taxonomy_id:10, + title:'Access to Clean Water and Sanitation Sustained', + reference: '9' ) - # 9. SDS priority area - priorityArea = FactoryGirl.create( - :taxonomy, - framework:sdsfw, - title: 'Priority area', - tags_measures: false, - allow_multiple: false, - priority: 9, - is_smart: false, + FactoryGirl.create( + :category, + taxonomy_id:10, + title:'Transport Systems and Networks Improved', + reference: '10' ) FactoryGirl.create( - :framework_taxonomy, - framework:sdsfw, - taxonomy:priorityArea, - ) - - # 10. SDS priority area - outcome = FactoryGirl.create( - :taxonomy, - framework:sdsfw, - title: 'Key outcome', - tags_measures: false, - allow_multiple: false, - priority: 9, - is_smart: false, - parent_id: 9 + :category, + taxonomy_id:10, + title:'Improved and Affordable Country Wide ICT Connectivity', + reference: '11' ) FactoryGirl.create( - :framework_taxonomy, - framework:sdsfw, - taxonomy:outcome, - ) - - # Set up categories + :category, + taxonomy_id:10, + title:'Quality Energy Supply', + reference: '12' + ) + FactoryGirl.create( + :category, + taxonomy_id:10, + title:'Environmental Resilience Improved', + reference: '13' + ) + FactoryGirl.create( + :category, + taxonomy_id:10, + title:'Climate and Disaster Resilience', + reference: '14' + ) # Human Rights Bodies http://www.ohchr.org/EN/HRBodies/Pages/HumanRightsBodies.aspx # FactoryGirl.create( # :category, From bb9d08441e985c4d56d7b77e4aad6f0be8fd5b49 Mon Sep 17 00:00:00 2001 From: tmfrnz Date: Tue, 12 Jan 2021 14:58:52 +0100 Subject: [PATCH 04/24] also set empties to prevent random values --- db/seeds.rb | 95 ++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 76 insertions(+), 19 deletions(-) diff --git a/db/seeds.rb b/db/seeds.rb index 3a51afb7..7d773129 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -234,116 +234,173 @@ def base_seeds! :category, taxonomy_id:9, title:'Economic', - reference: '1' + reference: '1', + short_title:'', + description:'', + url:'' ) FactoryGirl.create( :category, taxonomy_id:9, title:'Social', - reference: '2' + reference: '2', + short_title:'', + description:'', + url:'' ) FactoryGirl.create( :category, taxonomy_id:9, title:'Infrastructure', - reference: '3' + reference: '3', + short_title:'', + description:'', + url:'' ) FactoryGirl.create( :category, taxonomy_id:9, title:'Environment', - reference: '4' + reference: '4', + short_title:'', + description:'', + url:'' ) # sds key outcomes FactoryGirl.create( :category, taxonomy_id:10, title:'Macroeconomic Resilience Increased and Sustained', - reference: '1' + reference: '1', + short_title:'', + description:'', + url:'' ) FactoryGirl.create( :category, taxonomy_id:10, title:'Agriculture and Fisheries Productivity Increased', - reference: '2' + reference: '2', + short_title:'', + description:'', + url:'' ) FactoryGirl.create( :category, taxonomy_id:10, title:'Export Products Increased', - reference: '3' + reference: '3', + short_title:'', + description:'', + url:'' ) FactoryGirl.create( :category, taxonomy_id:10, title:'Tourism Development and Performance Improved', - reference: '4' + reference: '4', + short_title:'', + description:'', + url:'' ) FactoryGirl.create( :category, taxonomy_id:10, title:'Participation of Private Sector in Development Enhanced', - reference: '5' + reference: '5', + short_title:'', + description:'', + url:'' ) FactoryGirl.create( :category, taxonomy_id:10, title:'A Healthy Samoa and Well-being Promoted', - reference: '6' + reference: '6', + short_title:'', + description:'', + url:'' ) FactoryGirl.create( :category, taxonomy_id:10, title:'Quality Education and Training Improved', - reference: '7' + reference: '7', + short_title:'', + description:'', + url:'' ) FactoryGirl.create( :category, taxonomy_id:10, title:'Social Institutions Strengthened - Community Development Enhanced', - reference: '8a' + reference: '8a', + short_title:'', + description:'', + url:'' ) FactoryGirl.create( :category, taxonomy_id:10, title:'Social Institutions Strengthened - Community Safety Improved', - reference: '8b' + reference: '8b', + short_title:'', + description:'', + url:'' ) FactoryGirl.create( :category, taxonomy_id:10, title:'Access to Clean Water and Sanitation Sustained', - reference: '9' + reference: '9', + short_title:'', + description:'', + url:'' ) FactoryGirl.create( :category, taxonomy_id:10, title:'Transport Systems and Networks Improved', - reference: '10' + reference: '10', + short_title:'', + description:'', + url:'' ) FactoryGirl.create( :category, taxonomy_id:10, title:'Improved and Affordable Country Wide ICT Connectivity', - reference: '11' + reference: '11', + short_title:'', + description:'', + url:'' ) FactoryGirl.create( :category, taxonomy_id:10, title:'Quality Energy Supply', - reference: '12' + reference: '12', + short_title:'', + description:'', + url:'' ) FactoryGirl.create( :category, taxonomy_id:10, title:'Environmental Resilience Improved', - reference: '13' + reference: '13', + short_title:'', + description:'', + url:'' ) FactoryGirl.create( :category, taxonomy_id:10, title:'Climate and Disaster Resilience', - reference: '14' + reference: '14', + short_title:'', + description:'', + url:'' ) # Human Rights Bodies http://www.ohchr.org/EN/HRBodies/Pages/HumanRightsBodies.aspx # FactoryGirl.create( From 01c7a33f0d97579aa8fe14a03022ece83852c9ad Mon Sep 17 00:00:00 2001 From: Timo Franz Date: Sun, 27 Jun 2021 16:16:45 +0200 Subject: [PATCH 05/24] add sjukkola --- CONTRIBUTORS.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 9eb9aca4..3baeba31 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -4,7 +4,8 @@ - Br3nda - keyaral - oventi -- barancw - nrankin +- barancw - parndt - ben-rabid +- sjukkola From 285de2e94b9ea97d34119ffc713662f872dc6cd1 Mon Sep 17 00:00:00 2001 From: tmfrnz Date: Sun, 18 Jul 2021 15:15:47 +0200 Subject: [PATCH 06/24] update seeds file --- db/seeds.rb | 4037 +++++++++++++++++---------------------------------- 1 file changed, 1345 insertions(+), 2692 deletions(-) diff --git a/db/seeds.rb b/db/seeds.rb index 7d773129..8ccb470f 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -22,2797 +22,1450 @@ def run_env_seeds! def base_seeds! # Set up user roles - # Role.new(name: 'admin', friendly_name: 'Admin').save! - # Role.new(name: 'manager', friendly_name: 'Manager').save! - # Role.new(name: 'contributor', friendly_name: 'Contributor').save! - # - # # set up frameworks - # hr = Framework.new( - # title: 'International Human Rights Obligations', - # short_title: 'HR', - # has_indicators: false, - # has_measures: true, - # has_response: true, - # ) - # hr.save! - # - # sdgfw = Framework.new( - # title: 'Sustainable Debelopment Goals', - # short_title: 'SDGs', - # has_indicators: true, - # has_measures: true, - # has_response: false, - # ) - # sdgfw.save! - # // - # sdsfw = Framework.new( - # title: 'Strategy for the Development of Samoa', - # short_title: 'SDS', - # has_indicators: true, - # has_measures: true, - # has_response: false, - # ) - # sdsfw.save! - # - # # Set up taxonomies - # # 1. Global taxonomy - # body = FactoryGirl.create( - # :taxonomy, - # framework:hr, - # title: 'Human rights body', - # tags_measures: false, - # tags_users: false, - # allow_multiple: false, - # has_manager: true, - # priority: 1, - # is_smart: false, - # groups_recommendations_default: 1 - # ) - # FactoryGirl.create( - # :framework_taxonomy, - # framework:hr, - # taxonomy:body, - # ) - # # 2. Global taxonomy - # cycle = FactoryGirl.create( - # :taxonomy, - # framework:hr, - # title: 'Cycle', - # tags_measures: false, - # tags_users: false, - # allow_multiple: false, - # priority: 2, - # is_smart: false, - # groups_recommendations_default: 2, - # parent_id: 1, - # has_date: true - # ) - # FactoryGirl.create( - # :framework_taxonomy, - # framework:hr, - # taxonomy:cycle, - # ) - # - # # 3. Global taxonomy - # right = FactoryGirl.create( - # :taxonomy, - # framework:hr, - # title: 'Human rights issue', - # tags_measures: true, - # tags_users: false, - # allow_multiple: true, - # priority: 3, - # is_smart: false - # ) - # FactoryGirl.create( - # :framework_taxonomy, - # framework:hr, - # taxonomy:right, - # ) - # - # # 4. Global taxonomy - # persons = FactoryGirl.create( - # :taxonomy, - # framework:hr, - # title: 'Affected persons', - # tags_measures: true, - # tags_users: false, - # allow_multiple: true, - # priority: 4, - # is_smart: false - # ) - # FactoryGirl.create( - # :framework_taxonomy, - # framework:hr, - # taxonomy:persons, - # ) - # # 5. Country specific taxonomy - # cluster = FactoryGirl.create( - # :taxonomy, - # title: 'Thematic cluster', - # tags_measures: true, - # tags_users: false, - # allow_multiple: true, - # priority: 50, - # is_smart: false, - # groups_measures_default: 1 - # ) - # - # FactoryGirl.create( - # :framework_taxonomy, - # framework:hr, - # taxonomy:cluster, - # ) - # FactoryGirl.create( - # :framework_taxonomy, - # framework:sdgfw, - # taxonomy:cluster, - # ) - # FactoryGirl.create( - # :framework_taxonomy, - # framework:sdsfw, - # taxonomy:cluster, - # ) - # - # # 6. Samoa specific taxonomy - # org = FactoryGirl.create( - # :taxonomy, - # title: 'Organisation', - # tags_measures: true, - # tags_users: true, - # allow_multiple: true, - # priority: 6, - # is_smart: false, - # ) - # - # # 7. Global taxonomy - # sdg = FactoryGirl.create( - # :taxonomy, - # framework:sdgfw, - # title: 'SDGs', - # has_manager: true, - # allow_multiple: false, - # priority: 7, - # is_smart: false, - # ) - # - # FactoryGirl.create( - # :framework_taxonomy, - # framework:hr, - # taxonomy:sdg, - # ) - # FactoryGirl.create( - # :framework_taxonomy, - # framework:sdgfw, - # taxonomy:sdg, - # ) - # - # # 8. Progress - # progress = FactoryGirl.create( - # :taxonomy, - # title: 'Progress status', - # tags_measures: true, - # allow_multiple: false, - # priority: 8, - # is_smart: false, - # ) - # # 9. SDS priority area - # priorityArea = FactoryGirl.create( - # :taxonomy, - # framework:sdsfw, - # title: 'Priority area', - # tags_measures: false, - # allow_multiple: false, - # priority: 9, - # is_smart: false, - # ) - # FactoryGirl.create( - # :framework_taxonomy, - # framework:sdsfw, - # taxonomy:priorityArea, - # ) - # - # # 10. SDS key outcome - # outcome = FactoryGirl.create( - # :taxonomy, - # framework:sdsfw, - # title: 'Key outcome', - # tags_measures: false, - # allow_multiple: false, - # priority: 9, - # is_smart: false, - # parent_id: 9 - # ) - # FactoryGirl.create( - # :framework_taxonomy, - # framework:sdsfw, - # taxonomy:outcome, - # ) - # Set up categories - # sds priority areas + Role.new(name: 'admin', friendly_name: 'Admin').save! + Role.new(name: 'manager', friendly_name: 'Manager').save! + Role.new(name: 'contributor', friendly_name: 'Contributor').save! + + # set up frameworks ######################################################## + hr = Framework.new( + title: 'International Human Rights Obligations', + short_title: 'HR', + has_indicators: false, + has_measures: true, + has_response: true, + ) + hr.save! + + sdsfw = Framework.new( + title: 'Strategy for the Development of Samoa', + short_title: 'SDS', + has_indicators: true, + has_measures: true, + has_response: false, + ) + sdsfw.save! + sdgfw = Framework.new( + title: 'Sustainable Debelopment Goals', + short_title: 'SDGs', + has_indicators: true, + has_measures: true, + has_response: false, + ) + sdgfw.save! + + # Set up taxonomies ######################################################## + # 1. Global taxonomy + body = FactoryGirl.create( + :taxonomy, + framework:hr, + title: 'Human rights body', + tags_measures: false, + tags_users: false, + allow_multiple: false, + has_manager: true, + priority: 11, + groups_recommendations_default: 1 + ) + FactoryGirl.create( + :framework_taxonomy, + framework:hr, + taxonomy:body, + ) + # 2. Global taxonomy + cycle = FactoryGirl.create( + :taxonomy, + framework:hr, + title: 'Cycle', + tags_measures: false, + tags_users: false, + allow_multiple: false, + priority: 12, + groups_recommendations_default: 2, + parent_id: 1, # referencing hr body + has_date: true + ) + FactoryGirl.create( + :framework_taxonomy, + framework:hr, + taxonomy:cycle, + ) + + # 3. Global taxonomy + right = FactoryGirl.create( + :taxonomy, + framework:hr, + title: 'Human rights issue', + tags_measures: true, + tags_users: false, + allow_multiple: true, + priority: 51 + ) + FactoryGirl.create( + :framework_taxonomy, + framework:hr, + taxonomy:right, + ) + + # 4. Global taxonomy + persons = FactoryGirl.create( + :taxonomy, + framework:hr, + title: 'Affected persons', + tags_measures: true, + tags_users: false, + allow_multiple: true, + priority: 52 + ) + FactoryGirl.create( + :framework_taxonomy, + framework:hr, + taxonomy:persons, + ) + # 5. Country specific taxonomy + cluster = FactoryGirl.create( + :taxonomy, + title: 'Thematic cluster', + tags_measures: true, + tags_users: false, + allow_multiple: true, + priority: 100, + groups_measures_default: 1 + ) + + FactoryGirl.create( + :framework_taxonomy, + framework:hr, + taxonomy:cluster, + ) + FactoryGirl.create( + :framework_taxonomy, + framework:sdgfw, + taxonomy:cluster, + ) + FactoryGirl.create( + :framework_taxonomy, + framework:sdsfw, + taxonomy:cluster, + ) + + # 6. Samoa specific taxonomy + org = FactoryGirl.create( + :taxonomy, + title: 'Organisation', + tags_measures: true, + tags_users: true, + allow_multiple: true, + priority: 41 + ) + + # 7. Global taxonomy + sdg = FactoryGirl.create( + :taxonomy, + framework:sdgfw, + title: 'SDGs', + has_manager: true, + allow_multiple: true, + priority: 31 + ) + + FactoryGirl.create( + :framework_taxonomy, + framework:hr, + taxonomy:sdg, + ) + FactoryGirl.create( + :framework_taxonomy, + framework:sdgfw, + taxonomy:sdg, + ) + + # 8. Progress + progress = FactoryGirl.create( + :taxonomy, + title: 'Progress status', + tags_measures: true, + allow_multiple: false, + priority: 42 + ) + # 9. SDS priority area + priorityArea = FactoryGirl.create( + :taxonomy, + framework:sdsfw, + title: 'Priority area', + tags_measures: false, + allow_multiple: false, + priority: 21 + ) FactoryGirl.create( + :framework_taxonomy, + framework:sdsfw, + taxonomy:priorityArea, + ) + FactoryGirl.create( + :framework_taxonomy, + framework:hr, + taxonomy:outcome, + ) + + # 10. SDS key outcome + outcome = FactoryGirl.create( + :taxonomy, + framework:sdsfw, + title: 'Key outcome', + tags_measures: false, + allow_multiple: true, + priority: 22, + parent_id: 9 + ) + FactoryGirl.create( + :framework_taxonomy, + framework:sdsfw, + taxonomy:outcome, + ) + FactoryGirl.create( + :framework_taxonomy, + framework:hr, + taxonomy:outcome, + ) + + # 11. Source + source = FactoryGirl.create( + :taxonomy, + framework:hr, + title: 'Recommendation source', + tags_measures: false, + allow_multiple: false, + priority: 10 + ) + FactoryGirl.create( + :framework_taxonomy, + framework:hr, + taxonomy:source, + ) + + # Set up categories ######################################################## + # sds priority areas + sds1 = FactoryGirl.create( :category, - taxonomy_id:9, + taxonomy:priorityArea, title:'Economic', + reference: '1' + ) + sds2 = FactoryGirl.create( + :category, + taxonomy:priorityArea, + title:'Social', + reference: '2' + ) + sds3 = FactoryGirl.create( + :category, + taxonomy:priorityArea, + title:'Infrastructure', + reference: '3' + ) + sds4 = FactoryGirl.create( + :category, + taxonomy:priorityArea, + title:'Environment', + reference: '4' + ) + # sds key outcomes + FactoryGirl.create( + :category, + taxonomy:outcome, + title:'Macroeconomic Resilience Increased and Sustained', reference: '1', - short_title:'', + parent:sds1 + ) + FactoryGirl.create( + :category, + taxonomy:outcome, + title:'Agriculture and Fisheries Productivity Increased', + reference: '2', + parent:sds1 + ) + FactoryGirl.create( + :category, + taxonomy:outcome, + title:'Export Products Increased', + reference: '3', + parent:sds1 + ) + FactoryGirl.create( + :category, + taxonomy:outcome, + title:'Tourism Development and Performance Improved', + reference: '4', + parent:sds1 + ) + FactoryGirl.create( + :category, + taxonomy:outcome, + title:'Participation of Private Sector in Development Enhanced', + reference: '5', + parent:sds1 + ) + FactoryGirl.create( + :category, + taxonomy:outcome, + title:'A Healthy Samoa and Well-being Promoted', + reference: '6', + parent:sds2 + ) + FactoryGirl.create( + :category, + taxonomy:outcome, + title:'Quality Education and Training Improved', + reference: '7', + parent:sds2 + ) + FactoryGirl.create( + :category, + taxonomy:outcome, + title:'Social Institutions Strengthened - Community Development Enhanced', + reference: '8a', + parent:sds2 + ) + FactoryGirl.create( + :category, + taxonomy:outcome, + title:'Social Institutions Strengthened - Community Safety Improved', + reference: '8b', + parent:sds2 + ) + FactoryGirl.create( + :category, + taxonomy:outcome, + title:'Access to Clean Water and Sanitation Sustained', + reference: '9', + parent:sds3 + ) + FactoryGirl.create( + :category, + taxonomy:outcome, + title:'Transport Systems and Networks Improved', + reference: '10', + parent:sds3 + ) + FactoryGirl.create( + :category, + taxonomy:outcome, + title:'Improved and Affordable Country Wide ICT Connectivity', + reference: '11', + parent:sds3 + ) + FactoryGirl.create( + :category, + taxonomy:outcome, + title:'Quality Energy Supply', + reference: '12', + parent:sds3 + ) + FactoryGirl.create( + :category, + taxonomy:outcome, + title:'Environmental Resilience Improved', + reference: '13', + parent:sds4 + ) + FactoryGirl.create( + :category, + taxonomy:outcome, + title:'Climate and Disaster Resilience', + reference: '14', + parent:sds4 + ) + # Human Rights Bodies http://www.ohchr.org/EN/HRBodies/Pages/HumanRightsBodies.aspx + hr1 = FactoryGirl.create( + :category, + taxonomy:body, + title:'Universal Periodic Review', + short_title:'UPR', + reference:'UPR' + ) + hr2 = FactoryGirl.create( + :category, + taxonomy:body, + title:'Human Rights Committee', + short_title:'CCPR', + reference:'CCPR' + ) + hr3 = FactoryGirl.create( + :category, + taxonomy:body, + title:'Committee on Economic, Social and Cultural Rights', + short_title:'CESCR', + reference:'CESCR' + ) + hr4= FactoryGirl.create( + :category, + taxonomy:body, + title:'Committee on the Elimination of Discrimination against Women', + short_title:'CEDAW', + reference:'CEDAW' + ) + hr5 = FactoryGirl.create( + :category, + taxonomy:body, + title:'Committee against Torture', + short_title:'CAT', + reference:'CAT' + ) + hr6 = FactoryGirl.create( + :category, + taxonomy:body, + title:'Committee on the Rights of the Child', + short_title:'CRC', + reference:'CRC' + ) + hr7 = FactoryGirl.create( + :category, + taxonomy:body, + title:'Committee on the Rights of Persons with Disabilities', + short_title:'CRPD', + reference:'CRPD' + ) + hr8 = FactoryGirl.create( + :category, + taxonomy:body, + title:'Committee on Enforced Disappearances', + short_title:'CED', + reference:'CED' + ) + hr9 = FactoryGirl.create( + :category, + taxonomy:body, + title:'Working Group on discrimination against women in law and in practice', + short_title:'WGDAW', + reference:'WGDAW' + ) + hr10 = FactoryGirl.create( + :category, + taxonomy:body, + title:'National Human Rights Institution (Ombudsman)', + short_title:'NHRI', + reference:'NHRI' + ) + hr11 = FactoryGirl.create( + :category, + taxonomy:body, + title:'Samoa Law Reform Commission', + short_title:'SLRC', + reference:'SLRC' + ) + # HR body cycles + FactoryGirl.create( + :category, + taxonomy:cycle, + title:"UPR 1st cycle", + short_title:"UPR 1", + description:"Recommendations following Samoa's First Universal Periodic Review in 2011", + url:"https://documents-dds-ny.un.org/doc/UNDOC/GEN/G11/146/32/PDF/G1114632.pdf?OpenElement" + draft:true, + user_only:false, + parent:hr1 + ) + + FactoryGirl.create( + :category, + taxonomy:cycle, + title:"UPR 2nd cycle", + short_title:"UPR 2", + draft:false, + user_only:false, + parent:hr1 + ) + + FactoryGirl.create( + :category, + taxonomy:cycle, + title:"UPR 3rd cycle", + short_title:"UPR 3", + draft:true, + user_only:false, + parent:hr1 + ) + + FactoryGirl.create( + :category, + taxonomy:cycle, + title:"ICCPR Articles", + short_title:"ICCPR Articles", + draft:false, + user_only:false, + parent:hr2 + ) + + FactoryGirl.create( + :category, + taxonomy:cycle, + title:"ICESCR Articles", + short_title:"ICESCR Articles", + draft:false, + user_only:false, + parent:hr3 + ) + + FactoryGirl.create( + :category, + taxonomy:cycle, + title:"CEDAW Articles", + short_title:"CEDAW Articles", + draft:false, + user_only:false, + parent:hr4 + ) + + FactoryGirl.create( + :category, + taxonomy:cycle, + title:"CEDAW General Recommendations", + short_title:"CEDAW-GR", + draft:true, + user_only:false, + parent:hr4 + ) + + FactoryGirl.create( + :category, + taxonomy:cycle, + title:"CEDAW 1-3 Periodic Report", + short_title:"CEDAW 1-3", + description:"Combined initial, second and third report on CEDAW", + draft:true, + user_only:false, + parent:hr4 + ) + + FactoryGirl.create( + :category, + taxonomy:cycle, + title:"CEDAW 4-5 Periodic Report", + short_title:"CEDAW 4-5", + draft:true, + user_only:false, + parent:hr4 + ) + + FactoryGirl.create( + :category, + taxonomy:cycle, + title:"CEDAW 6th Periodic Report", + short_title:"6th Cycle", + draft:false, + user_only:false, + parent:hr4 + ) + + FactoryGirl.create( + :category, + taxonomy:cycle, + title:"CAT Articles", + short_title:"CAT Articles", + draft:false, + user_only:false, + parent:hr5 + ) + + FactoryGirl.create( + :category, + taxonomy:cycle, + title:"CRC Articles", + short_title:"CRC Articles", + draft:false, + user_only:false, + parent:hr6 + ) + + FactoryGirl.create( + :category, + taxonomy:cycle, + title:"CRC cycle 2-4", + short_title:"CRC 2-4", + draft:false, + parent:hr6 + ) + + FactoryGirl.create( + :category, + taxonomy:cycle, + title:"CRPD Articles", + short_title:"CRPD Articles", + draft:false, + user_only:false, + parent:hr7 + ) + + FactoryGirl.create( + :category, + taxonomy:cycle, + title:"CPPED Articles", + short_title:"CPPED Articles", + draft:false, + user_only:false, + parent:hr8 + ) + + FactoryGirl.create( + :category, + taxonomy:cycle, + title:"WGDAW all", + short_title:"WGDAW all", + draft:false, + user_only:false, + parent:hr9 + ) + + FactoryGirl.create( + :category, + taxonomy:cycle, + title:"NHRI 2015-2019", + short_title:"NHRI 2015-2019", + draft:false, + user_only:false, + parent:hr10 + ) + + FactoryGirl.create( + :category, + taxonomy:cycle, + title:"SLRC 2016", + short_title:"SLRC 2016", + draft:false, + user_only:false, + parent:hr11 + ) + # # Human Rights Issues (level 2 http://uhri.ohchr.org/search/guide) + # # TODO level 2 and 3 human rights + FactoryGirl.create( + :category, + taxonomy:right, + title:'Scope of international obligations', + short_title:'Int. obligations', + reference:'A1', description:'', url:'' ) FactoryGirl.create( :category, - taxonomy_id:9, - title:'Social', - reference: '2', - short_title:'', + taxonomy:right, + title:'Cooperation with human rights mechanisms and institutions', + short_title:'Cooperation ', + reference:'A2', description:'', url:'' ) FactoryGirl.create( :category, - taxonomy_id:9, - title:'Infrastructure', - reference: '3', - short_title:'', + taxonomy:right, + title:'Inter-State cooperation & development assistance', + short_title:'Inter-State cooperation', + reference:'A3', description:'', url:'' ) FactoryGirl.create( :category, - taxonomy_id:9, - title:'Environment', - reference: '4', - short_title:'', + taxonomy:right, + title:'Legal, institutional and policy framework', + short_title:'Framework', + reference:'A4', description:'', url:'' ) - # sds key outcomes FactoryGirl.create( :category, - taxonomy_id:10, - title:'Macroeconomic Resilience Increased and Sustained', - reference: '1', - short_title:'', + taxonomy:right, + title:'Human rights education, trainings and awareness raising', + short_title:'HR education', + reference:'A5', description:'', url:'' ) FactoryGirl.create( :category, - taxonomy_id:10, - title:'Agriculture and Fisheries Productivity Increased', - reference: '2', - short_title:'', + taxonomy:right, + title:'Context, statistics, budget, civil society', + short_title:'Context', + reference:'A6', description:'', url:'' ) FactoryGirl.create( :category, - taxonomy_id:10, - title:'Export Products Increased', - reference: '3', - short_title:'', + taxonomy:right, + title:'International criminal and humanitarian law', + short_title:'Int. law', + reference:'B1', description:'', url:'' ) FactoryGirl.create( :category, - taxonomy_id:10, - title:'Tourism Development and Performance Improved', - reference: '4', - short_title:'', + taxonomy:right, + title:'Right to self-determination', + short_title:'Self-determination', + reference:'B2', description:'', url:'' ) FactoryGirl.create( :category, - taxonomy_id:10, - title:'Participation of Private Sector in Development Enhanced', - reference: '5', - short_title:'', + taxonomy:right, + title:'Equality and non-discrimination', + short_title:'Equality', + reference:'B3', description:'', url:'' ) FactoryGirl.create( :category, - taxonomy_id:10, - title:'A Healthy Samoa and Well-being Promoted', - reference: '6', - short_title:'', + taxonomy:right, + title:'Right to development', + short_title:'Development', + reference:'B4', description:'', url:'' ) FactoryGirl.create( :category, - taxonomy_id:10, - title:'Quality Education and Training Improved', - reference: '7', - short_title:'', + taxonomy:right, + title:'Right to a remedy', + short_title:'Remedy', + reference:'B5', description:'', url:'' ) FactoryGirl.create( :category, - taxonomy_id:10, - title:'Social Institutions Strengthened - Community Development Enhanced', - reference: '8a', - short_title:'', + taxonomy:right, + title:'Business & Human Rights', + short_title:'Business', + reference:'B6', description:'', url:'' ) FactoryGirl.create( :category, - taxonomy_id:10, - title:'Social Institutions Strengthened - Community Safety Improved', - reference: '8b', - short_title:'', + taxonomy:right, + title:'Human rights and environmental issues', + short_title:'Environment', + reference:'B7', description:'', url:'' ) FactoryGirl.create( :category, - taxonomy_id:10, - title:'Access to Clean Water and Sanitation Sustained', - reference: '9', - short_title:'', + taxonomy:right, + title:'Human rights & counter-terrorism', + short_title:'Counter-terrorism', + reference:'B8', description:'', url:'' ) FactoryGirl.create( :category, - taxonomy_id:10, - title:'Transport Systems and Networks Improved', - reference: '10', - short_title:'', + taxonomy:right, + title:'Human rights & use of mercenaries', + short_title:'Mercenaries', + reference:'B9', description:'', url:'' ) FactoryGirl.create( :category, - taxonomy_id:10, - title:'Improved and Affordable Country Wide ICT Connectivity', - reference: '11', - short_title:'', + taxonomy:right, + title:'Civil & political rights - general measures of implementation', + short_title:'Civil & political', + reference:'D1', description:'', url:'' ) FactoryGirl.create( :category, - taxonomy_id:10, - title:'Quality Energy Supply', - reference: '12', - short_title:'', + taxonomy:right, + title:'Right to physical and moral integrity', + short_title:'Integrity', + reference:'D2', description:'', url:'' ) FactoryGirl.create( :category, - taxonomy_id:10, - title:'Environmental Resilience Improved', - reference: '13', - short_title:'', + taxonomy:right, + title:'Liberty and security of the person', + short_title:'Liberty', + reference:'D3', description:'', url:'' ) FactoryGirl.create( :category, - taxonomy_id:10, - title:'Climate and Disaster Resilience', - reference: '14', - short_title:'', + taxonomy:right, + title:'Fundamental freedoms', + short_title:'Freedoms', + reference:'D4', + description:'', + url:'' + ) + FactoryGirl.create( + :category, + taxonomy:right, + title:'Administration of justice', + short_title:'Justice', + reference:'D5', + description:'', + url:'' + ) + FactoryGirl.create( + :category, + taxonomy:right, + title:'Rights related to name, identity, nationality', + short_title:'Identity', + reference:'D6', + description:'', + url:'' + ) + FactoryGirl.create( + :category, + taxonomy:right, + title:'Right to participation in public affairs and right to vote', + short_title:'Participation', + reference:'D7', + description:'', + url:'' + ) + FactoryGirl.create( + :category, + taxonomy:right, + title:'Rights related to marriage & family', + short_title:'Family', + reference:'D8', + description:'', + url:'' + ) + FactoryGirl.create( + :category, + taxonomy:right, + title:'Economic, social & cultural rights - general measures of implementation', + short_title:'Economic, social & cultural', + reference:'E1', + description:'', + url:'' + ) + FactoryGirl.create( + :category, + taxonomy:right, + title:'Right to an adequate standard of living', + short_title:'Standard of living', + reference:'E2', + description:'', + url:'' + ) + FactoryGirl.create( + :category, + taxonomy:right, + title:'Labour rights', + short_title:'Labour rights', + reference:'E3', + description:'', + url:'' + ) + FactoryGirl.create( + :category, + taxonomy:right, + title:'Right to health', + short_title:'Health', + reference:'E4', + description:'', + url:'' + ) + FactoryGirl.create( + :category, + taxonomy:right, + title:'Right to education', + short_title:'Education', + reference:'E5', + description:'', + url:'' + ) + FactoryGirl.create( + :category, + taxonomy:right, + title:'Rights to protection of property; financial credit', + short_title:'Property', + reference:'E6', + description:'', + url:'' + ) + FactoryGirl.create( + :category, + taxonomy:right, + title:'Cultural rights', + short_title:'Cultural rights', + reference:'E7', + description:'', + url:'' + ) + FactoryGirl.create( + :category, + taxonomy:right, + title:'Women', + short_title:'Women', + reference:'F1', + description:'', + url:'' + ) + FactoryGirl.create( + :category, + taxonomy:right, + title:'Children', + short_title:'Children', + reference:'F3', + description:'', + url:'' + ) + FactoryGirl.create( + :category, + taxonomy:right, + title:'Persons with disabilities', + short_title:'Persons with disabilities', + reference:'F4', + description:'', + url:'' + ) + FactoryGirl.create( + :category, + taxonomy:right, + title:'Members of minorities', + short_title:'Minorities', + reference:'G1', + description:'', + url:'' + ) + FactoryGirl.create( + :category, + taxonomy:right, + title:'Indigenous peoples', + short_title:'Indigenous peoples', + reference:'G3', + description:'', + url:'' + ) + FactoryGirl.create( + :category, + taxonomy:right, + title:'Migrants', + short_title:'Migrants', + reference:'G4', + description:'', + url:'' + ) + FactoryGirl.create( + :category, + taxonomy:right, + title:'Refugees & asylum seekers', + short_title:'Refugees', + reference:'G5', + description:'', + url:'' + ) + FactoryGirl.create( + :category, + taxonomy:right, + title:'Internally displaced persons', + short_title:'Internally displaced', + reference:'G5', + description:'', + url:'' + ) + FactoryGirl.create( + :category, + taxonomy:right, + title:'Human rights defenders', + short_title:'HR defenders', + reference:'H1', description:'', url:'' ) - # Human Rights Bodies http://www.ohchr.org/EN/HRBodies/Pages/HumanRightsBodies.aspx - # FactoryGirl.create( - # :category, - # taxonomy:body, - # title:'Universal Periodic Review', - # short_title:'UPR', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:body, - # title:'Human Rights Committee', - # short_title:'CCPR', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:body, - # title:'Committee on Economic, Social and Cultural Rights', - # short_title:'CESCR', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:body, - # title:'Committee on the Elimination of Racial Discrimination', - # short_title:'CERD', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:body, - # title:'Committee on the Elimination of Discrimination against Women', - # short_title:'CEDAW', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:body, - # title:'Committee against Torture', - # short_title:'CAT', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:body, - # title:'Subcommittee on Prevention of Torture', - # short_title:'SPT', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:body, - # title:'Committee on the Rights of the Child', - # short_title:'CRC', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:body, - # title:'Committee on Migrant Workers', - # short_title:'CMW', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:body, - # title:'Committee on the Rights of Persons with Disabilities', - # short_title:'CRPD', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:body, - # title:'Committee on Enforced Disappearances', - # short_title:'CED', - # description:'', - # url:'' - # ) - # - # # Human Rights Issues (level 2 http://uhri.ohchr.org/search/guide) - # # TODO level 2 and 3 human rights - # FactoryGirl.create( - # :category, - # taxonomy:right, - # title:'Scope of international obligations', - # short_title:'Int. obligations', - # reference:'A1', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:right, - # title:'Cooperation with human rights mechanisms and institutions', - # short_title:'Cooperation ', - # reference:'A2', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:right, - # title:'Inter-State cooperation & development assistance', - # short_title:'Inter-State cooperation', - # reference:'A3', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:right, - # title:'Legal, institutional and policy framework', - # short_title:'Framework', - # reference:'A4', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:right, - # title:'Human rights education, trainings and awareness raising', - # short_title:'HR education', - # reference:'A5', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:right, - # title:'Context, statistics, budget, civil society', - # short_title:'Context', - # reference:'A6', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:right, - # title:'International criminal and humanitarian law', - # short_title:'Int. law', - # reference:'B1', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:right, - # title:'Right to self-determination', - # short_title:'Self-determination', - # reference:'B2', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:right, - # title:'Equality and non-discrimination', - # short_title:'Equality', - # reference:'B3', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:right, - # title:'Right to development', - # short_title:'Development', - # reference:'B4', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:right, - # title:'Right to a remedy', - # short_title:'Remedy', - # reference:'B5', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:right, - # title:'Business & Human Rights', - # short_title:'Business', - # reference:'B6', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:right, - # title:'Human rights and environmental issues', - # short_title:'Environment', - # reference:'B7', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:right, - # title:'Human rights & counter-terrorism', - # short_title:'Counter-terrorism', - # reference:'B8', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:right, - # title:'Human rights & use of mercenaries', - # short_title:'Mercenaries', - # reference:'B9', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:right, - # title:'Civil & political rights - general measures of implementation', - # short_title:'Civil & political', - # reference:'D1', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:right, - # title:'Right to physical and moral integrity', - # short_title:'Integrity', - # reference:'D2', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:right, - # title:'Liberty and security of the person', - # short_title:'Liberty', - # reference:'D3', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:right, - # title:'Fundamental freedoms', - # short_title:'Freedoms', - # reference:'D4', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:right, - # title:'Administration of justice', - # short_title:'Justice', - # reference:'D5', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:right, - # title:'Rights related to name, identity, nationality', - # short_title:'Identity', - # reference:'D6', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:right, - # title:'Right to participation in public affairs and right to vote', - # short_title:'Participation', - # reference:'D7', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:right, - # title:'Rights related to marriage & family', - # short_title:'Family', - # reference:'D8', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:right, - # title:'Economic, social & cultural rights - general measures of implementation', - # short_title:'Economic, social & cultural', - # reference:'E1', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:right, - # title:'Right to an adequate standard of living', - # short_title:'Standard of living', - # reference:'E2', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:right, - # title:'Labour rights', - # short_title:'Labour rights', - # reference:'E3', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:right, - # title:'Right to health', - # short_title:'Health', - # reference:'E4', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:right, - # title:'Right to education', - # short_title:'Education', - # reference:'E5', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:right, - # title:'Rights to protection of property; financial credit', - # short_title:'Property', - # reference:'E6', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:right, - # title:'Cultural rights', - # short_title:'Cultural rights', - # reference:'E7', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:right, - # title:'Women', - # short_title:'Women', - # reference:'F1', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:right, - # title:'Children', - # short_title:'Children', - # reference:'F3', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:right, - # title:'Persons with disabilities', - # short_title:'Persons with disabilities', - # reference:'F4', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:right, - # title:'Members of minorities', - # short_title:'Minorities', - # reference:'G1', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:right, - # title:'Indigenous peoples', - # short_title:'Indigenous peoples', - # reference:'G3', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:right, - # title:'Migrants', - # short_title:'Migrants', - # reference:'G4', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:right, - # title:'Refugees & asylum seekers', - # short_title:'Refugees', - # reference:'G5', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:right, - # title:'Internally displaced persons', - # short_title:'Internally displaced', - # reference:'G5', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:right, - # title:'Human rights defenders', - # short_title:'HR defenders', - # reference:'H1', - # description:'', - # url:'' - # ) - # - # - # # Affected Persons (http://uhri.ohchr.org/search/annotations) - # FactoryGirl.create( - # :category, - # taxonomy:persons, - # title:'Children', - # short_title:'Children', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:persons, - # title:'Children in street situations', - # short_title:'CSS', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:persons, - # title:'Disappeared persons', - # short_title:'Disappeared', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:persons, - # title:'Educational staff', - # short_title:'Edu', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:persons, - # title:'General', - # short_title:'General', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:persons, - # title:'Girls', - # short_title:'Girls', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:persons, - # title:'Human rights defenders', - # short_title:'HRD', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:persons, - # title:'Indigenous peoples', - # short_title:'Indigenous', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:persons, - # title:'Internally displaced persons', - # short_title:'IDP', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:persons, - # title:'Judges, lawyers and prosecutors', - # short_title:'JLP', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:persons, - # title:'Law enforcement / police officials', - # short_title:'Law', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:persons, - # title:'Lesbian, gay, bisexual and transgender and intersex persons (LGBTI)', - # short_title:'LGBTI', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:persons, - # title:'Media', - # short_title:'Media', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:persons, - # title:'Medical staff', - # short_title:'Medical', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:persons, - # title:'Mercenaries', - # short_title:'Mercenaries', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:persons, - # title:'Migrants', - # short_title:'Migrants', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:persons, - # title:'Military staff', - # short_title:'Military', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:persons, - # title:'Minorities / racial, ethnic, linguistic, religious or descent-based groups', - # short_title:'Minorities', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:persons, - # title:'Non-citizens', - # short_title:'Non-citizens', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:persons, - # title:'Older persons', - # short_title:'Old', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:persons, - # title:'Persons affected by armed conflict', - # short_title:'Armed conflict', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:persons, - # title:'Persons deprived of their liberty', - # short_title:'Liberty', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:persons, - # title:'Persons living in poverty', - # short_title:'Poverty', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:persons, - # title:'Persons living in rural areas', - # short_title:'Rural', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:persons, - # title:'Persons living with HIV/AIDS', - # short_title:'HIV', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:persons, - # title:'Persons with disabilities', - # short_title:'Disabilities', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:persons, - # title:'Prison officials', - # short_title:'Prison officials', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:persons, - # title:'Private security', - # short_title:'Private security', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:persons, - # title:'Public officials', - # short_title:'Public officials', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:persons, - # title:'Refugees & asylum seekers', - # short_title:'Refugees', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:persons, - # title:'Rural women', - # short_title:'Rural women', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:persons, - # title:'Social workers', - # short_title:'Social workers', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:persons, - # title:'Stateless persons', - # short_title:'Stateless', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:persons, - # title:'Vulnerable persons/groups', - # short_title:'Vulnerable', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:persons, - # title:'Women', - # short_title:'Women', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:persons, - # title:'Youth', - # short_title:'Youth', - # description:'', - # url:'' - # ) - # # SDGs - # FactoryGirl.create( - # :category, - # taxonomy:sdg, - # description:'End poverty in all its forms everywhere', - # title:'No poverty', - # reference: 1, - # short_title:'SDG 1', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:sdg, - # description:'End hunger, achieve food security and improved nutrition and promote sustainable agriculture', - # title:'Zero hunger', - # reference: 2, - # short_title:'SDG 2', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:sdg, - # description:'Ensure healthy lives and promote well-being for all at all ages', - # title:'Good Health and Well-being', - # reference: 3, - # short_title:'SDG 3', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:sdg, - # description:'Ensure inclusive and equitable quality education and promote lifelong learning opportunities for all', - # title:'Quality Education', - # reference: 4, - # short_title:'SDG 4', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:sdg, - # description:'Achieve gender equality and empower all women and girls', - # title:'Gender Equality', - # reference: 5, - # short_title:'SDG 5', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:sdg, - # description:'Ensure availability and sustainable management of water and sanitation for all', - # title:'Clean Water and Sanitation', - # reference: 6, - # short_title:'SDG 6', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:sdg, - # description:'Ensure access to affordable, reliable, sustainable and modern energy for all', - # title:'Affordable and Clean Energy', - # reference: 7, - # short_title:'SDG 7', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:sdg, - # description:'Promote sustained, inclusive and sustainable economic growth, full and productive employment and decent work for all', - # title:'Decent Work and Economic Growth', - # reference: 8, - # short_title:'SDG 8', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:sdg, - # description:'Build resilient infrastructure, promote inclusive and sustainable industrialization and foster innovation', - # title:'Industry, Innovation and Infrastructure', - # reference: 9, - # short_title:'SDG 9', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:sdg, - # description:'Reduce income inequality within and among countries', - # title:'Reduced Inequalities', - # reference: 10, - # short_title:'SDG 10', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:sdg, - # description:'Make cities and human settlements inclusive, safe, resilient and sustainable', - # title:'Sustainable Cities and Communities', - # reference: 11, - # short_title:'SDG 11', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:sdg, - # description:'Ensure sustainable consumption and production patterns', - # title:'Responsible Consumption and Production', - # reference: 12, - # short_title:'SDG 12', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:sdg, - # description:'Take urgent action to combat climate change and its impacts by regulating emissions and promoting developments in renewable energy', - # title:'Climate Action', - # reference: 13, - # short_title:'SDG 13', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:sdg, - # description:'Conserve and sustainably use the oceans, seas and marine resources for sustainable development', - # title:'Life Below Water', - # reference: 14, - # short_title:'SDG 14', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:sdg, - # description:'Protect, restore and promote sustainable use of terrestrial ecosystems, sustainably manage forests, combat desertification, and halt and reverse land degradation and halt biodiversity loss', - # title:'Life on Land', - # reference: 15, - # short_title:'SDG 15', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:sdg, - # description:'Promote peaceful and inclusive societies for sustainable development, provide access to justice for all and build effective, accountable and inclusive institutions at all levels', - # title:'Peace, Justice and Strong Institutions', - # reference: 16, - # short_title:'SDG 16', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:sdg, - # description:'Strengthen the means of implementation and revitalize the global partnership for sustainable development', - # title:'Partnerships for the Goals', - # reference: 17, - # short_title:'SDG 17', - # url:'' - # ) - # Countries - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Afghanistan', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Albania', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Algeria', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Andorra', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Angola', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Argentina', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Armenia', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Australia', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Austria', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Azerbaijan', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Bahamas', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Bahrain', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Bangladesh', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Barbados', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Belarus', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Belgium', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Belize', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Benin', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Bhutan', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Bolivia', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Bosnia and Herzegovina', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Botswana', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Brazil', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Brunei Darussalam', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Bulgaria', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Burkina Faso', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Burundi', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Cambodia', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Cameroon', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Canada', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Cape Verde', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Central African Republic', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Chad', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Chile', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'China', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Colombia', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Comoros', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Costa Rica', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Cote d\'Ivoire', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Croatia', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Cuba', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Cyprus', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Czechia', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'DPR Korea', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Democratic Republic of Congo', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Denmark', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Djibouti', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Dominica', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Dominican Republic', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Ecuador', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Egypt', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'El Salvador', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Equatorial Guinea', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Eritrea', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Estonia', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Ethiopia', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Fiji', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Finland', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'France', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Gabon', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Gambia', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Georgia', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Germany', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Ghana', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Greece', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Guatemala', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Guinea', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Guinea Bissau', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Guyana', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Haiti', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Holy See', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Honduras', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Hungary', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Iceland', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'India', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Indonesia', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Iran', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Iraq', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Ireland', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Israel', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Italy', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Jamaica', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Japan', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Jordan', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Kazakhstan', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Kenya', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Kiribati', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Kuwait', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Kyrgyzstan', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Laos', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Latvia', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Lebanon', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Lesotho', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Liberia', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Libya', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Liechtenstein', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Lithuania', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Luxembourg', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Macedonia FYR', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Madagascar', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Malawi', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Malaysia', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Maldives', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Mali', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Malta', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Marshall Islands', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Mauritania', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Mauritius', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Mexico', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Micronesia', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Moldova', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Monaco', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Mongolia', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Montenegro', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Morocco', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Mozambique', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Myanmar', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Namibia', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Nepal', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Netherlands', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'New Zealand', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Nicaragua', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Niger', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Nigeria', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Norway', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Oman', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Pakistan', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Palau', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Palestine', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Panama', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Paraguay', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Peru', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Philippines', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Poland', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Portugal', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Qatar', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Republic of Congo', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Republic of Korea', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Romania', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Russian Federation', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Rwanda', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Samoa', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'San Marino', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Sao Tome & Principe', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Saudi Arabia', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Senegal', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Serbia', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Seychelles', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Sierra Leone', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Singapore', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Slovakia', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Slovenia', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Solomon Islands', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Somalia', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'South Africa', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'South Sudan', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Spain', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Sri Lanka', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'St Kitts & Nevis', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'St Lucia', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'St Vincent & the Grenadines', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Sudan', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Swaziland', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Sweden', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Switzerland', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Syria', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Tajikistan', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Tanzania', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Thailand', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Timor-Leste', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Togo', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Tonga', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Trinidad and Tobago', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Tunisia', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Turkey', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Turkmenistan', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Tuvalu', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Uganda', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Ukraine', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'United Arab Emirates', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'United Kingdom', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'United States', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Uruguay', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Uzbekistan', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Vanuatu', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Venezuela', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Viet Nam', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Yemen', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Zambia', - # short_title:'', - # description:'', - # url:'' - # ) - # FactoryGirl.create( - # :category, - # taxonomy:country, - # title:'Zimbabwe', - # short_title:'', - # description:'', - # url:'' - # ) + # Affected Persons (http://uhri.ohchr.org/search/annotations) + FactoryGirl.create( + :category, + taxonomy:persons, + title:'Children', + short_title:'Children', + description:'', + url:'' + ) + FactoryGirl.create( + :category, + taxonomy:persons, + title:'Children in street situations', + short_title:'CSS', + description:'', + url:'' + ) + FactoryGirl.create( + :category, + taxonomy:persons, + title:'Disappeared persons', + short_title:'Disappeared', + description:'', + url:'' + ) + FactoryGirl.create( + :category, + taxonomy:persons, + title:'Educational staff', + short_title:'Edu', + description:'', + url:'' + ) + FactoryGirl.create( + :category, + taxonomy:persons, + title:'General', + short_title:'General', + description:'', + url:'' + ) + FactoryGirl.create( + :category, + taxonomy:persons, + title:'Girls', + short_title:'Girls', + description:'', + url:'' + ) + FactoryGirl.create( + :category, + taxonomy:persons, + title:'Human rights defenders', + short_title:'HRD', + description:'', + url:'' + ) + FactoryGirl.create( + :category, + taxonomy:persons, + title:'Indigenous peoples', + short_title:'Indigenous', + description:'', + url:'' + ) + FactoryGirl.create( + :category, + taxonomy:persons, + title:'Internally displaced persons', + short_title:'IDP', + description:'', + url:'' + ) + FactoryGirl.create( + :category, + taxonomy:persons, + title:'Judges, lawyers and prosecutors', + short_title:'JLP', + description:'', + url:'' + ) + FactoryGirl.create( + :category, + taxonomy:persons, + title:'Law enforcement / police officials', + short_title:'Law', + description:'', + url:'' + ) + FactoryGirl.create( + :category, + taxonomy:persons, + title:'Lesbian, gay, bisexual and transgender and intersex persons (LGBTI)', + short_title:'LGBTI', + description:'', + url:'' + ) + FactoryGirl.create( + :category, + taxonomy:persons, + title:'Media', + short_title:'Media', + description:'', + url:'' + ) + FactoryGirl.create( + :category, + taxonomy:persons, + title:'Medical staff', + short_title:'Medical', + description:'', + url:'' + ) + FactoryGirl.create( + :category, + taxonomy:persons, + title:'Mercenaries', + short_title:'Mercenaries', + description:'', + url:'' + ) + FactoryGirl.create( + :category, + taxonomy:persons, + title:'Migrants', + short_title:'Migrants', + description:'', + url:'' + ) + FactoryGirl.create( + :category, + taxonomy:persons, + title:'Military staff', + short_title:'Military', + description:'', + url:'' + ) + FactoryGirl.create( + :category, + taxonomy:persons, + title:'Minorities / racial, ethnic, linguistic, religious or descent-based groups', + short_title:'Minorities', + description:'', + url:'' + ) + FactoryGirl.create( + :category, + taxonomy:persons, + title:'Non-citizens', + short_title:'Non-citizens', + description:'', + url:'' + ) + FactoryGirl.create( + :category, + taxonomy:persons, + title:'Older persons', + short_title:'Old', + description:'', + url:'' + ) + FactoryGirl.create( + :category, + taxonomy:persons, + title:'Persons affected by armed conflict', + short_title:'Armed conflict', + description:'', + url:'' + ) + FactoryGirl.create( + :category, + taxonomy:persons, + title:'Persons deprived of their liberty', + short_title:'Liberty', + description:'', + url:'' + ) + FactoryGirl.create( + :category, + taxonomy:persons, + title:'Persons living in poverty', + short_title:'Poverty', + description:'', + url:'' + ) + FactoryGirl.create( + :category, + taxonomy:persons, + title:'Persons living in rural areas', + short_title:'Rural', + description:'', + url:'' + ) + FactoryGirl.create( + :category, + taxonomy:persons, + title:'Persons living with HIV/AIDS', + short_title:'HIV', + description:'', + url:'' + ) + FactoryGirl.create( + :category, + taxonomy:persons, + title:'Persons with disabilities', + short_title:'Disabilities', + description:'', + url:'' + ) + FactoryGirl.create( + :category, + taxonomy:persons, + title:'Prison officials', + short_title:'Prison officials', + description:'', + url:'' + ) + FactoryGirl.create( + :category, + taxonomy:persons, + title:'Private security', + short_title:'Private security', + description:'', + url:'' + ) + FactoryGirl.create( + :category, + taxonomy:persons, + title:'Public officials', + short_title:'Public officials', + description:'', + url:'' + ) + FactoryGirl.create( + :category, + taxonomy:persons, + title:'Refugees & asylum seekers', + short_title:'Refugees', + description:'', + url:'' + ) + FactoryGirl.create( + :category, + taxonomy:persons, + title:'Rural women', + short_title:'Rural women', + description:'', + url:'' + ) + FactoryGirl.create( + :category, + taxonomy:persons, + title:'Social workers', + short_title:'Social workers', + description:'', + url:'' + ) + FactoryGirl.create( + :category, + taxonomy:persons, + title:'Stateless persons', + short_title:'Stateless', + description:'', + url:'' + ) + FactoryGirl.create( + :category, + taxonomy:persons, + title:'Vulnerable persons/groups', + short_title:'Vulnerable', + description:'', + url:'' + ) + FactoryGirl.create( + :category, + taxonomy:persons, + title:'Women', + short_title:'Women', + description:'', + url:'' + ) + FactoryGirl.create( + :category, + taxonomy:persons, + title:'Youth', + short_title:'Youth', + description:'', + url:'' + ) + # SDGs + FactoryGirl.create( + :category, + taxonomy:sdg, + description:'End poverty in all its forms everywhere', + title:'No poverty', + reference: 1, + short_title:'SDG 1', + url:'' + ) + FactoryGirl.create( + :category, + taxonomy:sdg, + description:'End hunger, achieve food security and improved nutrition and promote sustainable agriculture', + title:'Zero hunger', + reference: 2, + short_title:'SDG 2', + url:'' + ) + FactoryGirl.create( + :category, + taxonomy:sdg, + description:'Ensure healthy lives and promote well-being for all at all ages', + title:'Good Health and Well-being', + reference: 3, + short_title:'SDG 3', + url:'' + ) + FactoryGirl.create( + :category, + taxonomy:sdg, + description:'Ensure inclusive and equitable quality education and promote lifelong learning opportunities for all', + title:'Quality Education', + reference: 4, + short_title:'SDG 4', + url:'' + ) + FactoryGirl.create( + :category, + taxonomy:sdg, + description:'Achieve gender equality and empower all women and girls', + title:'Gender Equality', + reference: 5, + short_title:'SDG 5', + url:'' + ) + FactoryGirl.create( + :category, + taxonomy:sdg, + description:'Ensure availability and sustainable management of water and sanitation for all', + title:'Clean Water and Sanitation', + reference: 6, + short_title:'SDG 6', + url:'' + ) + FactoryGirl.create( + :category, + taxonomy:sdg, + description:'Ensure access to affordable, reliable, sustainable and modern energy for all', + title:'Affordable and Clean Energy', + reference: 7, + short_title:'SDG 7', + url:'' + ) + FactoryGirl.create( + :category, + taxonomy:sdg, + description:'Promote sustained, inclusive and sustainable economic growth, full and productive employment and decent work for all', + title:'Decent Work and Economic Growth', + reference: 8, + short_title:'SDG 8', + url:'' + ) + FactoryGirl.create( + :category, + taxonomy:sdg, + description:'Build resilient infrastructure, promote inclusive and sustainable industrialization and foster innovation', + title:'Industry, Innovation and Infrastructure', + reference: 9, + short_title:'SDG 9', + url:'' + ) + FactoryGirl.create( + :category, + taxonomy:sdg, + description:'Reduce income inequality within and among countries', + title:'Reduced Inequalities', + reference: 10, + short_title:'SDG 10', + url:'' + ) + FactoryGirl.create( + :category, + taxonomy:sdg, + description:'Make cities and human settlements inclusive, safe, resilient and sustainable', + title:'Sustainable Cities and Communities', + reference: 11, + short_title:'SDG 11', + url:'' + ) + FactoryGirl.create( + :category, + taxonomy:sdg, + description:'Ensure sustainable consumption and production patterns', + title:'Responsible Consumption and Production', + reference: 12, + short_title:'SDG 12', + url:'' + ) + FactoryGirl.create( + :category, + taxonomy:sdg, + description:'Take urgent action to combat climate change and its impacts by regulating emissions and promoting developments in renewable energy', + title:'Climate Action', + reference: 13, + short_title:'SDG 13', + url:'' + ) + FactoryGirl.create( + :category, + taxonomy:sdg, + description:'Conserve and sustainably use the oceans, seas and marine resources for sustainable development', + title:'Life Below Water', + reference: 14, + short_title:'SDG 14', + url:'' + ) + FactoryGirl.create( + :category, + taxonomy:sdg, + description:'Protect, restore and promote sustainable use of terrestrial ecosystems, sustainably manage forests, combat desertification, and halt and reverse land degradation and halt biodiversity loss', + title:'Life on Land', + reference: 15, + short_title:'SDG 15', + url:'' + ) + FactoryGirl.create( + :category, + taxonomy:sdg, + description:'Promote peaceful and inclusive societies for sustainable development, provide access to justice for all and build effective, accountable and inclusive institutions at all levels', + title:'Peace, Justice and Strong Institutions', + reference: 16, + short_title:'SDG 16', + url:'' + ) + FactoryGirl.create( + :category, + taxonomy:sdg, + description:'Strengthen the means of implementation and revitalize the global partnership for sustainable development', + title:'Partnerships for the Goals', + reference: 17, + short_title:'SDG 17', + url:'' + ) + # Sources + FactoryGirl.create( + :category, + taxonomy:source, + title:'HR Convention Articles', + short_title:'Convention' + ) + FactoryGirl.create( + :category, + taxonomy:source, + title:'International recommendations', + short_title:'Internatl.' + ) + FactoryGirl.create( + :category, + taxonomy:source, + title:'National recommendations', + short_title:'National' + ) + # progress + FactoryGirl.create( + :category, + taxonomy:progress, + title:'Ongoing', + short_title:'Ongoing' + ) + # progress + FactoryGirl.create( + :category, + taxonomy:progress, + title:'Complete', + short_title:'Complete' + ) end def development_seeds! From 7826dfc097c4798060c611df9a970fb1205079b7 Mon Sep 17 00:00:00 2001 From: tmfrnz Date: Sun, 18 Jul 2021 15:25:13 +0200 Subject: [PATCH 07/24] specify migration version --- db/migrate/20170107173635_create_versions.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/migrate/20170107173635_create_versions.rb b/db/migrate/20170107173635_create_versions.rb index 96178cbe..a7a8391b 100644 --- a/db/migrate/20170107173635_create_versions.rb +++ b/db/migrate/20170107173635_create_versions.rb @@ -1,6 +1,6 @@ # This migration creates the `versions` table, the only schema PT requires. # All other migrations PT provides are optional. -class CreateVersions < ActiveRecord::Migration +class CreateVersions < ActiveRecord::Migration[5.0] # Class names of MySQL adapters. # - `MysqlAdapter` - Used by gems: `mysql`, `activerecord-jdbcmysql-adapter`. # - `Mysql2Adapter` - Used by `mysql2` gem. From 1d0782f4eab98fabc9d952ebc4ef7e148932a9f8 Mon Sep 17 00:00:00 2001 From: tmfrnz Date: Sun, 18 Jul 2021 15:28:25 +0200 Subject: [PATCH 08/24] fix seeds file --- db/seeds.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/seeds.rb b/db/seeds.rb index 8ccb470f..8364cbb8 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -460,7 +460,7 @@ def base_seeds! title:"UPR 1st cycle", short_title:"UPR 1", description:"Recommendations following Samoa's First Universal Periodic Review in 2011", - url:"https://documents-dds-ny.un.org/doc/UNDOC/GEN/G11/146/32/PDF/G1114632.pdf?OpenElement" + url:"https://documents-dds-ny.un.org/doc/UNDOC/GEN/G11/146/32/PDF/G1114632.pdf?OpenElement", draft:true, user_only:false, parent:hr1 From a632ea7ca9d0039c5addbb078ae866cfde7bbd89 Mon Sep 17 00:00:00 2001 From: tmfrnz Date: Sun, 18 Jul 2021 15:32:35 +0200 Subject: [PATCH 09/24] cleanup seeds file --- db/seeds.rb | 76 ++++++++++++++++++++++++++--------------------------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/db/seeds.rb b/db/seeds.rb index 8364cbb8..054fcd54 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -457,10 +457,10 @@ def base_seeds! FactoryGirl.create( :category, taxonomy:cycle, - title:"UPR 1st cycle", - short_title:"UPR 1", + title:'UPR 1st cycle', + short_title:'UPR 1', description:"Recommendations following Samoa's First Universal Periodic Review in 2011", - url:"https://documents-dds-ny.un.org/doc/UNDOC/GEN/G11/146/32/PDF/G1114632.pdf?OpenElement", + url:'https://documents-dds-ny.un.org/doc/UNDOC/GEN/G11/146/32/PDF/G1114632.pdf?OpenElement', draft:true, user_only:false, parent:hr1 @@ -469,8 +469,8 @@ def base_seeds! FactoryGirl.create( :category, taxonomy:cycle, - title:"UPR 2nd cycle", - short_title:"UPR 2", + title:'UPR 2nd cycle', + short_title:'UPR 2', draft:false, user_only:false, parent:hr1 @@ -479,8 +479,8 @@ def base_seeds! FactoryGirl.create( :category, taxonomy:cycle, - title:"UPR 3rd cycle", - short_title:"UPR 3", + title:'UPR 3rd cycle', + short_title:'UPR 3', draft:true, user_only:false, parent:hr1 @@ -489,8 +489,8 @@ def base_seeds! FactoryGirl.create( :category, taxonomy:cycle, - title:"ICCPR Articles", - short_title:"ICCPR Articles", + title:'ICCPR Articles', + short_title:'ICCPR Articles', draft:false, user_only:false, parent:hr2 @@ -499,8 +499,8 @@ def base_seeds! FactoryGirl.create( :category, taxonomy:cycle, - title:"ICESCR Articles", - short_title:"ICESCR Articles", + title:'ICESCR Articles', + short_title:'ICESCR Articles', draft:false, user_only:false, parent:hr3 @@ -509,8 +509,8 @@ def base_seeds! FactoryGirl.create( :category, taxonomy:cycle, - title:"CEDAW Articles", - short_title:"CEDAW Articles", + title:'CEDAW Articles', + short_title:'CEDAW Articles', draft:false, user_only:false, parent:hr4 @@ -519,8 +519,8 @@ def base_seeds! FactoryGirl.create( :category, taxonomy:cycle, - title:"CEDAW General Recommendations", - short_title:"CEDAW-GR", + title:'CEDAW General Recommendations', + short_title:'CEDAW-GR', draft:true, user_only:false, parent:hr4 @@ -529,9 +529,9 @@ def base_seeds! FactoryGirl.create( :category, taxonomy:cycle, - title:"CEDAW 1-3 Periodic Report", - short_title:"CEDAW 1-3", - description:"Combined initial, second and third report on CEDAW", + title:'CEDAW 1-3 Periodic Report', + short_title:'CEDAW 1-3', + description:'Combined initial, second and third report on CEDAW', draft:true, user_only:false, parent:hr4 @@ -540,8 +540,8 @@ def base_seeds! FactoryGirl.create( :category, taxonomy:cycle, - title:"CEDAW 4-5 Periodic Report", - short_title:"CEDAW 4-5", + title:'CEDAW 4-5 Periodic Report', + short_title:'CEDAW 4-5', draft:true, user_only:false, parent:hr4 @@ -550,8 +550,8 @@ def base_seeds! FactoryGirl.create( :category, taxonomy:cycle, - title:"CEDAW 6th Periodic Report", - short_title:"6th Cycle", + title:'CEDAW 6th Periodic Report', + short_title:'6th Cycle', draft:false, user_only:false, parent:hr4 @@ -560,8 +560,8 @@ def base_seeds! FactoryGirl.create( :category, taxonomy:cycle, - title:"CAT Articles", - short_title:"CAT Articles", + title:'CAT Articles', + short_title:'CAT Articles', draft:false, user_only:false, parent:hr5 @@ -570,8 +570,8 @@ def base_seeds! FactoryGirl.create( :category, taxonomy:cycle, - title:"CRC Articles", - short_title:"CRC Articles", + title:'CRC Articles', + short_title:'CRC Articles', draft:false, user_only:false, parent:hr6 @@ -580,8 +580,8 @@ def base_seeds! FactoryGirl.create( :category, taxonomy:cycle, - title:"CRC cycle 2-4", - short_title:"CRC 2-4", + title:'CRC cycle 2-4', + short_title:'CRC 2-4', draft:false, parent:hr6 ) @@ -589,8 +589,8 @@ def base_seeds! FactoryGirl.create( :category, taxonomy:cycle, - title:"CRPD Articles", - short_title:"CRPD Articles", + title:'CRPD Articles', + short_title:'CRPD Articles', draft:false, user_only:false, parent:hr7 @@ -599,8 +599,8 @@ def base_seeds! FactoryGirl.create( :category, taxonomy:cycle, - title:"CPPED Articles", - short_title:"CPPED Articles", + title:'CPPED Articles', + short_title:'CPPED Articles', draft:false, user_only:false, parent:hr8 @@ -609,8 +609,8 @@ def base_seeds! FactoryGirl.create( :category, taxonomy:cycle, - title:"WGDAW all", - short_title:"WGDAW all", + title:'WGDAW all', + short_title:'WGDAW all', draft:false, user_only:false, parent:hr9 @@ -619,8 +619,8 @@ def base_seeds! FactoryGirl.create( :category, taxonomy:cycle, - title:"NHRI 2015-2019", - short_title:"NHRI 2015-2019", + title:'NHRI 2015-2019', + short_title:'NHRI 2015-2019', draft:false, user_only:false, parent:hr10 @@ -629,8 +629,8 @@ def base_seeds! FactoryGirl.create( :category, taxonomy:cycle, - title:"SLRC 2016", - short_title:"SLRC 2016", + title:'SLRC 2016', + short_title:'SLRC 2016', draft:false, user_only:false, parent:hr11 From d64ab78b4b9e54bfb63e1afffde601b25afc7daa Mon Sep 17 00:00:00 2001 From: tmfrnz Date: Sun, 18 Jul 2021 15:34:49 +0200 Subject: [PATCH 10/24] fix seeds --- db/seeds.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/seeds.rb b/db/seeds.rb index 054fcd54..953fb6a9 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -204,7 +204,7 @@ def base_seeds! FactoryGirl.create( :framework_taxonomy, framework:hr, - taxonomy:outcome, + taxonomy:priorityArea, ) # 10. SDS key outcome From 7c4a50cead962fd243f3928bd23fd97229a6d38b Mon Sep 17 00:00:00 2001 From: tmfrnz Date: Sun, 18 Jul 2021 15:41:38 +0200 Subject: [PATCH 11/24] try category instead of parent --- db/seeds.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/seeds.rb b/db/seeds.rb index 953fb6a9..1753cc3e 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -275,7 +275,7 @@ def base_seeds! taxonomy:outcome, title:'Macroeconomic Resilience Increased and Sustained', reference: '1', - parent:sds1 + category:sds1 ) FactoryGirl.create( :category, From 10ee4bd15da4163a0470a4827599f043da3cd274 Mon Sep 17 00:00:00 2001 From: tmfrnz Date: Sun, 18 Jul 2021 15:44:22 +0200 Subject: [PATCH 12/24] replace parent with category --- db/seeds.rb | 66 ++++++++++++++++++++++++++--------------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/db/seeds.rb b/db/seeds.rb index 1753cc3e..39e24304 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -275,105 +275,105 @@ def base_seeds! taxonomy:outcome, title:'Macroeconomic Resilience Increased and Sustained', reference: '1', - category:sds1 + category:sds1 # parent/parent_id ) FactoryGirl.create( :category, taxonomy:outcome, title:'Agriculture and Fisheries Productivity Increased', reference: '2', - parent:sds1 + category:sds1 ) FactoryGirl.create( :category, taxonomy:outcome, title:'Export Products Increased', reference: '3', - parent:sds1 + category:sds1 ) FactoryGirl.create( :category, taxonomy:outcome, title:'Tourism Development and Performance Improved', reference: '4', - parent:sds1 + category:sds1 ) FactoryGirl.create( :category, taxonomy:outcome, title:'Participation of Private Sector in Development Enhanced', reference: '5', - parent:sds1 + category:sds1 ) FactoryGirl.create( :category, taxonomy:outcome, title:'A Healthy Samoa and Well-being Promoted', reference: '6', - parent:sds2 + category:sds2 ) FactoryGirl.create( :category, taxonomy:outcome, title:'Quality Education and Training Improved', reference: '7', - parent:sds2 + category:sds2 ) FactoryGirl.create( :category, taxonomy:outcome, title:'Social Institutions Strengthened - Community Development Enhanced', reference: '8a', - parent:sds2 + category:sds2 ) FactoryGirl.create( :category, taxonomy:outcome, title:'Social Institutions Strengthened - Community Safety Improved', reference: '8b', - parent:sds2 + category:sds2 ) FactoryGirl.create( :category, taxonomy:outcome, title:'Access to Clean Water and Sanitation Sustained', reference: '9', - parent:sds3 + category:sds3 ) FactoryGirl.create( :category, taxonomy:outcome, title:'Transport Systems and Networks Improved', reference: '10', - parent:sds3 + category:sds3 ) FactoryGirl.create( :category, taxonomy:outcome, title:'Improved and Affordable Country Wide ICT Connectivity', reference: '11', - parent:sds3 + category:sds3 ) FactoryGirl.create( :category, taxonomy:outcome, title:'Quality Energy Supply', reference: '12', - parent:sds3 + category:sds3 ) FactoryGirl.create( :category, taxonomy:outcome, title:'Environmental Resilience Improved', reference: '13', - parent:sds4 + category:sds4 ) FactoryGirl.create( :category, taxonomy:outcome, title:'Climate and Disaster Resilience', reference: '14', - parent:sds4 + category:sds4 ) # Human Rights Bodies http://www.ohchr.org/EN/HRBodies/Pages/HumanRightsBodies.aspx hr1 = FactoryGirl.create( @@ -463,7 +463,7 @@ def base_seeds! url:'https://documents-dds-ny.un.org/doc/UNDOC/GEN/G11/146/32/PDF/G1114632.pdf?OpenElement', draft:true, user_only:false, - parent:hr1 + category:hr1 ) FactoryGirl.create( @@ -473,7 +473,7 @@ def base_seeds! short_title:'UPR 2', draft:false, user_only:false, - parent:hr1 + category:hr1 ) FactoryGirl.create( @@ -483,7 +483,7 @@ def base_seeds! short_title:'UPR 3', draft:true, user_only:false, - parent:hr1 + category:hr1 ) FactoryGirl.create( @@ -493,7 +493,7 @@ def base_seeds! short_title:'ICCPR Articles', draft:false, user_only:false, - parent:hr2 + category:hr2 ) FactoryGirl.create( @@ -503,7 +503,7 @@ def base_seeds! short_title:'ICESCR Articles', draft:false, user_only:false, - parent:hr3 + category:hr3 ) FactoryGirl.create( @@ -513,7 +513,7 @@ def base_seeds! short_title:'CEDAW Articles', draft:false, user_only:false, - parent:hr4 + category:hr4 ) FactoryGirl.create( @@ -523,7 +523,7 @@ def base_seeds! short_title:'CEDAW-GR', draft:true, user_only:false, - parent:hr4 + category:hr4 ) FactoryGirl.create( @@ -534,7 +534,7 @@ def base_seeds! description:'Combined initial, second and third report on CEDAW', draft:true, user_only:false, - parent:hr4 + category:hr4 ) FactoryGirl.create( @@ -544,7 +544,7 @@ def base_seeds! short_title:'CEDAW 4-5', draft:true, user_only:false, - parent:hr4 + category:hr4 ) FactoryGirl.create( @@ -554,7 +554,7 @@ def base_seeds! short_title:'6th Cycle', draft:false, user_only:false, - parent:hr4 + category:hr4 ) FactoryGirl.create( @@ -564,7 +564,7 @@ def base_seeds! short_title:'CAT Articles', draft:false, user_only:false, - parent:hr5 + category:hr5 ) FactoryGirl.create( @@ -574,7 +574,7 @@ def base_seeds! short_title:'CRC Articles', draft:false, user_only:false, - parent:hr6 + category:hr6 ) FactoryGirl.create( @@ -583,7 +583,7 @@ def base_seeds! title:'CRC cycle 2-4', short_title:'CRC 2-4', draft:false, - parent:hr6 + category:hr6 ) FactoryGirl.create( @@ -593,7 +593,7 @@ def base_seeds! short_title:'CRPD Articles', draft:false, user_only:false, - parent:hr7 + category:hr7 ) FactoryGirl.create( @@ -603,7 +603,7 @@ def base_seeds! short_title:'CPPED Articles', draft:false, user_only:false, - parent:hr8 + category:hr8 ) FactoryGirl.create( @@ -613,7 +613,7 @@ def base_seeds! short_title:'WGDAW all', draft:false, user_only:false, - parent:hr9 + category:hr9 ) FactoryGirl.create( @@ -623,7 +623,7 @@ def base_seeds! short_title:'NHRI 2015-2019', draft:false, user_only:false, - parent:hr10 + category:hr10 ) FactoryGirl.create( @@ -633,7 +633,7 @@ def base_seeds! short_title:'SLRC 2016', draft:false, user_only:false, - parent:hr11 + category:hr11 ) # # Human Rights Issues (level 2 http://uhri.ohchr.org/search/guide) # # TODO level 2 and 3 human rights From 27efcd93cc73cad91ac9a9303fe20c8b0cd899ae Mon Sep 17 00:00:00 2001 From: tmfrnz Date: Sun, 18 Jul 2021 17:40:01 +0200 Subject: [PATCH 13/24] add allow_password_change field --- .../20210718153206_add_allow_password_change_to_users.rb | 5 +++++ db/schema.rb | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20210718153206_add_allow_password_change_to_users.rb diff --git a/db/migrate/20210718153206_add_allow_password_change_to_users.rb b/db/migrate/20210718153206_add_allow_password_change_to_users.rb new file mode 100644 index 00000000..1d26a34c --- /dev/null +++ b/db/migrate/20210718153206_add_allow_password_change_to_users.rb @@ -0,0 +1,5 @@ +class AddAllowPasswordChangeToUsers < ActiveRecord::Migration[5.0] + def change + add_column :users, :allow_password_change, :boolean, default: true + end +end diff --git a/db/schema.rb b/db/schema.rb index 6a2b1941..c4f7e531 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20201213232312) do +ActiveRecord::Schema.define(version: 20210718153206) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -310,6 +310,7 @@ t.string "uid", default: "", null: false t.json "tokens" t.integer "last_modified_user_id" + t.boolean "allow_password_change", default: true t.index ["email"], name: "index_users_on_email", unique: true, using: :btree t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true, using: :btree end From cb9fc3e73c686bddaa998348e6aaa509eada645c Mon Sep 17 00:00:00 2001 From: tmfrnz Date: Mon, 26 Feb 2024 21:59:45 +1300 Subject: [PATCH 14/24] test cors header --- app/controllers/s3_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/s3_controller.rb b/app/controllers/s3_controller.rb index 5039eda4..4cdb3892 100644 --- a/app/controllers/s3_controller.rb +++ b/app/controllers/s3_controller.rb @@ -3,10 +3,10 @@ class S3Controller < ApplicationController def sign options = {path_style: true} - headers = {"Content-Type" => params[:contentType], "x-amz-acl" => "public-read"} + headers = {"Content-Type" => params[:contentType], "Access-Control-Allow-Origin" => "https://sadata-staging.web.app", "Vary" => "Origin", "x-amz-acl" => "public-read"} url = FogStorage.put_object_url(ENV['S3_BUCKET_NAME'], "user_uploads/#{params[:objectName]}", 15.minutes.from_now.to_time.to_i, headers, options) render json: {signedUrl: url} end -end \ No newline at end of file +end From 87fbfa0cd03632e190bab6acf038dbbfa237f9a4 Mon Sep 17 00:00:00 2001 From: tmfrnz Date: Mon, 26 Feb 2024 22:06:07 +1300 Subject: [PATCH 15/24] test cors header 2 --- app/controllers/s3_controller.rb | 2 +- config/application.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/s3_controller.rb b/app/controllers/s3_controller.rb index 4cdb3892..e6ba40b5 100644 --- a/app/controllers/s3_controller.rb +++ b/app/controllers/s3_controller.rb @@ -3,7 +3,7 @@ class S3Controller < ApplicationController def sign options = {path_style: true} - headers = {"Content-Type" => params[:contentType], "Access-Control-Allow-Origin" => "https://sadata-staging.web.app", "Vary" => "Origin", "x-amz-acl" => "public-read"} + headers = {"Content-Type" => params[:contentType], "x-amz-acl" => "public-read"} url = FogStorage.put_object_url(ENV['S3_BUCKET_NAME'], "user_uploads/#{params[:objectName]}", 15.minutes.from_now.to_time.to_i, headers, options) diff --git a/config/application.rb b/config/application.rb index 459fb195..4c3ac5d6 100644 --- a/config/application.rb +++ b/config/application.rb @@ -22,7 +22,7 @@ class Application < Rails::Application config.middleware.insert_before 0, Rack::Cors do allow do - origins '*' + origins 'https://sadata-staging.web.app' resource '*', headers: :any, methods: :any, expose: ['access-token', 'expiry', 'token-type', 'uid', 'client'] end end From 33e8ab81fbbe3667afa28a4cc25f0388b4e0e896 Mon Sep 17 00:00:00 2001 From: tmfrnz Date: Mon, 26 Feb 2024 22:26:16 +1300 Subject: [PATCH 16/24] test cors header 3 --- config/application.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/config/application.rb b/config/application.rb index 4c3ac5d6..45bd3e26 100644 --- a/config/application.rb +++ b/config/application.rb @@ -23,6 +23,7 @@ class Application < Rails::Application config.middleware.insert_before 0, Rack::Cors do allow do origins 'https://sadata-staging.web.app' + resource '/s3', headers: :any, methods: :any, expose: ['access-token', 'expiry', 'token-type', 'uid', 'client'], credentials: true resource '*', headers: :any, methods: :any, expose: ['access-token', 'expiry', 'token-type', 'uid', 'client'] end end From 8ec1240b47216aaf03a2224ebc5f6f731f96f3d8 Mon Sep 17 00:00:00 2001 From: tmfrnz Date: Mon, 26 Feb 2024 22:27:54 +1300 Subject: [PATCH 17/24] test cors header 4 --- config/application.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/config/application.rb b/config/application.rb index 45bd3e26..eb27135d 100644 --- a/config/application.rb +++ b/config/application.rb @@ -23,8 +23,7 @@ class Application < Rails::Application config.middleware.insert_before 0, Rack::Cors do allow do origins 'https://sadata-staging.web.app' - resource '/s3', headers: :any, methods: :any, expose: ['access-token', 'expiry', 'token-type', 'uid', 'client'], credentials: true - resource '*', headers: :any, methods: :any, expose: ['access-token', 'expiry', 'token-type', 'uid', 'client'] + resource '*', headers: :any, methods: :any, expose: ['access-token', 'expiry', 'token-type', 'uid', 'client'], credentials: true end end From 64f74cca234dbd888212c404eab3f682c860ef66 Mon Sep 17 00:00:00 2001 From: tmfrnz Date: Tue, 27 Feb 2024 19:42:48 +1300 Subject: [PATCH 18/24] try multiple origins, incl localhost --- config/application.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/application.rb b/config/application.rb index eb27135d..4f4bdb25 100644 --- a/config/application.rb +++ b/config/application.rb @@ -22,7 +22,7 @@ class Application < Rails::Application config.middleware.insert_before 0, Rack::Cors do allow do - origins 'https://sadata-staging.web.app' + origins 'localhost:3000', 'https://sadata-staging.web.app' resource '*', headers: :any, methods: :any, expose: ['access-token', 'expiry', 'token-type', 'uid', 'client'], credentials: true end end From 1e8ad2566ed6a05d800bc84f98ee77a70406efa1 Mon Sep 17 00:00:00 2001 From: tmfrnz Date: Tue, 27 Feb 2024 20:31:37 +1300 Subject: [PATCH 19/24] add prod origins --- config/application.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/application.rb b/config/application.rb index 4f4bdb25..c78b3ec6 100644 --- a/config/application.rb +++ b/config/application.rb @@ -22,7 +22,7 @@ class Application < Rails::Application config.middleware.insert_before 0, Rack::Cors do allow do - origins 'localhost:3000', 'https://sadata-staging.web.app' + origins 'localhost:3000', 'https://sadata-staging.web.app', 'https://sadata.ws', 'https://sadata-production.web.app', 'https://sadata-production.firebaseapp.com' resource '*', headers: :any, methods: :any, expose: ['access-token', 'expiry', 'token-type', 'uid', 'client'], credentials: true end end From 5d542b033124a5efdf21735f22c297cdbab64fbf Mon Sep 17 00:00:00 2001 From: tmfrnz Date: Sat, 2 Mar 2024 10:57:37 +1300 Subject: [PATCH 20/24] try multiple origins --- config/application.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/config/application.rb b/config/application.rb index c78b3ec6..a190a364 100644 --- a/config/application.rb +++ b/config/application.rb @@ -23,7 +23,11 @@ class Application < Rails::Application config.middleware.insert_before 0, Rack::Cors do allow do origins 'localhost:3000', 'https://sadata-staging.web.app', 'https://sadata.ws', 'https://sadata-production.web.app', 'https://sadata-production.firebaseapp.com' - resource '*', headers: :any, methods: :any, expose: ['access-token', 'expiry', 'token-type', 'uid', 'client'], credentials: true + resource 's3/sign', headers: :any, methods: :any, expose: ['access-token', 'expiry', 'token-type', 'uid', 'client'], credentials: true + end + allow do + origins '*', + resource '*', headers: :any, methods: :any, expose: ['access-token', 'expiry', 'token-type', 'uid', 'client'] end end From 42648211f839e29d65c1229c0b114f8f3a77c53d Mon Sep 17 00:00:00 2001 From: tmfrnz Date: Sat, 2 Mar 2024 10:59:42 +1300 Subject: [PATCH 21/24] try multiple origins - fix typo --- config/application.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/application.rb b/config/application.rb index a190a364..7bf63082 100644 --- a/config/application.rb +++ b/config/application.rb @@ -26,7 +26,7 @@ class Application < Rails::Application resource 's3/sign', headers: :any, methods: :any, expose: ['access-token', 'expiry', 'token-type', 'uid', 'client'], credentials: true end allow do - origins '*', + origins '*' resource '*', headers: :any, methods: :any, expose: ['access-token', 'expiry', 'token-type', 'uid', 'client'] end end From b540dba58d340e96d417ebfa4460327b2b63367f Mon Sep 17 00:00:00 2001 From: tmfrnz Date: Sat, 2 Mar 2024 11:08:35 +1300 Subject: [PATCH 22/24] try multiple origins - 2 --- config/application.rb | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/config/application.rb b/config/application.rb index 7bf63082..95e1c00b 100644 --- a/config/application.rb +++ b/config/application.rb @@ -22,12 +22,23 @@ class Application < Rails::Application config.middleware.insert_before 0, Rack::Cors do allow do - origins 'localhost:3000', 'https://sadata-staging.web.app', 'https://sadata.ws', 'https://sadata-production.web.app', 'https://sadata-production.firebaseapp.com' - resource 's3/sign', headers: :any, methods: :any, expose: ['access-token', 'expiry', 'token-type', 'uid', 'client'], credentials: true + origins 'localhost:3000', + 'https://sadata-staging.web.app', + 'https://sadata.ws', + 'https://sadata-production.web.app', + 'https://sadata-production.firebaseapp.com' + resource '/s3/*', + headers: :any, + methods: :any, + expose: ['access-token', 'expiry', 'token-type', 'uid', 'client'], + credentials: true end allow do origins '*' - resource '*', headers: :any, methods: :any, expose: ['access-token', 'expiry', 'token-type', 'uid', 'client'] + resource '*', + headers: :any, + methods: :any, + expose: ['access-token', 'expiry', 'token-type', 'uid', 'client'] end end From 49b8b10ad412f73fae67c16ee509066e7e4db942 Mon Sep 17 00:00:00 2001 From: tmfrnz Date: Sat, 2 Mar 2024 11:14:22 +1300 Subject: [PATCH 23/24] use environment variable --- config/application.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/config/application.rb b/config/application.rb index 95e1c00b..4b75b249 100644 --- a/config/application.rb +++ b/config/application.rb @@ -22,11 +22,7 @@ class Application < Rails::Application config.middleware.insert_before 0, Rack::Cors do allow do - origins 'localhost:3000', - 'https://sadata-staging.web.app', - 'https://sadata.ws', - 'https://sadata-production.web.app', - 'https://sadata-production.firebaseapp.com' + origins ENV['ALLOWED_ORIGIN_S3'] resource '/s3/*', headers: :any, methods: :any, From 8704ec99f606f9755129683a9513d7875923e143 Mon Sep 17 00:00:00 2001 From: tmfrnz Date: Sat, 2 Mar 2024 11:22:04 +1300 Subject: [PATCH 24/24] use environment variable, multiple --- config/application.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/application.rb b/config/application.rb index 4b75b249..29cc6c3f 100644 --- a/config/application.rb +++ b/config/application.rb @@ -22,7 +22,7 @@ class Application < Rails::Application config.middleware.insert_before 0, Rack::Cors do allow do - origins ENV['ALLOWED_ORIGIN_S3'] + origins ENV['ALLOWED_ORIGIN_S3'].split(',').map { |origin| origin.strip } resource '/s3/*', headers: :any, methods: :any,