trust 0.6.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
@@ -60,14 +60,15 @@ module Trust
|
|
60
60
|
# returns or sets the model to be used in a controller
|
61
61
|
# If not set, the controller_path is used
|
62
62
|
# You can override the model to be accessed in a controller by setting the model
|
63
|
+
# Note that you should specify the model in plural form.
|
63
64
|
#
|
64
65
|
# ==== Example
|
65
66
|
#
|
66
67
|
# # You have a controller which inherits from a generic controller and it has not the same name. Below
|
67
|
-
# model :
|
68
|
+
# model :accounts # will assume that the class to be Account and instance variables to be @account/@accounts
|
68
69
|
#
|
69
70
|
# # name spaced models
|
70
|
-
# model :"customer/
|
71
|
+
# model :"customer/accounts"
|
71
72
|
#
|
72
73
|
def model(name = nil)
|
73
74
|
@model = name.to_s if name
|
@@ -126,7 +126,7 @@ module Trust
|
|
126
126
|
@controller.send(:build, action) if @controller.respond_to?(:build)
|
127
127
|
elsif properties.member_actions.include?(action)
|
128
128
|
# logger.debug "Trust.load: Finding parent: #{parent.inspect}, relation: #{relation.inspect}"
|
129
|
-
self.instance ||= relation.find(params[:id])
|
129
|
+
self.instance ||= relation.find(params[:id] || params["#{relation.name.underscore}_id".to_sym])
|
130
130
|
@controller.send(:build, action) if @controller.respond_to?(:build)
|
131
131
|
else # other outcome would be collection actions
|
132
132
|
# logger.debug "Trust.load: Parent is: #{parent.inspect}, collection or unknown action."
|
data/lib/trust/version.rb
CHANGED
@@ -35,3 +35,5 @@ Migrating to CreateClients (20120523144144)
|
|
35
35
|
[1m[35m (1.9ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20120523144144')
|
36
36
|
[1m[36m (1.7ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20120522115011')[0m
|
37
37
|
[1m[35m (1.9ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20120522130322')
|
38
|
+
Connecting to database specified by database.yml
|
39
|
+
MONGODB [DEBUG] Logging level is currently :debug which could negatively impact client-side performance. You should set your logging level no lower than :info in production.
|