mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
WIP: Making enterprise emails confirmable
This commit is contained in:
@@ -2,6 +2,8 @@ class Enterprise < ActiveRecord::Base
|
||||
TYPES = %w(full single profile)
|
||||
ENTERPRISE_SEARCH_RADIUS = 100
|
||||
|
||||
devise :confirmable, reconfirmable: true
|
||||
|
||||
self.inheritance_column = nil
|
||||
|
||||
acts_as_gmappable :process_geocoding => false
|
||||
|
||||
16
db/migrate/20141010043405_add_confirmable_to_enterprise.rb
Normal file
16
db/migrate/20141010043405_add_confirmable_to_enterprise.rb
Normal file
@@ -0,0 +1,16 @@
|
||||
class AddConfirmableToEnterprise < ActiveRecord::Migration
|
||||
def up
|
||||
add_column :enterprises, :confirmation_token, :string
|
||||
add_column :enterprises, :confirmed_at, :datetime
|
||||
add_column :enterprises, :confirmation_sent_at, :datetime
|
||||
add_column :enterprises, :unconfirmed_email, :string
|
||||
add_index :enterprises, :confirmation_token, :unique => true
|
||||
|
||||
# Existing enterprises are assumed to be confirmed
|
||||
Enterprise.update_all(:confirmed_at => Time.now)
|
||||
end
|
||||
|
||||
def down
|
||||
remove_columns :enterprises, :confirmation_token, :confirmed_at, :confirmation_sent_at, :unconfirmed_email
|
||||
end
|
||||
end
|
||||
@@ -11,7 +11,7 @@
|
||||
#
|
||||
# It's strongly recommended to check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(:version => 20140904003026) do
|
||||
ActiveRecord::Schema.define(:version => 20141010043405) do
|
||||
|
||||
create_table "adjustment_metadata", :force => true do |t|
|
||||
t.integer "adjustment_id"
|
||||
@@ -266,9 +266,14 @@ ActiveRecord::Schema.define(:version => 20140904003026) do
|
||||
t.string "linkedin"
|
||||
t.string "type", :default => "profile", :null => false
|
||||
t.integer "owner_id", :null => false
|
||||
t.string "confirmation_token"
|
||||
t.datetime "confirmed_at"
|
||||
t.datetime "confirmation_sent_at"
|
||||
t.string "unconfirmed_email"
|
||||
end
|
||||
|
||||
add_index "enterprises", ["address_id"], :name => "index_enterprises_on_address_id"
|
||||
add_index "enterprises", ["confirmation_token"], :name => "index_enterprises_on_confirmation_token", :unique => true
|
||||
add_index "enterprises", ["owner_id"], :name => "index_enterprises_on_owner_id"
|
||||
|
||||
create_table "exchange_fees", :force => true do |t|
|
||||
|
||||
Reference in New Issue
Block a user