{"action":"created","issue":{"url":"https://api.github.com/repos/Brunomm/delegate_associations/issues/1","repository_url":"https://api.github.com/repos/Brunomm/delegate_associations","labels_url":"https://api.github.com/repos/Brunomm/delegate_associations/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/Brunomm/delegate_associations/issues/1/comments","events_url":"https://api.github.com/repos/Brunomm/delegate_associations/issues/1/events","html_url":"https://github.com/Brunomm/delegate_associations/issues/1","id":138369056,"number":1,"title":"DelegationError","user":{"login":"sahal2080","id":6193430,"avatar_url":"https://avatars.githubusercontent.com/u/6193430?v=3","gravatar_id":"","url":"https://api.github.com/users/sahal2080","html_url":"https://github.com/sahal2080","followers_url":"https://api.github.com/users/sahal2080/followers","following_url":"https://api.github.com/users/sahal2080/following{/other_user}","gists_url":"https://api.github.com/users/sahal2080/gists{/gist_id}","starred_url":"https://api.github.com/users/sahal2080/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sahal2080/subscriptions","organizations_url":"https://api.github.com/users/sahal2080/orgs","repos_url":"https://api.github.com/users/sahal2080/repos","events_url":"https://api.github.com/users/sahal2080/events{/privacy}","received_events_url":"https://api.github.com/users/sahal2080/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-03-04T03:51:35Z","updated_at":"2016-03-18T12:00:12Z","closed_at":null,"body":"Basically following this simple tutorial:\r\nhttp://astockwell.com/blog/2014/03/polymorphic-associations-in-rails-4-devise/\r\nUsing your gem, when I try:\r\n```ruby\r\n# Create a record with nested attributes\r\nSubscriber.create(\r\n    :region          => 'West',\r\n    :referrer        => 'John Smith',\r\n    :email    => 'jd@example.com',\r\n    :name     => 'Jane Doe',\r\n    :password => 'foobar'\r\n)\r\n```\r\nI get this error: `Module::DelegationError`"},"comment":{"url":"https://api.github.com/repos/Brunomm/delegate_associations/issues/comments/198324407","html_url":"https://github.com/Brunomm/delegate_associations/issues/1#issuecomment-198324407","issue_url":"https://api.github.com/repos/Brunomm/delegate_associations/issues/1","id":198324407,"user":{"login":"Brunomm","id":2380733,"avatar_url":"https://avatars.githubusercontent.com/u/2380733?v=3","gravatar_id":"","url":"https://api.github.com/users/Brunomm","html_url":"https://github.com/Brunomm","followers_url":"https://api.github.com/users/Brunomm/followers","following_url":"https://api.github.com/users/Brunomm/following{/other_user}","gists_url":"https://api.github.com/users/Brunomm/gists{/gist_id}","starred_url":"https://api.github.com/users/Brunomm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Brunomm/subscriptions","organizations_url":"https://api.github.com/users/Brunomm/orgs","repos_url":"https://api.github.com/users/Brunomm/repos","events_url":"https://api.github.com/users/Brunomm/events{/privacy}","received_events_url":"https://api.github.com/users/Brunomm/received_events","type":"User","site_admin":false},"created_at":"2016-03-18T12:00:11Z","updated_at":"2016-03-18T12:00:11Z","body":"Thanks @sahal2080 ,  now I understood the problem. The gem auto_build_association is very simple, you only need to do this in your model:\r\n```ruby\r\n# models/subscriber.rb\r\nclass Subscriber < ActiveRecord::Base\r\n    has_one :user, as: :meta, dependent: :destroy\r\n    accepts_nested_attributes_for :user\r\n   \r\n   def user\r\n        super || build_user\r\n   end\r\nend\r\n```\r\n\r\nSo, I created this gem by a nececity in a project. Look:  http://pt.stackoverflow.com/questions/62750/como-modelar-com-heran%C3%A7a-uma-estrutura-de-pessoas#answer-63274."}}