Created
March 14, 2012 15:59
-
-
Save BDQ/2037461 to your computer and use it in GitHub Desktop.
Preference update changes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SQL (0.2ms) UPDATE `spree_preferences` SET `value` = '9d266968-7f40-9496-630b-6a7776d3a367', `value_type` = 'string' WHERE `spree_preferences`.`key` = 'store1/spraycan/app_configuration/background_file_guid' | |
SQL (0.1ms) UPDATE `spree_preferences` SET `value` = '8c46198c-b734-0d11-1404-26bc2f01d500', `value_type` = 'string' WHERE `spree_preferences`.`key` = 'store1/spraycan/app_configuration/logo_file_guid' | |
SQL (0.3ms) UPDATE `spree_preferences` SET `value` = 14, `value_type` = 'integer' WHERE `spree_preferences`.`key` = 'store1/spraycan/app_configuration/horizontal_navigation_font_size' | |
SQL (0.3ms) UPDATE `spree_preferences` SET `value` = 'Cousine', `value_type` = 'string' WHERE `spree_preferences`.`key` = 'store1/spraycan/app_configuration/body_font' | |
SQL (0.3ms) UPDATE `spree_preferences` SET `value` = 14, `value_type` = 'integer' WHERE `spree_preferences`.`key` = 'store1/spraycan/app_configuration/main_navigation_header_font_size' | |
SQL (0.2ms) UPDATE `spree_preferences` SET `value` = '171e7fcbe7ae0e975d971695face0a43', `value_type` = 'string' WHERE `spree_preferences`.`key` = 'store1/spraycan/app_configuration/stylesheet_digest' | |
SQL (0.4ms) UPDATE `spree_preferences` SET `value` = 'PT Sans Narrow', `value_type` = 'string' WHERE `spree_preferences`.`key` = 'store1/spraycan/app_configuration/title_font' | |
SQL (0.2ms) UPDATE `spree_preferences` SET `value` = 14, `value_type` = 'integer' WHERE `spree_preferences`.`key` = 'store1/spraycan/app_configuration/header_navigation_font_size' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Spree::Preference Load (0.7ms) SELECT `spree_preferences`.* FROM `spree_preferences` WHERE `spree_preferences`.`key` = 'store1/spraycan/app_configuration/background_file_guid' LIMIT 1 | |
(0.4ms) UPDATE `spree_preferences` SET `value` = 'd73a8e5d-c004-d7e9-d16d-2f87118bd512', `value_type` = 'string', `updated_at` = '2012-03-14 15:57:27' WHERE `spree_preferences`.`id` = 62 | |
Spree::Preference Load (0.7ms) SELECT `spree_preferences`.* FROM `spree_preferences` WHERE `spree_preferences`.`key` = 'store1/spraycan/app_configuration/logo_file_guid' LIMIT 1 | |
(0.4ms) UPDATE `spree_preferences` SET `value` = '9649f100-63ea-5916-24b4-3bd3b94d2d2a', `value_type` = 'string', `updated_at` = '2012-03-14 15:57:27' WHERE `spree_preferences`.`id` = 61 | |
Spree::Preference Load (0.7ms) SELECT `spree_preferences`.* FROM `spree_preferences` WHERE `spree_preferences`.`key` = 'store1/spraycan/app_configuration/heading_font_size' LIMIT 1 | |
(0.3ms) UPDATE `spree_preferences` SET `value` = 20, `value_type` = 'integer', `updated_at` = '2012-03-14 15:57:27' WHERE `spree_preferences`.`id` = 68 | |
Spree::Preference Load (0.7ms) SELECT `spree_preferences`.* FROM `spree_preferences` WHERE `spree_preferences`.`key` = 'store1/spraycan/app_configuration/horizontal_navigation_font_size' LIMIT 1 | |
(0.1ms) UPDATE `spree_preferences` SET `value` = 20, `value_type` = 'integer', `updated_at` = '2012-03-14 15:57:27' WHERE `spree_preferences`.`id` = 69 | |
Spree::Preference Load (0.7ms) SELECT `spree_preferences`.* FROM `spree_preferences` WHERE `spree_preferences`.`key` = 'store1/spraycan/app_configuration/product_detail_title_font_size' LIMIT 1 | |
(0.3ms) UPDATE `spree_preferences` SET `value` = 14, `value_type` = 'integer', `updated_at` = '2012-03-14 15:57:27' WHERE `spree_preferences`.`id` = 63 | |
Spree::Preference Load (0.7ms) SELECT `spree_preferences`.* FROM `spree_preferences` WHERE `spree_preferences`.`key` = 'store1/spraycan/app_configuration/main_navigation_font_size' LIMIT 1 | |
(0.2ms) UPDATE `spree_preferences` SET `value` = 12, `value_type` = 'integer', `updated_at` = '2012-03-14 15:57:27' WHERE `spree_preferences`.`id` = 66 | |
Spree::Preference Load (0.7ms) SELECT `spree_preferences`.* FROM `spree_preferences` WHERE `spree_preferences`.`key` = 'store1/spraycan/app_configuration/product_list_name_font_size' LIMIT 1 | |
(0.2ms) UPDATE `spree_preferences` SET `value` = 15, `value_type` = 'integer', `updated_at` = '2012-03-14 15:57:27' WHERE `spree_preferences`.`id` = 64 | |
Spree::Preference Load (0.7ms) SELECT `spree_preferences`.* FROM `spree_preferences` WHERE `spree_preferences`.`key` = 'store1/spraycan/app_configuration/base_theme_id' LIMIT 1 | |
(0.3ms) UPDATE `spree_preferences` SET `value` = 182, `value_type` = 'integer', `updated_at` = '2012-03-14 15:57:27' WHERE `spree_preferences`.`id` = 67 | |
Spree::Preference Load (0.5ms) SELECT `spree_preferences`.* FROM `spree_preferences` WHERE `spree_preferences`.`key` = 'store1/spraycan/app_configuration/favicon_file_guid' LIMIT 1 | |
(0.3ms) UPDATE `spree_preferences` SET `value_type` = 'string', `updated_at` = '2012-03-14 15:57:27' WHERE `spree_preferences`.`id` = 65 | |
Spree::Preference Load (0.7ms) SELECT `spree_preferences`.* FROM `spree_preferences` WHERE `spree_preferences`.`key` = 'store1/spraycan/app_configuration/background_repeat' LIMIT 1 | |
(0.2ms) UPDATE `spree_preferences` SET `value_type` = 'string', `updated_at` = '2012-03-14 15:57:27' WHERE `spree_preferences`.`id` = 72 | |
Spree::Preference Load (0.7ms) SELECT `spree_preferences`.* FROM `spree_preferences` WHERE `spree_preferences`.`key` = 'store1/spraycan/app_configuration/body_font' LIMIT 1 | |
(0.2ms) UPDATE `spree_preferences` SET `value` = 'Ubuntu', `value_type` = 'string', `updated_at` = '2012-03-14 15:57:27' WHERE `spree_preferences`.`id` = 71 | |
Spree::Preference Load (0.7ms) SELECT `spree_preferences`.* FROM `spree_preferences` WHERE `spree_preferences`.`key` = 'store1/spraycan/app_configuration/logo_alignment' LIMIT 1 | |
(0.1ms) UPDATE `spree_preferences` SET `value_type` = 'string', `updated_at` = '2012-03-14 15:57:27' WHERE `spree_preferences`.`id` = 70 | |
Spree::Preference Load (0.7ms) SELECT `spree_preferences`.* FROM `spree_preferences` WHERE `spree_preferences`.`key` = 'store1/spraycan/app_configuration/product_list_header_font_size' LIMIT 1 | |
(0.2ms) UPDATE `spree_preferences` SET `value` = 16, `value_type` = 'integer', `updated_at` = '2012-03-14 15:57:27' WHERE `spree_preferences`.`id` = 74 | |
Spree::Preference Load (0.5ms) SELECT `spree_preferences`.* FROM `spree_preferences` WHERE `spree_preferences`.`key` = 'store1/spraycan/app_configuration/main_navigation_header_font_size' LIMIT 1 | |
(0.4ms) UPDATE `spree_preferences` SET `value` = 16, `value_type` = 'integer', `updated_at` = '2012-03-14 15:57:27' WHERE `spree_preferences`.`id` = 73 | |
Spree::Preference Load (0.7ms) SELECT `spree_preferences`.* FROM `spree_preferences` WHERE `spree_preferences`.`key` = 'store1/spraycan/app_configuration/sub_heading_font_size' LIMIT 1 | |
(0.2ms) UPDATE `spree_preferences` SET `value` = 14, `value_type` = 'integer', `updated_at` = '2012-03-14 15:57:27' WHERE `spree_preferences`.`id` = 76 | |
Spree::Preference Load (0.7ms) SELECT `spree_preferences`.* FROM `spree_preferences` WHERE `spree_preferences`.`key` = 'store1/spraycan/app_configuration/stylesheet_digest' LIMIT 1 | |
(0.3ms) UPDATE `spree_preferences` SET `value` = '22401fe4ce2a6a4c72815afc86baf994', `value_type` = 'string', `updated_at` = '2012-03-14 15:57:27' WHERE `spree_preferences`.`id` = 4 | |
Spree::Preference Load (0.6ms) SELECT `spree_preferences`.* FROM `spree_preferences` WHERE `spree_preferences`.`key` = 'store1/spraycan/app_configuration/button_font_size' LIMIT 1 | |
(0.2ms) UPDATE `spree_preferences` SET `value` = 13, `value_type` = 'integer', `updated_at` = '2012-03-14 15:57:27' WHERE `spree_preferences`.`id` = 75 | |
Spree::Preference Load (0.7ms) SELECT `spree_preferences`.* FROM `spree_preferences` WHERE `spree_preferences`.`key` = 'store1/spraycan/app_configuration/product_detail_description_font_size' LIMIT 1 | |
(0.3ms) UPDATE `spree_preferences` SET `value` = 12, `value_type` = 'integer', `updated_at` = '2012-03-14 15:57:27' WHERE `spree_preferences`.`id` = 78 | |
Spree::Preference Load (0.7ms) SELECT `spree_preferences`.* FROM `spree_preferences` WHERE `spree_preferences`.`key` = 'store1/spraycan/app_configuration/product_detail_price_font_size' LIMIT 1 | |
(0.2ms) UPDATE `spree_preferences` SET `value` = 16, `value_type` = 'integer', `updated_at` = '2012-03-14 15:57:27' WHERE `spree_preferences`.`id` = 77 | |
Spree::Preference Load (0.5ms) SELECT `spree_preferences`.* FROM `spree_preferences` WHERE `spree_preferences`.`key` = 'store1/spraycan/app_configuration/product_detail_name_font_size' LIMIT 1 | |
(0.3ms) UPDATE `spree_preferences` SET `value` = 24, `value_type` = 'integer', `updated_at` = '2012-03-14 15:57:27' WHERE `spree_preferences`.`id` = 79 | |
Spree::Preference Load (0.6ms) SELECT `spree_preferences`.* FROM `spree_preferences` WHERE `spree_preferences`.`key` = 'store1/spraycan/app_configuration/base_font_size' LIMIT 1 | |
(0.2ms) UPDATE `spree_preferences` SET `value` = 12, `value_type` = 'integer', `updated_at` = '2012-03-14 15:57:27' WHERE `spree_preferences`.`id` = 82 | |
Spree::Preference Load (0.5ms) SELECT `spree_preferences`.* FROM `spree_preferences` WHERE `spree_preferences`.`key` = 'store1/spraycan/app_configuration/background_alignment' LIMIT 1 | |
(0.5ms) UPDATE `spree_preferences` SET `value_type` = 'string', `updated_at` = '2012-03-14 15:57:27' WHERE `spree_preferences`.`id` = 80 | |
Spree::Preference Load (0.7ms) SELECT `spree_preferences`.* FROM `spree_preferences` WHERE `spree_preferences`.`key` = 'store1/spraycan/app_configuration/javascript_digest' LIMIT 1 | |
(0.5ms) UPDATE `spree_preferences` SET `value_type` = 'string', `updated_at` = '2012-03-14 15:57:27' WHERE `spree_preferences`.`id` = 81 | |
Spree::Preference Load (0.4ms) SELECT `spree_preferences`.* FROM `spree_preferences` WHERE `spree_preferences`.`key` = 'store1/spraycan/app_configuration/input_box_font_size' LIMIT 1 | |
(0.1ms) UPDATE `spree_preferences` SET `value` = 12, `value_type` = 'integer', `updated_at` = '2012-03-14 15:57:27' WHERE `spree_preferences`.`id` = 84 | |
Spree::Preference Load (0.7ms) SELECT `spree_preferences`.* FROM `spree_preferences` WHERE `spree_preferences`.`key` = 'store1/spraycan/app_configuration/product_list_price_font_size' LIMIT 1 | |
(0.2ms) UPDATE `spree_preferences` SET `value` = 14, `value_type` = 'integer', `updated_at` = '2012-03-14 15:57:27' WHERE `spree_preferences`.`id` = 83 | |
Spree::Preference Load (0.6ms) SELECT `spree_preferences`.* FROM `spree_preferences` WHERE `spree_preferences`.`key` = 'store1/spraycan/app_configuration/product_list_search_font_size' LIMIT 1 | |
(0.2ms) UPDATE `spree_preferences` SET `value` = 14, `value_type` = 'integer', `updated_at` = '2012-03-14 15:57:27' WHERE `spree_preferences`.`id` = 85 | |
Spree::Preference Load (0.6ms) SELECT `spree_preferences`.* FROM `spree_preferences` WHERE `spree_preferences`.`key` = 'store1/spraycan/app_configuration/title_font' LIMIT 1 | |
(0.3ms) UPDATE `spree_preferences` SET `value` = 'Ubuntu', `value_type` = 'string', `updated_at` = '2012-03-14 15:57:27' WHERE `spree_preferences`.`id` = 87 | |
Spree::Preference Load (0.7ms) SELECT `spree_preferences`.* FROM `spree_preferences` WHERE `spree_preferences`.`key` = 'store1/spraycan/app_configuration/header_navigation_font_size' LIMIT 1 | |
(0.4ms) UPDATE `spree_preferences` SET `value` = 16, `value_type` = 'integer', `updated_at` = '2012-03-14 15:57:27' WHERE `spree_preferences`.`id` = 86 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def set(key, value, type) | |
if exist?(key) && value==get(key) | |
#do nothing | |
else | |
@cache.write(key, value) | |
persist(key, value, type) | |
end | |
end | |
private | |
def persist(cache_key, value, type) | |
return unless should_persist? | |
#single update statement no select to find id first | |
Spree::Preference.where(:key => cache_key).update_all(:value => value, :value_type => type) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment