Update venue.rb
definition of full_address and geocode has been added
This commit is contained in:
parent
ab0719096a
commit
5ed2ebe910
1 changed files with 6 additions and 3 deletions
|
|
@ -13,8 +13,11 @@ class Venue < ActiveRecord::Base
|
||||||
|
|
||||||
before_save :send_mail_notification
|
before_save :send_mail_notification
|
||||||
|
|
||||||
def address
|
geocoded_by :full_address
|
||||||
"#{street}, #{city}, #{country_name}"
|
after_validation :geocode
|
||||||
|
|
||||||
|
def full_address
|
||||||
|
"#{street}, #{city}, #{country}"
|
||||||
end
|
end
|
||||||
|
|
||||||
def country_name
|
def country_name
|
||||||
|
|
@ -35,7 +38,7 @@ class Venue < ActiveRecord::Base
|
||||||
def notify_on_venue_changed?
|
def notify_on_venue_changed?
|
||||||
return false unless conference.try(:email_settings).try(:send_on_venue_updated)
|
return false unless conference.try(:email_settings).try(:send_on_venue_updated)
|
||||||
# do not notify unless the address changed
|
# do not notify unless the address changed
|
||||||
return false unless name_changed? || street_changed? || city_changed? || country_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
|
# do not notify unless the mail content is set up
|
||||||
(!conference.email_settings.venue_updated_subject.blank? && !conference.email_settings.venue_updated_body.blank?)
|
(!conference.email_settings.venue_updated_subject.blank? && !conference.email_settings.venue_updated_body.blank?)
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue