Loomio
Thu 4 Apr 2019 6:49PM

Plugin example not working

ELP Edward L Platt Public Seen by 104

Hi, I've followed the example for creating a plugin ( https://help.loomio.org/en/dev_manual/plugins/ ) but the "Hello, World!" message is not printed when I run "rails c". Any suggestions on how to get this working?

I've tried adding plugin.enabled = true, but no luck. Here is the most recent code I've tried (placed in plugins/loomio_tags/plugin.rb):

# plugins/loomio_tags/plugin.rb
module Plugins
    module LoomioTags
        class Plugin < Plugins::Base
            setup! :loomio_tags do |plugin|
                # our code will go here!
                plugin.enabled = true
                puts "Hello, world!"
            end
        end
    end
end
RG

Robert Guthrie Fri 5 Apr 2019 8:18PM

Oh dear. The example is very out of date. To fix this, put another directory in your structure.. so plugins/dev/loomio_tags/plugin.rb

However, I would enquire what functionality you want to add to Loomio.

We're rewriting the front end client right now, and I don't expect any plugins with frontend code will work with this new system.

What are you trying to do?

ELP

Edward L Platt Fri 5 Apr 2019 9:28PM

We're using loomio to conduct some research on large-scale group deliberation and need to add some experimental functionality. The timing is unfortunate if our work won't be useful in the future, but we're just about ready to start running our experiments. Maybe we'll be able to update the plugin for the new front end if it proves useful.

More info on the research if you're curious: https://medium.com/@elplatt/building-consensus-through-deliberation-in-large-collaborations-organizations-and-cooperatives-79d28c3e3acc

RG

Robert Guthrie Fri 5 Apr 2019 9:34PM

I'd love to know, in detail, what changes you're making as I suspect it's in line (or could inform) the changes we have planned for the year.

We're planning on making all poll types configurable, so people can invent their own processes and share them as templates.

ELP

Edward L Platt Fri 5 Apr 2019 9:40PM

Oh, exciting! Specifically we're working on assigning participants in a discussion to "breakout groups" such that they can have conversations with a smaller group of people, while allowing administrators to shuffle groups and change the visibility of content from all groups.

RG

Robert Guthrie Fri 5 Apr 2019 9:57PM

Would further levels of sub groups support what you need?

ELP

Edward L Platt Fri 5 Apr 2019 11:01PM

We need a many groups to one poll structure, so I don't think it would. Our research results might still apply though. Many of the things we need for the study are specific to a research setting and might not be useful in practice, but it sounds like some of the work you're doing could be a good starting point for us.

RG

Robert Guthrie Fri 5 Apr 2019 11:28PM

If love to setup a chat to understand if you have time.

ELP

Edward L Platt Tue 9 Apr 2019 5:31PM

I'd like that! It's a busy time of the semester, but perhaps towards the end of the month or early May?

ELP

Edward L Platt Tue 9 Apr 2019 5:32PM

By moving the plugin to the plugins/dev directory, we were able to get the example plugin to run. However, now we're finding the following error when we start rails c:

PG::DuplicateTable: ERROR:  relation "tags" already exists (ActiveRecord::StatementInvalid)
: CREATE TABLE "tags" ("id" bigserial primary key, "group_id" bigint, "name" character varying, "color" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)

Any idea what we're doing wrong?

RG

Robert Guthrie Mon 15 Apr 2019 12:14AM

remove the database calls from your tags plugin to fix this.

Load More