simple_form_recurring_select 0.1.0 → 0.1.1

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
  SHA1:
3
- metadata.gz: e6c150429f5402f819650d6b20b152fad13e3416
4
- data.tar.gz: 6c9e5309ddb5c8bc1d0c2409ff49c1bec35824d5
3
+ metadata.gz: 242dd2751f362dedac66b8a4e0668255bc8c9de8
4
+ data.tar.gz: dceeca2f8d4e1a6c58dee50444edb3fb2699f983
5
5
  SHA512:
6
- metadata.gz: acf5dc942bcd91e58993ec9bb9e09756b5c8e32ccf818f3a7c66cb190b9c47ac216589e8e58a24eebe41bd14bfd3dd90396aebc948b6f49fc174135eb7ec6da2
7
- data.tar.gz: 09dffede6daf501fb5d59ce839508e42ec9d4116ed986570239f5a2ac0ce533d33bada14c130a7bafd240e9cc5922160049da3073a96b75f6bb6997fccc9aea7
6
+ metadata.gz: a40bcb42f7a725d36df4f6396cef8ae6df45441687590e4ec99c9754993827ee0db4e11c76b851247ce97de3e6e33a6bc5730bd48870892ec9683f6a3b28f294
7
+ data.tar.gz: 89ff842a6fedc0087e5124a44e90c18d3bae9ee7b87da7cb848285a3081f7e1dd9f3a489c17426941d31614994b0eb931b96cef2ed8f1dd06003ae72828f3a81
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Simple Form Recurring Select
2
2
 
3
- [![Build Status](https://travis-ci.org/tomasc/recurring_select.svg)](https://travis-ci.org/tomasc/recurring_select) [![Gem Version](https://badge.fury.io/rb/recurring_select.svg)](http://badge.fury.io/rb/recurring_select) [![Coverage Status](https://img.shields.io/coveralls/tomasc/recurring_select.svg)](https://coveralls.io/r/tomasc/recurring_select)
3
+ [![Build Status](https://travis-ci.org/tomasc/simple_form_recurring_select.svg)](https://travis-ci.org/tomasc/simple_form_recurring_select) [![Gem Version](https://badge.fury.io/rb/simple_form_recurring_select.svg)](http://badge.fury.io/rb/simple_form_recurring_select) [![Coverage Status](https://img.shields.io/coveralls/tomasc/simple_form_recurring_select.svg)](https://coveralls.io/r/tomasc/recurring_select)
4
4
 
5
5
  Wrapper around the [recurring_select](https://github.com/GetJobber/recurring_select) gem for Simple Form.
6
6
 
@@ -25,41 +25,41 @@ Or install it yourself as:
25
25
  In model:
26
26
 
27
27
  ```ruby
28
- class MyModel
29
- include SimpleFormRecurringSelect::HasRecurrenceRule
30
- has_recurrence_rule
28
+ class MyModel
29
+ include SimpleFormRecurringSelect::HasRecurrenceRule
30
+ has_recurrence_rule
31
31
 
32
- def recurrence_rule
33
- @recurrence_rule ||= schedule.recurrence_rules.first
34
- end
32
+ def recurrence_rule
33
+ @recurrence_rule ||= schedule.recurrence_rules.first
34
+ end
35
35
 
36
- private
36
+ private
37
37
 
38
- def update_schedule
39
- self.schedule = IceCube::Schedule.new(schedule.start_time) do |s|
40
- s.add_recurrence_rule(@recurrence_rule) if @recurrence_rule.present?
41
- end
38
+ def update_schedule
39
+ self.schedule = IceCube::Schedule.new(schedule.start_time) do |s|
40
+ s.add_recurrence_rule(@recurrence_rule) if @recurrence_rule.present?
42
41
  end
43
42
  end
43
+ end
44
44
  ```
45
45
 
46
- This will setup `#recurrence_rule` accessor that converts JSON coming from a form to (IceCube::Rule)[https://github.com/seejohnrun/ice_cube]. The logic of adding the recurrence rule to a schedule is left up to you.
46
+ This will setup `recurrence_rule` accessor that converts JSON coming from a form to [IceCube::Rule](https://github.com/seejohnrun/ice_cube). The logic of adding the recurrence rule to a schedule is left up to you.
47
47
 
48
48
  In forms:
49
49
 
50
50
  ```ruby
51
- = form.input :recurrence_rule, as: :recurring_select
51
+ = form.input :recurrence_rule, as: :recurring_select
52
52
  ```
53
53
 
54
54
  ## Configuration
55
55
 
56
- Accessor & schedule accessor / method names can be configured as follows:
56
+ The accessor name can be directly specified:
57
57
 
58
58
  ```ruby
59
- class MyModel
60
- include SimpleFormRecurringSelect::HasRecurringSelect
61
- has_recurring_select accessor_name: :my_recurrence_rule
62
- end
59
+ class MyModel
60
+ include SimpleFormRecurringSelect::HasRecurringSelect
61
+ has_recurring_select :my_recurrence_rule
62
+ end
63
63
  ```
64
64
 
65
65
  ## Development
@@ -10,9 +10,7 @@ module SimpleFormRecurringSelect
10
10
  # =====================================================================
11
11
 
12
12
  module ClassMethods
13
- def has_recurrence_rule options={}
14
- accessor_name = options.fetch :accessor_name, :recurrence_rule
15
-
13
+ def has_recurrence_rule accessor_name=:recurrence_rule
16
14
  attr_reader accessor_name
17
15
 
18
16
  define_method "#{accessor_name}=" do |value|
@@ -1,3 +1,3 @@
1
1
  module SimpleFormRecurringSelect
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_form_recurring_select
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomas Celizna