cut down on pets#load queries
This commit is contained in:
parent
6c3ff09f5d
commit
a39110884d
6 changed files with 64 additions and 12 deletions
2
Gemfile
2
Gemfile
|
@ -50,7 +50,7 @@ gem "parallel", "~> 0.5.17"
|
||||||
|
|
||||||
gem "http_accept_language", :git => "git://github.com/iain/http_accept_language.git"
|
gem "http_accept_language", :git => "git://github.com/iain/http_accept_language.git"
|
||||||
|
|
||||||
gem "globalize3"
|
gem "globalize3", :git => "git://github.com/matchu/globalize3.git"
|
||||||
|
|
||||||
# My flex branch fixes a minor pagination bug. Once it's merged into the
|
# My flex branch fixes a minor pagination bug. Once it's merged into the
|
||||||
# original gem, we can switch back.
|
# original gem, we can switch back.
|
||||||
|
|
15
Gemfile.lock
15
Gemfile.lock
|
@ -44,6 +44,15 @@ GIT
|
||||||
progressbar (~> 0.11.0)
|
progressbar (~> 0.11.0)
|
||||||
prompter (~> 0.1.5)
|
prompter (~> 0.1.5)
|
||||||
|
|
||||||
|
GIT
|
||||||
|
remote: git://github.com/matchu/globalize3.git
|
||||||
|
revision: c7cfc359f9fc8c283e45b3847ec9b9aaedff1d54
|
||||||
|
specs:
|
||||||
|
globalize3 (0.3.0)
|
||||||
|
activemodel (>= 3.0.0)
|
||||||
|
activerecord (>= 3.0.0)
|
||||||
|
paper_trail (~> 2)
|
||||||
|
|
||||||
GIT
|
GIT
|
||||||
remote: git://github.com/matchu/neopets.git
|
remote: git://github.com/matchu/neopets.git
|
||||||
revision: d33aaf63d4617d9236ef0d99452b3bdc577cbc8e
|
revision: d33aaf63d4617d9236ef0d99452b3bdc577cbc8e
|
||||||
|
@ -137,10 +146,6 @@ GEM
|
||||||
nokogiri (~> 1.5.0)
|
nokogiri (~> 1.5.0)
|
||||||
ruby-hmac
|
ruby-hmac
|
||||||
formatador (0.2.4)
|
formatador (0.2.4)
|
||||||
globalize3 (0.3.0)
|
|
||||||
activemodel (>= 3.0.0)
|
|
||||||
activerecord (>= 3.0.0)
|
|
||||||
paper_trail (~> 2)
|
|
||||||
haml (3.0.25)
|
haml (3.0.25)
|
||||||
hoptoad_notifier (2.4.11)
|
hoptoad_notifier (2.4.11)
|
||||||
activesupport
|
activesupport
|
||||||
|
@ -284,7 +289,7 @@ DEPENDENCIES
|
||||||
factory_girl_rails (~> 1.0)
|
factory_girl_rails (~> 1.0)
|
||||||
flex!
|
flex!
|
||||||
fog (~> 1.8.0)
|
fog (~> 1.8.0)
|
||||||
globalize3
|
globalize3!
|
||||||
haml (~> 3.0.18)
|
haml (~> 3.0.18)
|
||||||
hoptoad_notifier
|
hoptoad_notifier
|
||||||
http_accept_language!
|
http_accept_language!
|
||||||
|
|
|
@ -129,7 +129,7 @@ class Pet < ActiveRecord::Base
|
||||||
|
|
||||||
if @items
|
if @items
|
||||||
@items.each do |item|
|
@items.each do |item|
|
||||||
item.save!
|
item.save! if item.changed?
|
||||||
item.handle_assets!
|
item.handle_assets!
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
class RemoveTranslatedFieldsFromItems < ActiveRecord::Migration
|
||||||
|
def self.up
|
||||||
|
remove_column :items, :name
|
||||||
|
remove_column :items, :description
|
||||||
|
remove_column :items, :rarity
|
||||||
|
end
|
||||||
|
|
||||||
|
def self.down
|
||||||
|
add_column :items, :name, :limit => 100, :null => false
|
||||||
|
add_column :items, :description, :limit => 16777215, :null => false
|
||||||
|
add_columm :items, :rarity, :limit => 25
|
||||||
|
end
|
||||||
|
end
|
44
db/schema.rb
44
db/schema.rb
|
@ -11,7 +11,7 @@
|
||||||
#
|
#
|
||||||
# It's strongly recommended to check this file into your version control system.
|
# It's strongly recommended to check this file into your version control system.
|
||||||
|
|
||||||
ActiveRecord::Schema.define(:version => 20130121221226) do
|
ActiveRecord::Schema.define(:version => 20130128065543) do
|
||||||
|
|
||||||
create_table "auth_servers", :force => true do |t|
|
create_table "auth_servers", :force => true do |t|
|
||||||
t.string "short_name", :limit => 10, :null => false
|
t.string "short_name", :limit => 10, :null => false
|
||||||
|
@ -21,7 +21,25 @@ ActiveRecord::Schema.define(:version => 20130121221226) do
|
||||||
t.string "secret", :limit => 64, :null => false
|
t.string "secret", :limit => 64, :null => false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
create_table "campaign_translations", :force => true do |t|
|
||||||
|
t.integer "campaign_id"
|
||||||
|
t.string "locale"
|
||||||
|
t.string "progress_bar_message"
|
||||||
|
t.datetime "created_at"
|
||||||
|
t.datetime "updated_at"
|
||||||
|
end
|
||||||
|
|
||||||
|
add_index "campaign_translations", ["campaign_id"], :name => "index_campaign_translations_on_campaign_id"
|
||||||
|
add_index "campaign_translations", ["locale"], :name => "index_campaign_translations_on_locale"
|
||||||
|
|
||||||
create_table "campaigns", :force => true do |t|
|
create_table "campaigns", :force => true do |t|
|
||||||
|
t.integer "goal_cents"
|
||||||
|
t.integer "progress_cents"
|
||||||
|
t.datetime "created_at"
|
||||||
|
t.datetime "updated_at"
|
||||||
|
end
|
||||||
|
|
||||||
|
create_table "campaigns_old", :force => true do |t|
|
||||||
t.integer "goal_cents", :null => false
|
t.integer "goal_cents", :null => false
|
||||||
t.integer "progress_cents", :null => false
|
t.integer "progress_cents", :null => false
|
||||||
t.datetime "created_at"
|
t.datetime "created_at"
|
||||||
|
@ -81,6 +99,18 @@ ActiveRecord::Schema.define(:version => 20130121221226) do
|
||||||
add_index "contributions", ["user_id"], :name => "index_contributions_on_user_id"
|
add_index "contributions", ["user_id"], :name => "index_contributions_on_user_id"
|
||||||
|
|
||||||
create_table "donations", :force => true do |t|
|
create_table "donations", :force => true do |t|
|
||||||
|
t.integer "amount_cents"
|
||||||
|
t.boolean "processed"
|
||||||
|
t.datetime "created_at"
|
||||||
|
t.datetime "updated_at"
|
||||||
|
t.string "transaction_id"
|
||||||
|
t.string "access_token"
|
||||||
|
t.integer "campaign_id"
|
||||||
|
t.integer "outfit_features_count", :default => 0, :null => false
|
||||||
|
t.string "donor_name"
|
||||||
|
end
|
||||||
|
|
||||||
|
create_table "donations_old", :force => true do |t|
|
||||||
t.integer "amount_cents", :null => false
|
t.integer "amount_cents", :null => false
|
||||||
t.integer "campaign_id", :null => false
|
t.integer "campaign_id", :null => false
|
||||||
t.integer "user_id"
|
t.integer "user_id"
|
||||||
|
@ -123,11 +153,8 @@ ActiveRecord::Schema.define(:version => 20130121221226) do
|
||||||
create_table "items", :force => true do |t|
|
create_table "items", :force => true do |t|
|
||||||
t.text "zones_restrict", :null => false
|
t.text "zones_restrict", :null => false
|
||||||
t.text "thumbnail_url", :limit => 16777215, :null => false
|
t.text "thumbnail_url", :limit => 16777215, :null => false
|
||||||
t.string "name", :limit => 100, :null => false
|
|
||||||
t.text "description", :limit => 16777215, :null => false
|
|
||||||
t.string "category", :limit => 50
|
t.string "category", :limit => 50
|
||||||
t.string "type", :limit => 50
|
t.string "type", :limit => 50
|
||||||
t.string "rarity", :limit => 25
|
|
||||||
t.integer "rarity_index", :limit => 2
|
t.integer "rarity_index", :limit => 2
|
||||||
t.integer "price", :limit => 3, :null => false
|
t.integer "price", :limit => 3, :null => false
|
||||||
t.integer "weight_lbs", :limit => 2
|
t.integer "weight_lbs", :limit => 2
|
||||||
|
@ -140,7 +167,6 @@ ActiveRecord::Schema.define(:version => 20130121221226) do
|
||||||
end
|
end
|
||||||
|
|
||||||
add_index "items", ["last_spidered"], :name => "objects_last_spidered"
|
add_index "items", ["last_spidered"], :name => "objects_last_spidered"
|
||||||
add_index "items", ["name"], :name => "name"
|
|
||||||
|
|
||||||
create_table "login_cookies", :force => true do |t|
|
create_table "login_cookies", :force => true do |t|
|
||||||
t.integer "user_id", :null => false
|
t.integer "user_id", :null => false
|
||||||
|
@ -152,6 +178,14 @@ ActiveRecord::Schema.define(:version => 20130121221226) do
|
||||||
add_index "login_cookies", ["user_id"], :name => "login_cookies_user_id"
|
add_index "login_cookies", ["user_id"], :name => "login_cookies_user_id"
|
||||||
|
|
||||||
create_table "outfit_features", :force => true do |t|
|
create_table "outfit_features", :force => true do |t|
|
||||||
|
t.integer "donation_id"
|
||||||
|
t.integer "outfit_id"
|
||||||
|
t.boolean "approved"
|
||||||
|
t.datetime "created_at"
|
||||||
|
t.datetime "updated_at"
|
||||||
|
end
|
||||||
|
|
||||||
|
create_table "outfit_features_old", :force => true do |t|
|
||||||
t.integer "outfit_id", :null => false
|
t.integer "outfit_id", :null => false
|
||||||
t.datetime "created_at"
|
t.datetime "created_at"
|
||||||
t.datetime "updated_at"
|
t.datetime "updated_at"
|
||||||
|
|
BIN
vendor/cache/globalize3-0.3.0.gem
vendored
BIN
vendor/cache/globalize3-0.3.0.gem
vendored
Binary file not shown.
Loading…
Reference in a new issue