path: root/db
Commit message (Collapse)AuthorAgeFilesLines
* Introduce an Anonymous Agenthellekin2021-02-021-1/+2
| | | | | | | | | | | | | Since we moved away from Roles it's important to maintain a default Agent that is distinct from the previous default IN COMMON Agent. Previously, a user without a proper group would be granted the `observer` role in the default Agent, enough to create new resources. Now, we consider anonymous users to be part of the Anonymous Agent, which also brings the possibility for them to edit yet to be accepted Resources.
* Add markers and popupshellekin2021-01-223-1/+89
| | | | | - Replace MakiMarkers with ExtraMarkers and ForkAwesome - Add HTML popup binding
* Upgrade Rails and add StimulusJS supporthellekin2021-01-225-4/+115
* Add Stimulus Map and Taxonomy (WIP)hellekin2020-11-122-0/+19
| | | | | | | | This commit add StimulusJS interaction for the map and taxonomy, as well as styling. It provides preliminary work to hook up live data on the map from the taxonomy.
* Add map supporthellekin2020-11-111-2/+15
| | | | | | | | | | | | This commit creates a dedicated Map model and moves the JavaScript from view to a Stimulus controller. - Stimulus.js https://stimulusjs.org - Leaflet.js https://leafletjs.org Upcoming resources: - https://discourse.stimulusjs.org/t/leafletjs-with-stimulusjs-on-rails-6/1343/4 - https://github.com/ghybs/leaflet-defaulticon-compatibility
* Add Classifications and Resource validationshellekin2020-10-093-7/+43
| | | | | | | | | | | | | | | | - Turn `has_and_belongs_to_many` into `has_many :through`: now, resources and sections are related through Classifications. - Refactor usage of jsonb column to use ActiveRecord validations - Attention! store_accessor: NOTE: If you are using structured database data types (eg. PostgreSQL hstore/json, or MySQL 5.7+ json) there is no need for the serialization provided by .store. Simply use .store_accessor instead to generate the accessor methods. Be aware that these columns use a string keyed hash and do not allow access using a symbol. NOTE: The default validations with the exception of uniqueness will work. For example, if you want to check for uniqueness with hstore you will need to use a custom validation to handle it. https://api.rubyonrails.org/classes/ActiveRecord/Store.html
* Add categories, sections, and import datahellekin2020-10-084-1/+48
* Add model foundation for classificationshellekin2020-10-085-1/+98
| | | | | | | | Taxonomy > Category > Section This commit adds models for it. https://doc.incommon.cc/#classifications
* Fix resources migrationhellekin2020-10-062-1/+4
| | | | | | | t.references already creates an index, so the second index actually broke things. You may need to rebuild the database!
* Add Resource modelhellekin2020-10-062-1/+22
| | | | | | Resources will be stored as JSON, in the (GeoJSON) :feature column. They are assigned an UUID upon creation if they don't comme with one. They belong to an Agent.
* Populate database with Agents: rails db:seedhellekin2020-10-061-0/+11
* Ensure only one Agent exists for a given grouphellekin2020-10-061-0/+1
* Add Agent and Agency modelshellekin2020-10-053-1/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since IN COMMON is about collective management of data we're using the concept of Agent to describe a group of users acting together. In ActivityPub terms, Agent will be the Actor when manipulating data, so that any individual User (or application) member of this Agent will be able to manipulate data on behalf of this Agent. Therefore a User has many Agencies, and an Agent as well: the Agency model allows not only to create a joint table between Agents and Users, but also to manage User roles within the related Agent. Roles are defined as: - observer: one who can read and review or flag data - editor: one who create or edit data - maintainer: one who can edit data and manage maps - leader: one who can manage roles A User may have zero or more roles in an Agent. A User without a Agency record for a specific Agent will only be able to 'observe' public data from this Agent. (Note that this is not currently specified, but matches existing reflection on Agents) https://doc.incommon.cc/#agents
* Configure Discourse SSOhellekin2020-10-051-0/+15
| | | | | | | | We're creating a minimal User model that will be filled from SSO. We also configure Inflections so we can use SSO instead of Sso which looks weird for a module named after an acronym. Use Discourse as SSO: https://meta.discourse.org/t/using-discourse-as-a-sso-provider/32974
* Create database setuphellekin2020-10-051-0/+18
* rails new incommon-map -d postgresql -C -Thellekin2020-10-051-0/+7