aboutsummaryrefslogtreecommitdiffstats
path: root/railties/guides/source/engines.textile
diff options
context:
space:
mode:
authorRyan Bigg <radarlistener@gmail.com>2011-10-20 08:46:41 +1100
committerRyan Bigg <radarlistener@gmail.com>2011-10-20 08:48:06 +1100
commit1cc6105d4dd088e3f2b8026e7e49f4e9d8d7d6ea (patch)
treed4586bb69214dcecc5637ac901f30cc1bebf9f25 /railties/guides/source/engines.textile
parent8ede74e73a45b16a81064a175b3174848469498b (diff)
downloadrails-1cc6105d4dd088e3f2b8026e7e49f4e9d8d7d6ea.tar.gz
rails-1cc6105d4dd088e3f2b8026e7e49f4e9d8d7d6ea.tar.bz2
rails-1cc6105d4dd088e3f2b8026e7e49f4e9d8d7d6ea.zip
[engines guide] wrap up 'Configuring an Engine' section
Diffstat (limited to 'railties/guides/source/engines.textile')
-rw-r--r--railties/guides/source/engines.textile2
1 files changed, 2 insertions, 0 deletions
diff --git a/railties/guides/source/engines.textile b/railties/guides/source/engines.textile
index 02054c972a..f0d8f1a165 100644
--- a/railties/guides/source/engines.textile
+++ b/railties/guides/source/engines.textile
@@ -531,7 +531,9 @@ Blorgh.user_class = "User"
WARNING: It's very important here to use the +String+ version of the class, rather than the class itself. If you were to use the class, Rails would attempt to load that class and then reference the related table, which could lead to problems if the table wasn't already existing. Therefore, a +String+ should be used and then converted to a class using +constantize+ in the engine later on.
+Go ahead and try to create a new post. You will see that it works exactly in the same way as before, except this time the engine is using the configuration setting in +config/initializers/blorgh.rb+ to learn what the class is.
+There are now no strict dependencies on what the class is, only what the class's API must be. The engine simply requires this class to define a +find_or_create_by_name+ method which returns an object of that class to be associated with a post when it's created.
h3. Overriding engine functionality