Skip to content
This repository has been archived by the owner on Apr 11, 2024. It is now read-only.

Don't use conflicting module names - messes up 'included' blocks, etc #90

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/vestal_versions/users.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module Users

included do
attr_accessor :updated_by
Version.class_eval{ include VersionMethods }
Version.class_eval{ include UsersMethods }
end

# Methods added to versioned ActiveRecord::Base instances to enable versioning with additional
Expand All @@ -22,7 +22,7 @@ def version_attributes
end

# Instance methods added to VestalVersions::Version to accomodate incoming user information.
module VersionMethods
module UsersMethods
extend ActiveSupport::Concern

included do
Expand Down
8 changes: 5 additions & 3 deletions lib/vestal_versions/version_tagging.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ module VestalVersions
module VersionTagging
extend ActiveSupport::Concern

included do
Version.class_eval{ include VersionTaggingMethods }
end

# Adds an instance method which allows version tagging through the parent object.

# Accepts a single string argument which is attached to the version record associated with
Expand All @@ -21,7 +25,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 @@ -43,7 +47,5 @@ def tagged?
def validate_tags?
tagged? && tag != 'deleted'
end

Version.class_eval{ include VersionMethods }
end
end