Skip to content
Browse files

Formatting changes

  • Loading branch information...
1 parent 6087348 commit 8fa9e6fe9ca856f73782c4dd5b6fd22dc7d1a90f @elektronaut committed
Showing with 18 additions and 9 deletions.
  1. +18 −9 app/models/concerns/exchange_participant.rb
View
27 app/models/concerns/exchange_participant.rb
@@ -2,18 +2,27 @@ module ExchangeParticipant
extend ActiveSupport::Concern
included do
- has_many :discussions, :foreign_key => 'poster_id'
+ has_many :discussions, foreign_key: 'poster_id'
has_many :posts
- has_many :discussion_posts, :class_name => 'Post', :conditions => {:conversation => false}
- has_many :discussion_views, :dependent => :destroy
- has_many :discussion_relationships, :dependent => :destroy
+ has_many :discussion_posts, class_name: 'Post', conditions: { conversation: false }
+ has_many :discussion_views, dependent: :destroy
+ has_many :discussion_relationships, dependent: :destroy
- has_many :participated_discussions, :through => :discussion_relationships, :source => :discussion, :conditions => {:discussion_relationships => {:participated => true}}
- has_many :followed_discussions, :through => :discussion_relationships, :source => :discussion, :conditions => {:discussion_relationships => {:following => true}}
- has_many :favorite_discussions, :through => :discussion_relationships, :source => :discussion, :conditions => {:discussion_relationships => {:favorite => true}}
+ has_many :participated_discussions,
+ through: :discussion_relationships,
+ source: :discussion,
+ conditions: { discussion_relationships: { participated: true } }
+ has_many :followed_discussions,
+ through: :discussion_relationships,
+ source: :discussion,
+ conditions: { discussion_relationships: { following: true } }
+ has_many :favorite_discussions,
+ through: :discussion_relationships,
+ source: :discussion,
+ conditions: { discussion_relationships: { favorite: true } }
- has_many :conversation_relationships, :dependent => :destroy
- has_many :conversations, :through => :conversation_relationships
+ has_many :conversation_relationships, dependent: :destroy
+ has_many :conversations, through: :conversation_relationships
end
# Marks a discussion as viewed

0 comments on commit 8fa9e6f

Please sign in to comment.
Something went wrong with that request. Please try again.