mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Added Subscription model to send emails
This commit is contained in:
parent
ac25561523
commit
41fc21f7f4
5 changed files with 23 additions and 2 deletions
|
|
@ -49,7 +49,7 @@ class Conference < ActiveRecord::Base
|
|||
has_many :targets, dependent: :destroy
|
||||
has_many :campaigns, dependent: :destroy
|
||||
has_many :commercials, as: :commercialable, dependent: :destroy
|
||||
belongs_to :venue
|
||||
has_many :subscriptions, dependent: :destroy
|
||||
|
||||
accepts_nested_attributes_for :rooms, reject_if: proc { |r| r['name'].blank? }, allow_destroy: true
|
||||
accepts_nested_attributes_for :tracks, reject_if: proc { |r| r['name'].blank? }, allow_destroy: true
|
||||
|
|
|
|||
5
app/models/subscription.rb
Normal file
5
app/models/subscription.rb
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
class Subscription < ActiveRecord::Base
|
||||
attr_accessible :user_id, :conference_id
|
||||
belongs_to :conference
|
||||
belongs_to :user
|
||||
end
|
||||
|
|
@ -20,7 +20,7 @@ class User < ActiveRecord::Base
|
|||
has_many :registrations, dependent: :destroy
|
||||
has_many :votes, dependent: :destroy
|
||||
has_many :voted_events, through: :votes, source: :events
|
||||
|
||||
has_many :subscriptions, dependent: :destroy
|
||||
accepts_nested_attributes_for :roles
|
||||
|
||||
before_create :setup_role
|
||||
|
|
|
|||
9
db/migrate/20140724153520_create_subscriptions.rb
Normal file
9
db/migrate/20140724153520_create_subscriptions.rb
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
class CreateSubscriptions < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :subscriptions do |t|
|
||||
t.belongs_to :user
|
||||
t.belongs_to :conference
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -408,6 +408,13 @@ ActiveRecord::Schema.define(version: 20140801170430) do
|
|||
t.datetime "updated_at"
|
||||
end
|
||||
|
||||
create_table "subscriptions", force: true do |t|
|
||||
t.integer "user_id"
|
||||
t.integer "conference_id"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
end
|
||||
|
||||
create_table "supporter_levels", force: true do |t|
|
||||
t.integer "conference_id"
|
||||
t.string "title", null: false
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue