Commit 44c5519f51538f736ccb51c9196ccb8ddb1a481f

Authored by Victor Costa
2 parents d26eed6e e65387e7

Merge branch 'master' into staging_rails4

Conflicts:
	app/models/environment.rb
	app/views/profile_editor/_person.html.erb
	db/schema.rb
	lib/noosfero/api/v1/comments.rb
	lib/noosfero/api/v1/people.rb
	test/unit/api/people_test.rb
config/environments/production.rb
@@ -44,7 +44,7 @@ Noosfero::Application.configure do @@ -44,7 +44,7 @@ Noosfero::Application.configure do
44 # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new) 44 # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
45 45
46 # Use a different cache store in production 46 # Use a different cache store in production
47 - config.cache_store = :dalli_store, "127.0.0.1:11211" 47 + config.cache_store = :dalli_store, "127.0.0.1:11211", { :namespace => "noosfero/#{Noosfero::VERSION}" }
48 48
49 # Enable serving of images, stylesheets, and javascripts from an asset server 49 # Enable serving of images, stylesheets, and javascripts from an asset server
50 # config.action_controller.asset_host = "http://assets.example.com" 50 # config.action_controller.asset_host = "http://assets.example.com"
@@ -9,11 +9,14 @@ @@ -9,11 +9,14 @@
9 # from scratch. The latter is a flawed and unsustainable approach (the more migrations 9 # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10 # you'll amass, the slower it'll run and the greater likelihood for issues). 10 # you'll amass, the slower it'll run and the greater likelihood for issues).
11 # 11 #
12 -# It's strongly recommended to check this file into your version control system. 12 +# It's strongly recommended that you check this file into your version control system.
13 13
14 -ActiveRecord::Schema.define(:version => 20150918005035) do 14 +ActiveRecord::Schema.define(version: 20150921140802) do
15 15
16 - create_table "abuse_reports", :force => true do |t| 16 + # These are extensions that must be enabled in order to support this database
  17 + enable_extension "plpgsql"
  18 +
  19 + create_table "abuse_reports", force: :cascade do |t|
17 t.integer "reporter_id" 20 t.integer "reporter_id"
18 t.integer "abuse_complaint_id" 21 t.integer "abuse_complaint_id"
19 t.text "content" 22 t.text "content"
@@ -22,7 +25,7 @@ ActiveRecord::Schema.define(:version => 20150918005035) do @@ -22,7 +25,7 @@ ActiveRecord::Schema.define(:version => 20150918005035) do
22 t.datetime "updated_at" 25 t.datetime "updated_at"
23 end 26 end
24 27
25 - create_table "action_tracker", :force => true do |t| 28 + create_table "action_tracker", force: :cascade do |t|
26 t.integer "user_id" 29 t.integer "user_id"
27 t.string "user_type" 30 t.string "user_type"
28 t.integer "target_id" 31 t.integer "target_id"
@@ -31,46 +34,34 @@ ActiveRecord::Schema.define(:version => 20150918005035) do @@ -31,46 +34,34 @@ ActiveRecord::Schema.define(:version => 20150918005035) do
31 t.string "verb" 34 t.string "verb"
32 t.datetime "created_at" 35 t.datetime "created_at"
33 t.datetime "updated_at" 36 t.datetime "updated_at"
34 - t.integer "comments_count", :default => 0  
35 - t.boolean "visible", :default => true 37 + t.integer "comments_count", default: 0
  38 + t.boolean "visible", default: true
36 end 39 end
37 40
38 - add_index "action_tracker", ["target_id", "target_type"], :name => "index_action_tracker_on_dispatcher_id_and_dispatcher_type"  
39 - add_index "action_tracker", ["user_id", "user_type"], :name => "index_action_tracker_on_user_id_and_user_type"  
40 - add_index "action_tracker", ["verb"], :name => "index_action_tracker_on_verb" 41 + add_index "action_tracker", ["target_id", "target_type"], name: "index_action_tracker_on_dispatcher_id_and_dispatcher_type", using: :btree
  42 + add_index "action_tracker", ["user_id", "user_type"], name: "index_action_tracker_on_user_id_and_user_type", using: :btree
  43 + add_index "action_tracker", ["verb"], name: "index_action_tracker_on_verb", using: :btree
41 44
42 - create_table "action_tracker_notifications", :force => true do |t| 45 + create_table "action_tracker_notifications", force: :cascade do |t|
43 t.integer "action_tracker_id" 46 t.integer "action_tracker_id"
44 t.integer "profile_id" 47 t.integer "profile_id"
45 end 48 end
46 49
47 - add_index "action_tracker_notifications", ["action_tracker_id"], :name => "index_action_tracker_notifications_on_action_tracker_id"  
48 - add_index "action_tracker_notifications", ["profile_id", "action_tracker_id"], :name => "index_action_tracker_notif_on_prof_id_act_tracker_id", :unique => true  
49 - add_index "action_tracker_notifications", ["profile_id"], :name => "index_action_tracker_notifications_on_profile_id"  
50 -  
51 - create_table "article_followers", :force => true do |t|  
52 - t.integer "person_id", :null => false  
53 - t.integer "article_id", :null => false  
54 - t.datetime "since"  
55 - t.datetime "created_at", :null => false  
56 - t.datetime "updated_at", :null => false  
57 - end  
58 -  
59 - add_index "article_followers", ["article_id"], :name => "index_article_followers_on_article_id"  
60 - add_index "article_followers", ["person_id", "article_id"], :name => "index_article_followers_on_person_id_and_article_id", :unique => true  
61 - add_index "article_followers", ["person_id"], :name => "index_article_followers_on_person_id" 50 + add_index "action_tracker_notifications", ["action_tracker_id"], name: "index_action_tracker_notifications_on_action_tracker_id", using: :btree
  51 + add_index "action_tracker_notifications", ["profile_id", "action_tracker_id"], name: "index_action_tracker_notif_on_prof_id_act_tracker_id", unique: true, using: :btree
  52 + add_index "action_tracker_notifications", ["profile_id"], name: "index_action_tracker_notifications_on_profile_id", using: :btree
62 53
63 - create_table "article_privacy_exceptions", :id => false, :force => true do |t| 54 + create_table "article_privacy_exceptions", id: false, force: :cascade do |t|
64 t.integer "article_id" 55 t.integer "article_id"
65 t.integer "person_id" 56 t.integer "person_id"
66 end 57 end
67 58
68 - create_table "article_versions", :force => true do |t| 59 + create_table "article_versions", force: :cascade do |t|
69 t.integer "article_id" 60 t.integer "article_id"
70 t.integer "version" 61 t.integer "version"
71 t.string "name" 62 t.string "name"
72 t.string "slug" 63 t.string "slug"
73 - t.text "path", :default => "" 64 + t.text "path", default: ""
74 t.integer "parent_id" 65 t.integer "parent_id"
75 t.text "body" 66 t.text "body"
76 t.text "abstract" 67 t.text "abstract"
@@ -85,44 +76,43 @@ ActiveRecord::Schema.define(:version => 20150918005035) do @@ -85,44 +76,43 @@ ActiveRecord::Schema.define(:version => 20150918005035) do
85 t.integer "width" 76 t.integer "width"
86 t.string "versioned_type" 77 t.string "versioned_type"
87 t.integer "comments_count" 78 t.integer "comments_count"
88 - t.boolean "advertise", :default => true  
89 - t.boolean "published", :default => true 79 + t.boolean "advertise", default: true
  80 + t.boolean "published", default: true
90 t.datetime "start_date" 81 t.datetime "start_date"
91 t.datetime "end_date" 82 t.datetime "end_date"
92 - t.integer "children_count", :default => 0  
93 - t.boolean "accept_comments", :default => true 83 + t.integer "children_count", default: 0
  84 + t.boolean "accept_comments", default: true
94 t.integer "reference_article_id" 85 t.integer "reference_article_id"
95 t.text "setting" 86 t.text "setting"
96 - t.boolean "notify_comments", :default => false  
97 - t.integer "hits", :default => 0 87 + t.boolean "notify_comments", default: false
  88 + t.integer "hits", default: 0
98 t.datetime "published_at" 89 t.datetime "published_at"
99 t.string "source" 90 t.string "source"
100 - t.boolean "highlighted", :default => false 91 + t.boolean "highlighted", default: false
101 t.string "external_link" 92 t.string "external_link"
102 - t.boolean "thumbnails_processed", :default => false  
103 - t.boolean "is_image", :default => false 93 + t.boolean "thumbnails_processed", default: false
  94 + t.boolean "is_image", default: false
104 t.integer "translation_of_id" 95 t.integer "translation_of_id"
105 t.string "language" 96 t.string "language"
106 t.string "source_name" 97 t.string "source_name"
107 t.integer "license_id" 98 t.integer "license_id"
108 t.integer "image_id" 99 t.integer "image_id"
109 t.integer "position" 100 t.integer "position"
110 - t.integer "spam_comments_count", :default => 0 101 + t.integer "spam_comments_count", default: 0
111 t.integer "author_id" 102 t.integer "author_id"
112 t.integer "created_by_id" 103 t.integer "created_by_id"
113 - t.integer "followers_count"  
114 end 104 end
115 105
116 - add_index "article_versions", ["article_id"], :name => "index_article_versions_on_article_id"  
117 - add_index "article_versions", ["parent_id"], :name => "index_article_versions_on_parent_id"  
118 - add_index "article_versions", ["path", "profile_id"], :name => "index_article_versions_on_path_and_profile_id"  
119 - add_index "article_versions", ["path"], :name => "index_article_versions_on_path"  
120 - add_index "article_versions", ["published_at", "id"], :name => "index_article_versions_on_published_at_and_id" 106 + add_index "article_versions", ["article_id"], name: "index_article_versions_on_article_id", using: :btree
  107 + add_index "article_versions", ["parent_id"], name: "index_article_versions_on_parent_id", using: :btree
  108 + add_index "article_versions", ["path", "profile_id"], name: "index_article_versions_on_path_and_profile_id", using: :btree
  109 + add_index "article_versions", ["path"], name: "index_article_versions_on_path", using: :btree
  110 + add_index "article_versions", ["published_at", "id"], name: "index_article_versions_on_published_at_and_id", using: :btree
121 111
122 - create_table "articles", :force => true do |t| 112 + create_table "articles", force: :cascade do |t|
123 t.string "name" 113 t.string "name"
124 t.string "slug" 114 t.string "slug"
125 - t.text "path", :default => "" 115 + t.text "path", default: ""
126 t.integer "parent_id" 116 t.integer "parent_id"
127 t.text "body" 117 t.text "body"
128 t.text "abstract" 118 t.text "abstract"
@@ -137,133 +127,119 @@ ActiveRecord::Schema.define(:version => 20150918005035) do @@ -137,133 +127,119 @@ ActiveRecord::Schema.define(:version => 20150918005035) do
137 t.string "filename" 127 t.string "filename"
138 t.integer "height" 128 t.integer "height"
139 t.integer "width" 129 t.integer "width"
140 - t.integer "comments_count", :default => 0  
141 - t.boolean "advertise", :default => true  
142 - t.boolean "published", :default => true 130 + t.integer "comments_count", default: 0
  131 + t.boolean "advertise", default: true
  132 + t.boolean "published", default: true
143 t.datetime "start_date" 133 t.datetime "start_date"
144 t.datetime "end_date" 134 t.datetime "end_date"
145 - t.integer "children_count", :default => 0  
146 - t.boolean "accept_comments", :default => true 135 + t.integer "children_count", default: 0
  136 + t.boolean "accept_comments", default: true
147 t.integer "reference_article_id" 137 t.integer "reference_article_id"
148 t.text "setting" 138 t.text "setting"
149 - t.boolean "notify_comments", :default => true  
150 - t.integer "hits", :default => 0 139 + t.boolean "notify_comments", default: true
  140 + t.integer "hits", default: 0
151 t.datetime "published_at" 141 t.datetime "published_at"
152 t.string "source" 142 t.string "source"
153 - t.boolean "highlighted", :default => false 143 + t.boolean "highlighted", default: false
154 t.string "external_link" 144 t.string "external_link"
155 - t.boolean "thumbnails_processed", :default => false  
156 - t.boolean "is_image", :default => false 145 + t.boolean "thumbnails_processed", default: false
  146 + t.boolean "is_image", default: false
157 t.integer "translation_of_id" 147 t.integer "translation_of_id"
158 t.string "language" 148 t.string "language"
159 t.string "source_name" 149 t.string "source_name"
160 t.integer "license_id" 150 t.integer "license_id"
161 t.integer "image_id" 151 t.integer "image_id"
162 t.integer "position" 152 t.integer "position"
163 - t.integer "spam_comments_count", :default => 0 153 + t.integer "spam_comments_count", default: 0
164 t.integer "author_id" 154 t.integer "author_id"
165 t.integer "created_by_id" 155 t.integer "created_by_id"
166 - t.boolean "show_to_followers", :default => true  
167 - t.integer "sash_id"  
168 - t.integer "level", :default => 0  
169 - t.integer "followers_count", :default => 0  
170 - end  
171 -  
172 - add_index "articles", ["comments_count"], :name => "index_articles_on_comments_count"  
173 - add_index "articles", ["created_at"], :name => "index_articles_on_created_at"  
174 - add_index "articles", ["hits"], :name => "index_articles_on_hits"  
175 - add_index "articles", ["name"], :name => "index_articles_on_name"  
176 - add_index "articles", ["parent_id"], :name => "index_articles_on_parent_id"  
177 - add_index "articles", ["path", "profile_id"], :name => "index_articles_on_path_and_profile_id"  
178 - add_index "articles", ["path"], :name => "index_articles_on_path"  
179 - add_index "articles", ["profile_id"], :name => "index_articles_on_profile_id"  
180 - add_index "articles", ["published_at", "id"], :name => "index_articles_on_published_at_and_id"  
181 - add_index "articles", ["slug"], :name => "index_articles_on_slug"  
182 - add_index "articles", ["translation_of_id"], :name => "index_articles_on_translation_of_id"  
183 - add_index "articles", ["type", "parent_id"], :name => "index_articles_on_type_and_parent_id"  
184 - add_index "articles", ["type", "profile_id"], :name => "index_articles_on_type_and_profile_id"  
185 - add_index "articles", ["type"], :name => "index_articles_on_type"  
186 -  
187 - create_table "articles_categories", :id => false, :force => true do |t| 156 + t.boolean "show_to_followers", default: true
  157 + end
  158 +
  159 + add_index "articles", ["comments_count"], name: "index_articles_on_comments_count", using: :btree
  160 + add_index "articles", ["created_at"], name: "index_articles_on_created_at", using: :btree
  161 + add_index "articles", ["hits"], name: "index_articles_on_hits", using: :btree
  162 + add_index "articles", ["name"], name: "index_articles_on_name", using: :btree
  163 + add_index "articles", ["parent_id"], name: "index_articles_on_parent_id", using: :btree
  164 + add_index "articles", ["path", "profile_id"], name: "index_articles_on_path_and_profile_id", using: :btree
  165 + add_index "articles", ["path"], name: "index_articles_on_path", using: :btree
  166 + add_index "articles", ["profile_id"], name: "index_articles_on_profile_id", using: :btree
  167 + add_index "articles", ["published_at", "id"], name: "index_articles_on_published_at_and_id", using: :btree
  168 + add_index "articles", ["slug"], name: "index_articles_on_slug", using: :btree
  169 + add_index "articles", ["translation_of_id"], name: "index_articles_on_translation_of_id", using: :btree
  170 + add_index "articles", ["type", "parent_id"], name: "index_articles_on_type_and_parent_id", using: :btree
  171 + add_index "articles", ["type", "profile_id"], name: "index_articles_on_type_and_profile_id", using: :btree
  172 + add_index "articles", ["type"], name: "index_articles_on_type", using: :btree
  173 +
  174 + create_table "articles_categories", id: false, force: :cascade do |t|
188 t.integer "article_id" 175 t.integer "article_id"
189 t.integer "category_id" 176 t.integer "category_id"
190 - t.boolean "virtual", :default => false  
191 - end  
192 -  
193 - add_index "articles_categories", ["article_id"], :name => "index_articles_categories_on_article_id"  
194 - add_index "articles_categories", ["category_id"], :name => "index_articles_categories_on_category_id"  
195 -  
196 - create_table "badges_sashes", :force => true do |t|  
197 - t.integer "badge_id"  
198 - t.integer "sash_id"  
199 - t.boolean "notified_user", :default => false  
200 - t.datetime "created_at" 177 + t.boolean "virtual", default: false
201 end 178 end
202 179
203 - add_index "badges_sashes", ["badge_id", "sash_id"], :name => "index_badges_sashes_on_badge_id_and_sash_id"  
204 - add_index "badges_sashes", ["badge_id"], :name => "index_badges_sashes_on_badge_id"  
205 - add_index "badges_sashes", ["sash_id"], :name => "index_badges_sashes_on_sash_id" 180 + add_index "articles_categories", ["article_id"], name: "index_articles_categories_on_article_id", using: :btree
  181 + add_index "articles_categories", ["category_id"], name: "index_articles_categories_on_category_id", using: :btree
206 182
207 - create_table "blocks", :force => true do |t| 183 + create_table "blocks", force: :cascade do |t|
208 t.string "title" 184 t.string "title"
209 t.integer "box_id" 185 t.integer "box_id"
210 t.string "type" 186 t.string "type"
211 t.text "settings" 187 t.text "settings"
212 t.integer "position" 188 t.integer "position"
213 - t.boolean "enabled", :default => true 189 + t.boolean "enabled", default: true
214 t.datetime "created_at" 190 t.datetime "created_at"
215 t.datetime "updated_at" 191 t.datetime "updated_at"
216 t.datetime "fetched_at" 192 t.datetime "fetched_at"
217 - t.boolean "mirror", :default => false 193 + t.boolean "mirror", default: false
218 t.integer "mirror_block_id" 194 t.integer "mirror_block_id"
219 t.integer "observers_id" 195 t.integer "observers_id"
220 end 196 end
221 197
222 - add_index "blocks", ["box_id"], :name => "index_blocks_on_box_id"  
223 - add_index "blocks", ["enabled"], :name => "index_blocks_on_enabled"  
224 - add_index "blocks", ["fetched_at"], :name => "index_blocks_on_fetched_at"  
225 - add_index "blocks", ["type"], :name => "index_blocks_on_type" 198 + add_index "blocks", ["box_id"], name: "index_blocks_on_box_id", using: :btree
  199 + add_index "blocks", ["enabled"], name: "index_blocks_on_enabled", using: :btree
  200 + add_index "blocks", ["fetched_at"], name: "index_blocks_on_fetched_at", using: :btree
  201 + add_index "blocks", ["type"], name: "index_blocks_on_type", using: :btree
226 202
227 - create_table "boxes", :force => true do |t| 203 + create_table "boxes", force: :cascade do |t|
228 t.string "owner_type" 204 t.string "owner_type"
229 t.integer "owner_id" 205 t.integer "owner_id"
230 t.integer "position" 206 t.integer "position"
231 end 207 end
232 208
233 - add_index "boxes", ["owner_id", "owner_type"], :name => "index_boxes_on_owner_type_and_owner_id" 209 + add_index "boxes", ["owner_id", "owner_type"], name: "index_boxes_on_owner_type_and_owner_id", using: :btree
234 210
235 - create_table "categories", :force => true do |t| 211 + create_table "categories", force: :cascade do |t|
236 t.string "name" 212 t.string "name"
237 t.string "slug" 213 t.string "slug"
238 - t.text "path", :default => "" 214 + t.text "path", default: ""
239 t.integer "environment_id" 215 t.integer "environment_id"
240 t.integer "parent_id" 216 t.integer "parent_id"
241 t.string "type" 217 t.string "type"
242 t.float "lat" 218 t.float "lat"
243 t.float "lng" 219 t.float "lng"
244 - t.boolean "display_in_menu", :default => false  
245 - t.integer "children_count", :default => 0  
246 - t.boolean "accept_products", :default => true 220 + t.boolean "display_in_menu", default: false
  221 + t.integer "children_count", default: 0
  222 + t.boolean "accept_products", default: true
247 t.integer "image_id" 223 t.integer "image_id"
248 t.string "acronym" 224 t.string "acronym"
249 t.string "abbreviation" 225 t.string "abbreviation"
250 - t.string "display_color", :limit => 6 226 + t.string "display_color", limit: 6
251 t.text "ancestry" 227 t.text "ancestry"
252 end 228 end
253 229
254 - add_index "categories", ["parent_id"], :name => "index_categories_on_parent_id" 230 + add_index "categories", ["parent_id"], name: "index_categories_on_parent_id", using: :btree
255 231
256 - create_table "categories_profiles", :id => false, :force => true do |t| 232 + create_table "categories_profiles", id: false, force: :cascade do |t|
257 t.integer "profile_id" 233 t.integer "profile_id"
258 t.integer "category_id" 234 t.integer "category_id"
259 - t.boolean "virtual", :default => false 235 + t.boolean "virtual", default: false
260 end 236 end
261 237
262 - add_index "categories_profiles", ["category_id"], :name => "index_categories_profiles_on_category_id"  
263 - add_index "categories_profiles", ["profile_id"], :name => "index_categories_profiles_on_profile_id" 238 + add_index "categories_profiles", ["category_id"], name: "index_categories_profiles_on_category_id", using: :btree
  239 + add_index "categories_profiles", ["profile_id"], name: "index_categories_profiles_on_profile_id", using: :btree
264 240
265 - create_table "certifiers", :force => true do |t|  
266 - t.string "name", :null => false 241 + create_table "certifiers", force: :cascade do |t|
  242 + t.string "name", null: false
267 t.text "description" 243 t.text "description"
268 t.string "link" 244 t.string "link"
269 t.integer "environment_id" 245 t.integer "environment_id"
@@ -271,19 +247,19 @@ ActiveRecord::Schema.define(:version => 20150918005035) do @@ -271,19 +247,19 @@ ActiveRecord::Schema.define(:version => 20150918005035) do
271 t.datetime "updated_at" 247 t.datetime "updated_at"
272 end 248 end
273 249
274 - create_table "chat_messages", :force => true do |t|  
275 - t.integer "from_id", :null => false  
276 - t.integer "to_id", :null => false 250 + create_table "chat_messages", force: :cascade do |t|
  251 + t.integer "from_id", null: false
  252 + t.integer "to_id", null: false
277 t.text "body" 253 t.text "body"
278 - t.datetime "created_at", :null => false  
279 - t.datetime "updated_at", :null => false 254 + t.datetime "created_at", null: false
  255 + t.datetime "updated_at", null: false
280 end 256 end
281 257
282 - add_index "chat_messages", ["created_at"], :name => "index_chat_messages_on_created_at"  
283 - add_index "chat_messages", ["from_id"], :name => "index_chat_messages_on_from_id"  
284 - add_index "chat_messages", ["to_id"], :name => "index_chat_messages_on_to_id" 258 + add_index "chat_messages", ["created_at"], name: "index_chat_messages_on_created_at", using: :btree
  259 + add_index "chat_messages", ["from_id"], name: "index_chat_messages_on_from_id", using: :btree
  260 + add_index "chat_messages", ["to_id"], name: "index_chat_messages_on_to_id", using: :btree
285 261
286 - create_table "comments", :force => true do |t| 262 + create_table "comments", force: :cascade do |t|
287 t.string "title" 263 t.string "title"
288 t.text "body" 264 t.text "body"
289 t.integer "source_id" 265 t.integer "source_id"
@@ -298,24 +274,49 @@ ActiveRecord::Schema.define(:version => 20150918005035) do @@ -298,24 +274,49 @@ ActiveRecord::Schema.define(:version => 20150918005035) do
298 t.string "user_agent" 274 t.string "user_agent"
299 t.string "referrer" 275 t.string "referrer"
300 t.text "settings" 276 t.text "settings"
301 - t.integer "paragraph_id"  
302 - t.string "paragraph_uuid"  
303 end 277 end
304 278
305 - add_index "comments", ["paragraph_uuid"], :name => "index_comments_on_paragraph_uuid"  
306 - add_index "comments", ["source_id", "spam"], :name => "index_comments_on_source_id_and_spam" 279 + add_index "comments", ["source_id", "spam"], name: "index_comments_on_source_id_and_spam", using: :btree
307 280
308 - create_table "contact_lists", :force => true do |t| 281 + create_table "contact_lists", force: :cascade do |t|
309 t.text "list" 282 t.text "list"
310 t.string "error_fetching" 283 t.string "error_fetching"
311 - t.boolean "fetched", :default => false 284 + t.boolean "fetched", default: false
  285 + t.datetime "created_at"
  286 + t.datetime "updated_at"
  287 + end
  288 +
  289 + create_table "custom_field_values", force: :cascade do |t|
  290 + t.string "customized_type", default: "", null: false
  291 + t.integer "customized_id", default: 0, null: false
  292 + t.boolean "public", default: false, null: false
  293 + t.integer "custom_field_id", default: 0, null: false
  294 + t.text "value", default: ""
  295 + t.datetime "created_at"
  296 + t.datetime "updated_at"
  297 + end
  298 +
  299 + add_index "custom_field_values", ["customized_type", "customized_id", "custom_field_id"], name: "index_custom_field_values", unique: true, using: :btree
  300 +
  301 + create_table "custom_fields", force: :cascade do |t|
  302 + t.string "name"
  303 + t.string "format", default: ""
  304 + t.text "default_value", default: ""
  305 + t.string "customized_type"
  306 + t.text "extras", default: ""
  307 + t.boolean "active", default: false
  308 + t.boolean "required", default: false
  309 + t.boolean "signup", default: false
  310 + t.integer "environment_id"
312 t.datetime "created_at" 311 t.datetime "created_at"
313 t.datetime "updated_at" 312 t.datetime "updated_at"
314 end 313 end
315 314
316 - create_table "delayed_jobs", :force => true do |t|  
317 - t.integer "priority", :default => 0  
318 - t.integer "attempts", :default => 0 315 + add_index "custom_fields", ["customized_type", "name", "environment_id"], name: "index_custom_field", unique: true, using: :btree
  316 +
  317 + create_table "delayed_jobs", force: :cascade do |t|
  318 + t.integer "priority", default: 0
  319 + t.integer "attempts", default: 0
319 t.text "handler" 320 t.text "handler"
320 t.text "last_error" 321 t.text "last_error"
321 t.datetime "run_at" 322 t.datetime "run_at"
@@ -327,33 +328,22 @@ ActiveRecord::Schema.define(:version => 20150918005035) do @@ -327,33 +328,22 @@ ActiveRecord::Schema.define(:version => 20150918005035) do
327 t.string "queue" 328 t.string "queue"
328 end 329 end
329 330
330 - add_index "delayed_jobs", ["priority", "run_at"], :name => "delayed_jobs_priority" 331 + add_index "delayed_jobs", ["priority", "run_at"], name: "delayed_jobs_priority", using: :btree
331 332
332 - create_table "domains", :force => true do |t| 333 + create_table "domains", force: :cascade do |t|
333 t.string "name" 334 t.string "name"
334 t.string "owner_type" 335 t.string "owner_type"
335 t.integer "owner_id" 336 t.integer "owner_id"
336 - t.boolean "is_default", :default => false 337 + t.boolean "is_default", default: false
337 t.string "google_maps_key" 338 t.string "google_maps_key"
338 end 339 end
339 340
340 - add_index "domains", ["is_default"], :name => "index_domains_on_is_default"  
341 - add_index "domains", ["name"], :name => "index_domains_on_name"  
342 - add_index "domains", ["owner_id", "owner_type", "is_default"], :name => "index_domains_on_owner_id_and_owner_type_and_is_default"  
343 - add_index "domains", ["owner_id", "owner_type"], :name => "index_domains_on_owner_id_and_owner_type"  
344 -  
345 - create_table "email_templates", :force => true do |t|  
346 - t.string "name"  
347 - t.string "template_type"  
348 - t.string "subject"  
349 - t.text "body"  
350 - t.integer "owner_id"  
351 - t.string "owner_type"  
352 - t.datetime "created_at", :null => false  
353 - t.datetime "updated_at", :null => false  
354 - end 341 + add_index "domains", ["is_default"], name: "index_domains_on_is_default", using: :btree
  342 + add_index "domains", ["name"], name: "index_domains_on_name", using: :btree
  343 + add_index "domains", ["owner_id", "owner_type", "is_default"], name: "index_domains_on_owner_id_and_owner_type_and_is_default", using: :btree
  344 + add_index "domains", ["owner_id", "owner_type"], name: "index_domains_on_owner_id_and_owner_type", using: :btree
355 345
356 - create_table "environments", :force => true do |t| 346 + create_table "environments", force: :cascade do |t|
357 t.string "name" 347 t.string "name"
358 t.string "contact_email" 348 t.string "contact_email"
359 t.boolean "is_default" 349 t.boolean "is_default"
@@ -361,73 +351,60 @@ ActiveRecord::Schema.define(:version => 20150918005035) do @@ -361,73 +351,60 @@ ActiveRecord::Schema.define(:version => 20150918005035) do
361 t.text "design_data" 351 t.text "design_data"
362 t.text "custom_header" 352 t.text "custom_header"
363 t.text "custom_footer" 353 t.text "custom_footer"
364 - t.string "theme", :default => "default", :null => false 354 + t.string "theme", default: "default", null: false
365 t.text "terms_of_use_acceptance_text" 355 t.text "terms_of_use_acceptance_text"
366 t.datetime "created_at" 356 t.datetime "created_at"
367 t.datetime "updated_at" 357 t.datetime "updated_at"
368 - t.integer "reports_lower_bound", :default => 0, :null => false  
369 - t.string "redirection_after_login", :default => "keep_on_same_page" 358 + t.integer "reports_lower_bound", default: 0, null: false
  359 + t.string "redirection_after_login", default: "keep_on_same_page"
370 t.text "signup_welcome_text" 360 t.text "signup_welcome_text"
371 t.string "languages" 361 t.string "languages"
372 t.string "default_language" 362 t.string "default_language"
373 t.string "noreply_email" 363 t.string "noreply_email"
374 - t.string "redirection_after_signup", :default => "keep_on_same_page"  
375 - t.text "send_email_plugin_allow_to"  
376 - t.string "date_format", :default => "month_name_with_year" 364 + t.string "redirection_after_signup", default: "keep_on_same_page"
  365 + t.string "date_format", default: "month_name_with_year"
377 end 366 end
378 367
379 - create_table "external_feeds", :force => true do |t| 368 + create_table "external_feeds", force: :cascade do |t|
380 t.string "feed_title" 369 t.string "feed_title"
381 t.datetime "fetched_at" 370 t.datetime "fetched_at"
382 t.text "address" 371 t.text "address"
383 - t.integer "blog_id", :null => false  
384 - t.boolean "enabled", :default => true, :null => false  
385 - t.boolean "only_once", :default => true, :null => false 372 + t.integer "blog_id", null: false
  373 + t.boolean "enabled", default: true, null: false
  374 + t.boolean "only_once", default: true, null: false
386 t.datetime "created_at" 375 t.datetime "created_at"
387 t.datetime "updated_at" 376 t.datetime "updated_at"
388 t.text "error_message" 377 t.text "error_message"
389 - t.integer "update_errors", :default => 0 378 + t.integer "update_errors", default: 0
390 end 379 end
391 380
392 - add_index "external_feeds", ["blog_id"], :name => "index_external_feeds_on_blog_id"  
393 - add_index "external_feeds", ["enabled"], :name => "index_external_feeds_on_enabled"  
394 - add_index "external_feeds", ["fetched_at"], :name => "index_external_feeds_on_fetched_at" 381 + add_index "external_feeds", ["blog_id"], name: "index_external_feeds_on_blog_id", using: :btree
  382 + add_index "external_feeds", ["enabled"], name: "index_external_feeds_on_enabled", using: :btree
  383 + add_index "external_feeds", ["fetched_at"], name: "index_external_feeds_on_fetched_at", using: :btree
395 384
396 - create_table "favorite_enterprise_people", :force => true do |t| 385 + create_table "favorite_enterprise_people", force: :cascade do |t|
397 t.integer "person_id" 386 t.integer "person_id"
398 t.integer "enterprise_id" 387 t.integer "enterprise_id"
399 t.datetime "created_at" 388 t.datetime "created_at"
400 t.datetime "updated_at" 389 t.datetime "updated_at"
401 end 390 end
402 391
403 - add_index "favorite_enterprise_people", ["enterprise_id"], :name => "index_favorite_enterprise_people_on_enterprise_id"  
404 - add_index "favorite_enterprise_people", ["person_id", "enterprise_id"], :name => "index_favorite_enterprise_people_on_person_id_and_enterprise_id"  
405 - add_index "favorite_enterprise_people", ["person_id"], :name => "index_favorite_enterprise_people_on_person_id" 392 + add_index "favorite_enterprise_people", ["enterprise_id"], name: "index_favorite_enterprise_people_on_enterprise_id", using: :btree
  393 + add_index "favorite_enterprise_people", ["person_id", "enterprise_id"], name: "index_favorite_enterprise_people_on_person_id_and_enterprise_id", using: :btree
  394 + add_index "favorite_enterprise_people", ["person_id"], name: "index_favorite_enterprise_people_on_person_id", using: :btree
406 395
407 - create_table "friendships", :force => true do |t| 396 + create_table "friendships", force: :cascade do |t|
408 t.integer "person_id" 397 t.integer "person_id"
409 t.integer "friend_id" 398 t.integer "friend_id"
410 t.datetime "created_at" 399 t.datetime "created_at"
411 t.string "group" 400 t.string "group"
412 end 401 end
413 402
414 - add_index "friendships", ["friend_id"], :name => "index_friendships_on_friend_id"  
415 - add_index "friendships", ["person_id", "friend_id"], :name => "index_friendships_on_person_id_and_friend_id"  
416 - add_index "friendships", ["person_id"], :name => "index_friendships_on_person_id" 403 + add_index "friendships", ["friend_id"], name: "index_friendships_on_friend_id", using: :btree
  404 + add_index "friendships", ["person_id", "friend_id"], name: "index_friendships_on_person_id_and_friend_id", using: :btree
  405 + add_index "friendships", ["person_id"], name: "index_friendships_on_person_id", using: :btree
417 406
418 - create_table "gamification_plugin_badges", :force => true do |t|  
419 - t.string "name"  
420 - t.integer "level"  
421 - t.string "description"  
422 - t.string "custom_fields"  
423 - t.integer "owner_id"  
424 - t.string "owner_type"  
425 - t.datetime "created_at", :null => false  
426 - t.datetime "updated_at", :null => false  
427 - t.string "title"  
428 - end  
429 -  
430 - create_table "images", :force => true do |t| 407 + create_table "images", force: :cascade do |t|
431 t.integer "parent_id" 408 t.integer "parent_id"
432 t.string "content_type" 409 t.string "content_type"
433 t.string "filename" 410 t.string "filename"
@@ -435,43 +412,43 @@ ActiveRecord::Schema.define(:version => 20150918005035) do @@ -435,43 +412,43 @@ ActiveRecord::Schema.define(:version => 20150918005035) do
435 t.integer "size" 412 t.integer "size"
436 t.integer "width" 413 t.integer "width"
437 t.integer "height" 414 t.integer "height"
438 - t.boolean "thumbnails_processed", :default => false  
439 - t.string "label", :default => "" 415 + t.boolean "thumbnails_processed", default: false
  416 + t.string "label", default: ""
440 end 417 end
441 418
442 - add_index "images", ["parent_id"], :name => "index_images_on_parent_id" 419 + add_index "images", ["parent_id"], name: "index_images_on_parent_id", using: :btree
443 420
444 - create_table "inputs", :force => true do |t|  
445 - t.integer "product_id", :null => false  
446 - t.integer "product_category_id", :null => false 421 + create_table "inputs", force: :cascade do |t|
  422 + t.integer "product_id", null: false
  423 + t.integer "product_category_id", null: false
447 t.datetime "created_at" 424 t.datetime "created_at"
448 t.datetime "updated_at" 425 t.datetime "updated_at"
449 t.integer "position" 426 t.integer "position"
450 t.decimal "price_per_unit" 427 t.decimal "price_per_unit"
451 t.decimal "amount_used" 428 t.decimal "amount_used"
452 - t.boolean "relevant_to_price", :default => true  
453 - t.boolean "is_from_solidarity_economy", :default => false 429 + t.boolean "relevant_to_price", default: true
  430 + t.boolean "is_from_solidarity_economy", default: false
454 t.integer "unit_id" 431 t.integer "unit_id"
455 end 432 end
456 433
457 - add_index "inputs", ["product_category_id"], :name => "index_inputs_on_product_category_id"  
458 - add_index "inputs", ["product_id"], :name => "index_inputs_on_product_id" 434 + add_index "inputs", ["product_category_id"], name: "index_inputs_on_product_category_id", using: :btree
  435 + add_index "inputs", ["product_id"], name: "index_inputs_on_product_id", using: :btree
459 436
460 - create_table "licenses", :force => true do |t|  
461 - t.string "name", :null => false  
462 - t.string "slug", :null => false 437 + create_table "licenses", force: :cascade do |t|
  438 + t.string "name", null: false
  439 + t.string "slug", null: false
463 t.string "url" 440 t.string "url"
464 - t.integer "environment_id", :null => false 441 + t.integer "environment_id", null: false
465 end 442 end
466 443
467 - create_table "mailing_sents", :force => true do |t| 444 + create_table "mailing_sents", force: :cascade do |t|
468 t.integer "mailing_id" 445 t.integer "mailing_id"
469 t.integer "person_id" 446 t.integer "person_id"
470 t.datetime "created_at" 447 t.datetime "created_at"
471 t.datetime "updated_at" 448 t.datetime "updated_at"
472 end 449 end
473 450
474 - create_table "mailings", :force => true do |t| 451 + create_table "mailings", force: :cascade do |t|
475 t.string "type" 452 t.string "type"
476 t.string "subject" 453 t.string "subject"
477 t.text "body" 454 t.text "body"
@@ -483,52 +460,11 @@ ActiveRecord::Schema.define(:version => 20150918005035) do @@ -483,52 +460,11 @@ ActiveRecord::Schema.define(:version => 20150918005035) do
483 t.datetime "updated_at" 460 t.datetime "updated_at"
484 end 461 end
485 462
486 - create_table "mark_comment_as_read_plugin", :force => true do |t|  
487 - t.integer "comment_id"  
488 - t.integer "person_id"  
489 - end  
490 -  
491 - add_index "mark_comment_as_read_plugin", ["comment_id", "person_id"], :name => "index_mark_comment_as_read_plugin_on_comment_id_and_person_id", :unique => true  
492 -  
493 - create_table "merit_actions", :force => true do |t|  
494 - t.integer "user_id"  
495 - t.string "action_method"  
496 - t.integer "action_value"  
497 - t.boolean "had_errors", :default => false  
498 - t.string "target_model"  
499 - t.integer "target_id"  
500 - t.text "target_data"  
501 - t.boolean "processed", :default => false  
502 - t.datetime "created_at", :null => false  
503 - t.datetime "updated_at", :null => false  
504 - end  
505 -  
506 - create_table "merit_activity_logs", :force => true do |t|  
507 - t.integer "action_id"  
508 - t.string "related_change_type"  
509 - t.integer "related_change_id"  
510 - t.string "description"  
511 - t.datetime "created_at"  
512 - end  
513 -  
514 - create_table "merit_score_points", :force => true do |t|  
515 - t.integer "score_id"  
516 - t.integer "num_points", :default => 0  
517 - t.string "log"  
518 - t.datetime "created_at"  
519 - t.integer "action_id"  
520 - end  
521 -  
522 - create_table "merit_scores", :force => true do |t|  
523 - t.integer "sash_id"  
524 - t.string "category", :default => "default"  
525 - end  
526 -  
527 - create_table "national_region_types", :force => true do |t| 463 + create_table "national_region_types", force: :cascade do |t|
528 t.string "name" 464 t.string "name"
529 end 465 end
530 466
531 - create_table "national_regions", :force => true do |t| 467 + create_table "national_regions", force: :cascade do |t|
532 t.string "name" 468 t.string "name"
533 t.string "national_region_code" 469 t.string "national_region_code"
534 t.string "parent_national_region_code" 470 t.string "parent_national_region_code"
@@ -537,27 +473,18 @@ ActiveRecord::Schema.define(:version => 20150918005035) do @@ -537,27 +473,18 @@ ActiveRecord::Schema.define(:version => 20150918005035) do
537 t.integer "national_region_type_id" 473 t.integer "national_region_type_id"
538 end 474 end
539 475
540 - add_index "national_regions", ["name"], :name => "name_index"  
541 - add_index "national_regions", ["national_region_code"], :name => "code_index"  
542 -  
543 - create_table "pairwise_plugin_choices_related", :force => true do |t|  
544 - t.integer "choice_id"  
545 - t.integer "parent_choice_id"  
546 - t.integer "question_id"  
547 - t.integer "user_id"  
548 - t.datetime "created_at", :null => false  
549 - t.datetime "updated_at", :null => false  
550 - end 476 + add_index "national_regions", ["name"], name: "name_index", using: :btree
  477 + add_index "national_regions", ["national_region_code"], name: "code_index", using: :btree
551 478
552 - create_table "price_details", :force => true do |t|  
553 - t.decimal "price", :default => 0.0 479 + create_table "price_details", force: :cascade do |t|
  480 + t.decimal "price", default: 0.0
554 t.integer "product_id" 481 t.integer "product_id"
555 t.integer "production_cost_id" 482 t.integer "production_cost_id"
556 t.datetime "created_at" 483 t.datetime "created_at"
557 t.datetime "updated_at" 484 t.datetime "updated_at"
558 end 485 end
559 486
560 - create_table "product_qualifiers", :force => true do |t| 487 + create_table "product_qualifiers", force: :cascade do |t|
561 t.integer "product_id" 488 t.integer "product_id"
562 t.integer "qualifier_id" 489 t.integer "qualifier_id"
563 t.integer "certifier_id" 490 t.integer "certifier_id"
@@ -565,11 +492,11 @@ ActiveRecord::Schema.define(:version => 20150918005035) do @@ -565,11 +492,11 @@ ActiveRecord::Schema.define(:version => 20150918005035) do
565 t.datetime "updated_at" 492 t.datetime "updated_at"
566 end 493 end
567 494
568 - add_index "product_qualifiers", ["certifier_id"], :name => "index_product_qualifiers_on_certifier_id"  
569 - add_index "product_qualifiers", ["product_id"], :name => "index_product_qualifiers_on_product_id"  
570 - add_index "product_qualifiers", ["qualifier_id"], :name => "index_product_qualifiers_on_qualifier_id" 495 + add_index "product_qualifiers", ["certifier_id"], name: "index_product_qualifiers_on_certifier_id", using: :btree
  496 + add_index "product_qualifiers", ["product_id"], name: "index_product_qualifiers_on_product_id", using: :btree
  497 + add_index "product_qualifiers", ["qualifier_id"], name: "index_product_qualifiers_on_qualifier_id", using: :btree
571 498
572 - create_table "production_costs", :force => true do |t| 499 + create_table "production_costs", force: :cascade do |t|
573 t.string "name" 500 t.string "name"
574 t.integer "owner_id" 501 t.integer "owner_id"
575 t.string "owner_type" 502 t.string "owner_type"
@@ -577,7 +504,7 @@ ActiveRecord::Schema.define(:version => 20150918005035) do @@ -577,7 +504,7 @@ ActiveRecord::Schema.define(:version => 20150918005035) do
577 t.datetime "updated_at" 504 t.datetime "updated_at"
578 end 505 end
579 506
580 - create_table "products", :force => true do |t| 507 + create_table "products", force: :cascade do |t|
581 t.integer "profile_id" 508 t.integer "profile_id"
582 t.integer "product_category_id" 509 t.integer "product_category_id"
583 t.string "name" 510 t.string "name"
@@ -586,52 +513,52 @@ ActiveRecord::Schema.define(:version => 20150918005035) do @@ -586,52 +513,52 @@ ActiveRecord::Schema.define(:version => 20150918005035) do
586 t.datetime "created_at" 513 t.datetime "created_at"
587 t.datetime "updated_at" 514 t.datetime "updated_at"
588 t.decimal "discount" 515 t.decimal "discount"
589 - t.boolean "available", :default => true  
590 - t.boolean "highlighted", :default => false 516 + t.boolean "available", default: true
  517 + t.boolean "highlighted", default: false
591 t.integer "unit_id" 518 t.integer "unit_id"
592 t.integer "image_id" 519 t.integer "image_id"
593 t.string "type" 520 t.string "type"
594 t.text "data" 521 t.text "data"
595 - t.boolean "archived", :default => false 522 + t.boolean "archived", default: false
596 end 523 end
597 524
598 - add_index "products", ["created_at"], :name => "index_products_on_created_at"  
599 - add_index "products", ["product_category_id"], :name => "index_products_on_product_category_id"  
600 - add_index "products", ["profile_id"], :name => "index_products_on_profile_id" 525 + add_index "products", ["created_at"], name: "index_products_on_created_at", using: :btree
  526 + add_index "products", ["product_category_id"], name: "index_products_on_product_category_id", using: :btree
  527 + add_index "products", ["profile_id"], name: "index_products_on_profile_id", using: :btree
601 528
602 - create_table "profile_activities", :force => true do |t| 529 + create_table "profile_activities", force: :cascade do |t|
603 t.integer "profile_id" 530 t.integer "profile_id"
604 t.integer "activity_id" 531 t.integer "activity_id"
605 t.string "activity_type" 532 t.string "activity_type"
606 - t.datetime "created_at", :null => false  
607 - t.datetime "updated_at", :null => false 533 + t.datetime "created_at", null: false
  534 + t.datetime "updated_at", null: false
608 end 535 end
609 536
610 - add_index "profile_activities", ["activity_id", "activity_type"], :name => "index_profile_activities_on_activity_id_and_activity_type"  
611 - add_index "profile_activities", ["activity_type"], :name => "index_profile_activities_on_activity_type"  
612 - add_index "profile_activities", ["profile_id"], :name => "index_profile_activities_on_profile_id" 537 + add_index "profile_activities", ["activity_id", "activity_type"], name: "index_profile_activities_on_activity_id_and_activity_type", using: :btree
  538 + add_index "profile_activities", ["activity_type"], name: "index_profile_activities_on_activity_type", using: :btree
  539 + add_index "profile_activities", ["profile_id"], name: "index_profile_activities_on_profile_id", using: :btree
613 540
614 - create_table "profile_suggestions", :force => true do |t| 541 + create_table "profile_suggestions", force: :cascade do |t|
615 t.integer "person_id" 542 t.integer "person_id"
616 t.integer "suggestion_id" 543 t.integer "suggestion_id"
617 t.string "suggestion_type" 544 t.string "suggestion_type"
618 t.text "categories" 545 t.text "categories"
619 - t.boolean "enabled", :default => true  
620 - t.float "score", :default => 0.0  
621 - t.datetime "created_at", :null => false  
622 - t.datetime "updated_at", :null => false 546 + t.boolean "enabled", default: true
  547 + t.float "score", default: 0.0
  548 + t.datetime "created_at", null: false
  549 + t.datetime "updated_at", null: false
623 end 550 end
624 551
625 - add_index "profile_suggestions", ["person_id"], :name => "index_profile_suggestions_on_person_id"  
626 - add_index "profile_suggestions", ["score"], :name => "index_profile_suggestions_on_score"  
627 - add_index "profile_suggestions", ["suggestion_id"], :name => "index_profile_suggestions_on_suggestion_id" 552 + add_index "profile_suggestions", ["person_id"], name: "index_profile_suggestions_on_person_id", using: :btree
  553 + add_index "profile_suggestions", ["score"], name: "index_profile_suggestions_on_score", using: :btree
  554 + add_index "profile_suggestions", ["suggestion_id"], name: "index_profile_suggestions_on_suggestion_id", using: :btree
628 555
629 - create_table "profiles", :force => true do |t| 556 + create_table "profiles", force: :cascade do |t|
630 t.string "name" 557 t.string "name"
631 t.string "type" 558 t.string "type"
632 t.string "identifier" 559 t.string "identifier"
633 t.integer "environment_id" 560 t.integer "environment_id"
634 - t.boolean "active", :default => true 561 + t.boolean "active", default: true
635 t.string "address" 562 t.string "address"
636 t.string "contact_phone" 563 t.string "contact_phone"
637 t.integer "home_page_id" 564 t.integer "home_page_id"
@@ -642,103 +569,67 @@ ActiveRecord::Schema.define(:version => 20150918005035) do @@ -642,103 +569,67 @@ ActiveRecord::Schema.define(:version => 20150918005035) do
642 t.float "lat" 569 t.float "lat"
643 t.float "lng" 570 t.float "lng"
644 t.integer "geocode_precision" 571 t.integer "geocode_precision"
645 - t.boolean "enabled", :default => true  
646 - t.string "nickname", :limit => 16 572 + t.boolean "enabled", default: true
  573 + t.string "nickname", limit: 16
647 t.text "custom_header" 574 t.text "custom_header"
648 t.text "custom_footer" 575 t.text "custom_footer"
649 t.string "theme" 576 t.string "theme"
650 - t.boolean "public_profile", :default => true 577 + t.boolean "public_profile", default: true
651 t.date "birth_date" 578 t.date "birth_date"
652 t.integer "preferred_domain_id" 579 t.integer "preferred_domain_id"
653 t.datetime "updated_at" 580 t.datetime "updated_at"
654 - t.boolean "visible", :default => true 581 + t.boolean "visible", default: true
655 t.integer "image_id" 582 t.integer "image_id"
656 - t.boolean "validated", :default => true 583 + t.boolean "validated", default: true
657 t.string "cnpj" 584 t.string "cnpj"
658 t.string "national_region_code" 585 t.string "national_region_code"
659 - t.boolean "is_template", :default => false 586 + t.boolean "is_template", default: false
660 t.integer "template_id" 587 t.integer "template_id"
661 t.string "redirection_after_login" 588 t.string "redirection_after_login"
662 - t.integer "friends_count", :default => 0, :null => false  
663 - t.integer "members_count", :default => 0, :null => false  
664 - t.integer "activities_count", :default => 0, :null => false 589 + t.integer "friends_count", default: 0, null: false
  590 + t.integer "members_count", default: 0, null: false
  591 + t.integer "activities_count", default: 0, null: false
665 t.string "personal_website" 592 t.string "personal_website"
666 t.string "jabber_id" 593 t.string "jabber_id"
667 t.integer "welcome_page_id" 594 t.integer "welcome_page_id"
668 - t.boolean "allow_members_to_invite", :default => true  
669 - t.boolean "invite_friends_only", :default => false  
670 - t.boolean "secret", :default => false  
671 - t.integer "sash_id"  
672 - t.integer "level", :default => 0  
673 - end  
674 -  
675 - add_index "profiles", ["activities_count"], :name => "index_profiles_on_activities_count"  
676 - add_index "profiles", ["created_at"], :name => "index_profiles_on_created_at"  
677 - add_index "profiles", ["enabled"], :name => "index_profiles_on_enabled"  
678 - add_index "profiles", ["environment_id"], :name => "index_profiles_on_environment_id"  
679 - add_index "profiles", ["friends_count"], :name => "index_profiles_on_friends_count"  
680 - add_index "profiles", ["identifier"], :name => "index_profiles_on_identifier"  
681 - add_index "profiles", ["members_count"], :name => "index_profiles_on_members_count"  
682 - add_index "profiles", ["region_id"], :name => "index_profiles_on_region_id"  
683 - add_index "profiles", ["type"], :name => "index_profiles_on_type"  
684 - add_index "profiles", ["user_id", "type"], :name => "index_profiles_on_user_id_and_type"  
685 - add_index "profiles", ["user_id"], :name => "index_profiles_on_user_id"  
686 - add_index "profiles", ["validated"], :name => "index_profiles_on_validated"  
687 - add_index "profiles", ["visible"], :name => "index_profiles_on_visible"  
688 -  
689 - create_table "proposals_discussion_plugin_proposal_evaluations", :force => true do |t|  
690 - t.integer "proposal_task_id"  
691 - t.integer "evaluator_id"  
692 - t.integer "flagged_status"  
693 - t.datetime "created_at", :null => false  
694 - t.datetime "updated_at", :null => false  
695 - end  
696 -  
697 - add_index "proposals_discussion_plugin_proposal_evaluations", ["evaluator_id"], :name => "index_proposals_discussion_plugin_proposal_evaluator_id"  
698 - add_index "proposals_discussion_plugin_proposal_evaluations", ["proposal_task_id"], :name => "index_proposals_discussion_plugin_proposal_task_id"  
699 -  
700 - create_table "proposals_discussion_plugin_ranking_items", :force => true do |t|  
701 - t.integer "position"  
702 - t.string "abstract"  
703 - t.integer "votes_for"  
704 - t.integer "votes_against"  
705 - t.integer "hits"  
706 - t.decimal "effective_support"  
707 - t.integer "proposal_id"  
708 - t.datetime "created_at", :null => false  
709 - t.datetime "updated_at", :null => false  
710 - end  
711 -  
712 - add_index "proposals_discussion_plugin_ranking_items", ["proposal_id"], :name => "index_proposals_discussion_plugin_ranking_proposal_id"  
713 -  
714 - create_table "proposals_discussion_plugin_task_categories", :id => false, :force => true do |t|  
715 - t.integer "task_id"  
716 - t.integer "category_id"  
717 - end  
718 -  
719 - create_table "qualifier_certifiers", :force => true do |t| 595 + t.boolean "allow_members_to_invite", default: true
  596 + t.boolean "invite_friends_only", default: false
  597 + t.boolean "secret", default: false
  598 + end
  599 +
  600 + add_index "profiles", ["activities_count"], name: "index_profiles_on_activities_count", using: :btree
  601 + add_index "profiles", ["created_at"], name: "index_profiles_on_created_at", using: :btree
  602 + add_index "profiles", ["environment_id"], name: "index_profiles_on_environment_id", using: :btree
  603 + add_index "profiles", ["friends_count"], name: "index_profiles_on_friends_count", using: :btree
  604 + add_index "profiles", ["identifier"], name: "index_profiles_on_identifier", using: :btree
  605 + add_index "profiles", ["members_count"], name: "index_profiles_on_members_count", using: :btree
  606 + add_index "profiles", ["region_id"], name: "index_profiles_on_region_id", using: :btree
  607 + add_index "profiles", ["user_id", "type"], name: "index_profiles_on_user_id_and_type", using: :btree
  608 + add_index "profiles", ["user_id"], name: "index_profiles_on_user_id", using: :btree
  609 +
  610 + create_table "qualifier_certifiers", force: :cascade do |t|
720 t.integer "qualifier_id" 611 t.integer "qualifier_id"
721 t.integer "certifier_id" 612 t.integer "certifier_id"
722 end 613 end
723 614
724 - create_table "qualifiers", :force => true do |t|  
725 - t.string "name", :null => false 615 + create_table "qualifiers", force: :cascade do |t|
  616 + t.string "name", null: false
726 t.integer "environment_id" 617 t.integer "environment_id"
727 t.datetime "created_at" 618 t.datetime "created_at"
728 t.datetime "updated_at" 619 t.datetime "updated_at"
729 end 620 end
730 621
731 - create_table "refused_join_community", :id => false, :force => true do |t| 622 + create_table "refused_join_community", id: false, force: :cascade do |t|
732 t.integer "person_id" 623 t.integer "person_id"
733 t.integer "community_id" 624 t.integer "community_id"
734 end 625 end
735 626
736 - create_table "region_validators", :id => false, :force => true do |t| 627 + create_table "region_validators", id: false, force: :cascade do |t|
737 t.integer "region_id" 628 t.integer "region_id"
738 t.integer "organization_id" 629 t.integer "organization_id"
739 end 630 end
740 631
741 - create_table "reported_images", :force => true do |t| 632 + create_table "reported_images", force: :cascade do |t|
742 t.integer "size" 633 t.integer "size"
743 t.string "content_type" 634 t.string "content_type"
744 t.string "filename" 635 t.string "filename"
@@ -747,36 +638,25 @@ ActiveRecord::Schema.define(:version => 20150918005035) do @@ -747,36 +638,25 @@ ActiveRecord::Schema.define(:version => 20150918005035) do
747 t.integer "abuse_report_id" 638 t.integer "abuse_report_id"
748 end 639 end
749 640
750 - create_table "role_assignments", :force => true do |t|  
751 - t.integer "accessor_id", :null => false 641 + create_table "role_assignments", force: :cascade do |t|
  642 + t.integer "accessor_id", null: false
752 t.string "accessor_type" 643 t.string "accessor_type"
753 t.integer "resource_id" 644 t.integer "resource_id"
754 t.string "resource_type" 645 t.string "resource_type"
755 - t.integer "role_id", :null => false 646 + t.integer "role_id", null: false
756 t.boolean "is_global" 647 t.boolean "is_global"
757 end 648 end
758 649
759 - add_index "role_assignments", ["accessor_id", "accessor_type", "resource_id", "resource_type"], :name => "index_on_role_assigments_accessor_resource_role"  
760 - add_index "role_assignments", ["accessor_id", "accessor_type", "role_id"], :name => "index_on_role_assigments_accessor_role"  
761 - add_index "role_assignments", ["accessor_id", "accessor_type"], :name => "index_role_assignments_on_accessor_id_and_accessor_type"  
762 - add_index "role_assignments", ["resource_id", "resource_type", "role_id"], :name => "index_on_role_assigments_resource_role"  
763 - add_index "role_assignments", ["resource_id", "resource_type"], :name => "index_role_assignments_on_resource_id_and_resource_type"  
764 -  
765 - create_table "roles", :force => true do |t| 650 + create_table "roles", force: :cascade do |t|
766 t.string "name" 651 t.string "name"
767 t.string "key" 652 t.string "key"
768 - t.boolean "system", :default => false 653 + t.boolean "system", default: false
769 t.text "permissions" 654 t.text "permissions"
770 t.integer "environment_id" 655 t.integer "environment_id"
771 t.integer "profile_id" 656 t.integer "profile_id"
772 end 657 end
773 658
774 - create_table "sashes", :force => true do |t|  
775 - t.datetime "created_at", :null => false  
776 - t.datetime "updated_at", :null => false  
777 - end  
778 -  
779 - create_table "scraps", :force => true do |t| 659 + create_table "scraps", force: :cascade do |t|
780 t.text "content" 660 t.text "content"
781 t.integer "sender_id" 661 t.integer "sender_id"
782 t.integer "receiver_id" 662 t.integer "receiver_id"
@@ -786,104 +666,104 @@ ActiveRecord::Schema.define(:version => 20150918005035) do @@ -786,104 +666,104 @@ ActiveRecord::Schema.define(:version => 20150918005035) do
786 t.integer "context_id" 666 t.integer "context_id"
787 end 667 end
788 668
789 - create_table "search_term_occurrences", :force => true do |t| 669 + create_table "search_term_occurrences", force: :cascade do |t|
790 t.integer "search_term_id" 670 t.integer "search_term_id"
791 t.datetime "created_at" 671 t.datetime "created_at"
792 - t.integer "total", :default => 0  
793 - t.integer "indexed", :default => 0 672 + t.integer "total", default: 0
  673 + t.integer "indexed", default: 0
794 end 674 end
795 675
796 - add_index "search_term_occurrences", ["created_at"], :name => "index_search_term_occurrences_on_created_at" 676 + add_index "search_term_occurrences", ["created_at"], name: "index_search_term_occurrences_on_created_at", using: :btree
797 677
798 - create_table "search_terms", :force => true do |t| 678 + create_table "search_terms", force: :cascade do |t|
799 t.string "term" 679 t.string "term"
800 t.integer "context_id" 680 t.integer "context_id"
801 t.string "context_type" 681 t.string "context_type"
802 - t.string "asset", :default => "all"  
803 - t.float "score", :default => 0.0  
804 - t.float "relevance_score", :default => 0.0  
805 - t.float "occurrence_score", :default => 0.0 682 + t.string "asset", default: "all"
  683 + t.float "score", default: 0.0
  684 + t.float "relevance_score", default: 0.0
  685 + t.float "occurrence_score", default: 0.0
806 end 686 end
807 687
808 - add_index "search_terms", ["asset"], :name => "index_search_terms_on_asset"  
809 - add_index "search_terms", ["occurrence_score"], :name => "index_search_terms_on_occurrence_score"  
810 - add_index "search_terms", ["relevance_score"], :name => "index_search_terms_on_relevance_score"  
811 - add_index "search_terms", ["score"], :name => "index_search_terms_on_score"  
812 - add_index "search_terms", ["term"], :name => "index_search_terms_on_term" 688 + add_index "search_terms", ["asset"], name: "index_search_terms_on_asset", using: :btree
  689 + add_index "search_terms", ["occurrence_score"], name: "index_search_terms_on_occurrence_score", using: :btree
  690 + add_index "search_terms", ["relevance_score"], name: "index_search_terms_on_relevance_score", using: :btree
  691 + add_index "search_terms", ["score"], name: "index_search_terms_on_score", using: :btree
  692 + add_index "search_terms", ["term"], name: "index_search_terms_on_term", using: :btree
813 693
814 - create_table "sessions", :force => true do |t|  
815 - t.string "session_id", :null => false 694 + create_table "sessions", force: :cascade do |t|
  695 + t.string "session_id", null: false
816 t.text "data" 696 t.text "data"
817 t.datetime "created_at" 697 t.datetime "created_at"
818 t.datetime "updated_at" 698 t.datetime "updated_at"
819 t.integer "user_id" 699 t.integer "user_id"
820 end 700 end
821 701
822 - add_index "sessions", ["session_id"], :name => "index_sessions_on_session_id"  
823 - add_index "sessions", ["updated_at"], :name => "index_sessions_on_updated_at"  
824 - add_index "sessions", ["user_id"], :name => "index_sessions_on_user_id" 702 + add_index "sessions", ["session_id"], name: "index_sessions_on_session_id", using: :btree
  703 + add_index "sessions", ["updated_at"], name: "index_sessions_on_updated_at", using: :btree
  704 + add_index "sessions", ["user_id"], name: "index_sessions_on_user_id", using: :btree
825 705
826 - create_table "suggestion_connections", :force => true do |t|  
827 - t.integer "suggestion_id", :null => false  
828 - t.integer "connection_id", :null => false  
829 - t.string "connection_type", :null => false 706 + create_table "suggestion_connections", force: :cascade do |t|
  707 + t.integer "suggestion_id", null: false
  708 + t.integer "connection_id", null: false
  709 + t.string "connection_type", null: false
830 end 710 end
831 711
832 - create_table "taggings", :force => true do |t| 712 + create_table "taggings", force: :cascade do |t|
833 t.integer "tag_id" 713 t.integer "tag_id"
834 t.integer "taggable_id" 714 t.integer "taggable_id"
835 t.string "taggable_type" 715 t.string "taggable_type"
836 t.datetime "created_at" 716 t.datetime "created_at"
837 t.integer "tagger_id" 717 t.integer "tagger_id"
838 t.string "tagger_type" 718 t.string "tagger_type"
839 - t.string "context", :limit => 128 719 + t.string "context", limit: 128
840 end 720 end
841 721
842 - add_index "taggings", ["tag_id", "taggable_id", "taggable_type", "context", "tagger_id", "tagger_type"], :name => "taggings_idx", :unique => true  
843 - add_index "taggings", ["taggable_id", "taggable_type", "context"], :name => "index_taggings_on_taggable_id_and_taggable_type_and_context"  
844 - add_index "taggings", ["taggable_id", "taggable_type"], :name => "index_taggings_on_taggable_id_and_taggable_type" 722 + add_index "taggings", ["tag_id", "taggable_id", "taggable_type", "context", "tagger_id", "tagger_type"], name: "taggings_idx", unique: true, using: :btree
  723 + add_index "taggings", ["taggable_id", "taggable_type", "context"], name: "index_taggings_on_taggable_id_and_taggable_type_and_context", using: :btree
  724 + add_index "taggings", ["taggable_id", "taggable_type"], name: "index_taggings_on_taggable_id_and_taggable_type", using: :btree
845 725
846 - create_table "tags", :force => true do |t| 726 + create_table "tags", force: :cascade do |t|
847 t.string "name" 727 t.string "name"
848 t.integer "parent_id" 728 t.integer "parent_id"
849 - t.boolean "pending", :default => false  
850 - t.integer "taggings_count", :default => 0 729 + t.boolean "pending", default: false
  730 + t.integer "taggings_count", default: 0
851 end 731 end
852 732
853 - add_index "tags", ["name"], :name => "index_tags_on_name", :unique => true  
854 - add_index "tags", ["parent_id"], :name => "index_tags_on_parent_id" 733 + add_index "tags", ["name"], name: "index_tags_on_name", unique: true, using: :btree
  734 + add_index "tags", ["parent_id"], name: "index_tags_on_parent_id", using: :btree
855 735
856 - create_table "tasks", :force => true do |t| 736 + create_table "tasks", force: :cascade do |t|
857 t.text "data" 737 t.text "data"
858 t.integer "status" 738 t.integer "status"
859 - t.datetime "end_date" 739 + t.date "end_date"
860 t.integer "requestor_id" 740 t.integer "requestor_id"
861 t.integer "target_id" 741 t.integer "target_id"
862 - t.string "code", :limit => 40 742 + t.string "code", limit: 40
863 t.string "type" 743 t.string "type"
864 t.datetime "created_at" 744 t.datetime "created_at"
865 t.string "target_type" 745 t.string "target_type"
866 t.integer "image_id" 746 t.integer "image_id"
867 - t.boolean "spam", :default => false 747 + t.boolean "spam", default: false
868 t.integer "responsible_id" 748 t.integer "responsible_id"
869 t.integer "closed_by_id" 749 t.integer "closed_by_id"
870 end 750 end
871 751
872 - add_index "tasks", ["requestor_id"], :name => "index_tasks_on_requestor_id"  
873 - add_index "tasks", ["spam"], :name => "index_tasks_on_spam"  
874 - add_index "tasks", ["status"], :name => "index_tasks_on_status"  
875 - add_index "tasks", ["target_id", "target_type"], :name => "index_tasks_on_target_id_and_target_type"  
876 - add_index "tasks", ["target_id"], :name => "index_tasks_on_target_id"  
877 - add_index "tasks", ["target_type"], :name => "index_tasks_on_target_type" 752 + add_index "tasks", ["requestor_id"], name: "index_tasks_on_requestor_id", using: :btree
  753 + add_index "tasks", ["spam"], name: "index_tasks_on_spam", using: :btree
  754 + add_index "tasks", ["status"], name: "index_tasks_on_status", using: :btree
  755 + add_index "tasks", ["target_id", "target_type"], name: "index_tasks_on_target_id_and_target_type", using: :btree
  756 + add_index "tasks", ["target_id"], name: "index_tasks_on_target_id", using: :btree
  757 + add_index "tasks", ["target_type"], name: "index_tasks_on_target_type", using: :btree
878 758
879 - create_table "terms_forum_people", :id => false, :force => true do |t| 759 + create_table "terms_forum_people", id: false, force: :cascade do |t|
880 t.integer "forum_id" 760 t.integer "forum_id"
881 t.integer "person_id" 761 t.integer "person_id"
882 end 762 end
883 763
884 - add_index "terms_forum_people", ["forum_id", "person_id"], :name => "index_terms_forum_people_on_forum_id_and_person_id" 764 + add_index "terms_forum_people", ["forum_id", "person_id"], name: "index_terms_forum_people_on_forum_id_and_person_id", using: :btree
885 765
886 - create_table "thumbnails", :force => true do |t| 766 + create_table "thumbnails", force: :cascade do |t|
887 t.integer "size" 767 t.integer "size"
888 t.string "content_type" 768 t.string "content_type"
889 t.string "filename" 769 t.string "filename"
@@ -893,33 +773,33 @@ ActiveRecord::Schema.define(:version => 20150918005035) do @@ -893,33 +773,33 @@ ActiveRecord::Schema.define(:version => 20150918005035) do
893 t.string "thumbnail" 773 t.string "thumbnail"
894 end 774 end
895 775
896 - add_index "thumbnails", ["parent_id"], :name => "index_thumbnails_on_parent_id" 776 + add_index "thumbnails", ["parent_id"], name: "index_thumbnails_on_parent_id", using: :btree
897 777
898 - create_table "units", :force => true do |t|  
899 - t.string "singular", :null => false  
900 - t.string "plural", :null => false 778 + create_table "units", force: :cascade do |t|
  779 + t.string "singular", null: false
  780 + t.string "plural", null: false
901 t.integer "position" 781 t.integer "position"
902 - t.integer "environment_id", :null => false 782 + t.integer "environment_id", null: false
903 end 783 end
904 784
905 - create_table "users", :force => true do |t| 785 + create_table "users", force: :cascade do |t|
906 t.string "login" 786 t.string "login"
907 t.string "email" 787 t.string "email"
908 - t.string "crypted_password", :limit => 40  
909 - t.string "salt", :limit => 40 788 + t.string "crypted_password", limit: 40
  789 + t.string "salt", limit: 40
910 t.datetime "created_at" 790 t.datetime "created_at"
911 t.datetime "updated_at" 791 t.datetime "updated_at"
912 t.string "remember_token" 792 t.string "remember_token"
913 t.datetime "remember_token_expires_at" 793 t.datetime "remember_token_expires_at"
914 t.text "terms_of_use" 794 t.text "terms_of_use"
915 - t.string "terms_accepted", :limit => 1 795 + t.string "terms_accepted", limit: 1
916 t.integer "environment_id" 796 t.integer "environment_id"
917 t.string "password_type" 797 t.string "password_type"
918 - t.boolean "enable_email", :default => false  
919 - t.string "last_chat_status", :default => ""  
920 - t.string "chat_status", :default => "" 798 + t.boolean "enable_email", default: false
  799 + t.string "last_chat_status", default: ""
  800 + t.string "chat_status", default: ""
921 t.datetime "chat_status_at" 801 t.datetime "chat_status_at"
922 - t.string "activation_code", :limit => 40 802 + t.string "activation_code", limit: 40
923 t.datetime "activated_at" 803 t.datetime "activated_at"
924 t.string "return_to" 804 t.string "return_to"
925 t.datetime "last_login_at" 805 t.datetime "last_login_at"
@@ -927,23 +807,23 @@ ActiveRecord::Schema.define(:version => 20150918005035) do @@ -927,23 +807,23 @@ ActiveRecord::Schema.define(:version => 20150918005035) do
927 t.datetime "private_token_generated_at" 807 t.datetime "private_token_generated_at"
928 end 808 end
929 809
930 - create_table "validation_infos", :force => true do |t| 810 + create_table "validation_infos", force: :cascade do |t|
931 t.text "validation_methodology" 811 t.text "validation_methodology"
932 t.text "restrictions" 812 t.text "restrictions"
933 t.integer "organization_id" 813 t.integer "organization_id"
934 end 814 end
935 815
936 - create_table "votes", :force => true do |t|  
937 - t.integer "vote", :null => false  
938 - t.integer "voteable_id", :null => false  
939 - t.string "voteable_type", :null => false 816 + create_table "votes", force: :cascade do |t|
  817 + t.integer "vote", null: false
  818 + t.integer "voteable_id", null: false
  819 + t.string "voteable_type", null: false
940 t.integer "voter_id" 820 t.integer "voter_id"
941 t.string "voter_type" 821 t.string "voter_type"
942 t.datetime "created_at" 822 t.datetime "created_at"
943 t.datetime "updated_at" 823 t.datetime "updated_at"
944 end 824 end
945 825
946 - add_index "votes", ["voteable_id", "voteable_type"], :name => "fk_voteables"  
947 - add_index "votes", ["voter_id", "voter_type"], :name => "fk_voters" 826 + add_index "votes", ["voteable_id", "voteable_type"], name: "fk_voteables", using: :btree
  827 + add_index "votes", ["voter_id", "voter_type"], name: "fk_voters", using: :btree
948 828
949 end 829 end
debian/noosfero.prerm
@@ -8,14 +8,7 @@ dbc_go noosfero $@ @@ -8,14 +8,7 @@ dbc_go noosfero $@
8 8
9 #DEBHELPER# 9 #DEBHELPER#
10 10
11 -# some dirty work is needed after Noosfero is stopped  
12 if [ "$1" = "upgrade" ]; then 11 if [ "$1" = "upgrade" ]; then
13 - # delete cached files  
14 - rm -f /var/lib/noosfero-data/cache/*  
15 -  
16 - # restart memcache  
17 - invoke-rc.d memcached restart  
18 -  
19 # stop debconf to avoid the problem with infinite hanging, cfe 12 # stop debconf to avoid the problem with infinite hanging, cfe
20 # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=295477 13 # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=295477
21 db_stop 14 db_stop
@@ -25,7 +25,7 @@ override_dh_auto_install: @@ -25,7 +25,7 @@ override_dh_auto_install:
25 debian/filter-gemfile > $(CURDIR)/debian/noosfero/usr/share/noosfero/Gemfile 25 debian/filter-gemfile > $(CURDIR)/debian/noosfero/usr/share/noosfero/Gemfile
26 26
27 override_dh_installinit: 27 override_dh_installinit:
28 - dh_installinit -pnoosfero --onlyscripts 28 + dh_installinit -pnoosfero --onlyscripts --restart-after-upgrade
29 29
30 override_dh_clean: 30 override_dh_clean:
31 dh_clean 31 dh_clean
features/step_definitions/web_steps.rb
@@ -118,11 +118,7 @@ end @@ -118,11 +118,7 @@ end
118 118
119 Then /^(?:|I )should see "([^"]*)"(?: within "([^"]*)")?$/ do |text, selector| 119 Then /^(?:|I )should see "([^"]*)"(?: within "([^"]*)")?$/ do |text, selector|
120 with_scope(selector) do 120 with_scope(selector) do
121 - if page.respond_to? :should  
122 - page.should have_content(text)  
123 - else  
124 - assert page.has_content?(text)  
125 - end 121 + expect(page).to have_content(text)
126 end 122 end
127 end 123 end
128 124
plugins/newsletter/public/style.css
@@ -17,6 +17,11 @@ @@ -17,6 +17,11 @@
17 margin-left: 10px; 17 margin-left: 10px;
18 } 18 }
19 19
  20 +#newsletter-moderation-preview th {
  21 + padding: 0px;
  22 + border: 0px;
  23 +}
  24 +
20 #newsletter-moderation-preview input[type=checkbox] { 25 #newsletter-moderation-preview input[type=checkbox] {
21 margin-left: -27px; 26 margin-left: -27px;
22 margin-top: 16px; 27 margin-top: 16px;
plugins/newsletter/test/functional/newsletter_plugin_admin_controller_test.rb
1 -require File.dirname(__FILE__) + '/../../../../test/test_helper' 1 +require 'test_helper'
2 2
3 class NewsletterPluginAdminControllerTest < ActionController::TestCase 3 class NewsletterPluginAdminControllerTest < ActionController::TestCase
4 4
plugins/newsletter/test/functional/newsletter_plugin_controller_test.rb
1 -require File.dirname(__FILE__) + '/../../../../test/test_helper' 1 +require 'test_helper'
2 2
3 class NewsletterPluginControllerTest < ActionController::TestCase 3 class NewsletterPluginControllerTest < ActionController::TestCase
4 4
plugins/newsletter/views/tasks/newsletter_plugin/_moderate_newsletter_accept_details.html.erb
@@ -3,14 +3,14 @@ @@ -3,14 +3,14 @@
3 <h1><%= _('Check posts you want to include') %></h1> 3 <h1><%= _('Check posts you want to include') %></h1>
4 4
5 <div id='newsletter-moderation-preview'> 5 <div id='newsletter-moderation-preview'>
6 - <% newsletter_content = newsletter.body.gsub(/width: 640px;/,'').sub(/#{NewsletterPlugin::Newsletter::CSS['breaking-news-wrap']}/, '') %> 6 + <% newsletter_content = newsletter.body.gsub(/width: 640px;/,'').sub(/#{NewsletterPlugin::Newsletter::CSS['breakingnews-wrap']}/, '') %>
7 7
8 <% newsletter.posts.each do |post| %> 8 <% newsletter.posts.each do |post| %>
9 <% input_name = "tasks[#{task.id}][task][post_ids][]" %> 9 <% input_name = "tasks[#{task.id}][task][post_ids][]" %>
10 <% post_check_box = hidden_field_tag(input_name, '0') +check_box_tag(input_name, post.id, true) %> 10 <% post_check_box = hidden_field_tag(input_name, '0') +check_box_tag(input_name, post.id, true) %>
11 11
12 - <% newsletter_content.gsub!(/<span id="#{post.id}"/, post_check_box+ '<span') %>  
13 - <% newsletter_content.gsub!(/<img id="#{post.id}"/, post_check_box+ '<img') %> 12 + <% newsletter_content.gsub!(/<span([^>]*?) id="#{post.id}"/, post_check_box + '<span\\1')%>
  13 + <% newsletter_content.gsub!(/<img([^>]*?) id="#{post.id}"/, post_check_box + '<img\\1') %>
14 <% end %> 14 <% end %>
15 15
16 <%= newsletter_content %> 16 <%= newsletter_content %>
plugins/organization_ratings/controllers/organization_ratings_plugin_profile_controller.rb
@@ -43,6 +43,7 @@ class OrganizationRatingsPluginProfileController &lt; ProfileController @@ -43,6 +43,7 @@ class OrganizationRatingsPluginProfileController &lt; ProfileController
43 rating.value = params[:organization_rating_value] if params[:organization_rating_value] 43 rating.value = params[:organization_rating_value] if params[:organization_rating_value]
44 44
45 if rating.save 45 if rating.save
  46 + @plugins.dispatch(:organization_ratings_plugin_rating_created, rating, params)
46 create_rating_comment(rating) 47 create_rating_comment(rating)
47 session[:notice] = _("%s successfully rated!") % profile.name 48 session[:notice] = _("%s successfully rated!") % profile.name
48 else 49 else
plugins/organization_ratings/lib/organization_ratings_plugin.rb
@@ -25,6 +25,10 @@ class OrganizationRatingsPlugin &lt; Noosfero::Plugin @@ -25,6 +25,10 @@ class OrganizationRatingsPlugin &lt; Noosfero::Plugin
25 def organization_ratings_plugin_extra_fields_show_data user_rating 25 def organization_ratings_plugin_extra_fields_show_data user_rating
26 nil 26 nil
27 end 27 end
  28 +
  29 + def organization_ratings_plugin_rating_created rating, params
  30 + nil
  31 + end
28 end 32 end
29 33
30 # Plugin Hotspot to display the average rating 34 # Plugin Hotspot to display the average rating
plugins/sniffer/lib/sniffer_plugin/helper.rb
@@ -5,7 +5,7 @@ module SnifferPlugin::Helper @@ -5,7 +5,7 @@ module SnifferPlugin::Helper
5 def filter_visible_attr_profile(profile) 5 def filter_visible_attr_profile(profile)
6 filtered_profile = {} 6 filtered_profile = {}
7 visible_attributes = [:id, :name, :lat, :lng, :sniffer_plugin_distance] 7 visible_attributes = [:id, :name, :lat, :lng, :sniffer_plugin_distance]
8 - visible_attributes.each{ |a| filtered_profile[a] = profile[a] || 0 } 8 + visible_attributes.each{ |a| filtered_profile[a] = profile.send(a) || 0 }
9 filtered_profile 9 filtered_profile
10 end 10 end
11 11
test/unit/api/search_test.rb
@@ -30,7 +30,8 @@ class SearchTest &lt; ActiveSupport::TestCase @@ -30,7 +30,8 @@ class SearchTest &lt; ActiveSupport::TestCase
30 assert_empty json['articles'] 30 assert_empty json['articles']
31 end 31 end
32 32
33 - should 'do not list articles of wrong type' do 33 + should 'not list articles of wrong type' do
  34 + Article.delete_all
34 fast_create(Article, :profile_id => person.id) 35 fast_create(Article, :profile_id => person.id)
35 get "/api/v1/search/article?type=TinyMceArticle" 36 get "/api/v1/search/article?type=TinyMceArticle"
36 json = JSON.parse(last_response.body) 37 json = JSON.parse(last_response.body)