1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activerecord/test/models
David Dollar e0750d6a5c Add :accessible option to Associations for allowing mass assignments using hash. [#474 state:resolved]
Allows nested Hashes (i.e. from nested forms) to hydrate the appropriate
ActiveRecord models.

class Post < ActiveRecord::Base
  belongs_to :author,   :accessible => true
  has_many   :comments, :accessible => true
end

post = Post.create({
  :title    => 'Accessible Attributes',
  :author   => { :name => 'David Dollar' },
  :comments => [
    { :body => 'First Post!' },
    { :body => 'Nested Hashes are great!' }
  ]
})

post.comments << { :body => 'Another Comment' }

Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2008-07-14 02:53:21 +01:00
..
author.rb Add :accessible option to Associations for allowing mass assignments using hash. [#474 state:resolved] 2008-07-14 02:53:21 +01:00
auto_id.rb
binary.rb
book.rb
categorization.rb
category.rb fix eager loading with dynamic finders 2008-06-09 12:05:20 -04:00
citation.rb
club.rb has_one :through supports :source_type. Fix up some tests. References #4756. 2008-03-22 02:20:37 +00:00
column_name.rb
comment.rb Merge the has_finder gem, renamed as 'named_scope'. Closes #11404 [nkallen] 2008-03-24 02:50:02 +00:00
company.rb Add support for :primary_key option to has_one as well as has_many so that a key other than the default primary key can be used for the association 2008-07-06 20:25:10 +02:00
company_in_module.rb Improve ActiveRecord::Base#table_name unit tests for nested classes. Closes #10289. [scott_willson] 2008-04-07 19:44:37 +00:00
computer.rb
contact.rb
course.rb
customer.rb
default.rb
developer.rb Disable validations for associated belongs_to record by default 2008-06-11 12:39:56 +01:00
edge.rb
entrant.rb
guid.rb Fix validates_uniqueness_of for SQL keywords [#23 state:resolved] 2008-05-11 19:30:03 +01:00
item.rb
job.rb Ensure table names are quoted by the association preloading code. 2008-04-26 12:14:50 +12:00
joke.rb
keyboard.rb
legacy_thing.rb
matey.rb
member.rb Add has_one :through support, finally. Closes #4756 [thechrisoshow] 2008-03-21 18:09:03 +00:00
membership.rb Add has_one :through support, finally. Closes #4756 [thechrisoshow] 2008-03-21 18:09:03 +00:00
minimalistic.rb
mixed_case_monkey.rb
movie.rb
order.rb
owner.rb Fixed preloading belongs_to associations which reference a custom foreign key. References #9640. 2008-01-31 07:50:15 +00:00
parrot.rb
person.rb fix eager loading with dynamic finders 2008-06-09 12:05:20 -04:00
pet.rb Fixed preloading belongs_to associations which reference a custom foreign key. References #9640. 2008-01-31 07:50:15 +00:00
pirate.rb Dirty attributes aren't cleared if save fails. [#174 state:resolved] 2008-05-12 17:04:17 -07:00
post.rb Add :accessible option to Associations for allowing mass assignments using hash. [#474 state:resolved] 2008-07-14 02:53:21 +01:00
price_estimate.rb Fix has_many :through a polymorphic has_many. Closes #10529 [Aleksey Kondratenko] 2008-02-02 03:27:31 +00:00
project.rb Introduce the :readonly option to all associations. Records from the association cannot be saved. Closes #11084. 2008-02-13 06:32:50 +00:00
reader.rb
reference.rb Ensure table names are quoted by the association preloading code. 2008-04-26 12:14:50 +12:00
reply.rb Change tests against all scope to base scope as all is now used as a finder alias 2008-04-30 00:25:52 -05:00
ship.rb
sponsor.rb Add has_one :through support, finally. Closes #4756 [thechrisoshow] 2008-03-21 18:09:03 +00:00
subject.rb
subscriber.rb Fixed AssociationsPreload such that it doesnt require foreign keys to be integers (fcheung) [#33 state:resolved] 2008-04-30 23:30:50 -05:00
subscription.rb Added missing files 2008-05-01 15:03:16 -05:00
tag.rb
tagging.rb
task.rb
topic.rb Ensure NamedScope#build/create/create!/new works as expected when named scope has hash conditions. [Daniel Guettler, Pratik Naik] [#419 state:resolved] 2008-07-09 14:09:17 +01:00
treasure.rb Fix has_many :through a polymorphic has_many. Closes #10529 [Aleksey Kondratenko] 2008-02-02 03:27:31 +00:00
vertex.rb
warehouse_thing.rb