Skip to content

Commit 9da1a04

Browse files
authored
Merge pull request #110 from tungleduyxyz/technical-support-170
Remove retry code
2 parents 6ba088b + c7d490d commit 9da1a04

2 files changed

Lines changed: 22 additions & 9 deletions

File tree

.github/workflows/ci.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ jobs:
2525
database-password: 'root'
2626
database-port: '3306'
2727
docker-compose-file: 'docker-compose.ci.mysql.yml'
28+
- ruby-version: '3.3.5'
29+
database-adapter: 'postgresql'
30+
database-user: 'postgres'
31+
database-password: 'postgres'
32+
database-port: '5432'
33+
docker-compose-file: 'docker-compose.ci.postgresql.yml'
2834
- ruby-version: 'jruby-9.1.17.0'
2935
database-adapter: 'mysql2'
3036
database-user: 'root'
@@ -37,6 +43,12 @@ jobs:
3743
database-password: 'postgres'
3844
database-port: '5432'
3945
docker-compose-file: 'docker-compose.ci.postgresql.yml'
46+
- ruby-version: '3.3.5'
47+
database-adapter: 'postgresql'
48+
database-user: 'postgres'
49+
database-password: 'postgres'
50+
database-port: '5432'
51+
docker-compose-file: 'docker-compose.ci.postgresql.yml'
4052
- ruby-version: 'jruby-9.1.17.0'
4153
database-adapter: 'postgresql'
4254
database-user: 'postgres'

lib/killbill_client/models/resource.rb

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -174,15 +174,16 @@ def instantiate_record_from_json(resource_class, data)
174174

175175
def attribute(name)
176176
send('attr_accessor', name.to_sym)
177-
attributes = @json_attributes ||= []
178-
begin
179-
json_attributes.push(name.to_s)
180-
rescue NameError
181-
(class << self; self; end).
182-
send(:define_method, :json_attributes) { attributes }
183-
retry
184-
end
185-
end
177+
attributes = @json_attributes ||= []
178+
179+
if respond_to?(:json_attributes, true)
180+
json_attributes.push(name.to_s)
181+
else
182+
(class << self; self; end).
183+
send(:define_method, :json_attributes) { attributes }
184+
json_attributes.push(name.to_s)
185+
end
186+
end
186187

187188
def has_many(attr_name, type = nil)
188189
send("attr_accessor", attr_name.to_sym)

0 commit comments

Comments
 (0)