 <pre><code>#app/models/notification.rb class Notification &lt; ActiveRecord::Base belongs_to :device, foreign_key: :registration_id, primary_key: :token delegate :user, to: :device #-&gt; notification.user.name end #app/models/device.rb class Device &lt; ActiveRecord::Base belongs_to :user has_many :notifications, foreign_key: :registration_id, primary_key: :token end #app/models/user.rb class User &lt; ActiveRecord::Base has_many :devices has_many :notifications, through: :devices end </code></pre> <p>The above is how I would perceive it to be set up.</p> <p>You'll be able to call:</p> <pre><code>@notification = Notification.find params[:id] @notification.device.user.name #-&gt; "name" of associated "user" model @notification.user.name #-&gt; delegate to "user" model directly </code></pre> <hr> <p>The <a href="http://apidock.com/rails/Module/delegate" rel="nofollow"><code>delegate</code></a> method is a trick to circumvent the <a href="https://en.wikipedia.org/wiki/Law_of_Demeter" rel="nofollow"><code>law of demeter</code></a> issue (calling an object several levels "away" from the parent).</p>