Skip to content

Commit

Permalink
Workaround ActiveSupport::Concern error
Browse files Browse the repository at this point in the history
See laserlemon#111. This issue
seems to be the gem defines 2 Version::VersionMethods modules, one users.rb
and one in version_tagging.rb, each with an `included` block.

As quick proof of concept rename the module in VersionTagging (since we
don't use that feature) to `VersionTaggingMethods` and update the
`class_eval` block to reflect the change.

A better approach might be to namesoace each `VersionMethods` module to
the parent module, e.g. `VestalVersions::VersionTagging::VersionMethods`
and `VestalVersions::User::VersionMethods`
  • Loading branch information
dlagerro committed Apr 12, 2020
1 parent beccc57 commit 3945e01
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/vestal_versions/version_tagging.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def tag_version(tag)
end

# Instance methods included into VestalVersions::Version to enable version tagging.
module VersionMethods
module VersionTaggingMethods
extend ActiveSupport::Concern

included do
Expand All @@ -46,6 +46,6 @@ def validate_tags?
tagged? && tag != 'deleted'
end

Version.class_eval{ include VersionMethods }
Version.class_eval{ include VersionTaggingMethods }
end
end

0 comments on commit 3945e01

Please sign in to comment.