forked from saurabh/orbit4-5
Merge branch 'master' of gitlab.tp.rulingcom.com:saurabh/orbit4-5 into ydu
This commit is contained in:
commit
4985984d3a
|
@ -105,7 +105,8 @@ class Admin::SitesController < OrbitAdminController
|
||||||
result = "failed"
|
result = "failed"
|
||||||
else
|
else
|
||||||
result = "success"
|
result = "success"
|
||||||
Bundler.with_clean_env { `cd #{Rails.root} && bundle update` }
|
# Bundler.with_clean_env { `cd #{Rails.root} && bundle update` }
|
||||||
|
Bundler.with_clean_env { `cd #{Rails.root} && BUNDLE_GEMFILE=built_in_extensions.rb bundle update && bundle` }
|
||||||
end
|
end
|
||||||
|
|
||||||
render :text => result
|
render :text => result
|
||||||
|
@ -115,7 +116,7 @@ class Admin::SitesController < OrbitAdminController
|
||||||
end
|
end
|
||||||
|
|
||||||
def bundle_install
|
def bundle_install
|
||||||
Bundler.with_clean_env { `cd #{Rails.root} && bundle update` }
|
Bundler.with_clean_env { `cd #{Rails.root} && BUNDLE_GEMFILE=built_in_extensions.rb bundle update && bundle` }
|
||||||
%x(kill -s USR2 `cat tmp/pids/unicorn.pid`)
|
%x(kill -s USR2 `cat tmp/pids/unicorn.pid`)
|
||||||
sleep 5
|
sleep 5
|
||||||
render :nothing => true
|
render :nothing => true
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<% if !@plugin_shows.blank? %>
|
||||||
<div id="member-module">
|
<div id="member-module">
|
||||||
<div id="module-navbar">
|
<div id="module-navbar">
|
||||||
<div class="navbar">
|
<div class="navbar">
|
||||||
|
@ -65,7 +65,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ require File.expand_path('../application', __FILE__)
|
||||||
# Initialize the Rails application.
|
# Initialize the Rails application.
|
||||||
Orbit::Application.initialize!
|
Orbit::Application.initialize!
|
||||||
Orbit::Application.config.secret_key_base = 'acc6ffc5a7d360c9cf2a7bdb4ddf9a897942ec6767413a5c0324a0fa8b86197a96298288a66bd46d8770d8b6edf509aad65716961c2c364ce006b475e6cfd418'
|
Orbit::Application.config.secret_key_base = 'acc6ffc5a7d360c9cf2a7bdb4ddf9a897942ec6767413a5c0324a0fa8b86197a96298288a66bd46d8770d8b6edf509aad65716961c2c364ce006b475e6cfd418'
|
||||||
|
OrbitApp.cleanup_modules
|
||||||
|
|
||||||
if Site.count == 0
|
if Site.count == 0
|
||||||
site = Site.new
|
site = Site.new
|
||||||
|
|
|
@ -10,5 +10,15 @@ module OrbitApp
|
||||||
Widget::Registration.new(name,&block)
|
Widget::Registration.new(name,&block)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def cleanup_modules
|
||||||
|
module_apps = ModuleApp.all
|
||||||
|
module_apps.each do |ma|
|
||||||
|
reg = OrbitApp::Module::Registration.find_by_key(ma.key) rescue nil
|
||||||
|
if reg.nil?
|
||||||
|
ma.destroy
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
|
@ -10,29 +10,22 @@ module OrbitTag
|
||||||
module ClassMethods
|
module ClassMethods
|
||||||
def with_tags(tags=[])
|
def with_tags(tags=[])
|
||||||
tags = [tags].flatten.uniq
|
tags = [tags].flatten.uniq
|
||||||
result = []
|
|
||||||
if tags.blank?
|
if tags.blank?
|
||||||
self.all
|
self.all
|
||||||
else
|
else
|
||||||
self.all.each do |taggable|
|
taggings = Tagging.where(:tag_id.in=>tags).map{|item| item.taggable_id}
|
||||||
result << taggable if (taggable.taggings.map{|t| t.tag.id.to_s } & tags).size > 0
|
self.where(:id.in=>taggings)
|
||||||
end
|
|
||||||
self.where(:id.in=>result.map{|taggable| taggable.id})
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def filter_by_tags(tags=[])
|
def filter_by_tags(tags=[])
|
||||||
tags = OrbitHelper.page_tags if tags.blank?
|
tags = OrbitHelper.page_tags if tags.blank?
|
||||||
tags = [tags].flatten.uniq
|
tags = [tags].flatten.uniq
|
||||||
result = []
|
|
||||||
|
|
||||||
if tags.blank? or (tags.include?("all") rescue false)
|
if tags.blank? or (tags.include?("all") rescue false)
|
||||||
self.all
|
self.all
|
||||||
else
|
else
|
||||||
self.all.each do |taggable|
|
taggings = Tagging.where(:tag_id.in=>tags).map{|item| item.taggable_id}
|
||||||
result << taggable if (taggable.taggings.map{|t| t.tag.id.to_s } & tags).size > 0
|
self.where(:id.in=>taggings)
|
||||||
end
|
|
||||||
self.where(:id.in=>result.map{|taggable| taggable.id})
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue