Using save navigation

This commit is contained in:
echarp 2018-09-23 18:06:52 +02:00
parent 53971c7b0c
commit 9e367a88ef
4 changed files with 5 additions and 5 deletions

View File

@ -18,7 +18,7 @@ class EventCallbacks
return unless event.will_save_change_to_moderated? && event.moderated?
event.decision_time = Time.zone.now
create_repeats event if event.repeat.try(:positive?) && event.rule
create_repeats event if event.repeat&.positive? && event.rule
end
def self.after_update(event)

View File

@ -6,5 +6,5 @@
= link_to event do
%strong.city{ title: event.address }= event.city
= event.title
- if event.repeat.positive?
- if event.repeat&.positive?
%em.fa.fa-repeat{ title: event.schedule }

View File

@ -64,14 +64,14 @@
encode: (request.format == 'text/html' ? :javascript : nil),
replace_at: ' CHEZ ', replace_dot: ' POINT '
- if @event.tags && @event.tags.present?
- if @event.tags&.present?
%p.tags
%em.fa.fa-tags
%span.label= Event.human_attribute_name :tags
- @event.tags.each do |tag|
= link_to tag, tag_path(tag.name), rel: :tag
- if @event.repeat > 0 && @event.rule
- if @event.repeat&.positive? && @event.rule
%h3
%em.fa.fa-repeat
= @event.schedule

View File

@ -11,7 +11,7 @@
- if @event.contact.present?
!= display_attr @event, :contact
!= display_attr @event, :tag_list, @event.tag_list
- if @event.repeat > 0
- if @event.repeat&.positive?
= display_attr @event, :repeat
= display_attr @event, :rule, t(@event.rule, scope: 'activerecord.attributes.event.rule_values')
\