Вопрос по ruby-on-rails, ruby – DangerousAttributeError в OmniAuth Руководство по Railscast: создание определяется ActiveRecord

8

Error: User Rate Limit ExceededError: User Rate Limit ExceededError: User Rate Limit Exceeded

Error: User Rate Limit ExceededError: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

Error:

ActiveRecord::DangerousAttributeError in AuthenticationsController#create

create is defined by ActiveRecord
Rails.root: /beta/devise-omniauth1

Application Trace | Framework Trace | Full Trace
app/controllers/authentications_controller.rb:15:in `create'

Authentications_Controller:

  def create
    auth = request.env["omniauth.auth"] 
    current_user.authentications.create(:provider => auth['provider'], :uid => auth['uid'])
    flash[:notice] = "Authentication successful."
    redirect_to authentications_url
  end

Models:

class Authentication < ActiveRecord::Base
belongs_to :user
end


class User < ActiveRecord::Base
has_many :authentications

  # Include default devise modules. Others available are:
  # :token_authenticatable, :encryptable, :confirmable, :lockable, :timeoutable and     :omniauthable
  devise :database_authenticatable, :registerable,
         :recoverable, :rememberable, :trackable, :validatable

  # Setup accessible (or protected) attributes for your model
  attr_accessible :email, :password, :password_confirmation, :remember_me
end

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded xta
Error: User Rate Limit Exceeded Apane101
Error: User Rate Limit Exceeded Frederick Cheung

Ваш Ответ

4   ответа
4

8

rails g nifty:scaffold authentication user_id:integer \
        provider:string uid:string index create destroy

rails g scaffold authentication user_id:integer \
        provider:string uid:string index create destroy

Error: User Rate Limit Exceeded
4

rails g migration remove_silly_authentication_fields_which_should_not_be_there

class DropSillyControllerAttributes < ActiveRecord::Migration
   def change
      remove_column :authentications, :index
      remove_column :authentications, :create
      remove_column :authentications, :destroy
   end
end

rake db:migration

rake db:rollback

rails d scaffold authentication

rails g scaffold authentication user_id:integer provider:string uid:string

Error: User Rate Limit Exceeded
Error: User Rate Limit Exceeded
1

Error: User Rate Limit Exceededcurrent_user.authentications.create!(:provider => auth['provider'], :uid => auth['uid'])Error: User Rate Limit ExceededActiveRecord::DangerousAttributeError in AuthenticationsController#create create is defined by ActiveRecord xta

Похожие вопросы