This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Activity < ActiveRecord::Base | |
belongs_to :user | |
belongs_to :target, :polymorphic => true | |
default_scope :order => 'activities.created_at DESC', :limit => 10 | |
AUDITION_POSTED = 1 #target --> model audition | |
AUDITION_FEEDBACK_UPDATED = 2 #target --> model audition | |
AUDITION_VIEWED = 3 #target --> model video | |
NEW_PART = 4 #target --> model part |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CreateActivities < ActiveRecord::Migration | |
def self.up | |
create_table :activities do |t| | |
t.integer :user_id, :null => false | |
t.integer :activity_type, :null => false | |
t.integer :target_id, :null => false | |
t.string :target_type, :null => false | |
t.timestamps | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- if local_assigns[:show_ad] | |
= render partial: 'ad' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
= render partial: 'user/new' | |
= render partial: 'user/new', locals: { show_ad: true } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
upstream yoursite { | |
server yoursite1.yoursite.com max_fails=3; | |
server yoursite2.yoursite.com max_fails=3; | |
server yoursite3.yoursite.com backup; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
upstream yoursite { | |
server yoursite1.yoursite.com; | |
server yoursite2.yoursite.com max_fails=3 fail_timeout=30s; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
upstream yoursite { | |
server yoursite1.yoursite.com weight=4; | |
server yoursite2.yoursite.com; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
upstream yoursite { | |
ip_hash; | |
server yoursite1.yoursite.com down; | |
server yoursite2.yoursite.com; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
upstream yoursite { | |
ip_hash; | |
server yoursite1.yoursite.com; | |
server yoursite2.yoursite.com; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
upstream yoursite { | |
server yoursite1.yoursite.com; | |
server yoursite2.yoursite.com; | |
} | |
server { | |
server_name www.yoursite.com; | |
location / { | |
proxy_pass http://yoursite; | |
} |