Module: WithSlug
- Extended by:
- ActiveSupport::Concern
- Included in:
- Content
- Defined in:
- app/models/concerns/with_slug.rb
Overview
TODO may use mumukit slug
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
-
#rebase!(organization) ⇒ Object
Copy and Rebase.
- #rebased_dup(organization) ⇒ Object
- #slug_parts ⇒ Object
-
#sync_key ⇒ Object
Resource Protocol.
Instance Method Details
#rebase!(organization) ⇒ Object
Copy and Rebase
23 24 25 |
# File 'app/models/concerns/with_slug.rb', line 23 def rebase!(organization) self.slug = self.slug.to_mumukit_slug.rebase(organization).to_s end |
#rebased_dup(organization) ⇒ Object
27 28 29 |
# File 'app/models/concerns/with_slug.rb', line 27 def rebased_dup(organization) dup.tap { |it| it.rebase! organization } end |
#slug_parts ⇒ Object
10 11 12 13 |
# File 'app/models/concerns/with_slug.rb', line 10 def slug_parts org, repo = slug.split('/') {organization: org, repository: repo} end |
#sync_key ⇒ Object
Resource Protocol
17 18 19 |
# File 'app/models/concerns/with_slug.rb', line 17 def sync_key Mumukit::Sync.key self.class.name.underscore.to_sym, slug end |