Commit 0c970b187c42ea726e02da8c1183744fdab7a7ce

Authored by Daniela Feitosa
Committed by Antonio Terceiro
1 parent 2c9ff311

ActionItem1218: adding timestamp to environment

   * home page news cache uses cache_key
app/models/environment.rb
@@ -659,7 +659,7 @@ class Environment < ActiveRecord::Base @@ -659,7 +659,7 @@ class Environment < ActiveRecord::Base
659 end 659 end
660 660
661 def portal_news_cache_key 661 def portal_news_cache_key
662 - "home-page-news/#{id}/#{portal_community.id}" 662 + "home-page-news/#{cache_key}"
663 end 663 end
664 664
665 after_create :create_templates 665 after_create :create_templates
db/migrate/073_add_timestamps_in_environment.rb 0 → 100644
@@ -0,0 +1,11 @@ @@ -0,0 +1,11 @@
  1 +class AddTimestampsInEnvironment < ActiveRecord::Migration
  2 + def self.up
  3 + add_timestamps(:environments)
  4 + execute "update environments set created_at = 'Thu Aug 06 14:07:04 -0300 2009'"
  5 + execute 'update environments set updated_at = created_at'
  6 + end
  7 +
  8 + def self.down
  9 + remove_timestamps(:environments)
  10 + end
  11 +end
@@ -9,7 +9,7 @@ @@ -9,7 +9,7 @@
9 # 9 #
10 # It's strongly recommended to check this file into your version control system. 10 # It's strongly recommended to check this file into your version control system.
11 11
12 -ActiveRecord::Schema.define(:version => 72) do 12 +ActiveRecord::Schema.define(:version => 73) do
13 13
14 create_table "article_versions", :force => true do |t| 14 create_table "article_versions", :force => true do |t|
15 t.integer "article_id" 15 t.integer "article_id"
@@ -92,12 +92,11 @@ ActiveRecord::Schema.define(:version =&gt; 72) do @@ -92,12 +92,11 @@ ActiveRecord::Schema.define(:version =&gt; 72) do
92 add_index "articles_categories", ["category_id"], :name => "index_articles_categories_on_category_id" 92 add_index "articles_categories", ["category_id"], :name => "index_articles_categories_on_category_id"
93 93
94 create_table "blocks", :force => true do |t| 94 create_table "blocks", :force => true do |t|
95 - t.string "title"  
96 - t.integer "box_id"  
97 - t.string "type"  
98 - t.text "settings"  
99 - t.integer "position"  
100 - t.datetime "last_updated" 95 + t.string "title"
  96 + t.integer "box_id"
  97 + t.string "type"
  98 + t.text "settings"
  99 + t.integer "position"
101 end 100 end
102 101
103 add_index "blocks", ["box_id"], :name => "index_blocks_on_box_id" 102 add_index "blocks", ["box_id"], :name => "index_blocks_on_box_id"
@@ -157,26 +156,28 @@ ActiveRecord::Schema.define(:version =&gt; 72) do @@ -157,26 +156,28 @@ ActiveRecord::Schema.define(:version =&gt; 72) do
157 end 156 end
158 157
159 create_table "environments", :force => true do |t| 158 create_table "environments", :force => true do |t|
160 - t.string "name"  
161 - t.string "contact_email"  
162 - t.boolean "is_default"  
163 - t.text "settings"  
164 - t.text "design_data"  
165 - t.text "custom_header"  
166 - t.text "custom_footer"  
167 - t.string "theme"  
168 - t.text "terms_of_use_acceptance_text" 159 + t.string "name"
  160 + t.string "contact_email"
  161 + t.boolean "is_default"
  162 + t.text "settings"
  163 + t.text "design_data"
  164 + t.text "custom_header"
  165 + t.text "custom_footer"
  166 + t.string "theme"
  167 + t.text "terms_of_use_acceptance_text"
  168 + t.datetime "created_at"
  169 + t.datetime "updated_at"
169 end 170 end
170 171
171 create_table "external_feeds", :force => true do |t| 172 create_table "external_feeds", :force => true do |t|
172 t.string "feed_title" 173 t.string "feed_title"
  174 + t.date "fetched_at"
173 t.string "address" 175 t.string "address"
174 t.integer "blog_id", :null => false 176 t.integer "blog_id", :null => false
175 t.boolean "enabled", :default => true, :null => false 177 t.boolean "enabled", :default => true, :null => false
176 t.boolean "only_once", :default => true, :null => false 178 t.boolean "only_once", :default => true, :null => false
177 t.datetime "created_at" 179 t.datetime "created_at"
178 t.datetime "updated_at" 180 t.datetime "updated_at"
179 - t.datetime "fetched_at"  
180 end 181 end
181 182
182 create_table "favorite_enteprises_people", :id => false, :force => true do |t| 183 create_table "favorite_enteprises_people", :id => false, :force => true do |t|
@@ -279,9 +280,9 @@ ActiveRecord::Schema.define(:version =&gt; 72) do @@ -279,9 +280,9 @@ ActiveRecord::Schema.define(:version =&gt; 72) do
279 280
280 create_table "roles", :force => true do |t| 281 create_table "roles", :force => true do |t|
281 t.string "name" 282 t.string "name"
282 - t.text "permissions" 283 + t.text "permissions", :limit => 255
283 t.string "key" 284 t.string "key"
284 - t.boolean "system", :default => false 285 + t.boolean "system", :default => false
285 t.integer "environment_id" 286 t.integer "environment_id"
286 end 287 end
287 288