Revert "Sci names permitted params"

This commit is contained in:
Taylor Griffin committed 2015-01-23 11:42:42 +11:00
1 parent dabfeeea3c
commit 0e0c309c15
4 files changed
+55 -60

No files matched your search

+1 -1
View File
@@ -146,6 +146,6 @@ class CropsController < ApplicationController
private
def crop_params
params.require(:crop).permit(:en_wikipedia_url, :name, :parent_id, :creator_id, :scientific_names_attributes => [:scientific_name])
params.require(:crop).permit(:en_wikipedia_url, :name, :parent_id, :creator_id, :scientific_names_attributes)
end
end
-2
View File
@@ -1,8 +1,6 @@
Growstuff::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
config.action_controller.action_on_unpermitted_parameters = :raise
# Eager load code on boot. This eager loads most of Rails and
# your application in memory, allowing both threaded web servers
# and those relying on copy on write to perform better.
+54 -55
View File
@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20141209074953) do
ActiveRecord::Schema.define(version: 20141119130555) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@@ -20,24 +20,24 @@ ActiveRecord::Schema.define(version: 20141209074953) do
t.string "name", null: false
t.boolean "is_paid"
t.boolean "is_permanent_paid"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "accounts", force: true do |t|
t.integer "member_id", null: false
t.integer "account_type_id"
t.datetime "paid_until"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "alternate_names", force: true do |t|
t.string "name", null: false
t.integer "crop_id", null: false
t.integer "creator_id", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "authentications", force: true do |t|
@@ -46,8 +46,8 @@ ActiveRecord::Schema.define(version: 20141209074953) do
t.string "uid"
t.string "token"
t.string "secret"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.datetime "created_at"
t.datetime "updated_at"
t.string "name"
end
@@ -57,20 +57,19 @@ ActiveRecord::Schema.define(version: 20141209074953) do
t.integer "post_id", null: false
t.integer "author_id", null: false
t.text "body", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "crops", force: true do |t|
t.string "name", null: false
t.string "name", null: false
t.string "en_wikipedia_url"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.datetime "created_at"
t.datetime "updated_at"
t.string "slug"
t.integer "parent_id"
t.integer "plantings_count", default: 0
t.integer "creator_id"
t.boolean "approved", default: true
end
add_index "crops", ["name"], name: "index_crops_on_name", using: :btree
@@ -87,16 +86,16 @@ ActiveRecord::Schema.define(version: 20141209074953) do
create_table "follows", force: true do |t|
t.integer "follower_id"
t.integer "followed_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "forums", force: true do |t|
t.string "name", null: false
t.text "description", null: false
t.integer "owner_id", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.datetime "created_at"
t.datetime "updated_at"
t.string "slug"
end
@@ -106,8 +105,8 @@ ActiveRecord::Schema.define(version: 20141209074953) do
t.string "name", null: false
t.integer "owner_id"
t.string "slug", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.datetime "created_at"
t.datetime "updated_at"
t.text "description"
t.boolean "active", default: true
t.string "location"
@@ -117,7 +116,7 @@ ActiveRecord::Schema.define(version: 20141209074953) do
t.string "area_unit"
end
add_index "gardens", ["owner_id"], name: "index_gardens_on_user_id", using: :btree
add_index "gardens", ["owner_id"], name: "index_gardens_on_owner_id", using: :btree
add_index "gardens", ["slug"], name: "index_gardens_on_slug", unique: true, using: :btree
create_table "harvests", force: true do |t|
@@ -127,8 +126,8 @@ ActiveRecord::Schema.define(version: 20141209074953) do
t.decimal "quantity"
t.string "unit"
t.text "description"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.datetime "created_at"
t.datetime "updated_at"
t.string "slug"
t.decimal "weight_quantity"
t.string "weight_unit"
@@ -160,8 +159,8 @@ ActiveRecord::Schema.define(version: 20141209074953) do
t.integer "failed_attempts", default: 0
t.string "unlock_token"
t.datetime "locked_at"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.datetime "created_at"
t.datetime "updated_at"
t.string "login_name"
t.string "slug"
t.boolean "tos_agreement"
@@ -176,11 +175,11 @@ ActiveRecord::Schema.define(version: 20141209074953) do
t.boolean "send_planting_reminder", default: true
end
add_index "members", ["confirmation_token"], name: "index_users_on_confirmation_token", unique: true, using: :btree
add_index "members", ["email"], name: "index_users_on_email", unique: true, using: :btree
add_index "members", ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true, using: :btree
add_index "members", ["slug"], name: "index_users_on_slug", unique: true, using: :btree
add_index "members", ["unlock_token"], name: "index_users_on_unlock_token", unique: true, using: :btree
add_index "members", ["confirmation_token"], name: "index_members_on_confirmation_token", unique: true, using: :btree
add_index "members", ["email"], name: "index_members_on_email", unique: true, using: :btree
add_index "members", ["reset_password_token"], name: "index_members_on_reset_password_token", unique: true, using: :btree
add_index "members", ["slug"], name: "index_members_on_slug", unique: true, using: :btree
add_index "members", ["unlock_token"], name: "index_members_on_unlock_token", unique: true, using: :btree
create_table "members_roles", id: false, force: true do |t|
t.integer "member_id"
@@ -194,8 +193,8 @@ ActiveRecord::Schema.define(version: 20141209074953) do
t.text "body"
t.boolean "read", default: false
t.integer "post_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "order_items", force: true do |t|
@@ -203,13 +202,13 @@ ActiveRecord::Schema.define(version: 20141209074953) do
t.integer "product_id"
t.integer "price"
t.integer "quantity"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "orders", force: true do |t|
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.datetime "created_at"
t.datetime "updated_at"
t.datetime "completed_at"
t.integer "member_id"
t.string "paypal_express_token"
@@ -226,8 +225,8 @@ ActiveRecord::Schema.define(version: 20141209074953) do
t.integer "owner_id", null: false
t.string "thumbnail_url", null: false
t.string "fullsize_url", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.datetime "created_at"
t.datetime "updated_at"
t.string "title", null: false
t.string "license_name", null: false
t.string "license_url"
@@ -242,8 +241,8 @@ ActiveRecord::Schema.define(version: 20141209074953) do
create_table "plant_parts", force: true do |t|
t.string "name"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.datetime "created_at"
t.datetime "updated_at"
t.string "slug"
end
@@ -253,8 +252,8 @@ ActiveRecord::Schema.define(version: 20141209074953) do
t.date "planted_at"
t.integer "quantity"
t.text "description"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.datetime "created_at"
t.datetime "updated_at"
t.string "slug"
t.string "sunniness"
t.string "planted_from"
@@ -269,21 +268,21 @@ ActiveRecord::Schema.define(version: 20141209074953) do
t.integer "author_id", null: false
t.string "subject", null: false
t.text "body", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.datetime "created_at"
t.datetime "updated_at"
t.string "slug"
t.integer "forum_id"
end
add_index "posts", ["created_at", "author_id"], name: "index_updates_on_created_at_and_user_id", using: :btree
add_index "posts", ["slug"], name: "index_updates_on_slug", unique: true, using: :btree
add_index "posts", ["created_at", "author_id"], name: "index_posts_on_created_at_and_author_id", using: :btree
add_index "posts", ["slug"], name: "index_posts_on_slug", unique: true, using: :btree
create_table "products", force: true do |t|
t.string "name", null: false
t.text "description", null: false
t.integer "min_price", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.datetime "created_at"
t.datetime "updated_at"
t.integer "account_type_id"
t.integer "paid_months"
t.integer "recommended_price"
@@ -292,8 +291,8 @@ ActiveRecord::Schema.define(version: 20141209074953) do
create_table "roles", force: true do |t|
t.string "name", null: false
t.text "description"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.datetime "created_at"
t.datetime "updated_at"
t.string "slug"
end
@@ -302,8 +301,8 @@ ActiveRecord::Schema.define(version: 20141209074953) do
create_table "scientific_names", force: true do |t|
t.string "scientific_name", null: false
t.integer "crop_id", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.datetime "created_at"
t.datetime "updated_at"
t.integer "creator_id"
end
@@ -313,8 +312,8 @@ ActiveRecord::Schema.define(version: 20141209074953) do
t.text "description"
t.integer "quantity"
t.date "plant_before"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.datetime "created_at"
t.datetime "updated_at"
t.string "tradable_to", default: "nowhere"
t.string "slug"
end
@@ -43,10 +43,8 @@ feature "crop wranglers" do
click_link 'Add Crop'
fill_in 'Name', with: "aubergine"
fill_in 'Wikipedia URL', with: "http://en.wikipedia.org/wiki/Maize"
fill_in 'crop_scientific_names_attributes_0_scientific_name', with: "planticus maximus"
click_on 'Save'
expect(page).to have_content 'Crop was successfully created'
expect(page).to have_content 'planticus maximus'
end
end