aboutsummaryrefslogtreecommitdiffstats
path: root/lib
AgeCommit message (Collapse)Author
2017-09-19ModelAttribute.methods_by_class: Take symbol parameter instead of stringTeddy Wing
Didn't like how `#initialize` takes a different type for `klass` than `.methods_by_class`. Make these types and values uniform. If we need to change it, we should make a separate mechanism to do so. I think. Refs #4401
2017-09-19ModelAttribute: Add `.methods_by_class` methodTeddy Wing
Allows us to get all `ModelAttribute`s given a certain class name. Needed an `#==` method to be able to test object equality more easily so I added one in. I don't like that the `klass` is a lowercase symbol and the `klass` attribute to `.methods_by_class` is a constantized string. Want to correct that and make them uniform. Only did it this way because that's how it was suggested in the ticket. Refs #4401
2017-09-19ModelAttribute: Make `@@all` a class instance variableTeddy Wing
Robert argues that the class variable is not ideal because its value gets shared with subclasses, violating the Liskov substitution principle: 17:44:23 < robert> ```133] pry(main)> class A; @@greeting = :hello end 17:44:23 < robert> => :hello 17:44:23 < robert> [134] pry(main)> class B < A; end 17:44:23 < robert> => nil 17:44:23 < robert> [135] pry(main)> B.class_variable_get '@@greeting' 17:44:23 < robert> => :hello Instead, go with his suggestion to use a class instance variable instead, which gives us the same amount of availability of the `all` list while not sharing it indiscriminately and making it easier to test. Refs #4401
2017-09-19ModelAttribute: Add `#code` methodTeddy Wing
A method that returns a string representation of the attribute, in the form `:class#:name". This will be used to store a reference to the attribute in the database. For example, a validation will reference a `ModelAttribute` in a database column using this `#code` string. Refs #4401
2017-09-19ModelAttribute: Add `ModelAttribute`s for a bunch of models&attributesTeddy Wing
We want to define `ModelAttribute`s for an initial set of `Chouette` models: * Chouette::Route * Chouette::JourneyPattern * Chouette::VehicleJourney * Chouette::Footnote * Chouette::TimeTable * Chouette::RoutingConstraintZone I added these by looking at the `schema.rb` as well as some form views for these models. Given that information, I made some guesses about what attributes it might make sense to add here. We want to end up with a collection of only editable attributes for these models, so this excludes things like `created_at`, foreign keys, and programmatically set fields. This is my guess at what those fields are. We can refine the list later. We'll be using this list for Compliance Control to get a set of fields of a given type in order to create custom validations using those fields. Refs #4401
2017-09-19Fix spec on mission compliance controls permissionsXinhui
2017-09-19ModelAttribute spec: Allow test to handle existing elements in `@@all`Teddy Wing
When `ModelAttribute` instances are added to `@@all` directly in the class, the test breaks. Make it a little more robust by checking change in array size instead of total size. Refs #4401
2017-09-19Add `ModelAttribute`Teddy Wing
This new class will allow us to generate a list of all editable fields in all our models including the type of each field. We need this for Compliance Control, in order to get a list of fields or models & fields that can be selected to validate a given model validation check. The crucial bits here are the models, fields, and the types of those fields. These need to be defined (manually at least to begin with), accessible, and filterable. Refs #4401
2017-09-19referential.rake: Update `Route#wayback` valuesTeddy Wing
The possible values for this field changed in 2fa3be1518da4f471d614832f80526e074983195 to `outbound` and `inbound`. Update them accordingly in this Rake task, otherwise it fails. Refs #4555
2017-09-19Merge pull request #69 from af83/4431-permission-renamingLuc Donnet
Fixes: #4431@0.16666666666666666h;
2017-09-19Merge pull request #71 from af83/4446-spec-features-api-keysLuc Donnet
4446 spec features api keys
2017-09-19Delete duplicate keys in #all_resources Refs #4446Luc Donnet
2017-09-18Fix table name compliance_check_result to compliance_check_message Refs #4390 @2Luc Donnet
2017-09-15merged 4442 into 4446Robert
2017-09-14Refs: #4446@0.7438h; Creation feature specedRobert
2017-09-14Fixes: #4442@0.5h;4442-api_keys-permissions-spexRobert
2017-09-14Fixes: #4431@0.16666666666666666h;4431-permission-renamingRobert
2017-09-13Merge branch 'master' of github.com:AF83/stif-boivLuc Donnet
2017-09-13Disable deploy when not in master/staging or production. Refs #4468Alban Peignier
2017-09-13Fixes nice pre-commit typo o/. Refs #4468Alban Peignier
2017-09-13Drop, create and migrate database in ci. Refs #4468Alban Peignier
2017-09-12Add errors details on reflex:sync logXinhui
2017-09-11Fix views and access for api keys generation Refs #4276 @8Luc Donnet
2017-09-07Reflex:sync log invalid objectXinhui
Refs #4367
2017-09-01Fix Reflex sync check for valid stopArea before saveXinhui
Refs #4367
2017-08-30Update show data for import Refs #4258Luc Donnet
2017-08-28Merge branch '4273_http_service_broken'Alban Peignier
2017-08-27Create STIF::NetexFile to read zip content and create ReferentialMetadata ↵Alban Peignier
from real data. Refs #4273
2017-08-27Create NetexImport even if Referential can be created. Add a ImportMessage ↵Alban Peignier
and failed status in this case. Refs #4273
2017-08-25ReferentialMetadataKludge: Use non-overlapping dates in test dataTeddy Wing
Previously, the OFFRE_... zip's two referentials had overlapping dates (2017-03-01..2017-03-31 & 2017-03-01..2017-12-31). This caused this validation error when trying to save the referentials: OFFRE_TRANSDEV_20170301122517 couvre le même périmètre d'offre To fix this, Alban & I changed the dates of the two offers inside the zip (in the calendrier.xml files) and matched the dates in `ReferentialMetadataKludge`.
2017-08-25ReferentialMetadataKludge: Get line IDs by `objectid`Teddy Wing
Instead of hard-coding an ID for the line IDs, get them by their `objectid` field. Worked on this with Alban. Even though the Kludge class is for testing purposes only and isn't meant to be real, let's take out the hard-coded values. The `objectid`s correspond to those in the OFFRE_... zip in `spec/fixtures/`.
2017-08-24Unify npm options in ci rake task and capistrano. Remove --silent option to ↵Alban Peignier
display ... errors
2017-08-24Add --profile option to rspec during ci tasksAlban Peignier
2017-08-11initialRobert
2017-08-01schedule.rb: Add cron job to update parent imports from child importsTeddy Wing
This task will run every 5 minutes, synchronising parent imports with the status of their children. When all children have finished, if none of them have failed, the parent import should get a status of "successful": WorkbenchImport status: :successful NetexImport status: :successful NetexImport status: :successful When all children have finished, if any of them have failed, the parent import should get a status of "failed": WorkbenchImport status: :failed NetexImport status: :failed NetexImport status: :successful We need a Cron job for this instead of being able to do it via a Ruby method because the thing that's setting the status on the sub-imports when they're complete is the STIF Java IEV application. Thus there's no way for our Ruby code to know that a sub-import has finished. Because of that, we do this polling mechanism every five minutes to update the imports that need updating. Created a Rake task to use in the Whenever schedule because the `runner` method from Whenever expanded to `script/rails`, which is a bloody ancient file, and tries to run via JRuby lolwat. Didn't want to bother adding a configuration to Whenever to use something more modern, and didn't know whether the binstub in `bin/` for `rails` is available since we don't commit those to the repo apparently (although I knew that fact from before). Refs #3511
2017-08-01Merge pull request #48 from af83/1726-WorkbenchImport-for-multi-Netex-importteddywing
1726 workbench import for multi netex import
2017-08-01Merge pull request #46 from af83/3507_1726_impl_workbench_importteddywing
3507 1726 impl workbench import
2017-08-01Update model diagram generationLuc Donnet
2017-07-31Refs: #3507_1726@6h Code ReviewRobert
2017-07-27Edit access point to use new StifReflexAttributesSupportXinhui
2017-07-25Refs: #3507;20h Specing and Implementing the ZipServiceRobert
2017-07-24Refs: #4019@1h; Adds spec for Permission Translation and implements it in ↵Robert
lib/stif/permission_translator
2017-07-21Refs: #3507@4.5h spec setup and refactoring, using Faraday in workerRobert
- Setting up correct headers for the Webmock request (Oh Boy) - Refactoring all Faraday requests into `lib/af83/http_fetcher.rb` - Implementing the Download
2017-07-18Update erd config generation to use in stif documentationLuc Donnet
2017-07-11Merge branch 'master' of github.com:AF83/stif-boivFlorent Peyraud
2017-07-11update install scripts and tasksFlorent Peyraud
2017-07-10hotfixRobert
2017-07-10Fixes: #3478@2.5hRobert
- Decorator Spec Setup `spec/support/decortor_helpers.rb` - Speced - Fixed
2017-07-06improve packagingFlorent Peyraud
2017-06-29Fix RoutingConstraintZone PolicyLuc Donnet