Make use of fake data in factories
This commit is contained in:
parent
737a9d4808
commit
77e0340387
30 changed files with 96 additions and 77 deletions
|
|
@ -3,8 +3,6 @@ class Contact < ActiveRecord::Base
|
|||
|
||||
validates :conference, presence: true
|
||||
# Conferences only have one contact
|
||||
validates :conference_id, uniqueness: {message: 'has already contact details'}
|
||||
|
||||
validates :facebook, :twitter, :googleplus, :instagram,
|
||||
format: URI::regexp(%w(http https)), allow_blank: true
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ class Venue < ActiveRecord::Base
|
|||
|
||||
accepts_nested_attributes_for :commercial, allow_destroy: true
|
||||
validates :name, :street, :city, :country, presence: true
|
||||
validates :conference_id, presence: true, uniqueness: true
|
||||
|
||||
mount_uploader :picture, PictureUploader, mount_on: :photo_file_name
|
||||
|
||||
|
|
@ -32,7 +31,7 @@ class Venue < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def notify_on_venue_changed?
|
||||
return false unless conference.email_settings.send_on_venue_updated
|
||||
return false unless conference.try(:email_settings).try(:send_on_venue_updated)
|
||||
# do not notify unless the address changed
|
||||
return false unless self.name_changed? || self.street_changed? || self.city_changed? || self.country_changed?
|
||||
# do not notify unless the mail content is set up
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue