Skip to content

Instantly share code, notes, and snippets.

@alagu
Last active March 16, 2017 10:45
Show Gist options
  • Save alagu/60e876fa33cbf830b816d878b9afa71c to your computer and use it in GitHub Desktop.
Save alagu/60e876fa33cbf830b816d878b9afa71c to your computer and use it in GitHub Desktop.
class Asker < ActiveRecord::Base
has_many :questions
belongs_to :user
accepts_nested_attributes_for :user
end
class Question < ActiveRecord::Base
belongs_to :asker
end
class User
has_one :asker
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment