Skip to content

Commit

Permalink
remove old style hashes from readme
Browse files Browse the repository at this point in the history
  • Loading branch information
dreamfall committed May 29, 2024
1 parent c77d0e3 commit 652b895
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ It's also possible to store enumerized attribute value using custom values (e.g.
class User < ActiveRecord::Base
extend Enumerize

enumerize :role, in: {:user => 1, :admin => 2}
enumerize :role, in: { user: 1, admin: 2 }
end

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

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

User.student
Expand Down Expand Up @@ -422,7 +422,7 @@ and if you want it as radio buttons:

```erb
<%= simple_form_for @user do |f| %>
<%= f.input :status, :as => :radio_buttons %>
<%= f.input :status, as: :radio_buttons %>
<% end %>
```

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

```erb
<%= semantic_form_for @user do |f| %>
<%= f.input :status, :as => :radio %>
<%= f.input :status, as: :radio %>
<% end %>
```

Expand Down

0 comments on commit 652b895

Please sign in to comment.