Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion app/controllers/widget_controller.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class WidgetController < ApplicationController
def index
RAILS_DEFAULT_LOGGER.warn("Test log message with the old constants")
Rails.logger.warn("Test log message with the old constants")
end

end
8 changes: 4 additions & 4 deletions app/models/widget.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
class Widget < ActiveRecord::Base
named_scope :equals_test, where(:test_val => "Test")
validate_on_create :create_validation
validate_on_update :update_validation
scope :equals_test, where(:test_val => "Test")
validate :create_validation, :on => :create
validate :update_validation, :on => :update

def save_without_verification
save(false)
save(:validate => false)
end

def create_validation
Expand Down
4 changes: 2 additions & 2 deletions app/views/widget/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<h1>Test#index</h1>
rails root is - <%= RAILS_ROOT %><br />
Environment is - <%= RAILS_ENV %>
rails root is - <%= Rails.root %><br />
Environment is - <%= Rails.env %>
2 changes: 1 addition & 1 deletion test/test_helper.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ENV["RAILS_ENV"] = "test"
ENV["Rails.env"] = "test"
require File.expand_path('../../config/environment', __FILE__)
require 'rails/test_help'

Expand Down