mirror of
https://github.com/danbee/danbarberphoto
synced 2025-03-04 08:49:07 +00:00
Ruby 1.9 hash syntax
This commit is contained in:
parent
de4312663b
commit
e8401c4958
@ -4,7 +4,7 @@ require 'rails/all'
|
||||
|
||||
if defined?(Bundler)
|
||||
# If you precompile assets before deploying to production, use this line
|
||||
Bundler.require *Rails.groups(:assets => %w(development test))
|
||||
Bundler.require *Rails.groups(assets: %w(development test))
|
||||
# If you want your assets lazily compiled in production, use this line
|
||||
# Bundler.require(:default, :assets, Rails.env)
|
||||
end
|
||||
|
||||
@ -33,6 +33,6 @@ DanBarberPhoto::Application.configure do
|
||||
|
||||
config.action_mailer.delivery_method = :letter_opener
|
||||
|
||||
config.action_mailer.default_url_options = { :host => "danbarberphoto.dev" }
|
||||
config.action_mailer.default_url_options = { host: "danbarberphoto.dev" }
|
||||
|
||||
end
|
||||
|
||||
@ -66,15 +66,15 @@ DanBarberPhoto::Application.configure do
|
||||
|
||||
# Settings for Sendgrid Free on Heroku
|
||||
ActionMailer::Base.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'
|
||||
}
|
||||
ActionMailer::Base.delivery_method = :smtp
|
||||
|
||||
config.action_mailer.default_url_options = { :host => "danbarberphoto.com" }
|
||||
config.action_mailer.default_url_options = { host: "danbarberphoto.com" }
|
||||
|
||||
end
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
class MoveToManyToMany < ActiveRecord::Migration
|
||||
def self.up
|
||||
remove_column :photos, :category_id
|
||||
create_table :categories_photos, :id => false do |t|
|
||||
create_table :categories_photos, id: false do |t|
|
||||
t.integer :category_id
|
||||
t.integer :photo_id
|
||||
end
|
||||
|
||||
@ -2,14 +2,14 @@ class CreateAdminUsers < ActiveRecord::Migration
|
||||
|
||||
def self.up
|
||||
create_table :admin_users do |t|
|
||||
t.string :first_name, :default => "", :null => false
|
||||
t.string :last_name, :default => "", :null => false
|
||||
t.string :role, :null => false
|
||||
t.string :email, :null => false
|
||||
t.boolean :status, :default => false
|
||||
t.string :token, :null => false
|
||||
t.string :salt, :null => false
|
||||
t.string :crypted_password, :null => false
|
||||
t.string :first_name, default: "", null: false
|
||||
t.string :last_name, default: "", null: false
|
||||
t.string :role, null: false
|
||||
t.string :email, null: false
|
||||
t.boolean :status, default: false
|
||||
t.string :token, null: false
|
||||
t.string :salt, null: false
|
||||
t.string :crypted_password, null: false
|
||||
t.string :preferences
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
class PhotoShowcase < ActiveRecord::Migration
|
||||
def self.up
|
||||
add_column :photos, :featured, :boolean, :default => false
|
||||
add_column :photos, :featured, :boolean, default: false
|
||||
end
|
||||
|
||||
def self.down
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
class AddEnabledToPhotos < ActiveRecord::Migration
|
||||
def self.up
|
||||
add_column :photos, :enabled, :boolean, :default => true
|
||||
add_column :photos, :enabled, :boolean, default: true
|
||||
end
|
||||
|
||||
def self.down
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
class AddViewCountToPhotos < ActiveRecord::Migration
|
||||
def self.up
|
||||
add_column :photos, :views, :integer, :default => 0
|
||||
add_column :photos, :views, :integer, default: 0
|
||||
end
|
||||
|
||||
def self.down
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
class AddSessionsTable < ActiveRecord::Migration
|
||||
def up
|
||||
create_table :sessions do |t|
|
||||
t.string :session_id, :null => false
|
||||
t.string :session_id, null: false
|
||||
t.text :data
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
@ -5,14 +5,14 @@ class RemoveAdminUsers < ActiveRecord::Migration
|
||||
|
||||
def self.down
|
||||
create_table :admin_users do |t|
|
||||
t.string :first_name, :default => "", :null => false
|
||||
t.string :last_name, :default => "", :null => false
|
||||
t.string :role, :null => false
|
||||
t.string :email, :null => false
|
||||
t.boolean :status, :default => false
|
||||
t.string :token, :null => false
|
||||
t.string :salt, :null => false
|
||||
t.string :crypted_password, :null => false
|
||||
t.string :first_name, default: "", null: false
|
||||
t.string :last_name, default: "", null: false
|
||||
t.string :role, null: false
|
||||
t.string :email, null: false
|
||||
t.boolean :status, default: false
|
||||
t.string :token, null: false
|
||||
t.string :salt, null: false
|
||||
t.string :crypted_password, null: false
|
||||
t.string :preferences
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
@ -2,8 +2,8 @@ class CreateDeviseAdminUsers < ActiveRecord::Migration
|
||||
def up
|
||||
create_table(:admin_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
|
||||
@ -13,7 +13,7 @@ class CreateDeviseAdminUsers < ActiveRecord::Migration
|
||||
t.datetime :remember_created_at
|
||||
|
||||
# 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
|
||||
@ -26,18 +26,18 @@ class CreateDeviseAdminUsers < ActiveRecord::Migration
|
||||
t.string :unconfirmed_email # Only if using reconfirmable
|
||||
|
||||
# Lockable
|
||||
t.integer :failed_attempts, :default => 0 # Only if lock strategy is :failed_attempts
|
||||
t.integer :failed_attempts, default: 0 # Only if lock strategy is :failed_attempts
|
||||
t.string :unlock_token # Only if unlock strategy is :email or :both
|
||||
t.datetime :locked_at
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
add_index :admin_users, :email, :unique => true
|
||||
add_index :admin_users, :reset_password_token, :unique => true
|
||||
add_index :admin_users, :confirmation_token, :unique => true
|
||||
add_index :admin_users, :unlock_token, :unique => true
|
||||
# add_index :admin_users, :authentication_token, :unique => true
|
||||
add_index :admin_users, :email, unique: true
|
||||
add_index :admin_users, :reset_password_token, unique: true
|
||||
add_index :admin_users, :confirmation_token, unique: true
|
||||
add_index :admin_users, :unlock_token, unique: true
|
||||
# add_index :admin_users, :authentication_token, unique: true
|
||||
end
|
||||
|
||||
def down
|
||||
|
||||
@ -6,8 +6,8 @@ class RemoveDeviseAdminUsers < ActiveRecord::Migration
|
||||
def down
|
||||
create_table(:admin_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
|
||||
@ -17,7 +17,7 @@ class RemoveDeviseAdminUsers < ActiveRecord::Migration
|
||||
t.datetime :remember_created_at
|
||||
|
||||
# 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
|
||||
@ -30,16 +30,16 @@ class RemoveDeviseAdminUsers < ActiveRecord::Migration
|
||||
t.string :unconfirmed_email # Only if using reconfirmable
|
||||
|
||||
# Lockable
|
||||
t.integer :failed_attempts, :default => 0 # Only if lock strategy is :failed_attempts
|
||||
t.integer :failed_attempts, default: 0 # Only if lock strategy is :failed_attempts
|
||||
t.string :unlock_token # Only if unlock strategy is :email or :both
|
||||
t.datetime :locked_at
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
add_index :admin_users, :email, :unique => true
|
||||
add_index :admin_users, :reset_password_token, :unique => true
|
||||
add_index :admin_users, :confirmation_token, :unique => true
|
||||
add_index :admin_users, :unlock_token, :unique => true
|
||||
add_index :admin_users, :email, unique: true
|
||||
add_index :admin_users, :reset_password_token, unique: true
|
||||
add_index :admin_users, :confirmation_token, unique: true
|
||||
add_index :admin_users, :unlock_token, unique: true
|
||||
end
|
||||
end
|
||||
|
||||
@ -3,5 +3,5 @@
|
||||
#
|
||||
# Examples:
|
||||
#
|
||||
# cities = City.create([{ :name => 'Chicago' }, { :name => 'Copenhagen' }])
|
||||
# Mayor.create(:name => 'Daley', :city => cities.first)
|
||||
# cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
|
||||
# Mayor.create(name: 'Daley', city: cities.first)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user