Skip to content

allows creating/updating associated models with hash params (rails)

License

Notifications You must be signed in to change notification settings

psergi/accessible_association

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AccessibleAssociation
=====================

Allows associations to be created with hash parameters.


Example
=======

class User < ActiveRecord::Base
  belongs_to :preferences
  accessible_association :preferences
end

u = User.create(:name => 'jones', :preferences => { :email => 'jones@mail.com' })

u.name
=> 'jones'
u.preferences.email
=> 'jones@mail.com'

Copyright (c) 2009 Phil Sergi, released under the MIT license

About

allows creating/updating associated models with hash params (rails)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages