discourse-calendar/app/models
Joffrey JAFFEUX 7d6e1f1a76
FIX: prevents exception when accessing `post.local_dates` (#125)
`post.local_dates` is coming from the core discourse plugin, which has the following implementation:

```
  add_to_class(:post, :local_dates) do
    custom_fields[DiscourseLocalDates::POST_CUSTOM_FIELD] || []
  end
```

Meaning we should always at least get an array, however, if the core local dates plugin is disabled, add_to_class will be called and the method added , however it will return nothing if the plugin is not enabled.

Source location correctly leads to the `add_to_class` block:

```
[9] pry(main)> Post.last.method(:local_dates).source_location
=> ["/discourse/lib/plugin/instance.rb", 260]
```
2021-04-27 21:08:12 +02:00
..
discourse_post_event FIX: event serializer start and end date (#117) 2021-04-08 10:10:55 +10:00
calendar_event.rb FIX: prevents exception when accessing `post.local_dates` (#125) 2021-04-27 21:08:12 +02:00