petergate 1.7.5 → 1.8.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5226fdf72eb5218ffd51f5229c2ba423914b24b1
4
- data.tar.gz: 00f68fc628f8a4222ccb109b043b4b989d794cc1
3
+ metadata.gz: 6e3e7f6b21e4e2741e2f6532608aa4d474d3b06c
4
+ data.tar.gz: bc189e9b546e61b2f4286ed926ca215154a98d0a
5
5
  SHA512:
6
- metadata.gz: 2706fc97c16e08716615b24b513fc5ed6899e502cbc07761a3a9ea1207865cffe2ebb50f8b75ee6c00f05630ab71fd75581e229dbc810e965fb37a60c4e60051
7
- data.tar.gz: bbae5015e38184d1a0755372121e3cabace72777fb9830a6288fccce5b3a03a633d7f4ea85dac4e1fbd9a9d3cd30caea580e3746063a862b141a815430887063
6
+ metadata.gz: 28a273b2501a589505919929ff370547865f5404ca39f99bb1f21632c0ba51b679e3fe0043684143737a925852cddef3634ff387c49f574a4cdc5980282cc529
7
+ data.tar.gz: 6476a7d81f6f4669fbc50f4134bd7095adca0549ee293e38e1b73b08fc32610a69cdcd530f3817c2991f3c5d5549e260296e3512a874ad7d0e887961c7dcaaf1
@@ -0,0 +1 @@
1
+ 2.3.1
@@ -1,5 +1,5 @@
1
1
  language: ruby
2
2
  rvm:
3
- - "2.1.3"
3
+ - "2.3.1"
4
4
  before_script: "bundle install && cd dummy && rake db:create && rake db:migrate"
5
5
  script: "bundle exec rake test"
data/Gemfile CHANGED
@@ -1,4 +1,5 @@
1
1
  source 'https://rubygems.org'
2
+ ruby '2.3.1'
2
3
 
3
4
  # Specify your gem's dependencies in petergate.gemspec
4
5
  gemspec
data/README.md CHANGED
@@ -119,6 +119,59 @@ If you want to change the `permission denied` message you can add to the access
119
119
  access user: [:show, :index], message: "You shall not pass"
120
120
  ```
121
121
 
122
+ #### User Admin Example Form for Multiple Roles
123
+
124
+ ```slim
125
+ = form_for @user do |f|
126
+ - if @user.errors.any?
127
+ #error_explanation
128
+ h2 = "#{pluralize(@user.errors.count, "error")} prohibited this user from being saved:"
129
+ ul
130
+ - @user.errors.full_messages.each do |message|
131
+ li = message
132
+
133
+ .field
134
+ = f.label :email
135
+ = f.text_field :email
136
+ - if @user.new_record? || params[:passwd]
137
+ .field
138
+ = f.label :password
139
+ = f.text_field :password
140
+ .field
141
+ = f.label :password_confirmation
142
+ = f.text_field :password_confirmation
143
+ .field
144
+ = f.label :roles
145
+ = f.select :roles, @user.available_roles, {}, {multiple: true}
146
+ .actions = f.submit
147
+ ```
148
+
149
+ #### User Admin Example Form for Single Role Mode
150
+
151
+ ```slim
152
+ = form_for @user do |f|
153
+ - if @user.errors.any?
154
+ #error_explanation
155
+ h2 = "#{pluralize(@user.errors.count, "error")} prohibited this user from being saved:"
156
+ ul
157
+ - @user.errors.full_messages.each do |message|
158
+ li = message
159
+
160
+ .field
161
+ = f.label :email
162
+ = f.text_field :email
163
+ - if @user.new_record? || params[:passwd]
164
+ .field
165
+ = f.label :password
166
+ = f.text_field :password
167
+ .field
168
+ = f.label :password_confirmation
169
+ = f.text_field :password_confirmation
170
+ .field
171
+ = f.label :role
172
+ = f.select :role, @user.available_roles
173
+ .actions = f.submit
174
+ ```
122
175
  Credits
123
176
  -------
124
177
 
@@ -64,6 +64,8 @@ module Petergate
64
64
  end
65
65
  end
66
66
 
67
+ alias_method :role=, :roles=
68
+
67
69
  def role
68
70
  roles.first
69
71
  end
@@ -1,3 +1,3 @@
1
1
  module Petergate
2
- VERSION = "1.7.5"
2
+ VERSION = "1.8.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: petergate
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.5
4
+ version: 1.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Isaac Sloan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-22 00:00:00.000000000 Z
11
+ date: 2017-10-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -62,6 +62,7 @@ extensions: []
62
62
  extra_rdoc_files: []
63
63
  files:
64
64
  - ".gitignore"
65
+ - ".ruby-version"
65
66
  - ".travis.yml"
66
67
  - Gemfile
67
68
  - LICENSE.txt