From eaa552749ac347007bf8cf34e352282397c02779 Mon Sep 17 00:00:00 2001 From: yasushiito Date: Tue, 10 Jun 2014 17:58:42 +0900 Subject: [PATCH] upgrade rails 3.2 --- Gemfile | 9 +++++---- app/models/balloon.rb | 6 +++++- app/models/ground_picture.rb | 6 +++++- app/models/panel_picture.rb | 6 +++++- app/models/speech.rb | 2 +- app/views/scrolls/_summary.html.erb | 1 - app/views/sheet_panels/_element.html.erb | 2 +- config/application.rb | 1 + config/initializers/mime_types.rb | 3 --- 9 files changed, 23 insertions(+), 13 deletions(-) diff --git a/Gemfile b/Gemfile index d9887dd6..a6f9b752 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,6 @@ source 'https://rubygems.org' -gem 'rails', '3.1.1' +gem 'rails', '~> 3.2.0' gem 'devise', '=1.5.2' gem 'rest-client' gem 'underscore-rails' @@ -21,6 +21,7 @@ gem 'circle_speech_balloon' gem 'plain_speech_balloon' gem 'square_speech_balloon' gem 'test_speech_balloon' +gem 'square_speech_balloon' gem 'pettanr_simple_format' # Bundle edge Rails instead: @@ -30,8 +31,8 @@ gem 'pettanr_simple_format' # Gems used only for assets and not required # in production environments by default. group :assets do - gem 'sass-rails', '~> 3.1.4' - gem 'coffee-rails', '~> 3.1.1' + gem 'sass-rails', '~> 3.0' + gem 'coffee-rails', '~> 3.0' gem 'uglifier', '>= 1.0.3' end @@ -63,7 +64,7 @@ end group :development, :test do gem 'sqlite3' gem 'webrat' - gem 'rspec', '~> 2.13.0' + gem 'rspec', '~> 2.0' gem 'rspec-rails' gem 'cucumber' gem 'cucumber-rails' diff --git a/app/models/balloon.rb b/app/models/balloon.rb index 71d97e7a..bce4d6a8 100644 --- a/app/models/balloon.rb +++ b/app/models/balloon.rb @@ -16,6 +16,10 @@ class Balloon < Peta::Element # validates :caption, :presence => true validates :speech_balloon_template_settings, :boost => {:boost_name => :speech_balloon_template} + def _y + self.attributes['y'] + end + def url '/system_pictures/' + self.system_picture.filename end @@ -54,7 +58,7 @@ self.system_picture_id = 1 def style { 'width' => self.width.to_s + 'px','height' => self.height.to_s + 'px', - 'top' => self.y.to_s + 'px','left' => self.x.to_s + 'px' + 'top' => self._y.to_s + 'px','left' => self.x.to_s + 'px' } end diff --git a/app/models/ground_picture.rb b/app/models/ground_picture.rb index 36461d34..1f303ec9 100644 --- a/app/models/ground_picture.rb +++ b/app/models/ground_picture.rb @@ -13,6 +13,10 @@ class GroundPicture < Peta::Element @@repeat_texts = ['repeat', 'repeat-x', 'repeat-y', 'no-repeat'] + def _y + self.attributes['y'] + end + def self.by_author_list_includes { :panel => { @@ -44,7 +48,7 @@ class GroundPicture < Peta::Element 'position' => 'absolute', 'top' => '0px', 'left' => '0px', 'z-index' => self.z, 'background-image' => "url(#{self.picture.url})", 'background-repeat' => self.repeat_text, - 'background-position' => "#{self.x}px #{self.y}px" + 'background-position' => "#{self.x}px #{self._y}px" } self.merge_opacity(r, opacity) if spot and spot != self r diff --git a/app/models/panel_picture.rb b/app/models/panel_picture.rb index df7df24e..38995abe 100644 --- a/app/models/panel_picture.rb +++ b/app/models/panel_picture.rb @@ -13,6 +13,10 @@ class PanelPicture < Peta::Element validates :z, :presence => true, :numericality => {:greater_than => 0} validates :t, :presence => true, :numericality => {:greater_than_or_equal_to => 0} + def _y + self.attributes['y'] + end + def self.by_author_list_includes { :panel => { @@ -58,7 +62,7 @@ class PanelPicture < Peta::Element end def opt_div_style - "top:#{self.y}px; left:#{self.x}px; z-index:#{self.z}; position: absolute;" + "top:#{self._y}px; left:#{self.x}px; z-index:#{self.z}; position: absolute;" end def opt_img_tag spot = nil, opacity = 20 diff --git a/app/models/speech.rb b/app/models/speech.rb index efe2ab70..2b217203 100644 --- a/app/models/speech.rb +++ b/app/models/speech.rb @@ -35,7 +35,7 @@ class Speech < Peta::Element def outer_style { - 'top' => self.y, 'left' => self.x, + 'top' => self._y, 'left' => self.x, 'width' => self.width, 'height' => self.height } end diff --git a/app/views/scrolls/_summary.html.erb b/app/views/scrolls/_summary.html.erb index 38b81b35..c8b4c41a 100644 --- a/app/views/scrolls/_summary.html.erb +++ b/app/views/scrolls/_summary.html.erb @@ -1,6 +1,5 @@
<%= t_selected_item('scroll_visible_items', item.visible) %> - <%= t('scrolls.scroll_panels_count', :c => item.scroll_panels_count) %>
<%= link_to h(truncate(item.author.name, :length => 12)), author_path(item.author) %> diff --git a/app/views/sheet_panels/_element.html.erb b/app/views/sheet_panels/_element.html.erb index ce76f9dc..1bd4f619 100644 --- a/app/views/sheet_panels/_element.html.erb +++ b/app/views/sheet_panels/_element.html.erb @@ -1,4 +1,4 @@ -
+
<% if elm.panel -%> <%# blocked in panels/body panel = Panel.show elm.panel, author -%> <%= render 'panels/body', :panel => elm.panel, :operators => operators, :spot => nil %> diff --git a/config/application.rb b/config/application.rb index 1fe4db4c..17af8a03 100644 --- a/config/application.rb +++ b/config/application.rb @@ -39,6 +39,7 @@ config.assets.initialize_on_precompile = false # config.time_zone = 'Central Time (US & Canada)' # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. + I18n.enforce_available_locales = false config.i18n.load_path += Dir[Rails.root.join('config', 'locales', '**', '*.{rb,yml}').to_s] config.i18n.default_locale = :ja diff --git a/config/initializers/mime_types.rb b/config/initializers/mime_types.rb index 0876b143..fa0c5cd6 100644 --- a/config/initializers/mime_types.rb +++ b/config/initializers/mime_types.rb @@ -3,8 +3,5 @@ # Add new mime types for use in respond_to blocks: # Mime::Type.register "text/richtext", :rtf # Mime::Type.register_alias "text/html", :iphone -Mime::Type.register_alias "image/png", :png -Mime::Type.register_alias "image/gif", :gif -Mime::Type.register_alias "image/jpeg", :jpeg Mime::Type.register_alias "application/javascript", :jsonp Mime::Type.register_alias "text/html", :prof -- 2.11.0