Skip to content

Commit 623eabd

Browse files
authored
Merge pull request gregschmit#122 from GetJobber/JOB-9744/upgrade-to-rails-5
Update so we can use this on rails 5
2 parents 9a33735 + 9e02f39 commit 623eabd

File tree

6 files changed

+37
-10
lines changed

6 files changed

+37
-10
lines changed

.ruby-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.1.3
1+
2.3.7

.travis.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,31 @@ rvm:
66
- 2.0.0
77
- 2.1.5
88
- 2.2.0
9+
- 2.3.7
910
- jruby-19mode
1011
gemfile:
1112
- spec/gemfiles/Gemfile.rails-4.0.x
1213
- spec/gemfiles/Gemfile.rails-4.1.x
1314
- spec/gemfiles/Gemfile.rails-4.2.x
15+
- spec/gemfiles/Gemfile.rails-5.0.x
1416
matrix:
1517
exclude:
1618
- rvm: 1.9.3
1719
gemfile: spec/gemfiles/rails-4.0.x.gemfile
20+
- rvm: 1.9.3
21+
gemfile: spec/gemfiles/rails-5.0.x.gemfile
1822
- rvm: 1.9.3
1923
gemfile: spec/gemfiles/rails-4.1.x.gemfile
24+
- rvm: 1.9.3
25+
gemfile: spec/gemfiles/rails-5.0.x.gemfile
2026
- rvm: 1.9.3
2127
gemfile: spec/gemfiles/rails-4.2.x.gemfile
28+
- rvm: 2.0.0
29+
gemfile: spec/gemfiles/rails-5.0.x.gemfile
30+
- rvm: 2.1.5
31+
gemfile: spec/gemfiles/rails-5.0.x.gemfile
32+
- rvm: 2.2.2
33+
gemfile: spec/gemfiles/rails-5.0.x.gemfile
2234
- rvm: jruby-19mode
2335
gemfile: spec/gemfiles/Gemfile.rails-3.2.x
2436
fast_finish: true

Gemfile.lock

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
recurring_select (2.0.0)
4+
recurring_select (2.1.0)
55
coffee-rails (>= 3.1)
66
ice_cube (>= 0.11)
77
jquery-rails (>= 3.0)
@@ -37,19 +37,19 @@ GEM
3737
tzinfo (~> 0.3.37)
3838
arel (4.0.2)
3939
builder (3.1.4)
40-
coffee-rails (4.1.0)
40+
coffee-rails (4.2.2)
4141
coffee-script (>= 2.2.0)
42-
railties (>= 4.0.0, < 5.0)
42+
railties (>= 4.0.0)
4343
coffee-script (2.4.1)
4444
coffee-script-source
4545
execjs
46-
coffee-script-source (1.9.1.1)
46+
coffee-script-source (1.12.2)
4747
diff-lcs (1.2.5)
4848
erubis (2.7.0)
49-
execjs (2.6.0)
49+
execjs (2.7.0)
5050
hike (1.2.3)
5151
i18n (0.7.0)
52-
ice_cube (0.13.0)
52+
ice_cube (0.16.2)
5353
jquery-rails (3.1.2)
5454
railties (>= 3.0, < 5.0)
5555
thor (>= 0.14, < 2.0)
@@ -130,3 +130,6 @@ DEPENDENCIES
130130
rspec (>= 2.14)
131131
rspec-rails (>= 2.14)
132132
sass-rails (~> 4.0.5)
133+
134+
BUNDLED WITH
135+
1.16.2

app/helpers/recurring_select_helper.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
module RecurringSelectHelper
44
module FormHelper
5-
if Rails::VERSION::MAJOR == 4
5+
if Rails::VERSION::MAJOR >= 4
66
def select_recurring(object, method, default_schedules = nil, options = {}, html_options = {})
77
RecurringSelectTag.new(object, method, self, default_schedules, options, html_options).render
88
end
@@ -114,7 +114,11 @@ def initialize(object, method, template_object, default_schedules = nil, options
114114
end
115115

116116
def render
117-
option_tags = add_options(recurring_options_for_select(value(object), @default_schedules, @options), @options, value(object))
117+
if Rails::VERSION::STRING >= '5.2'
118+
option_tags = add_options(recurring_options_for_select(value, @default_schedules, @options), @options, value)
119+
else
120+
option_tags = add_options(recurring_options_for_select(value(object), @default_schedules, @options), @options, value(object))
121+
end
118122
select_content_tag(option_tags, @options, @html_options)
119123
end
120124
end

lib/recurring_select/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module RecurringSelect
2-
VERSION = "2.0.0"
2+
VERSION = "2.1.0"
33
end

spec/gemfiles/Gemfile.rails-5.0.x

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
source "https://rubygems.org"
2+
gemspec :path => "./../.."
3+
4+
gem 'pg', platform: :ruby
5+
gem 'activerecord-jdbcpostgresql-adapter', platform: :jruby
6+
7+
gem "rails", "~> 5.2"
8+
gem "sass-rails", "~> 5.0"

0 commit comments

Comments
 (0)