acts_as_bookable 0.1.0 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.coveralls.yml +1 -0
- data/.gitignore +2 -0
- data/CHANGELOG.md +29 -0
- data/Gemfile.lock +39 -9
- data/README.md +1 -0
- data/acts_as_bookable.gemspec +10 -9
- data/db/migrate/20160217085200_create_acts_as_bookable_bookings.rb +3 -3
- data/lib/acts_as_bookable/bookable/core.rb +4 -1
- data/lib/acts_as_bookable/booker.rb +0 -3
- data/lib/acts_as_bookable/booking.rb +3 -3
- data/lib/acts_as_bookable/db_utils.rb +13 -0
- data/lib/acts_as_bookable/version.rb +1 -1
- data/spec/acts_as_bookable/bookable/core_spec.rb +2 -2
- data/spec/acts_as_bookable/booking_spec.rb +10 -10
- data/spec/acts_as_bookable/time_utils_spec.rb +2 -2
- data/spec/internal/db/schema.rb +2 -2
- data/spec/spec_helper.rb +3 -0
- metadata +55 -37
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5e70f79709f18b1c536bc7d6ceaffa72711c150c
|
4
|
+
data.tar.gz: 4a5be0c822d2528e9a688fc2eacc8e8ea9a59d11
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 09701c959b62e9f56e13c88835d5fc5482996fa26b3691b52ea2dae335987406a05aedb3d644702361cf23e8d01ea53a557938ac10db3521db96fa918e9d4945
|
7
|
+
data.tar.gz: 5e77f2ee59eb30fa9562cd719adeb3c6ec78c2532300f7c6b19c4cfce784df0c85e31014357ab6936b85ba0dcd5e99cd6db1d14e739372fe6ac252b680962115
|
data/.coveralls.yml
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
service_name: travis-ci
|
data/.gitignore
CHANGED
data/CHANGELOG.md
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# Change Log
|
2
|
+
|
3
|
+
## [v0.1.2](https://github.com/tandusrl/acts_as_bookable/tree/v0.1.2) (2016-02-22)
|
4
|
+
[Full Changelog](https://github.com/tandusrl/acts_as_bookable/compare/v0.1.1...v0.1.2)
|
5
|
+
|
6
|
+
**Fixed bugs:**
|
7
|
+
|
8
|
+
- Fix dependencies [\#11](https://github.com/tandusrl/acts_as_bookable/issues/11)
|
9
|
+
- Fix build failing for some DBs [\#10](https://github.com/tandusrl/acts_as_bookable/issues/10)
|
10
|
+
|
11
|
+
## [v0.1.1](https://github.com/tandusrl/acts_as_bookable/tree/v0.1.1) (2016-02-22)
|
12
|
+
[Full Changelog](https://github.com/tandusrl/acts_as_bookable/compare/v0.1.0...v0.1.1)
|
13
|
+
|
14
|
+
## [v0.1.0](https://github.com/tandusrl/acts_as_bookable/tree/v0.1.0) (2016-02-17)
|
15
|
+
**Implemented enhancements:**
|
16
|
+
|
17
|
+
- Remove location\_type: :range [\#1](https://github.com/tandusrl/acts_as_bookable/issues/1)
|
18
|
+
|
19
|
+
**Closed issues:**
|
20
|
+
|
21
|
+
- Add an option to allow bookings that start in an occurrence and end in another [\#8](https://github.com/tandusrl/acts_as_bookable/issues/8)
|
22
|
+
- Move ice\_cube gem from Gemfile to gemspec [\#7](https://github.com/tandusrl/acts_as_bookable/issues/7)
|
23
|
+
- Implement booking with date costraints [\#5](https://github.com/tandusrl/acts_as_bookable/issues/5)
|
24
|
+
- Merge date and time [\#4](https://github.com/tandusrl/acts_as_bookable/issues/4)
|
25
|
+
- Create a README [\#3](https://github.com/tandusrl/acts_as_bookable/issues/3)
|
26
|
+
|
27
|
+
|
28
|
+
|
29
|
+
\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
acts_as_bookable (0.1.
|
4
|
+
acts_as_bookable (0.1.2)
|
5
5
|
activerecord (>= 3.2, < 5)
|
6
6
|
ice_cube_chosko (~> 0.1.0)
|
7
7
|
|
@@ -44,8 +44,18 @@ GEM
|
|
44
44
|
builder (3.2.2)
|
45
45
|
byebug (8.2.2)
|
46
46
|
coderay (1.1.0)
|
47
|
+
coveralls (0.8.10)
|
48
|
+
json (~> 1.8)
|
49
|
+
rest-client (>= 1.6.8, < 2)
|
50
|
+
simplecov (~> 0.11.0)
|
51
|
+
term-ansicolor (~> 1.3)
|
52
|
+
thor (~> 0.19.1)
|
53
|
+
tins (~> 1.6.0)
|
47
54
|
database_cleaner (1.5.1)
|
48
55
|
diff-lcs (1.2.5)
|
56
|
+
docile (1.1.5)
|
57
|
+
domain_name (0.5.20160128)
|
58
|
+
unf (>= 0.0.5, < 1.0.0)
|
49
59
|
erubis (2.7.0)
|
50
60
|
factory_girl (4.5.0)
|
51
61
|
activesupport (>= 3.0.0)
|
@@ -68,6 +78,8 @@ GEM
|
|
68
78
|
guard (~> 2.1)
|
69
79
|
guard-compat (~> 1.1)
|
70
80
|
rspec (>= 2.99.0, < 4.0)
|
81
|
+
http-cookie (1.0.2)
|
82
|
+
domain_name (~> 0.5)
|
71
83
|
i18n (0.7.0)
|
72
84
|
ice_cube_chosko (0.1.0)
|
73
85
|
json (1.8.3)
|
@@ -78,10 +90,12 @@ GEM
|
|
78
90
|
nokogiri (>= 1.5.9)
|
79
91
|
lumberjack (1.0.10)
|
80
92
|
method_source (0.8.2)
|
93
|
+
mime-types (2.99)
|
81
94
|
mini_portile2 (2.0.0)
|
82
95
|
minitest (5.8.4)
|
83
96
|
mysql2 (0.3.20)
|
84
97
|
nenv (0.3.0)
|
98
|
+
netrc (0.11.0)
|
85
99
|
nokogiri (1.6.7.2)
|
86
100
|
mini_portile2 (~> 2.0.0.rc2)
|
87
101
|
notiffany (0.0.8)
|
@@ -114,6 +128,10 @@ GEM
|
|
114
128
|
rb-fsevent (0.9.7)
|
115
129
|
rb-inotify (0.9.7)
|
116
130
|
ffi (>= 0.5.0)
|
131
|
+
rest-client (1.8.0)
|
132
|
+
http-cookie (>= 1.0.2, < 2.0)
|
133
|
+
mime-types (>= 1.16, < 3.0)
|
134
|
+
netrc (~> 0.7)
|
117
135
|
rspec (3.4.0)
|
118
136
|
rspec-core (~> 3.4.0)
|
119
137
|
rspec-expectations (~> 3.4.0)
|
@@ -136,12 +154,23 @@ GEM
|
|
136
154
|
rspec-support (~> 3.4.0)
|
137
155
|
rspec-support (3.4.1)
|
138
156
|
shellany (0.0.1)
|
157
|
+
simplecov (0.11.2)
|
158
|
+
docile (~> 1.1.0)
|
159
|
+
json (~> 1.8)
|
160
|
+
simplecov-html (~> 0.10.0)
|
161
|
+
simplecov-html (0.10.0)
|
139
162
|
slop (3.6.0)
|
140
163
|
sqlite3 (1.3.11)
|
164
|
+
term-ansicolor (1.3.2)
|
165
|
+
tins (~> 1.0)
|
141
166
|
thor (0.19.1)
|
142
167
|
thread_safe (0.3.5)
|
168
|
+
tins (1.6.0)
|
143
169
|
tzinfo (1.2.2)
|
144
170
|
thread_safe (~> 0.1)
|
171
|
+
unf (0.1.4)
|
172
|
+
unf_ext
|
173
|
+
unf_ext (0.0.7.2)
|
145
174
|
|
146
175
|
PLATFORMS
|
147
176
|
ruby
|
@@ -149,20 +178,21 @@ PLATFORMS
|
|
149
178
|
DEPENDENCIES
|
150
179
|
acts_as_bookable!
|
151
180
|
appraisal
|
152
|
-
awesome_print
|
153
|
-
barrier
|
181
|
+
awesome_print (~> 1.6)
|
182
|
+
barrier (~> 1.0)
|
154
183
|
byebug
|
155
|
-
|
156
|
-
|
184
|
+
coveralls (~> 0.8)
|
185
|
+
database_cleaner (~> 1.5)
|
186
|
+
factory_girl_rails (~> 4.6)
|
157
187
|
guard
|
158
188
|
guard-rspec
|
159
189
|
mysql2 (~> 0.3.7)
|
160
|
-
pg
|
190
|
+
pg (~> 0.18)
|
161
191
|
pry-nav
|
162
192
|
rake
|
163
|
-
rspec
|
164
|
-
rspec-rails
|
165
|
-
sqlite3
|
193
|
+
rspec (~> 3)
|
194
|
+
rspec-rails (~> 3)
|
195
|
+
sqlite3 (~> 1.3)
|
166
196
|
|
167
197
|
BUNDLED WITH
|
168
198
|
1.11.2
|
data/README.md
CHANGED
@@ -3,6 +3,7 @@
|
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/acts_as_bookable.svg)](http://badge.fury.io/rb/acts_as_bookable)
|
4
4
|
[![Build Status](https://secure.travis-ci.org/tandusrl/acts_as_bookable.png)](http://travis-ci.org/tandusrl/acts_as_bookable)
|
5
5
|
[![Code Climate](https://codeclimate.com/github/tandusrl/acts_as_bookable.png)](https://codeclimate.com/github/tandusrl/acts_as_bookable)
|
6
|
+
[![Coverage Status](https://coveralls.io/repos/github/tandusrl/acts_as_bookable/badge.svg?branch=master)](https://coveralls.io/github/tandusrl/acts_as_bookable?branch=master)
|
6
7
|
[![Inline docs](http://inch-ci.org/github/tandusrl/acts_as_bookable.png)](http://inch-ci.org/github/tandusrl/acts_as_bookable)
|
7
8
|
|
8
9
|
ActsAsBookable allows resources to be booked by users. It:
|
data/acts_as_bookable.gemspec
CHANGED
@@ -12,7 +12,7 @@ Gem::Specification.new do |gem|
|
|
12
12
|
gem.email = ["ruben.caliandro@gmail.com"]
|
13
13
|
gem.homepage = "https://github.com/tandusrl/acts_as_bookable"
|
14
14
|
gem.summary = "The reservation engine for Rails applications that allows resources to be booked"
|
15
|
-
gem.description = "
|
15
|
+
gem.description = "ActsAsBookable is a reservation engine for Rails applications that allows resources to be booked. You can define availability rules for bookable models and set costraints to implement different types of booking (hotels, theaters, meeting rooms...)"
|
16
16
|
gem.licenses = ["MIT"]
|
17
17
|
gem.platform = Gem::Platform::RUBY
|
18
18
|
|
@@ -29,13 +29,14 @@ Gem::Specification.new do |gem|
|
|
29
29
|
gem.add_dependency 'ice_cube_chosko', '~> 0.1.0'
|
30
30
|
gem.add_runtime_dependency 'activerecord', ['>= 3.2', '< 5']
|
31
31
|
|
32
|
-
gem.add_development_dependency 'sqlite3'
|
32
|
+
gem.add_development_dependency 'sqlite3', '~> 1.3'
|
33
33
|
gem.add_development_dependency 'mysql2', '~> 0.3.7'
|
34
|
-
gem.add_development_dependency 'pg'
|
35
|
-
gem.add_development_dependency 'rspec-rails'
|
36
|
-
gem.add_development_dependency 'rspec'
|
37
|
-
gem.add_development_dependency '
|
38
|
-
gem.add_development_dependency '
|
39
|
-
gem.add_development_dependency '
|
40
|
-
gem.add_development_dependency '
|
34
|
+
gem.add_development_dependency 'pg', '~> 0.18'
|
35
|
+
gem.add_development_dependency 'rspec-rails', '~> 3'
|
36
|
+
gem.add_development_dependency 'rspec', '~> 3'
|
37
|
+
gem.add_development_dependency 'coveralls', '~> 0.8'
|
38
|
+
gem.add_development_dependency 'factory_girl_rails', '~> 4.6'
|
39
|
+
gem.add_development_dependency 'barrier', '~> 1.0'
|
40
|
+
gem.add_development_dependency 'database_cleaner', '~>1.5'
|
41
|
+
gem.add_development_dependency 'awesome_print', '~>1.6'
|
41
42
|
end
|
@@ -1,8 +1,8 @@
|
|
1
1
|
class CreateActsAsBookableBookings < ActiveRecord::Migration
|
2
2
|
def change
|
3
|
-
create_table :acts_as_bookable_bookings, force:
|
4
|
-
t.references :bookable, polymorphic: true
|
5
|
-
t.references :booker, polymorphic: true
|
3
|
+
create_table :acts_as_bookable_bookings, force: true do |t|
|
4
|
+
t.references :bookable, polymorphic: true, index: {name: "index_acts_as_bookable_bookings_bookable"}
|
5
|
+
t.references :booker, polymorphic: true, index: {name: "index_acts_as_bookable_bookings_booker"}
|
6
6
|
t.column :amount, :integer
|
7
7
|
t.column :schedule, :text
|
8
8
|
t.column :time_start, :datetime
|
@@ -162,6 +162,9 @@ module ActsAsBookable::Bookable
|
|
162
162
|
# Example:
|
163
163
|
# @room.check_availability!(from: Date.today, to: Date.tomorrow, amount: 2)
|
164
164
|
def check_availability!(opts)
|
165
|
+
# validates options
|
166
|
+
self.validate_booking_options!(opts)
|
167
|
+
|
165
168
|
# Capacity check (done first because it doesn't require additional queries)
|
166
169
|
if self.booking_opts[:capacity_type] != :none
|
167
170
|
# Amount > capacity
|
@@ -274,7 +277,7 @@ module ActsAsBookable::Bookable
|
|
274
277
|
# @param opts The booking options
|
275
278
|
#
|
276
279
|
def validate_booking_options!(opts)
|
277
|
-
self.validate_booking_options!(opts)
|
280
|
+
self.class.validate_booking_options!(opts)
|
278
281
|
end
|
279
282
|
|
280
283
|
def booker?
|
@@ -40,9 +40,6 @@ module ActsAsBookable
|
|
40
40
|
# Example:
|
41
41
|
# @user.book!(@room)
|
42
42
|
def book!(bookable, opts={})
|
43
|
-
# validates options
|
44
|
-
bookable.class.validate_booking_options!(opts) if bookable.class.bookable?
|
45
|
-
|
46
43
|
# check availability
|
47
44
|
bookable.check_availability!(opts) if bookable.class.bookable?
|
48
45
|
|
@@ -21,13 +21,13 @@ module ActsAsBookable
|
|
21
21
|
|
22
22
|
# Time options
|
23
23
|
if(opts[:time].present?)
|
24
|
-
query =
|
24
|
+
query = DBUtils.time_comparison(query,'time','=',opts[:time])
|
25
25
|
end
|
26
26
|
if(opts[:time_start].present?)
|
27
|
-
query =
|
27
|
+
query = DBUtils.time_comparison(query,'time_end', '>=', opts[:time_start])
|
28
28
|
end
|
29
29
|
if(opts[:time_end].present?)
|
30
|
-
query =
|
30
|
+
query = DBUtils.time_comparison(query,'time_start', '<', opts[:time_end])
|
31
31
|
end
|
32
32
|
query
|
33
33
|
}
|
@@ -30,6 +30,19 @@ module ActsAsBookable
|
|
30
30
|
using_postgresql? ? 'ILIKE' : 'LIKE'
|
31
31
|
end
|
32
32
|
|
33
|
+
##
|
34
|
+
# Compare times according to the DB
|
35
|
+
#
|
36
|
+
def time_comparison (query, field, operator, time)
|
37
|
+
if using_postgresql?
|
38
|
+
query.where("#{field}::timestamp #{operator} ?::timestamp", time.to_time.utc.to_s)
|
39
|
+
elsif using_sqlite?
|
40
|
+
query.where("Datetime(#{field}) #{operator} Datetime('#{time.to_time.utc.iso8601}')")
|
41
|
+
else
|
42
|
+
query.where("#{field} #{operator} ?", time.to_time)
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
33
46
|
# escape _ and % characters in strings, since these are wildcards in SQL.
|
34
47
|
def escape_like(str)
|
35
48
|
str.gsub(/[!%_]/) { |x| '!' + x }
|
@@ -68,7 +68,7 @@ describe 'Bookable model' do
|
|
68
68
|
begin
|
69
69
|
@bookable.check_availability!({time_start: time, time_end: endtime})
|
70
70
|
rescue ActsAsBookable::AvailabilityError => e
|
71
|
-
expect(e.message).to include "the Bookable is not available from #{time} to #{endtime}"
|
71
|
+
expect(e.message).to include "the Bookable is not available from #{time.to_time} to #{endtime.to_time}"
|
72
72
|
end
|
73
73
|
end
|
74
74
|
|
@@ -128,7 +128,7 @@ describe 'Bookable model' do
|
|
128
128
|
begin
|
129
129
|
@bookable.check_availability!({time_start: time, time_end: endtime})
|
130
130
|
rescue ActsAsBookable::AvailabilityError => e
|
131
|
-
expect(e.message).to include "the Bookable is not available from #{time} to #{endtime}"
|
131
|
+
expect(e.message).to include "the Bookable is not available from #{time.to_time} to #{endtime.to_time}"
|
132
132
|
end
|
133
133
|
end
|
134
134
|
|
@@ -70,9 +70,9 @@ describe 'Booking model' do
|
|
70
70
|
booking3 = ActsAsBookable::Booking.create!(time_start: Time.now - 10.days, time_end: Time.now - 9.days, time: nil, bookable: @bookable, booker: @booker)
|
71
71
|
opts = {}
|
72
72
|
expect(ActsAsBookable::Booking.overlapped(@bookable,opts).count).to eq 3
|
73
|
-
expect(ActsAsBookable::Booking.overlapped(@bookable,opts)[0].id).to eq booking1.id
|
74
|
-
expect(ActsAsBookable::Booking.overlapped(@bookable,opts)[1].id).to eq booking2.id
|
75
|
-
expect(ActsAsBookable::Booking.overlapped(@bookable,opts)[2].id).to eq booking3.id
|
73
|
+
expect(ActsAsBookable::Booking.overlapped(@bookable,opts).order(:id)[0].id).to eq booking1.id
|
74
|
+
expect(ActsAsBookable::Booking.overlapped(@bookable,opts).order(:id)[1].id).to eq booking2.id
|
75
|
+
expect(ActsAsBookable::Booking.overlapped(@bookable,opts).order(:id)[2].id).to eq booking3.id
|
76
76
|
end
|
77
77
|
end
|
78
78
|
|
@@ -92,8 +92,8 @@ describe 'Booking model' do
|
|
92
92
|
booking3 = ActsAsBookable::Booking.create!(time_start: nil, time_end: nil, time: time + 1.hour, bookable: @bookable, booker: @booker)
|
93
93
|
opts = {time: time}
|
94
94
|
expect(ActsAsBookable::Booking.overlapped(@bookable,opts).count).to eq 2
|
95
|
-
expect(ActsAsBookable::Booking.overlapped(@bookable,opts)[0].id).to eq booking1.id
|
96
|
-
expect(ActsAsBookable::Booking.overlapped(@bookable,opts)[1].id).to eq booking2.id
|
95
|
+
expect(ActsAsBookable::Booking.overlapped(@bookable,opts).order(:id)[0].id).to eq booking1.id
|
96
|
+
expect(ActsAsBookable::Booking.overlapped(@bookable,opts).order(:id)[1].id).to eq booking2.id
|
97
97
|
end
|
98
98
|
|
99
99
|
it "returns no overlapped booking if time is wrong" do
|
@@ -122,8 +122,8 @@ describe 'Booking model' do
|
|
122
122
|
booking3 = ActsAsBookable::Booking.create!(time_start: time_start-10.days, time_end: time_end-10.days, time: nil, bookable: @bookable, booker: @booker)
|
123
123
|
opts = { time_start: time_start, time_end: time_end }
|
124
124
|
expect(ActsAsBookable::Booking.overlapped(@bookable,opts).count).to eq 2
|
125
|
-
expect(ActsAsBookable::Booking.overlapped(@bookable,opts)[0].id).to eq booking1.id
|
126
|
-
expect(ActsAsBookable::Booking.overlapped(@bookable,opts)[1].id).to eq booking2.id
|
125
|
+
expect(ActsAsBookable::Booking.overlapped(@bookable,opts).order(:id)[0].id).to eq booking1.id
|
126
|
+
expect(ActsAsBookable::Booking.overlapped(@bookable,opts).order(:id)[1].id).to eq booking2.id
|
127
127
|
end
|
128
128
|
|
129
129
|
it "doesn't return any booking if time is wrong" do
|
@@ -162,9 +162,9 @@ describe 'Booking model' do
|
|
162
162
|
booking4 = ActsAsBookable::Booking.create!(time_start: time_start+10.days, time_end: time_end+10.days, time: nil, bookable: @bookable, booker: @booker)
|
163
163
|
opts = { time_start: time_start, time_end: time_end }
|
164
164
|
expect(ActsAsBookable::Booking.overlapped(@bookable,opts).count).to eq 3
|
165
|
-
expect(ActsAsBookable::Booking.overlapped(@bookable,opts)[0].id).to eq booking1.id
|
166
|
-
expect(ActsAsBookable::Booking.overlapped(@bookable,opts)[1].id).to eq booking2.id
|
167
|
-
expect(ActsAsBookable::Booking.overlapped(@bookable,opts)[2].id).to eq booking3.id
|
165
|
+
expect(ActsAsBookable::Booking.overlapped(@bookable,opts).order(:id)[0].id).to eq booking1.id
|
166
|
+
expect(ActsAsBookable::Booking.overlapped(@bookable,opts).order(:id)[1].id).to eq booking2.id
|
167
|
+
expect(ActsAsBookable::Booking.overlapped(@bookable,opts).order(:id)[2].id).to eq booking3.id
|
168
168
|
end
|
169
169
|
|
170
170
|
describe "should handle limit cases" do
|
@@ -46,7 +46,7 @@ describe 'ActsAsBookable::TimeUtils' do
|
|
46
46
|
|
47
47
|
describe '#interval_in_schedule?' do
|
48
48
|
before :each do
|
49
|
-
@day0 = '2016-01-05'.to_date
|
49
|
+
@day0 = '2016-01-05'.to_date.to_time
|
50
50
|
@schedule = IceCube::Schedule.new(@day0,duration: 1.day)
|
51
51
|
@schedule.add_recurrence_rule IceCube::Rule.monthly.day_of_month(1,3,5,7)
|
52
52
|
end
|
@@ -398,7 +398,7 @@ describe 'ActsAsBookable::TimeUtils' do
|
|
398
398
|
# |--4--|
|
399
399
|
# |----9----|
|
400
400
|
it 'correctly merges interval attributes handling dates and times' do
|
401
|
-
time0 = Date.today
|
401
|
+
time0 = Date.today.to_time
|
402
402
|
time1 = time0 + 1
|
403
403
|
time2 = time0 + 2
|
404
404
|
time3 = time0 + 3
|
data/spec/internal/db/schema.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
ActiveRecord::Schema.define version: 0 do
|
2
2
|
create_table :acts_as_bookable_bookings, force: true do |t|
|
3
|
-
t.references :bookable, polymorphic: true
|
4
|
-
t.references :booker, polymorphic: true
|
3
|
+
t.references :bookable, polymorphic: true, index: {name: "index_acts_as_bookable_bookings_bookable"}
|
4
|
+
t.references :booker, polymorphic: true, index: {name: "index_acts_as_bookable_bookings_booker"}
|
5
5
|
t.column :amount, :integer
|
6
6
|
t.column :schedule, :text
|
7
7
|
t.column :time_start, :datetime
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: acts_as_bookable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chosko
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-02-
|
11
|
+
date: 2016-02-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ice_cube_chosko
|
@@ -48,16 +48,16 @@ dependencies:
|
|
48
48
|
name: sqlite3
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
50
50
|
requirements:
|
51
|
-
- - "
|
51
|
+
- - "~>"
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: '
|
53
|
+
version: '1.3'
|
54
54
|
type: :development
|
55
55
|
prerelease: false
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
57
|
requirements:
|
58
|
-
- - "
|
58
|
+
- - "~>"
|
59
59
|
- !ruby/object:Gem::Version
|
60
|
-
version: '
|
60
|
+
version: '1.3'
|
61
61
|
- !ruby/object:Gem::Dependency
|
62
62
|
name: mysql2
|
63
63
|
requirement: !ruby/object:Gem::Requirement
|
@@ -76,113 +76,131 @@ dependencies:
|
|
76
76
|
name: pg
|
77
77
|
requirement: !ruby/object:Gem::Requirement
|
78
78
|
requirements:
|
79
|
-
- - "
|
79
|
+
- - "~>"
|
80
80
|
- !ruby/object:Gem::Version
|
81
|
-
version: '0'
|
81
|
+
version: '0.18'
|
82
82
|
type: :development
|
83
83
|
prerelease: false
|
84
84
|
version_requirements: !ruby/object:Gem::Requirement
|
85
85
|
requirements:
|
86
|
-
- - "
|
86
|
+
- - "~>"
|
87
87
|
- !ruby/object:Gem::Version
|
88
|
-
version: '0'
|
88
|
+
version: '0.18'
|
89
89
|
- !ruby/object:Gem::Dependency
|
90
90
|
name: rspec-rails
|
91
91
|
requirement: !ruby/object:Gem::Requirement
|
92
92
|
requirements:
|
93
|
-
- - "
|
93
|
+
- - "~>"
|
94
94
|
- !ruby/object:Gem::Version
|
95
|
-
version: '
|
95
|
+
version: '3'
|
96
96
|
type: :development
|
97
97
|
prerelease: false
|
98
98
|
version_requirements: !ruby/object:Gem::Requirement
|
99
99
|
requirements:
|
100
|
-
- - "
|
100
|
+
- - "~>"
|
101
101
|
- !ruby/object:Gem::Version
|
102
|
-
version: '
|
102
|
+
version: '3'
|
103
103
|
- !ruby/object:Gem::Dependency
|
104
104
|
name: rspec
|
105
105
|
requirement: !ruby/object:Gem::Requirement
|
106
106
|
requirements:
|
107
|
-
- - "
|
107
|
+
- - "~>"
|
108
108
|
- !ruby/object:Gem::Version
|
109
|
-
version: '
|
109
|
+
version: '3'
|
110
110
|
type: :development
|
111
111
|
prerelease: false
|
112
112
|
version_requirements: !ruby/object:Gem::Requirement
|
113
113
|
requirements:
|
114
|
-
- - "
|
114
|
+
- - "~>"
|
115
115
|
- !ruby/object:Gem::Version
|
116
|
-
version: '
|
116
|
+
version: '3'
|
117
|
+
- !ruby/object:Gem::Dependency
|
118
|
+
name: coveralls
|
119
|
+
requirement: !ruby/object:Gem::Requirement
|
120
|
+
requirements:
|
121
|
+
- - "~>"
|
122
|
+
- !ruby/object:Gem::Version
|
123
|
+
version: '0.8'
|
124
|
+
type: :development
|
125
|
+
prerelease: false
|
126
|
+
version_requirements: !ruby/object:Gem::Requirement
|
127
|
+
requirements:
|
128
|
+
- - "~>"
|
129
|
+
- !ruby/object:Gem::Version
|
130
|
+
version: '0.8'
|
117
131
|
- !ruby/object:Gem::Dependency
|
118
132
|
name: factory_girl_rails
|
119
133
|
requirement: !ruby/object:Gem::Requirement
|
120
134
|
requirements:
|
121
|
-
- - "
|
135
|
+
- - "~>"
|
122
136
|
- !ruby/object:Gem::Version
|
123
|
-
version: '
|
137
|
+
version: '4.6'
|
124
138
|
type: :development
|
125
139
|
prerelease: false
|
126
140
|
version_requirements: !ruby/object:Gem::Requirement
|
127
141
|
requirements:
|
128
|
-
- - "
|
142
|
+
- - "~>"
|
129
143
|
- !ruby/object:Gem::Version
|
130
|
-
version: '
|
144
|
+
version: '4.6'
|
131
145
|
- !ruby/object:Gem::Dependency
|
132
146
|
name: barrier
|
133
147
|
requirement: !ruby/object:Gem::Requirement
|
134
148
|
requirements:
|
135
|
-
- - "
|
149
|
+
- - "~>"
|
136
150
|
- !ruby/object:Gem::Version
|
137
|
-
version: '0'
|
151
|
+
version: '1.0'
|
138
152
|
type: :development
|
139
153
|
prerelease: false
|
140
154
|
version_requirements: !ruby/object:Gem::Requirement
|
141
155
|
requirements:
|
142
|
-
- - "
|
156
|
+
- - "~>"
|
143
157
|
- !ruby/object:Gem::Version
|
144
|
-
version: '0'
|
158
|
+
version: '1.0'
|
145
159
|
- !ruby/object:Gem::Dependency
|
146
160
|
name: database_cleaner
|
147
161
|
requirement: !ruby/object:Gem::Requirement
|
148
162
|
requirements:
|
149
|
-
- - "
|
163
|
+
- - "~>"
|
150
164
|
- !ruby/object:Gem::Version
|
151
|
-
version: '
|
165
|
+
version: '1.5'
|
152
166
|
type: :development
|
153
167
|
prerelease: false
|
154
168
|
version_requirements: !ruby/object:Gem::Requirement
|
155
169
|
requirements:
|
156
|
-
- - "
|
170
|
+
- - "~>"
|
157
171
|
- !ruby/object:Gem::Version
|
158
|
-
version: '
|
172
|
+
version: '1.5'
|
159
173
|
- !ruby/object:Gem::Dependency
|
160
174
|
name: awesome_print
|
161
175
|
requirement: !ruby/object:Gem::Requirement
|
162
176
|
requirements:
|
163
|
-
- - "
|
177
|
+
- - "~>"
|
164
178
|
- !ruby/object:Gem::Version
|
165
|
-
version: '
|
179
|
+
version: '1.6'
|
166
180
|
type: :development
|
167
181
|
prerelease: false
|
168
182
|
version_requirements: !ruby/object:Gem::Requirement
|
169
183
|
requirements:
|
170
|
-
- - "
|
184
|
+
- - "~>"
|
171
185
|
- !ruby/object:Gem::Version
|
172
|
-
version: '
|
173
|
-
description:
|
174
|
-
be booked
|
186
|
+
version: '1.6'
|
187
|
+
description: ActsAsBookable is a reservation engine for Rails applications that allows
|
188
|
+
resources to be booked. You can define availability rules for bookable models and
|
189
|
+
set costraints to implement different types of booking (hotels, theaters, meeting
|
190
|
+
rooms...)
|
175
191
|
email:
|
176
192
|
- ruben.caliandro@gmail.com
|
177
193
|
executables: []
|
178
194
|
extensions: []
|
179
195
|
extra_rdoc_files: []
|
180
196
|
files:
|
197
|
+
- ".coveralls.yml"
|
181
198
|
- ".gitignore"
|
182
199
|
- ".rspec"
|
183
200
|
- ".ruby-version"
|
184
201
|
- ".travis.yml"
|
185
202
|
- Appraisals
|
203
|
+
- CHANGELOG.md
|
186
204
|
- Gemfile
|
187
205
|
- Gemfile.lock
|
188
206
|
- Guardfile
|
@@ -262,7 +280,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
262
280
|
version: '0'
|
263
281
|
requirements: []
|
264
282
|
rubyforge_project:
|
265
|
-
rubygems_version: 2.
|
283
|
+
rubygems_version: 2.4.8
|
266
284
|
signing_key:
|
267
285
|
specification_version: 4
|
268
286
|
summary: The reservation engine for Rails applications that allows resources to be
|