summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormo k <mo@mokhan.ca>2012-03-04 19:02:47 -0700
committermo k <mo@mokhan.ca>2012-03-04 19:02:47 -0700
commitaab0400e8f4951fb09648cae7fcd436a00280133 (patch)
tree13c3bd2be0580df9b332d12ad55d56025f7cb65d
parentfdcae42bd19ce269d966f4c395350f69dd1c17ab (diff)
move query into queries folder.
-rw-r--r--app.rb1
-rw-r--r--controller/project.rb3
-rw-r--r--queries/find_all_projects.rb3
-rw-r--r--queries/init.rb12
4 files changed, 16 insertions, 3 deletions
diff --git a/app.rb b/app.rb
index 27fe4d5..ff43905 100644
--- a/app.rb
+++ b/app.rb
@@ -11,3 +11,4 @@ Ramaze.options.roots = [__DIR__]
# Initialize controllers and models
require __DIR__('domain/init')
require __DIR__('controller/init')
+require __DIR__('queries/init')
diff --git a/controller/project.rb b/controller/project.rb
index 7b3c073..dc0aeae 100644
--- a/controller/project.rb
+++ b/controller/project.rb
@@ -6,6 +6,3 @@ class ProjectController < Controller
@query_builder.build(FindAllProjects).fetch
end
end
-class FindAllProjects
-
-end
diff --git a/queries/find_all_projects.rb b/queries/find_all_projects.rb
new file mode 100644
index 0000000..7db8053
--- /dev/null
+++ b/queries/find_all_projects.rb
@@ -0,0 +1,3 @@
+class FindAllProjects
+
+end
diff --git a/queries/init.rb b/queries/init.rb
new file mode 100644
index 0000000..bd096f9
--- /dev/null
+++ b/queries/init.rb
@@ -0,0 +1,12 @@
+# This file is used for loading all your models. Note that you don't have to actually use
+# this file. The great thing about Ramaze is that you're free to change it the way you see
+# fit.
+
+# Here go your requires for models:
+# require __DIR__('user')
+Dir[File.dirname(__FILE__) + '**/*.rb'].each do |file|
+ load file unless file == __FILE__
+end
+class FindAllProjects
+
+end