active_bookings 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
  SHA256:
3
- metadata.gz: 4a094c563d3e4de794dafa566582dc5d0cc3511bc0c7397b4a50f49346dd4ba0
4
- data.tar.gz: 23746232c3e41bcddd9b11db629ce8a077b024e5df83b091e342fa7f765d2039
3
+ metadata.gz: 8b1ea9b220f2c1e044b970907830aef2e0d1ba3ec9426adb15e1b747d683a616
4
+ data.tar.gz: bec3940117cd00e3aad6b7fadcde26d45a565ed8312a99b08cd742a07d4bf253
5
5
  SHA512:
6
- metadata.gz: 64c45f54e6f47f27a5b019ee139ae5c99b21cb1ef511ef0d38a61979b796caedaf8ca2eaeea1c1f705791db238045c690a068f1cb9057473aa5a34af7fc25dbe
7
- data.tar.gz: 1386a8ccd484468fe6da08051735c10d87645e59107fb4a8a8b92c7509b573f12a876464f1915a68729ee46839aa7cbceef932ec67ada9f6832dcf0bc8a05243
6
+ metadata.gz: f1ad11a96511a379e1bd3c3cc73c379a3a6a5097a92d61bd308133530d4588df6e1c66399d219f289b319e7ccf8ab30e8068382e125dc7d06684324162180eca
7
+ data.tar.gz: 7014f05094c4feb532707aabad872ea2b4a6bd90b5320044a8a1c3fd0a794d5be39f95a4df02ea8cef496a2bbb8c0cc351287874a49164fb1d0ed8a21428e889
data/README.md CHANGED
@@ -32,12 +32,8 @@ After checking out the repo, run `bin/setup` to install dependencies. Then, run
32
32
 
33
33
  ## Contributing
34
34
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/hardpixel/active-bookings. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
35
+ Bug reports and pull requests are welcome on GitHub at https://github.com/hardpixel/active-bookings.
36
36
 
37
37
  ## License
38
38
 
39
39
  The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
40
-
41
- ## Code of Conduct
42
-
43
- Everyone interacting in the ActiveBookings project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/hardpixel/active-bookings/blob/master/CODE_OF_CONDUCT.md).
@@ -1,9 +1,10 @@
1
+ require 'ice_cube'
1
2
  require 'active_record'
2
3
  require 'active_record/version'
3
4
  require 'active_support/core_ext/module'
4
- require 'ice_cube'
5
5
 
6
- IceCube.compatibility = 12 # Drop compatibility for :start_date, avoiding a bunch of warnings caused by serialization
6
+ # Drop compatibility for :start_date, avoiding a bunch of warnings caused by serialization
7
+ IceCube.compatibility = 12
7
8
 
8
9
  module ActiveBookings
9
10
  extend ActiveSupport::Autoload
@@ -22,13 +23,13 @@ module ActiveBookings
22
23
 
23
24
  class InitializationError < StandardError
24
25
  def initialize model, message
25
- super "Error initializing active_bookings on #{model.to_s} - " + message
26
+ super "Error initializing active_bookings on #{model.to_s} - #{message}"
26
27
  end
27
28
  end
28
29
 
29
30
  class OptionsInvalid < StandardError
30
31
  def initialize model, message
31
- super "Error validating options for #{model.to_s} - " + message
32
+ super "Error validating options for #{model.to_s} - #{message}"
32
33
  end
33
34
  end
34
35
 
@@ -14,8 +14,10 @@ module ActiveBookings
14
14
  # is_booker
15
15
  # end
16
16
  def is_booker(opts={})
17
+ assoc_class_name = opts.delete(:class_name) || '::ActiveBookings::Booking'
18
+
17
19
  class_eval do
18
- has_many :bookings, as: :booker, dependent: :destroy, class_name: '::ActiveBookings::Booking'
20
+ has_many :bookings, as: :booker, dependent: :destroy, class_name: assoc_class_name
19
21
  end
20
22
 
21
23
  include ActiveBookings::Booker::InstanceMethods
@@ -12,7 +12,7 @@ module ActiveBookings
12
12
  # @param interval_start The beginning time of the interval to match against
13
13
  # @param interval_end The ending time of the interval to match against
14
14
  #
15
- def time_in_interval? (time, interval_start, interval_end)
15
+ def time_in_interval?(time, interval_start, interval_end)
16
16
  time >= interval_start && time < interval_end
17
17
  end
18
18
 
@@ -1,3 +1,3 @@
1
1
  module ActiveBookings
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: active_bookings
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
  - Jonian Guveli
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2018-05-25 00:00:00.000000000 Z
12
+ date: 2020-03-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord
@@ -59,14 +59,14 @@ dependencies:
59
59
  requirements:
60
60
  - - "~>"
61
61
  - !ruby/object:Gem::Version
62
- version: '10.0'
62
+ version: '13.0'
63
63
  type: :development
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
67
  - - "~>"
68
68
  - !ruby/object:Gem::Version
69
- version: '10.0'
69
+ version: '13.0'
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: minitest
72
72
  requirement: !ruby/object:Gem::Requirement
@@ -88,7 +88,6 @@ executables: []
88
88
  extensions: []
89
89
  extra_rdoc_files: []
90
90
  files:
91
- - CODE_OF_CONDUCT.md
92
91
  - Gemfile
93
92
  - LICENSE.txt
94
93
  - README.md
@@ -125,8 +124,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
125
124
  - !ruby/object:Gem::Version
126
125
  version: '0'
127
126
  requirements: []
128
- rubyforge_project:
129
- rubygems_version: 2.7.7
127
+ rubygems_version: 3.0.6
130
128
  signing_key:
131
129
  specification_version: 4
132
130
  summary: Rails reservation engine that allows bookable resources
@@ -1,74 +0,0 @@
1
- # Contributor Covenant Code of Conduct
2
-
3
- ## Our Pledge
4
-
5
- In the interest of fostering an open and welcoming environment, we as
6
- contributors and maintainers pledge to making participation in our project and
7
- our community a harassment-free experience for everyone, regardless of age, body
8
- size, disability, ethnicity, gender identity and expression, level of experience,
9
- nationality, personal appearance, race, religion, or sexual identity and
10
- orientation.
11
-
12
- ## Our Standards
13
-
14
- Examples of behavior that contributes to creating a positive environment
15
- include:
16
-
17
- * Using welcoming and inclusive language
18
- * Being respectful of differing viewpoints and experiences
19
- * Gracefully accepting constructive criticism
20
- * Focusing on what is best for the community
21
- * Showing empathy towards other community members
22
-
23
- Examples of unacceptable behavior by participants include:
24
-
25
- * The use of sexualized language or imagery and unwelcome sexual attention or
26
- advances
27
- * Trolling, insulting/derogatory comments, and personal or political attacks
28
- * Public or private harassment
29
- * Publishing others' private information, such as a physical or electronic
30
- address, without explicit permission
31
- * Other conduct which could reasonably be considered inappropriate in a
32
- professional setting
33
-
34
- ## Our Responsibilities
35
-
36
- Project maintainers are responsible for clarifying the standards of acceptable
37
- behavior and are expected to take appropriate and fair corrective action in
38
- response to any instances of unacceptable behavior.
39
-
40
- Project maintainers have the right and responsibility to remove, edit, or
41
- reject comments, commits, code, wiki edits, issues, and other contributions
42
- that are not aligned to this Code of Conduct, or to ban temporarily or
43
- permanently any contributor for other behaviors that they deem inappropriate,
44
- threatening, offensive, or harmful.
45
-
46
- ## Scope
47
-
48
- This Code of Conduct applies both within project spaces and in public spaces
49
- when an individual is representing the project or its community. Examples of
50
- representing a project or community include using an official project e-mail
51
- address, posting via an official social media account, or acting as an appointed
52
- representative at an online or offline event. Representation of a project may be
53
- further defined and clarified by project maintainers.
54
-
55
- ## Enforcement
56
-
57
- Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
- reported by contacting the project team at info@hardpixel.eu. All
59
- complaints will be reviewed and investigated and will result in a response that
60
- is deemed necessary and appropriate to the circumstances. The project team is
61
- obligated to maintain confidentiality with regard to the reporter of an incident.
62
- Further details of specific enforcement policies may be posted separately.
63
-
64
- Project maintainers who do not follow or enforce the Code of Conduct in good
65
- faith may face temporary or permanent repercussions as determined by other
66
- members of the project's leadership.
67
-
68
- ## Attribution
69
-
70
- This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
- available at [http://contributor-covenant.org/version/1/4][version]
72
-
73
- [homepage]: http://contributor-covenant.org
74
- [version]: http://contributor-covenant.org/version/1/4/