Skip to content

Commit

Permalink
Use Ruby 1.9 hash style
Browse files Browse the repository at this point in the history
  • Loading branch information
timurvafin committed Oct 15, 2012
1 parent e7a67a5 commit 2623daf
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 32 deletions.
12 changes: 6 additions & 6 deletions config/environments/production.rb
Expand Up @@ -53,12 +53,12 @@

# Heroku specific setting for Cedar stack http://devcenter.heroku.com/articles/sendgrid#usage
config.action_mailer.smtp_settings = {
:address => 'smtp.sendgrid.net',
:port => '587',
:authentication => :plain,
:user_name => ENV['SENDGRID_USERNAME'],
:password => ENV['SENDGRID_PASSWORD'],
:domain => 'heroku.com'
address: 'smtp.sendgrid.net',
port: '587',
authentication: :plain,
user_name: ENV['SENDGRID_USERNAME'],
password: ENV['SENDGRID_PASSWORD'],
domain: 'heroku.com'
}

# Preview email in the browser instead of sending it.
Expand Down
42 changes: 21 additions & 21 deletions config/initializers/simple_form.rb
Expand Up @@ -5,8 +5,8 @@
# wrapper, change the order or even add your own to the
# stack. The options given below are used to wrap the
# whole input.
config.wrappers :default, :class => :input,
:hint_class => :field_with_hint, :error_class => :field_with_errors do |b|
config.wrappers :default, class: :input,
hint_class: :field_with_hint, error_class: :field_with_errors do |b|
## Extensions enabled by default
# Any of these extensions can be disabled for a
# given input by passing: `f.input EXTENSION_NAME => false`.
Expand All @@ -18,7 +18,7 @@
b.use :html5

# Calculates placeholders automatically from I18n
# You can also pass a string as f.input :placeholder => "Placeholder"
# You can also pass a string as f.input placeholder: "Placeholder"
b.use :placeholder

## Optional extensions
Expand All @@ -41,44 +41,44 @@

## Inputs
b.use :label_input
b.use :hint, :wrap_with => { :tag => :span, :class => :hint }
b.use :error, :wrap_with => { :tag => :span, :class => :error }
b.use :hint, wrap_with: { tag: :span, class: :hint }
b.use :error, wrap_with: { tag: :span, class: :error }
end

config.wrappers :bootstrap, :tag => 'div', :class => 'control-group', :error_class => 'error' do |b|
config.wrappers :bootstrap, tag: 'div', class: 'control-group', error_class: 'error' do |b|
b.use :html5
b.use :placeholder
b.use :label
b.wrapper :tag => 'div', :class => 'controls' do |ba|
b.wrapper tag: 'div', class: 'controls' do |ba|
ba.use :input
ba.use :error, :wrap_with => { :tag => 'span', :class => 'help-inline' }
ba.use :hint, :wrap_with => { :tag => 'p', :class => 'help-block' }
ba.use :error, wrap_with: { tag: 'span', class: 'help-inline' }
ba.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
end
end

config.wrappers :prepend, :tag => 'div', :class => "control-group", :error_class => 'error' do |b|
config.wrappers :prepend, tag: 'div', class: "control-group", error_class: 'error' do |b|
b.use :html5
b.use :placeholder
b.use :label
b.wrapper :tag => 'div', :class => 'controls' do |input|
input.wrapper :tag => 'div', :class => 'input-prepend' do |prepend|
b.wrapper tag: 'div', class: 'controls' do |input|
input.wrapper tag: 'div', class: 'input-prepend' do |prepend|
prepend.use :input
end
input.use :hint, :wrap_with => { :tag => 'span', :class => 'help-block' }
input.use :error, :wrap_with => { :tag => 'span', :class => 'help-inline' }
input.use :hint, wrap_with: { tag: 'span', class: 'help-block' }
input.use :error, wrap_with: { tag: 'span', class: 'help-inline' }
end
end

config.wrappers :append, :tag => 'div', :class => "control-group", :error_class => 'error' do |b|
config.wrappers :append, tag: 'div', class: "control-group", error_class: 'error' do |b|
b.use :html5
b.use :placeholder
b.use :label
b.wrapper :tag => 'div', :class => 'controls' do |input|
input.wrapper :tag => 'div', :class => 'input-append' do |append|
b.wrapper tag: 'div', class: 'controls' do |input|
input.wrapper tag: 'div', class: 'input-append' do |append|
append.use :input
end
input.use :hint, :wrap_with => { :tag => 'span', :class => 'help-block' }
input.use :error, :wrap_with => { :tag => 'span', :class => 'help-inline' }
input.use :hint, wrap_with: { tag: 'span', class: 'help-block' }
input.use :error, wrap_with: { tag: 'span', class: 'help-inline' }
end
end

Expand All @@ -90,8 +90,8 @@

# Define the way to render check boxes / radio buttons with labels.
# Defaults to :nested for bootstrap config.
# :inline => input + label
# :nested => label > input
# inline: input + label
# nested: label > input
config.boolean_style = :nested

# Default class for buttons
Expand Down
4 changes: 2 additions & 2 deletions config/navigations/user_navigation.rb
Expand Up @@ -6,8 +6,8 @@

if user_signed_in?
user.item :account, current_user.full_name_with_email, '#',
:class => 'dropdown',
:link => {:class => 'dropdown-toggle', 'data-toggle' => 'dropdown'} do |account|
class: 'dropdown',
link: { class: 'dropdown-toggle', 'data-toggle' => 'dropdown' } do |account|

account.dom_class = 'dropdown-menu'

Expand Down
6 changes: 3 additions & 3 deletions db/migrate/20100713113845_devise_create_users.rb
Expand Up @@ -2,8 +2,8 @@ class DeviseCreateUsers < ActiveRecord::Migration
def self.up
create_table(:users) do |t|
# Database authenticatable
t.string :email, :null => false, :default => ""
t.string :encrypted_password, :null => false, :default => ""
t.string :email, null: false, default: ""
t.string :encrypted_password, null: false, default: ""

# Recoverable
t.string :reset_password_token
Expand All @@ -19,7 +19,7 @@ def self.up
t.string :unconfirmed_email # Only if using reconfirmable

# Trackable
t.integer :sign_in_count, :default => 0
t.integer :sign_in_count, default: 0
t.datetime :current_sign_in_at
t.datetime :last_sign_in_at
t.string :current_sign_in_ip
Expand Down

0 comments on commit 2623daf

Please sign in to comment.