1. 12 Sep, 2017 1 commit
  2. 01 Sep, 2016 14 commits
    • azul's avatar
      use hybrid Cookies serializer · e702284a
      azul authored
      Slowly migrate towards the json one.
      e702284a
    • azul's avatar
      upgrade: use the new config/secrets.yml · 470787d3
      azul authored
      Still reading secret_token from config/crabgrass/secret.txt if it is there.
      
      This way we can migrate old sessions to the new keybase.
      470787d3
    • azul's avatar
      upgrade: dump db as ruby not sql · 0c110f93
      azul authored
      Let's see if this fixes travis missing db/structure.sql
      0c110f93
    • azul's avatar
      upgrade: application.rb Gemfile without :assets now · 51acf593
      azul authored
      51acf593
    • azul's avatar
      upgrade: disable_implicit_join_references in AR · 4adf7c1d
      azul authored
      This option turns of the implicit joining of references mentioned in
      where queries. As the deprecation comment of the feature states it
      is inherently buggy and we don't seem to rely on it so far.
      
      So let's just turn it of for the future.
      4adf7c1d
    • azul's avatar
      upgrade: use namespace for notices · 4aea05e3
      azul authored
      4aea05e3
    • azul's avatar
      proper namespace for polls · 30cf1bb2
      azul authored
      30cf1bb2
    • azul's avatar
      TaskParticipation -> Task::Participation · 74e7c1c2
      azul authored
      cleans up circular dependency:
      RuntimeError: Circular dependency detected while autoloading constant Task::TaskParticipation
      74e7c1c2
    • azul's avatar
      fix discussion namespace issue · 65bc1cd6
      azul authored
      or rather lack of namespace issue.
      We'll get rid of discussions and move posts to messages and comments
      so no point in trying to create a properly namespaced version of them.
      65bc1cd6
    • azul's avatar
      upgrade: drop outdated config settings (rails 4.0) · 6937f342
      azul authored
      6937f342
    • azul's avatar
      move the WikiExtensions into Wiki namespace · 8933b86c
      azul authored
      8933b86c
    • azul's avatar
      move remaining associations into user namespace · 3aa324a7
      azul authored
      3aa324a7
    • azul's avatar
      namespace: asset for all the asset things · 3c9d9525
      azul authored
      Also separate Asset::Storage::Path from Asset::Storage
      3c9d9525
    • azul's avatar
      namespace Activity and remove from autoload_path · 4955ee0a
      azul authored
      We used to have app/models/activity in the autoload path and had classes
      like FriendActivity < Activity
      
      This conflicts with how rails4 handles class lookup. Plus it clutters the
      autoload path and makes it harder to find classes.
      
      Using proper namespaces instead now and I'm about to apply this to all the
      different namespace avoiding things like ...Extension. We can use classes
      as namespaces as long as we:
      * make sure to define things inside the namespace in one line or in a
         class instead of a module block:
         ```ruby
           class Activity::Friend < Activity
           # or
           class Activity
             class Friend < ::Activity
         ```
       * have names inside the namespaces that do not conflict with global names
      
      The second one is important because if PrivatePost is already loaded and
      Activity::PrivatePost is referenced somewhere it will be found as an
      constant inside the Object namespace of Activity (since Activity is a class).
      So instead of loading Activity::PrivatePost we'll see a warning that global
      constant PrivatePost was referenced by Activity::PrivatePost.
      
      So how do we prevent this?
      * do not clutter the global namespace
      * use more specific names in other namespaces
        -> in this case i am renaming PrivatePostActivity to Activity::MessageSent
        and not Activity::PrivatePost
      4955ee0a
  3. 28 Oct, 2015 1 commit
  4. 21 Jul, 2015 1 commit
  5. 25 Jun, 2015 1 commit
    • azul's avatar
      fix castle gates reloading in development · 043c351c
      azul authored
      Here's what was going on...
      
      When loading a page after changing a file in development the server
      would crash indicating that config/permissions.rb was loaded twice.
      Behind the scenes rails was trying to load the constant Group inside
      the ContextPagesController. So it first looked up
        ContextPagesController::Group
      and then Group itself. Both lookups fired the after_reload callbacks.
      This way the callbacks for Group were run twice leading to errors because
      duplicate gates were defined.
      
      What are we doing now?...
      
      Now we load config/permissions.rb inside a config.to_prepare block.
      Here's what the documentation says about that hook:
      ```
        to_prepare: Run after the initializers are run for all Railties
        (including the application itself), but before eager loading and
        the middleware stack is built.
        More importantly, will run upon every request in development, but
        only once (during boot-up) in production and test.
      ```
      
      We also use require_dependency instead of plain require. This way the file
      will actually be reloaded when models are reloaded.
      043c351c
  6. 23 Jun, 2015 3 commits
    • azul's avatar
      namespace all the tracking things · 4668ea6b
      azul authored
      Tracking now is Tracking::Page.
      4668ea6b
    • azul's avatar
      acae4e8c
    • azul's avatar
      track_actions for all participation tracking · 4436e29d
      azul authored
      Allows us to remove UserParticipationObserver and GroupParticipationObserver.
      
      All changes to participations are now tracked by PageHistory::UpdateParticipation.
      This will test it's subclasses if they take care of the participation in question.
      The first subclass for which Class.tracks(changes, participation) returns true
      will be used.
      
      This allows us to handle different changes in different classes without a central
      registry. It requires however for all classes to be defined in the same file or
      the use of require_dependency directives. For now we still have all PageHistory
      subclasses in one file.
      4436e29d
  7. 16 Jun, 2015 1 commit
  8. 15 Jun, 2015 1 commit
  9. 12 Jun, 2015 1 commit
  10. 11 Jun, 2015 7 commits
  11. 28 May, 2015 1 commit
    • azul's avatar
      bring back ErrorNotFound, drop per site i18n · 6f0b4b56
      azul authored
      ErrorNotFound is similar to ActiveRecord::RecordNotFound - but it allows
      specifying the type of thing that was not found for more detailed error
      messages.
      
      For the translations we use cascading translations. So say a group was not
      found... we will lookup the following:
      exception.title.group.not_found
      exception.title.not_found
      exception.not_found
      not_found
      
      For all of these %{thing} will be interpolated with a translation of :group.
      If there is no translation for the given class of things it will be an empty
      string.
      
      In order for the cascading translation to work we have do drop the support
      for site specific translations. Otherwise the lookup will start with a
      cascade from:
      site.exception.title.group.not_found
      and succeed when looking up 'not_found'.
      So it won't process the more detailed cascade correctly.
      
      Alternatively we could add the site scope last. But I think site specific
      translations are not something we will need any time soon and it adds a lot of
      complexity. Instance specific translations can easily be put in
        /extensions/locales
      and overwrite the defaults.
      6f0b4b56
  12. 21 May, 2015 2 commits
    • azul's avatar
      use custom subclass of AD::PublicExceptions · f657b301
      azul authored and azul's avatar azul committed
      For a 404 it will use our own controller and fall back to the standard pages in public.
      Everything else still uses the ActionDispatch::PublicExceptions. We still try to rescue
      everything else within the app anyway.
      In case there is a 500 (or 422) we do not rely on the ExceptionsController but use a plain
      file for now.
      f657b301
    • azul's avatar
      first take on using an exception app for 404s · 09523369
      azul authored and azul's avatar azul committed
      09523369
  13. 19 May, 2015 1 commit
  14. 08 May, 2015 3 commits
  15. 06 May, 2015 2 commits
    • azul's avatar
      cleanup: remove all traces of MODS · 63f3ba3d
      azul authored
      We can bring them back in case we need them again at some point.
      
      Rails seems to have it's own mechanisms for allowing such things now such
      as the engine load order and overwriting model behaviour by including
      Concerns in config.to_prepare.
      
      I think this also does what we want in terms of reloading files in development
      and caching them in production.
      63f3ba3d
    • azul's avatar
      use initializer method for page registration · 340d84ad
      azul authored
      Not sure which one i prefer. initializer method allows specifying the
      order more explicitly and could probably be combined into a
      register_page method to be included in all Page Engines
      340d84ad