Was also considering checking if the model had a 'key' method on it, which
would allow it to work for users, or whatever else uses a key, so we don't
have a hard dependency on Discussion.

Not familiar with that 'acts_as' method; how does it work?


On Tue, Feb 11, 2014 at 9:54 AM, Richard D. Bartlett <
notifications@github.com> wrote:

> In app/models/concerns/translatable.rb:
>
> >    extend ActiveSupport::Concern
> > +
> > +  included do
> > +    before_update :clear_translations
> > +    has_many :translations, as: :translatable
> > +  end
> > +
> > +  def self.get_instance(model, id)
> > +    model = model.to_s.humanize.constantize
> > +    if model == Discussion
>
> We need to remove this Discussion dependency. Suggestion: rather than include
> Translatable in the discussion model, can this say:
>
> acts_as_translatable scope: :published, fields: 'body'
>
> ...which will also dry up def self.translatable_fields
>
> --
> Reply to this email directly or view it on GitHub<https://github.com/loomio/loomio/pull/1281/files#r9601331>
> .
>