roomer 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (102) hide show
  1. data/.autotest +17 -0
  2. data/.gitignore +9 -0
  3. data/.rvmrc +2 -0
  4. data/.travis.yml +2 -0
  5. data/Gemfile +31 -0
  6. data/MIT-LICENSE +20 -0
  7. data/README.md +116 -0
  8. data/Rakefile +16 -0
  9. data/TODO.md +10 -0
  10. data/doc/ActiveRecord/Base.html +328 -0
  11. data/doc/ApplicationController.html +116 -0
  12. data/doc/Roomer/Engine.html +116 -0
  13. data/doc/Roomer/Generators/InstallGenerator.html +419 -0
  14. data/doc/Roomer/Generators/SetupGenerator.html +209 -0
  15. data/doc/Roomer/Generators.html +108 -0
  16. data/doc/Roomer/Tools.html +702 -0
  17. data/doc/Roomer/VERSION.html +149 -0
  18. data/doc/Roomer.html +533 -0
  19. data/doc/RoomerCreate.html +121 -0
  20. data/doc/_index.html +232 -0
  21. data/doc/class_list.html +47 -0
  22. data/doc/css/common.css +1 -0
  23. data/doc/css/full_list.css +53 -0
  24. data/doc/css/style.css +320 -0
  25. data/doc/file.README.html +146 -0
  26. data/doc/file_list.html +49 -0
  27. data/doc/frames.html +13 -0
  28. data/doc/index.html +146 -0
  29. data/doc/js/app.js +205 -0
  30. data/doc/js/full_list.js +150 -0
  31. data/doc/js/jquery.js +16 -0
  32. data/doc/method_list.html +182 -0
  33. data/doc/top-level-namespace.html +105 -0
  34. data/lib/generators/roomer/install/install_generator.rb +39 -0
  35. data/lib/generators/roomer/install/templates/README +15 -0
  36. data/lib/generators/roomer/install/templates/roomer.rb +68 -0
  37. data/lib/generators/roomer/migration/migration_generator.rb +35 -0
  38. data/lib/generators/roomer/migration/templates/migration.rb +17 -0
  39. data/lib/generators/roomer/model/model_generator.rb +45 -0
  40. data/lib/generators/roomer/model/templates/migration.rb +16 -0
  41. data/lib/generators/roomer/setup/setup_generator.rb +38 -0
  42. data/lib/generators/roomer/setup/templates/global_migration.rb +20 -0
  43. data/lib/roomer/extensions/controller.rb +36 -0
  44. data/lib/roomer/extensions/model.rb +72 -0
  45. data/lib/roomer/helpers/generator_helper.rb +30 -0
  46. data/lib/roomer/helpers/migration_helper.rb +7 -0
  47. data/lib/roomer/helpers/postgres_helper.rb +75 -0
  48. data/lib/roomer/rails.rb +24 -0
  49. data/lib/roomer/schema.rb +63 -0
  50. data/lib/roomer/schema_dumper.rb +36 -0
  51. data/lib/roomer/tasks/migrate.rake +85 -0
  52. data/lib/roomer/utils.rb +68 -0
  53. data/lib/roomer/version.rb +14 -0
  54. data/lib/roomer.rb +125 -0
  55. data/roomer.gemspec +22 -0
  56. data/test/config.rb +3 -0
  57. data/test/config.yml +7 -0
  58. data/test/generators/install_generator_test.rb +13 -0
  59. data/test/generators/migration_generator_test.rb +33 -0
  60. data/test/generators/model_generator_test.rb +25 -0
  61. data/test/generators/setup_generator_test.rb +25 -0
  62. data/test/rails_app/app/controllers/application_controller.rb +3 -0
  63. data/test/rails_app/app/helpers/application_helper.rb +2 -0
  64. data/test/rails_app/app/models/tenant.rb +12 -0
  65. data/test/rails_app/app/views/layouts/application.html.erb +14 -0
  66. data/test/rails_app/config/application.rb +50 -0
  67. data/test/rails_app/config/boot.rb +6 -0
  68. data/test/rails_app/config/database.yml +2 -0
  69. data/test/rails_app/config/environment.rb +5 -0
  70. data/test/rails_app/config/environments/development.rb +26 -0
  71. data/test/rails_app/config/environments/production.rb +49 -0
  72. data/test/rails_app/config/environments/test.rb +35 -0
  73. data/test/rails_app/config/initializers/backtrace_silencers.rb +7 -0
  74. data/test/rails_app/config/initializers/inflections.rb +10 -0
  75. data/test/rails_app/config/initializers/mime_types.rb +5 -0
  76. data/test/rails_app/config/initializers/roomer.rb +68 -0
  77. data/test/rails_app/config/initializers/secret_token.rb +7 -0
  78. data/test/rails_app/config/initializers/session_store.rb +8 -0
  79. data/test/rails_app/config/locales/en.yml +5 -0
  80. data/test/rails_app/config/routes.rb +58 -0
  81. data/test/rails_app/config.ru +4 -0
  82. data/test/rails_app/db/migrate/global/20110825231409_roomer_create_tenants.rb +20 -0
  83. data/test/rails_app/db/seeds.rb +7 -0
  84. data/test/rails_app/lib/tasks/.gitkeep +0 -0
  85. data/test/rails_app/public/404.html +26 -0
  86. data/test/rails_app/public/422.html +26 -0
  87. data/test/rails_app/public/500.html +26 -0
  88. data/test/rails_app/public/favicon.ico +0 -0
  89. data/test/rails_app/public/images/rails.png +0 -0
  90. data/test/rails_app/public/index.html +239 -0
  91. data/test/rails_app/public/javascripts/application.js +2 -0
  92. data/test/rails_app/public/javascripts/controls.js +965 -0
  93. data/test/rails_app/public/javascripts/dragdrop.js +974 -0
  94. data/test/rails_app/public/javascripts/effects.js +1123 -0
  95. data/test/rails_app/public/javascripts/prototype.js +6001 -0
  96. data/test/rails_app/public/javascripts/rails.js +191 -0
  97. data/test/rails_app/public/robots.txt +5 -0
  98. data/test/rails_app/public/stylesheets/.gitkeep +0 -0
  99. data/test/roomer/helpers/postgres_helper_test.rb +62 -0
  100. data/test/roomer/roomer_test.rb +37 -0
  101. data/test/test_helper.rb +23 -0
  102. metadata +228 -0
data/.autotest ADDED
@@ -0,0 +1,17 @@
1
+ require 'autotest/growl'
2
+
3
+ Autotest.add_hook :initialize do |at|
4
+ at.clear_mappings
5
+
6
+ at.add_mapping(/.*_test.rb/) do |f, _|
7
+ f
8
+ end
9
+
10
+ %w{.git .svn .hg .DS_Store ._* vendor tmp log doc}.each do |exception|
11
+ at.add_exception(exception)
12
+ end
13
+ end
14
+
15
+ Autotest::Growl::show_modified_files = true
16
+ Autotest::Growl::one_notification_per_run = true
17
+ Autotest::Growl::clear_terminal = false
data/.gitignore ADDED
@@ -0,0 +1,9 @@
1
+ .DS_Store
2
+ .yardoc*
3
+ *.gem
4
+ .bundle
5
+ Gemfile.lock
6
+ pkg/*
7
+ test/tmp*
8
+ tmp*
9
+ test/rails_app/log*
data/.rvmrc ADDED
@@ -0,0 +1,2 @@
1
+ rvm ruby-1.8.7-p334@roomer --create
2
+ echo "commencing countdown, engines on!"
data/.travis.yml ADDED
@@ -0,0 +1,2 @@
1
+ before_script:
2
+ - "psql -c 'create database roomer_test;' -U postgres >/dev/null"
data/Gemfile ADDED
@@ -0,0 +1,31 @@
1
+ source "http://rubygems.org"
2
+ gemspec
3
+
4
+ gem "rails", "3.0.9"
5
+
6
+ group :doc do
7
+ gem "yard"
8
+ end
9
+
10
+ group :test do
11
+ gem "webrat", "~> 0.7.2", :require => false
12
+ gem "mocha", "~> 0.9.12", :require => false
13
+ gem "ZenTest", "~> 4.6.2", :require => false
14
+ gem "autotest-growl", "~> 0.2.9", :require => false
15
+ end
16
+
17
+ platforms :ruby do
18
+ group :db do
19
+ gem "pg", ">= 0.11.0"
20
+ end
21
+ end
22
+
23
+ platforms :jruby do
24
+ gem "activerecord-jdbc-adapter"
25
+ end
26
+
27
+ platforms :mri_18 do
28
+ group :test do
29
+ gem "ruby-debug", ">= 0.10.3"
30
+ end
31
+ end
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2011 Marketron Broadcast Solutions
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,116 @@
1
+ # Roomer
2
+
3
+ Roomer is a multitenant framework for Rails using PostgreSQL
4
+
5
+ ## Multitenant Data Strategy
6
+
7
+ While there are several strategies for multi-tenancy, Roomer uses PostgreSQL's schemas (namespaces) to achieve its goal. You can use Roomer if your application has the below characteristics:
8
+
9
+ * Each Tenant's data has be to be private to the Tenant.
10
+ * No (or minimal) requirement to run cross-tenant queries.
11
+
12
+ Each Tenant's data is stored in separate schema and shared data is stored in a "global" schema accessible to all the Tenants.
13
+
14
+ ### PostgreSQL "Schemas"
15
+
16
+ A database in PostgreSQL contains one or more named schemas, which in turn contain tables. Schemas also contain other kinds of named objects, including data types, functions, and operators. The same object name can be used in different schemas without conflict; for example, both schema1 and myschema may contain tables named mytable. Unlike databases, schemas are not rigidly separated: a user may access objects in any of the schemas in the database he is connected to, if he has privileges to do so.
17
+
18
+ More information at http://www.postgresql.org/docs/8.2/static/ddl-schemas.html
19
+
20
+ ## Usage
21
+
22
+ ### Installation
23
+
24
+ Roomer currently in pre-release and only supports Rails 3. In your Gemfile insert the below and run "bundle install"
25
+
26
+ gem 'roomer', :git => "git://github.com/gosuri/roomer.git"
27
+
28
+ After you install Roomer and add it to your Gemfile, you need to run the generator. Roomer will use default values "tenant" for Tenant scoped models and "global" for shared models. If you'd like to override the defaults use the optional parameters
29
+
30
+ ```bash
31
+ rails generate roomer:install
32
+ ```
33
+
34
+ The generator will install an initializer under config/initializers/roomer.rb which describes ALL Roomer’s configuration options and you MUST take a look at it.
35
+
36
+ ### Setup
37
+
38
+ After you've done the necessary config changes to the initializer, run the setup:
39
+
40
+ ```bash
41
+ rails generate roomer:setup
42
+ ```
43
+
44
+ ### Running Migrations
45
+
46
+ #### Shared
47
+
48
+ The setup will generate migrations under db/migrate/[shared_shema_name], by default it should be db/migrate/global. You need to run the shared migrations to setup the tenant tables
49
+
50
+ ```bash
51
+ rake roomer:shared:migrate
52
+ ```
53
+
54
+ #### Tenanted
55
+
56
+ This will run migrations under db/migrate. If you set the "config.use_tenanted_migrations_directory" parameter to true, it should run the migrations under db/migrate/[tenant_table_name]/*
57
+
58
+ ```bash
59
+ rake roomer:tenanted:migrate
60
+ ```
61
+ #### Both
62
+
63
+ To run both shared and tenanted use:
64
+
65
+ ```bash
66
+ rake roomer:migrate
67
+ ```
68
+
69
+ ## Models
70
+
71
+ To enable Roomer on your models, simply call the roomer method and specify the type in your Model Class definition:
72
+
73
+ ```ruby
74
+ class Orders < ActiveRecord::Base
75
+ roomer :tenanted
76
+ end
77
+ ```
78
+
79
+ Roomer supports types of scoped models
80
+
81
+ * shared: shared by all tenants
82
+ * tenanted: scoped to a tenant
83
+
84
+ Roomer also provides generators
85
+
86
+ ```bash
87
+ rails generate roomer:model user name:string email:string
88
+ ```
89
+
90
+ Optionally, you can specify --shared flag to generate a shared model
91
+
92
+ ```bash
93
+ rails generate roomer:model organizations name:string desc:string --shared
94
+ ```
95
+
96
+ Migrations are similar, defaulting to the global schema,
97
+ or optionally --shared for tenanted migration
98
+
99
+ ```bash
100
+ rails generate roomer:migration AddPhoneToPerson phone:string
101
+ ```
102
+
103
+ ```bash
104
+ rails generate roomer:migration AddPhoneToPerson phone:string --shared
105
+ ```
106
+
107
+ ## Contributors
108
+
109
+ https://github.com/gosuri/roomer/contributors
110
+
111
+ ## Build Status
112
+
113
+ * stable ([![Build Status](http://travis-ci.org/gosuri/roomer.png?branch=master)](http://travis-ci.org/gosuri/roomer?branch=master))
114
+ * unstable ([![Build Status](http://travis-ci.org/gosuri/roomer.png?branch=develop)](http://travis-ci.org/gosuri/roomer?branch=develop))
115
+
116
+
data/Rakefile ADDED
@@ -0,0 +1,16 @@
1
+ # encoding: UTF-8
2
+
3
+ require "bundler/gem_tasks"
4
+ require 'rake/testtask'
5
+ require 'rdoc/task'
6
+
7
+ desc 'Run Roomer unit tests'
8
+ Rake::TestTask.new(:test) do |t|
9
+ t.libs << 'lib'
10
+ t.libs << 'test'
11
+ t.pattern = 'test/**/*_test.rb'
12
+ t.verbose = true
13
+ end
14
+
15
+ desc 'Run tests by default'
16
+ task :default => %w(test)
data/TODO.md ADDED
@@ -0,0 +1,10 @@
1
+ # Features
2
+ + Scoped routes for tenants
3
+ + Generators for Tenanted and Shared Migrators - DONE
4
+ rails generate roomer:migration [migration_name] [attribute:type]
5
+ rails generate roomer:migration [migration_name] [attribute:type] --shared
6
+ + Option to disable standard rails migration "rake db:migrate"
7
+
8
+ # Enhancements
9
+ + Show warnings if unrun migrations exists under db/migrate/global while running rake roomer:shared:migrate
10
+
@@ -0,0 +1,328 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+ <title>
7
+ Class: ActiveRecord::Base
8
+
9
+ &mdash; Documentation by YARD 0.7.2
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../css/style.css" type="text/css" media="screen" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="../css/common.css" type="text/css" media="screen" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ relpath = '..';
19
+ if (relpath != '') relpath += '/';
20
+ </script>
21
+
22
+ <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
23
+
24
+ <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
25
+
26
+
27
+ </head>
28
+ <body>
29
+ <script type="text/javascript" charset="utf-8">
30
+ if (window.top.frames.main) document.body.className = 'frames';
31
+ </script>
32
+
33
+ <div id="header">
34
+ <div id="menu">
35
+
36
+ <a href="../_index.html">Index (B)</a> &raquo;
37
+ <span class='title'>ActiveRecord</span>
38
+ &raquo;
39
+ <span class="title">Base</span>
40
+
41
+
42
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
43
+ </div>
44
+
45
+ <div id="search">
46
+
47
+ <a id="class_list_link" href="#">Class List</a>
48
+
49
+ <a id="method_list_link" href="#">Method List</a>
50
+
51
+ <a id="file_list_link" href="#">File List</a>
52
+
53
+ </div>
54
+ <div class="clear"></div>
55
+ </div>
56
+
57
+ <iframe id="search_frame"></iframe>
58
+
59
+ <div id="content"><h1>Class: ActiveRecord::Base
60
+
61
+
62
+
63
+ </h1>
64
+
65
+ <dl class="box">
66
+
67
+ <dt class="r1">Inherits:</dt>
68
+ <dd class="r1">
69
+ <span class="inheritName">Object</span>
70
+
71
+ <ul class="fullTree">
72
+ <li>Object</li>
73
+
74
+ <li class="next">ActiveRecord::Base</li>
75
+
76
+ </ul>
77
+ <a href="#" class="inheritanceTree">show all</a>
78
+
79
+ </dd>
80
+
81
+
82
+
83
+
84
+
85
+
86
+
87
+
88
+
89
+ <dt class="r2 last">Defined in:</dt>
90
+ <dd class="r2 last">lib/roomer/extensions/active_record.rb</dd>
91
+
92
+ </dl>
93
+ <div class="clear"></div>
94
+
95
+
96
+
97
+
98
+
99
+
100
+
101
+ <h2>
102
+ Class Method Summary
103
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
104
+ </h2>
105
+
106
+ <ul class="summary">
107
+
108
+ <li class="public ">
109
+ <span class="summary_signature">
110
+
111
+ <a href="#roomer-class_method" title="roomer (class method)">+ (Symbol) <strong>roomer</strong>(scope) </a>
112
+
113
+
114
+
115
+ </span>
116
+
117
+
118
+
119
+
120
+
121
+
122
+
123
+
124
+ <span class="summary_desc"><div class='inline'>
125
+ <p>Sets the roomer scope for the model and changes the model’s
126
+ table_name_prefix If :shared is passed, the global schema will be used as
127
+ the table name prefix if :tenanted is pased, the current tenant’s schema
128
+ will be used as the table name prefix.</p>
129
+ </div></span>
130
+
131
+ </li>
132
+
133
+
134
+ <li class="public ">
135
+ <span class="summary_signature">
136
+
137
+ <a href="#table_name_prefix-class_method" title="table_name_prefix (class method)">+ (String) <strong>table_name_prefix</strong> </a>
138
+
139
+
140
+
141
+ </span>
142
+
143
+
144
+
145
+
146
+
147
+
148
+
149
+
150
+ <span class="summary_desc"><div class='inline'>
151
+ <p>Overrides ActiveRecord::Base.table_name_prefix Defaults to blank if roomer
152
+ class method is not set in model Returns the shared schema name prefix if
153
+ roomer method is set to :shared Returns the current tenants schema name if
154
+ roomer class method is set to :tenanted.</p>
155
+ </div></span>
156
+
157
+ </li>
158
+
159
+
160
+ </ul>
161
+
162
+
163
+
164
+
165
+ <div id="class_method_details" class="method_details_list">
166
+ <h2>Class Method Details</h2>
167
+
168
+
169
+ <div class="method_details first">
170
+ <p class="signature first" id="roomer-class_method">
171
+
172
+ + (<tt>Symbol</tt>) <strong>roomer</strong>(scope)
173
+
174
+
175
+
176
+ </p><div class="docstring">
177
+ <div class="discussion">
178
+
179
+ <p>Sets the roomer scope for the model and changes the model’s
180
+ table_name_prefix If :shared is passed, the global schema will be used as
181
+ the table name prefix if :tenanted is pased, the current tenant’s schema
182
+ will be used as the table name prefix</p>
183
+
184
+
185
+ </div>
186
+ </div>
187
+ <div class="tags">
188
+ <h3>Returns:</h3>
189
+ <ul class="return">
190
+
191
+ <li>
192
+
193
+
194
+ <span class='type'>(<tt>Symbol</tt>)</span>
195
+
196
+
197
+
198
+ &mdash;
199
+ <div class='inline'>
200
+ <p>:shared or :tenanted</p>
201
+ </div>
202
+
203
+ </li>
204
+
205
+ </ul>
206
+
207
+ </div><table class="source_code">
208
+ <tr>
209
+ <td>
210
+ <pre class="lines">
211
+
212
+
213
+ 24
214
+ 25
215
+ 26
216
+ 27
217
+ 28
218
+ 29
219
+ 30
220
+ 31
221
+ 32
222
+ 33</pre>
223
+ </td>
224
+ <td>
225
+ <pre class="code"><span class="info file"># File 'lib/roomer/extensions/active_record.rb', line 24</span>
226
+
227
+ <span class='def def kw'>def</span> <span class='roomer identifier id'>roomer</span><span class='lparen token'>(</span><span class='scope identifier id'>scope</span><span class='rparen token'>)</span>
228
+ <span class='case case kw'>case</span> <span class='scope identifier id'>scope</span>
229
+ <span class='when when kw'>when</span> <span class='symbol val'>:shared</span>
230
+ <span class='@roomer_scope ivar id'>@roomer_scope</span> <span class='assign token'>=</span> <span class='symbol val'>:shared</span>
231
+ <span class='when when kw'>when</span> <span class='symbol val'>:tenanted</span>
232
+ <span class='@roomer_scope ivar id'>@roomer_scope</span> <span class='assign token'>=</span> <span class='symbol val'>:tenanted</span>
233
+ <span class='else else kw'>else</span>
234
+ <span class='raise identifier id'>raise</span> <span class='string val'>&quot;Invalid roomer model scope. Choose :shared or :tenanted&quot;</span>
235
+ <span class='end end kw'>end</span>
236
+ <span class='end end kw'>end</span>
237
+ </pre>
238
+ </td>
239
+ </tr>
240
+ </table>
241
+ </div>
242
+
243
+ <div class="method_details ">
244
+ <p class="signature " id="table_name_prefix-class_method">
245
+
246
+ + (<tt>String</tt>) <strong>table_name_prefix</strong>
247
+
248
+
249
+
250
+ </p><div class="docstring">
251
+ <div class="discussion">
252
+
253
+ <p>Overrides ActiveRecord::Base.table_name_prefix Defaults to blank if roomer
254
+ class method is not set in model Returns the shared schema name prefix if
255
+ roomer method is set to :shared Returns the current tenants schema name if
256
+ roomer class method is set to :tenanted</p>
257
+
258
+
259
+ </div>
260
+ </div>
261
+ <div class="tags">
262
+ <h3>Returns:</h3>
263
+ <ul class="return">
264
+
265
+ <li>
266
+
267
+
268
+ <span class='type'>(<tt>String</tt>)</span>
269
+
270
+
271
+
272
+ &mdash;
273
+ <div class='inline'>
274
+ <p>shared schema name prefix or current tenants schema name</p>
275
+ </div>
276
+
277
+ </li>
278
+
279
+ </ul>
280
+
281
+ </div><table class="source_code">
282
+ <tr>
283
+ <td>
284
+ <pre class="lines">
285
+
286
+
287
+ 9
288
+ 10
289
+ 11
290
+ 12
291
+ 13
292
+ 14
293
+ 15
294
+ 16
295
+ 17
296
+ 18</pre>
297
+ </td>
298
+ <td>
299
+ <pre class="code"><span class="info file"># File 'lib/roomer/extensions/active_record.rb', line 9</span>
300
+
301
+ <span class='def def kw'>def</span> <span class='table_name_prefix identifier id'>table_name_prefix</span>
302
+ <span class='return return kw'>return</span> <span class='@table_name_prefix ivar id'>@table_name_prefix</span> <span class='unless unless_mod kw'>unless</span> <span class='@table_name_prefix ivar id'>@table_name_prefix</span><span class='dot token'>.</span><span class='blank? fid id'>blank?</span>
303
+ <span class='if if kw'>if</span> <span class='shared? fid id'>shared?</span>
304
+ <span class='Roomer constant id'>Roomer</span><span class='dot token'>.</span><span class='shared_schema_name identifier id'>shared_schema_name</span><span class='dot token'>.</span><span class='to_s identifier id'>to_s</span>
305
+ <span class='elsif elsif kw'>elsif</span> <span class='tenanted? fid id'>tenanted?</span>
306
+ <span class='self self kw'>self</span><span class='dot token'>.</span><span class='current_tenant identifier id'>current_tenant</span><span class='lbrack token'>[</span><span class='Roomer constant id'>Roomer</span><span class='dot token'>.</span><span class='tenant_schema_name_column identifier id'>tenant_schema_name_column</span><span class='rbrack token'>]</span>
307
+ <span class='else else kw'>else</span>
308
+ <span class='string val'>&quot;&quot;</span>
309
+ <span class='end end kw'>end</span>
310
+ <span class='end end kw'>end</span>
311
+ </pre>
312
+ </td>
313
+ </tr>
314
+ </table>
315
+ </div>
316
+
317
+ </div>
318
+
319
+ </div>
320
+
321
+ <div id="footer">
322
+ Generated on Fri Aug 12 10:39:12 2011 by
323
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
324
+ 0.7.2 (ruby-1.8.7).
325
+ </div>
326
+
327
+ </body>
328
+ </html>
@@ -0,0 +1,116 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+ <title>
7
+ Class: ApplicationController
8
+
9
+ &mdash; Documentation by YARD 0.7.2
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="css/style.css" type="text/css" media="screen" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ relpath = '';
19
+ if (relpath != '') relpath += '/';
20
+ </script>
21
+
22
+ <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
23
+
24
+ <script type="text/javascript" charset="utf-8" src="js/app.js"></script>
25
+
26
+
27
+ </head>
28
+ <body>
29
+ <script type="text/javascript" charset="utf-8">
30
+ if (window.top.frames.main) document.body.className = 'frames';
31
+ </script>
32
+
33
+ <div id="header">
34
+ <div id="menu">
35
+
36
+ <a href="_index.html">Index (A)</a> &raquo;
37
+
38
+
39
+ <span class="title">ApplicationController</span>
40
+
41
+
42
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
43
+ </div>
44
+
45
+ <div id="search">
46
+
47
+ <a id="class_list_link" href="#">Class List</a>
48
+
49
+ <a id="method_list_link" href="#">Method List</a>
50
+
51
+ <a id="file_list_link" href="#">File List</a>
52
+
53
+ </div>
54
+ <div class="clear"></div>
55
+ </div>
56
+
57
+ <iframe id="search_frame"></iframe>
58
+
59
+ <div id="content"><h1>Class: ApplicationController
60
+
61
+
62
+
63
+ </h1>
64
+
65
+ <dl class="box">
66
+
67
+ <dt class="r1">Inherits:</dt>
68
+ <dd class="r1">
69
+ <span class="inheritName">ActionController::Base</span>
70
+
71
+ <ul class="fullTree">
72
+ <li>Object</li>
73
+
74
+ <li class="next">ActionController::Base</li>
75
+
76
+ <li class="next">ApplicationController</li>
77
+
78
+ </ul>
79
+ <a href="#" class="inheritanceTree">show all</a>
80
+
81
+ </dd>
82
+
83
+
84
+
85
+
86
+
87
+
88
+
89
+
90
+
91
+ <dt class="r2 last">Defined in:</dt>
92
+ <dd class="r2 last">lib/roomer/extensions/application_controller.rb</dd>
93
+
94
+ </dl>
95
+ <div class="clear"></div>
96
+
97
+
98
+
99
+
100
+
101
+
102
+
103
+
104
+
105
+
106
+
107
+ </div>
108
+
109
+ <div id="footer">
110
+ Generated on Fri Aug 12 10:39:12 2011 by
111
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
112
+ 0.7.2 (ruby-1.8.7).
113
+ </div>
114
+
115
+ </body>
116
+ </html>