Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove old style hashes from readme #451

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading