Skip to content

Commit

Permalink
Fix Circular dependency loading
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasknoepfle committed Feb 12, 2020
1 parent 54d6131 commit 9b18b2c
Show file tree
Hide file tree
Showing 59 changed files with 1,487 additions and 1,416 deletions.
2 changes: 1 addition & 1 deletion app/controllers/articles_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def similar_articles query

def change_state
# For changing the state of an article
# Refer to Article::State
# Refer to ArticleConcerns::State
if params[:activate]
activate
elsif params[:deactivate]
Expand Down
16 changes: 12 additions & 4 deletions app/models/article.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,18 @@ class Article < ApplicationRecord
extend Sanitization

# Article module concerns
include Validations, ActiveRecordOverwrites, Associations,
Commendation, FeesAndDonations,
Images, ExtendedAttributes, State, Scopes,
Checks, Delegates, Commentable
include ArticleConcerns::Validations
include ArticleConcerns::ActiveRecordOverwrites
include ArticleConcerns::Associations
include ArticleConcerns::Commendation
include ArticleConcerns::FeesAndDonations
include ArticleConcerns::Images
include ArticleConcerns::ExtendedAttributes
include ArticleConcerns::State
include ArticleConcerns::Scopes
include ArticleConcerns::Checks
include ArticleConcerns::Delegates
include ArticleConcerns::Commentable

############### Friendly_id for beautiful links
def slug_candidates
Expand Down
4 changes: 3 additions & 1 deletion app/models/business_transaction.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ class BusinessTransaction < ApplicationRecord
extend Sanitization
extend RailsAdminStatistics

include BusinessTransaction::Refundable, BusinessTransaction::Discountable, BusinessTransaction::Scopes
include BusinessTransactionConcerns::Refundable
include BusinessTransactionConcerns::Discountable
include BusinessTransactionConcerns::Scopes

belongs_to :article, inverse_of: :business_transactions

Expand Down
59 changes: 0 additions & 59 deletions app/models/concerns/article/active_record_overwrites.rb

This file was deleted.

41 changes: 0 additions & 41 deletions app/models/concerns/article/associations.rb

This file was deleted.

58 changes: 0 additions & 58 deletions app/models/concerns/article/checks.rb

This file was deleted.

71 changes: 0 additions & 71 deletions app/models/concerns/article/commendation.rb

This file was deleted.

16 changes: 0 additions & 16 deletions app/models/concerns/article/delegates.rb

This file was deleted.

Loading

0 comments on commit 9b18b2c

Please sign in to comment.