rails-models
Correct design: a Post can have one User (author) plus many Users (tagged users)
I have a situation where I\'m getting a bit stuck. A Post can have a User (as an author), and a Post can also have many Users (as a post can have other users tagged in it).[详细]
2023-04-11 10:31 分类:问答How to add sequences to a migration and use them in a model?
I want to have a \"Customer\" Model with a normal primary key and another column to store a custom \"Customer Number\". In addition, I want the db to handle default Customer Numbers. I think, defining[详细]
2023-04-09 06:14 分类:问答CouchRest Model use a custom value instead of guid for _id field
I wonder if there is a way to use a custom string value (e.g. name of the object) as the 开发者_如何转开发_id field instead of a guid in CouchRest Model.[详细]
2023-04-08 14:20 分类:问答How to add property in module in Rails CouchRest Model to support multiple inheritance?
In my class, I want to include multiple modules.Each module can define its own property to persist in couchDB.[详细]
2023-04-05 18:55 分类:问答I'm gettgin No route matches {:action=>"new", :controller=>"posts"} even though it's not in my routes.rb file. HELP?
OK so this is my first question posted to stackoverflow. I\'m pretty new to coding, been learning Ruby on Rails for the past 3 months. There could be a few things wrong with my code but here it goes.[详细]
2023-03-31 02:44 分类:问答Ruby on rails 3 - Join many models to update a field of one model using attributes from another model non related directly
I have a problem trying to update an attribute of one model using the value from another model, but those two models are not related.[详细]
2023-03-27 18:08 分类:问答Ruby on Rails - concatenate strings on save to database upon user clicking create action
Its late and I probably should sleep on this. Easy one I have 3 fields in a form which a user fills in. Once they click the create button these records are saved to the database. Simple.[详细]
2023-03-22 02:29 分类:问答Rails 3: update multiple parents when creating a child object on one of the parent's show
I am new to rails and trying to learn now so hopefully someone can help. I have 3 models for User, Opinion and Vote with one-to-many relationships. Each user has_many :opinions and has_many :votes. E[详细]
2023-03-21 09:10 分类:问答cross model scoping - rails 3
I want to create a scope for all Posts without comments... I do not understand how, in the model (by creating a scope), I can check if my Post has any Comments attached to it as only the Comments seem[详细]
2023-03-21 04:49 分类:问答Rails 3 Nested Model Form: Can not mass assign protected attribute
I currently have a form set up with nested models - all going according to plan so far. The form allows me to create a sale, and from that I can create a customer and a vehicle (separate models).[详细]
2023-03-20 16:15 分类:问答