Skip to content

Commit b5e904b

Browse files
authored
Merge pull request #451 from dreamfall/remove-old-hash-style-from-readme
Remove old style hashes from readme
2 parents c77d0e3 + 652b895 commit b5e904b

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ It's also possible to store enumerized attribute value using custom values (e.g.
306306
class User < ActiveRecord::Base
307307
extend Enumerize
308308

309-
enumerize :role, in: {:user => 1, :admin => 2}
309+
enumerize :role, in: { user: 1, admin: 2 }
310310
end
311311

312312
user = User.new
@@ -325,8 +325,8 @@ User.role.find_value(:admin).value #=> 2
325325
```ruby
326326
class User < ActiveRecord::Base
327327
extend Enumerize
328-
enumerize :role, :in => [:user, :admin], scope: true
329-
enumerize :status, :in => { student: 1, employed: 2, retired: 3 }, scope: :having_status
328+
enumerize :role, in: [:user, :admin], scope: true
329+
enumerize :status, in: { student: 1, employed: 2, retired: 3 }, scope: :having_status
330330
end
331331

332332
User.with_role(:admin)
@@ -346,8 +346,8 @@ Adds named scopes to the class directly.
346346
```ruby
347347
class User < ActiveRecord::Base
348348
extend Enumerize
349-
enumerize :status, :in => [:student, :employed, :retired], scope: :shallow
350-
enumerize :role, :in => { user: 1, admin: 2 }, scope: :shallow
349+
enumerize :status, in: [:student, :employed, :retired], scope: :shallow
350+
enumerize :role, in: { user: 1, admin: 2 }, scope: :shallow
351351
end
352352

353353
User.student
@@ -422,7 +422,7 @@ and if you want it as radio buttons:
422422

423423
```erb
424424
<%= simple_form_for @user do |f| %>
425-
<%= f.input :status, :as => :radio_buttons %>
425+
<%= f.input :status, as: :radio_buttons %>
426426
<% end %>
427427
```
428428

@@ -442,7 +442,7 @@ and if you want it as radio buttons:
442442

443443
```erb
444444
<%= semantic_form_for @user do |f| %>
445-
<%= f.input :status, :as => :radio %>
445+
<%= f.input :status, as: :radio %>
446446
<% end %>
447447
```
448448

0 commit comments

Comments
 (0)