mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Rooms belong to venue
This commit is contained in:
parent
feabbfbc99
commit
f840f2b3f0
31 changed files with 221 additions and 166 deletions
|
|
@ -7,7 +7,6 @@ class Program < ActiveRecord::Base
|
|||
has_many :event_types, dependent: :destroy
|
||||
has_many :tracks, dependent: :destroy
|
||||
has_many :difficulty_levels, dependent: :destroy
|
||||
has_many :rooms, dependent: :destroy
|
||||
has_many :events, dependent: :destroy do
|
||||
def workshops
|
||||
where(require_registration: true, state: :confirmed)
|
||||
|
|
@ -36,11 +35,10 @@ class Program < ActiveRecord::Base
|
|||
accepts_nested_attributes_for :event_types, allow_destroy: true
|
||||
accepts_nested_attributes_for :tracks, reject_if: proc { |r| r['name'].blank? }, allow_destroy: true
|
||||
accepts_nested_attributes_for :difficulty_levels, allow_destroy: true
|
||||
accepts_nested_attributes_for :rooms, reject_if: proc { |r| r['name'].blank? }, allow_destroy: true
|
||||
|
||||
attr_accessible :schedule_fluid, :rating,
|
||||
:schedule_public, :include_cfp_in_splash, :conference_id,
|
||||
:event_types_attributes, :difficulty_levels_attributes, :rooms_attributes, :tracks_attributes
|
||||
:event_types_attributes, :difficulty_levels_attributes, :tracks_attributes
|
||||
|
||||
# validates :conference_id, presence: true, uniqueness: true
|
||||
validates :rating, numericality: { greater_than_or_equal_to: 0, less_than_or_equal_to: 10 }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue