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 :account # will assume that the class to be Account and instance variables to be @account/@accounts
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/account"
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
@@ -23,5 +23,5 @@
23
23
  # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24
24
 
25
25
  module Trust
26
- VERSION = "0.6.0"
26
+ VERSION = "0.6.1"
27
27
  end
@@ -35,3 +35,5 @@ Migrating to CreateClients (20120523144144)
35
35
   (1.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20120523144144')
36
36
   (1.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20120522115011')
37
37
   (1.9ms) 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.