Skip to content

PG Error #20

Description

@homerjon

I am getting this error

PG::UndefinedColumn: ERROR: column users.subdomain does not exist
LINE 1: ...HERE (("users"."email" = 'myemailaddress@gmail.com' AND "users"."s...
^
: SELECT "users".* FROM "users" WHERE (("users"."email" = 'myemailaddress@gmail.com' AND "users"."subdomain" = 'mysubdomainname')) LIMIT 1

I am using

gem 'devise', '> 3.2.0'
gem 'devise_invitable', '
> 1.3.6'
gem 'devise-basecamper'

I do have two model Users and Vetters. Users uses basecamper and the other does not.

Here is my model

class User < ActiveRecord::Base

# Associations
belongs_to :account, :class_name => "Account", :foreign_key => "account_id"
has_many :documents

# Validations
validates :firstname, :presence => true
validates :lastname, :presence => true
validates :phone, :presence => true
validates :language_pref, :presence => true
validates :date_pref, :presence => true
validates :time_zone, :presence => true
validates_presence_of   :email
validates_uniqueness_of :email   
validates_format_of  :email, :with  => /\A([\w\.%\+\-]+)@([\w\-]+\.)+([\w]{2,})\z/i
with_options :if => :password_required? do |v|
    v.validates_presence_of     :password
    v.validates_confirmation_of :password
    v.validates_length_of       :password, :within => 6..20, :allow_blank => true
end


#  Devise
devise :invitable, :database_authenticatable, :recoverable, :rememberable, :validatable, :trackable, :basecamper, :request_keys => [:subdomain], :reset_password_keys => [:email, :subdomain]

devise_basecamper :subdomain_class => :account, :subdomain_field => :subdomain, :scope_field => :account_id

# Attributes
attr_accessible :account_id, :agreedtoterms, :firstname, :lastname, :phone, :title, :language_pref, :time_zone, :date_pref, :email, :password, :password_confirmation, :remember_me, :owner


# Callbacks

# Scopes
scope :accounted, lambda { |account| where("users.account_id = ?", account.id) }
scope :registered, where('firstname is not null AND lastname is not null AND language_pref is not null')
scope :alphabetical, order("lastname ASC")

end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions