activemodel
Rails - Help understanding how to use :dependent => :destroy
I have the following models: User (id) Project (id) Permission (project_id, user_id) Thread (project_id) ThreadParticipation (thread_id, user_id)[详细]
2023-02-10 17:09 分类:问答Build a table which has a Field of User_ids, and then querying for a particular User_Id
I need some help building a table and then getting data from that table in Rails 3. Here\'s the break down:[详细]
2023-02-10 03:10 分类:问答In Rails - How to have one query that has multiple queries?
In have 3 models here: projects threads (project_id) thread_participations (thread_id, read boolean) Right now I have a list of the user\'s projects, and the list shows how many threads are unrea[详细]
2023-02-08 23:37 分类:问答Rails Validation with ActiveModel
I\'ve been going through the documentation for getting ActiveRecord validation working with ActiveModel. For some reason I am not seeing any validation results returned.[详细]
2023-02-08 09:44 分类:问答Getting a undefined method `validates_presence_of' for for a custom attr_accessor
I think the trouble is coming from the fact this is a custom Model. Error: undefined method `validates_presence_of\' for Calculation:Class[详细]
2023-02-08 04:42 分类:问答How can i set include_root_in_json to false for all my RoR models?
How can i set include_root_in_json to false for all my RoR models? 开发者_运维知识库I\'ve tried to set ActiveModel::Base.include_root_in_json = false inside application.rb, but it has no effect.Model[详细]
2023-01-30 02:43 分类:问答ActiveModel without rails
开发者_如何学PythonIs possible use ActiveModel without rails?. Is possible use ActiveModel in desktop application?With Rails 3 you can! Check out this post on Rubyinside.com Yes, for example using th[详细]
2023-01-29 04:21 分类:问答Rails, Model Relationship Question
I have the following which works great: @request_thread 开发者_如何学编程= current_user.request_threads.new(params[:request_thread])[详细]
2023-01-24 11:00 分类:问答Mongoid: How can I make Mongoid recognize my custom ActiveModel validations?
I have a model, which has and array of names and I want to ensure that only one document can have a given name. I\'m trying to write a custom validation to handle this. My custom validation and the mo[详细]
2023-01-24 05:32 分类:问答rails 3:how to generate models for existing database tables
I\'ve configured my database.yml to point to my existing mysql database how can I generate models from it?[详细]
2023-01-24 02:34 分类:问答