aboutsummaryrefslogtreecommitdiffstats
path: root/guides/source/engines.textile
diff options
context:
space:
mode:
authorFrancesco Rodriguez <lrodriguezsanc@gmail.com>2012-07-22 19:51:17 -0500
committerFrancesco Rodriguez <lrodriguezsanc@gmail.com>2012-07-22 19:51:17 -0500
commit738a0e17eb2f7b6656e8a4a9fa58d4609bcc7eaa (patch)
tree657ea6d4d6e5f5a6c77ab50c3996e4510c615289 /guides/source/engines.textile
parent890b9dd4439986e306ec4fc0067a00effa606204 (diff)
downloadrails-738a0e17eb2f7b6656e8a4a9fa58d4609bcc7eaa.tar.gz
rails-738a0e17eb2f7b6656e8a4a9fa58d4609bcc7eaa.tar.bz2
rails-738a0e17eb2f7b6656e8a4a9fa58d4609bcc7eaa.zip
fix removed ruby tag in commit 890b9dd [ci skip]
Diffstat (limited to 'guides/source/engines.textile')
-rw-r--r--guides/source/engines.textile9
1 files changed, 5 insertions, 4 deletions
diff --git a/guides/source/engines.textile b/guides/source/engines.textile
index db23c1c584..11c837be32 100644
--- a/guides/source/engines.textile
+++ b/guides/source/engines.textile
@@ -706,17 +706,17 @@ end
module Blorg::Concerns::Models::Post
extend ActiveSupport::Concern
-
+
# 'included do' causes the code within to be evaluated in the conext
# where it is included, rather be executed in the module's context.
included do
attr_accessor :author_name
belongs_to :author, :class_name => "User"
-
+
before_save :set_author
-
+
private
-
+
def set_author
self.author = User.find_or_create_by_name(author_name)
end
@@ -850,6 +850,7 @@ s.add_dependency "moo"
To specify a dependency that should only be installed as a development
dependency of the application, specify it like this:
+<ruby>
s.add_development_dependency "moo"
</ruby>