strong_form 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/lib/strong_form/tag.rb +4 -1
- data/lib/strong_form/version.rb +1 -1
- data/spec/dummy/app/views/base/_user_fields.html.haml +1 -0
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/migrate/20151116150723_add_roles_to_users.rb +5 -0
- data/spec/dummy/db/schema.rb +2 -1
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/development.log +7 -0
- data/spec/dummy/log/test.log +4244 -0
- data/spec/examples.txt +58 -56
- data/spec/features/strong_form_spec.rb +8 -3
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a30f0f44d553fb9d707018abd5d9d55aa03ec1dd
|
4
|
+
data.tar.gz: b8ce403abbfdf3a12aeb68872b3ef7773db66ec5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8a2a3ec614c3b8e1aef6703421a7ae931e2180d922db010318a12c5e494a754bf8b8b76baea275d15b95825651271105b63a0d45ab5bddb7c0165910064d755a
|
7
|
+
data.tar.gz: b5a489bc2673f013f1d93aa63872c473e26ddc912c5286f2bc1cf289a8e4c6b367297e1d9d6844c82c0488185356d8fc0b04368ca46a6c9ef22a61f57083846d
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,14 @@
|
|
2
2
|
|
3
3
|
## master
|
4
4
|
|
5
|
+
## 0.0.6
|
6
|
+
|
7
|
+
### Bugs fixed
|
8
|
+
|
9
|
+
* Permit array attributes with `[roles: []]`, too, not only with `[:roles]`.
|
10
|
+
In fact it is OK to have either the symbol or a hash with the key (value is
|
11
|
+
ignored). Makes this more compatible with Rail`s strong params.
|
12
|
+
|
5
13
|
## 0.0.5
|
6
14
|
|
7
15
|
### Bugs fixed
|
data/lib/strong_form/tag.rb
CHANGED
@@ -8,7 +8,10 @@ module StrongForm
|
|
8
8
|
if object.respond_to?(:permitted_attributes) && !object.permitted_attributes.nil?
|
9
9
|
(@html_options || @options)[:disabled] ||=
|
10
10
|
object.permitted_attributes != true &&
|
11
|
-
|
11
|
+
(
|
12
|
+
!object.permitted_attributes.include?(@method_name.to_sym) &&
|
13
|
+
!object.permitted_attributes.include?("#{@method_name}": [])
|
14
|
+
)
|
12
15
|
end
|
13
16
|
render_orig
|
14
17
|
end
|
data/lib/strong_form/version.rb
CHANGED
Binary file
|
data/spec/dummy/db/schema.rb
CHANGED
@@ -11,7 +11,7 @@
|
|
11
11
|
#
|
12
12
|
# It's strongly recommended that you check this file into your version control system.
|
13
13
|
|
14
|
-
ActiveRecord::Schema.define(version:
|
14
|
+
ActiveRecord::Schema.define(version: 20151116150723) do
|
15
15
|
|
16
16
|
create_table "addresses", force: :cascade do |t|
|
17
17
|
t.string "street"
|
@@ -39,6 +39,7 @@ ActiveRecord::Schema.define(version: 20150626132542) do
|
|
39
39
|
t.text "description"
|
40
40
|
t.datetime "created_at", null: false
|
41
41
|
t.datetime "updated_at", null: false
|
42
|
+
t.string "roles"
|
42
43
|
end
|
43
44
|
|
44
45
|
end
|
data/spec/dummy/db/test.sqlite3
CHANGED
Binary file
|
@@ -53,3 +53,10 @@ Migrating to CreateTags (20150626132542)
|
|
53
53
|
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150626132542"]]
|
54
54
|
[1m[36m (2.4ms)[0m [1mcommit transaction[0m
|
55
55
|
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
56
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.4ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
57
|
+
Migrating to AddRolesToUsers (20151116150723)
|
58
|
+
[1m[35m (0.1ms)[0m begin transaction
|
59
|
+
[1m[36m (0.3ms)[0m [1mALTER TABLE "users" ADD "roles" varchar[0m
|
60
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20151116150723"]]
|
61
|
+
[1m[36m (0.4ms)[0m [1mcommit transaction[0m
|
62
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|