mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-12-02 11:59:17 -05:00
FIX: DiscourseLocalOnebox should have a higher priority than other
discourse sites
This commit is contained in:
parent
2def97aceb
commit
cbf2e2e8f9
2 changed files with 6 additions and 1 deletions
|
@ -204,7 +204,7 @@ GEM
|
||||||
omniauth-twitter (1.0.1)
|
omniauth-twitter (1.0.1)
|
||||||
multi_json (~> 1.3)
|
multi_json (~> 1.3)
|
||||||
omniauth-oauth (~> 1.0)
|
omniauth-oauth (~> 1.0)
|
||||||
onebox (1.2.4)
|
onebox (1.2.5)
|
||||||
hexpress (~> 1.2)
|
hexpress (~> 1.2)
|
||||||
moneta (~> 0.7)
|
moneta (~> 0.7)
|
||||||
multi_json (~> 1.7)
|
multi_json (~> 1.7)
|
||||||
|
|
|
@ -5,6 +5,11 @@ module Onebox
|
||||||
|
|
||||||
matches_regexp Regexp.new("^#{Discourse.base_url.gsub(".","\\.")}.*$", true)
|
matches_regexp Regexp.new("^#{Discourse.base_url.gsub(".","\\.")}.*$", true)
|
||||||
|
|
||||||
|
# Use this onebox before others
|
||||||
|
def self.priority
|
||||||
|
1
|
||||||
|
end
|
||||||
|
|
||||||
def to_html
|
def to_html
|
||||||
uri = URI::parse(@url)
|
uri = URI::parse(@url)
|
||||||
route = Rails.application.routes.recognize_path(uri.path)
|
route = Rails.application.routes.recognize_path(uri.path)
|
||||||
|
|
Loading…
Reference in a new issue