aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClaudio B <claudiob@users.noreply.github.com>2016-02-01 10:02:56 -0800
committerClaudio B <claudiob@users.noreply.github.com>2016-02-01 10:02:56 -0800
commit9aa425f75fac376ea1c268ad5196ddb2dd7ed387 (patch)
tree1a7ce3f797d8c97324e52928c810bd6a44677988
parent25a42755403ba4a8d9a4128d5ff6483ca2fd9252 (diff)
parent949925d6432b8238da8af2a71d568978655aad6e (diff)
downloadrails-9aa425f75fac376ea1c268ad5196ddb2dd7ed387.tar.gz
rails-9aa425f75fac376ea1c268ad5196ddb2dd7ed387.tar.bz2
rails-9aa425f75fac376ea1c268ad5196ddb2dd7ed387.zip
Merge pull request #23401 from claudiob/fix-as-changelog-md
[ci skip] Properly indent code in markdown
-rw-r--r--activesupport/CHANGELOG.md58
1 files changed, 29 insertions, 29 deletions
diff --git a/activesupport/CHANGELOG.md b/activesupport/CHANGELOG.md
index 7701e0a7a2..8cff374a47 100644
--- a/activesupport/CHANGELOG.md
+++ b/activesupport/CHANGELOG.md
@@ -42,44 +42,44 @@
Here's an example of a simple event tracking system where the object being tracked needs not pass a creator that it
doesn't need itself along:
- module Current
- thread_mattr_accessor :account
- thread_mattr_accessor :user
+ module Current
+ thread_mattr_accessor :account
+ thread_mattr_accessor :user
- def self.reset() self.account = self.user = nil end
- end
+ def self.reset() self.account = self.user = nil end
+ end
- class ApplicationController < ActionController::Base
- before_action :set_current
- after_action { Current.reset }
+ class ApplicationController < ActionController::Base
+ before_action :set_current
+ after_action { Current.reset }
- private
- def set_current
- Current.account = Account.find(params[:account_id])
- Current.user = Current.account.users.find(params[:user_id])
+ private
+ def set_current
+ Current.account = Account.find(params[:account_id])
+ Current.user = Current.account.users.find(params[:user_id])
+ end
end
- end
- class MessagesController < ApplicationController
- def create
- @message = Message.create!(message_params)
- end
- end
+ class MessagesController < ApplicationController
+ def create
+ @message = Message.create!(message_params)
+ end
+ end
- class Message < ApplicationRecord
- has_many :events
- after_create :track_created
+ class Message < ApplicationRecord
+ has_many :events
+ after_create :track_created
- private
- def track_created
- events.create! origin: self, action: :create
+ private
+ def track_created
+ events.create! origin: self, action: :create
+ end
end
- end
- class Event < ApplicationRecord
- belongs_to :creator, class_name: 'User'
- before_validation { self.creator ||= Current.user }
- end
+ class Event < ApplicationRecord
+ belongs_to :creator, class_name: 'User'
+ before_validation { self.creator ||= Current.user }
+ end
*DHH*