Fix gravity blank bug.
This commit is contained in:
parent
8ddce60cba
commit
cb812c983d
|
@ -12,7 +12,7 @@ class AlbumSetting
|
||||||
before_save do
|
before_save do
|
||||||
if defined?(OrbitHelper::SharedHash) && OrbitHelper::SharedHash
|
if defined?(OrbitHelper::SharedHash) && OrbitHelper::SharedHash
|
||||||
OrbitHelper::SharedHash['gallery'][:thumb_process_option] = self.thumb_process_option
|
OrbitHelper::SharedHash['gallery'][:thumb_process_option] = self.thumb_process_option
|
||||||
OrbitHelper::SharedHash['gallery'][:resize_gravity] = self.resize_gravity
|
OrbitHelper::SharedHash['gallery'][:resize_gravity] = (self.resize_gravity.blank? ? 'Center' : self.resize_gravity)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
|
@ -92,7 +92,7 @@ Gem::Specification.new do |s|
|
||||||
s.license = "MIT"
|
s.license = "MIT"
|
||||||
s.metadata = {
|
s.metadata = {
|
||||||
"_require" => "#{File.expand_path("../app/models/album_setting", __FILE__)}",
|
"_require" => "#{File.expand_path("../app/models/album_setting", __FILE__)}",
|
||||||
"global_hash" => "{resize_gravity: (AlbumSetting.first.resize_gravity rescue 'Center'), thumb_process_option: (AlbumSetting.first.thumb_process_option rescue 1)}"
|
"global_hash" => "{resize_gravity: ([AlbumSetting.first.resize_gravity, 'Center'].select{|s| s.present?}.first rescue 'Center'), thumb_process_option: (AlbumSetting.first.thumb_process_option rescue 1)}"
|
||||||
}
|
}
|
||||||
|
|
||||||
s.files = Dir["{app,config,db,lib}/**/*", "MIT-LICENSE", "Rakefile", "README.rdoc"]
|
s.files = Dir["{app,config,db,lib}/**/*", "MIT-LICENSE", "Rakefile", "README.rdoc"]
|
||||||
|
|
Loading…
Reference in New Issue