Note that there are some explanatory texts on larger screens.

plurals
  1. PORuby on Rails no such column: authentication.provider: Omniauth
    primarykey
    data
    text
    <p>I was following this tutorial on Omniauth: <a href="http://railscasts.com/episodes/235-omniauth-part-1?view=asciicast" rel="nofollow">http://railscasts.com/episodes/235-omniauth-part-1?view=asciicast</a></p> <p>I keep getting this error:</p> <blockquote> <p>no such column: authentication.provider:</p> </blockquote> <p>Now the <strong>main thing</strong> I want to know is why "provider" isn't being accepted. It exists in the class... the authentications database exists... so why is it saying it isn't there?</p> <p>Here's my authentications controller:</p> <pre><code>class AuthenticationsController &lt; InheritedResources::Base def index @authentications = current_user.authentications if current_user end def create @user = User.where(authentication: auth).first_or_create(:provider =&gt; auth['provider'], :uid =&gt; auth['uid']) self.current_user = @user # auth = request.env["omniauth.auth"] current_user.authentications.create(:provider =&gt; auth['provider'], :uid =&gt; auth['uid']) flash[:notice] = "Authentication successful." redirect_to authentications_url end def auth request.env['omniauth.auth'] end def destroy @authentication = current_user.authentications.find(params[:id]) @authentication.destroy flash[:notice] = "Successfully destroyed authentication." redirect_to authentications_url end end </code></pre> <p>I can assure you I have a model called authentication and that this model has a provider and uid field. I've also tried where(authentications: auth) and where(auth: auth) each with no luck.</p> <p>Any ideas would be appreciated.</p> <p><strong>UPDATE</strong></p> <p>authentication.rb (model)</p> <pre><code>class Authentication &lt; ActiveRecord::Base attr_accessible :create, :destroy, :index, :provider, :uid, :user_id belongs_to :user end </code></pre> <p><strong>UPDATE 2</strong></p> <p>I'm basically attempting to adapt this tutorial to rails 3.2.</p> <p>The original line from the tutorial is commented out above.</p> <p><strong>UPDATE 3</strong> Here is the entire first line of error:</p> <blockquote> <p>SQLite3::SQLException: no such column: authentication.provider: SELECT "users".* FROM "users" WHERE "authentication"."provider" = 'facebook' AND "authentication"."uid" = '2222222' AND "authentication"."info" = '--- !ruby/hash:OmniAuth::AuthHash::InfoHash</p> </blockquote> <p>Hate to be a burden... but the clock's really ticking, my ass is on the line, and I'm about to go completely insane trying to figure this out. If you can tell me just why provider isn't being accepted I'm sure I can figure out the rest.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload