Skip to content

Commit 0eba0b7

Browse files
authored
Merge pull request #2792 from nervosnetwork/testnet
Deploy to mainnet
2 parents c630764 + 7788e08 commit 0eba0b7

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

app/models/udt.rb

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,30 @@ def type_script
4343
}
4444
end
4545

46+
def icon_file
47+
raw = read_attribute(:icon_file)
48+
if raw.nil?
49+
nil
50+
else
51+
domain1 = "oss.jinse.cc"
52+
domain2 = "goldenlegend.oss-cn-hangzhou.aliyuncs.com"
53+
regex = Regexp.new("#{Regexp.escape(domain1)}|#{Regexp.escape(domain2)}")
54+
55+
raw.gsub(regex, "https://images.nftbox.me/")
56+
end
57+
end
58+
59+
# def icon_file
60+
# self[:icon_url]
61+
# # return self[:icon_url] if self[:icon_url].nil?
62+
63+
# # domain1 = "oss.jinse.cc"
64+
# # domain2 = "goldenlegend.oss-cn-hangzhou.aliyuncs.com"
65+
# # regex = Regexp.new("#{Regexp.escape(domain1)}|#{Regexp.escape(domain2)}")
66+
67+
# # self[:icon_url].gsub(regex, "https://images.nftbox.me/")
68+
# end
69+
4670
def holders_count
4771
udt_holder_allocations.sum("ckb_holder_count + btc_holder_count")
4872
end

0 commit comments

Comments
 (0)