mongoid_occurrences 1.0.4 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5ad2621a85048b9b98be55f4bc411d9b0ad3a7e040f5d7a9cf16e3d71c1f0cf0
4
- data.tar.gz: 4ad4fc88c2de4332c9ff5bfca1113ce0f5448f0466a50cbb814d61f5d39e770e
3
+ metadata.gz: e2a314d87b9ef1b779dd6b1d267225fa9e8d0aed71ec3cd50aa0985eb8ba18d0
4
+ data.tar.gz: 68b93f8530a9d9ee95a27819e8d1351a819080e0fd37d1aabfbf29242b9df068
5
5
  SHA512:
6
- metadata.gz: a19a6fbae99ff733e2f8814f2e94ddd774ff4faed015c22296f11a2e832812ff823ac9e9360112f39586b7d0c3113cb52a880dbb765faa2b77802b4a1377d630
7
- data.tar.gz: 3b243cd776fda744b3e36f1299ee23c728a9e69b844f090ed387909440305b9ba121a4cd2b9eda66709710e3f3431a06af5fc075fc20f32e0f0e3f04820ce125
6
+ metadata.gz: 22a2554e94b5512fc9ab6393050b1c3b959a3410ceda5b31508d5b93a4164b8cb2cc1a94293f411859a2eeb58f6daf178dcb3c1a8307a2dc4b47c60c4706ec7d
7
+ data.tar.gz: 1a3b5c2b93f38e83d35558fa7d94c878b50abda16d7509657fea8b017091e7b0558720e34696c1ee1920395f97fb14b012b2168324cb31c20c76996e66f18b6f
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 1.1.0
4
+
5
+ * CHANGE: `#embedded_in_event` requires `name` (`#embedded_in_event(name, options)`)
6
+
3
7
  ## 1.0.4
4
8
 
5
9
  * FIX: We rely on occurrences having their `updated_at` field touched when saving an event, which currently doesn't happen. Adding `cascade_callbacks` fixes that.
data/README.md CHANGED
@@ -58,7 +58,7 @@ class Occurrence
58
58
  include Mongoid::Document
59
59
  include MongoidOccurrences::Occurrence
60
60
 
61
- embedded_in_event class_name: 'Event'
61
+ embedded_in_event :event, class_name: 'Event'
62
62
  end
63
63
  ```
64
64
 
@@ -8,8 +8,8 @@ module MongoidOccurrences
8
8
  end
9
9
 
10
10
  module ClassMethods
11
- def embedded_in_event(options = {})
12
- super(options)
11
+ def embedded_in_event(name, options = {})
12
+ super(name, options)
13
13
 
14
14
  include Mongoid::EnumAttribute
15
15
  enum :operator, %i[append replace remove], default: :append
@@ -4,8 +4,8 @@ module MongoidOccurrences
4
4
  SCHEDULE_DURATION = 1.year
5
5
 
6
6
  module ClassMethods
7
- def embedded_in_event(options = {})
8
- super(options)
7
+ def embedded_in_event(name, options = {})
8
+ super(name, options)
9
9
 
10
10
  field :schedule, type: MongoidIceCubeExtension::Schedule
11
11
  field :schedule_dtstart, type: Time
@@ -19,12 +19,12 @@ module MongoidOccurrences
19
19
  end
20
20
 
21
21
  module ClassMethods
22
- def embedded_in_event(options = {})
22
+ def embedded_in_event(name, options = {})
23
23
  field :dtstart, type: DateTime
24
24
  field :dtend, type: DateTime
25
25
  field :all_day, type: Boolean
26
26
 
27
- embedded_in options.fetch(:parent_name, :event), class_name: options.fetch(:class_name, nil), inverse_of: :occurrences
27
+ embedded_in name, class_name: options.fetch(:class_name, nil), inverse_of: :occurrences
28
28
 
29
29
  after_validation :adjust_dates_for_all_day!, if: :changed?
30
30
 
@@ -1,3 +1,3 @@
1
1
  module MongoidOccurrences
2
- VERSION = '1.0.4'.freeze
2
+ VERSION = '1.1.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongoid_occurrences
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomas Celizna