1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Revert "Unused methods, module, etc."

This reverts commit 4e05bfb8e2.

Reason: BlankTopic#blank? should not be removed to check that dynamic finder with a bang can find a model that responds to `blank?`
This commit is contained in:
Akira Matsuda 2013-01-24 21:44:02 +09:00
parent 4e05bfb8e2
commit 0400139038
4 changed files with 28 additions and 0 deletions

View file

@ -71,6 +71,14 @@ module MyApplication
i.belongs_to :nested_qualified_billing_firm, :class_name => 'MyApplication::Billing::Nested::Firm'
i.belongs_to :nested_unqualified_billing_firm, :class_name => 'Nested::Firm'
end
validate :check_empty_credit_limit
protected
def check_empty_credit_limit
errors.add_on_empty "credit_limit"
end
end
end
end

View file

@ -91,6 +91,14 @@ class NestedPerson < ActiveRecord::Base
has_one :best_friend, :class_name => 'NestedPerson', :foreign_key => :best_friend_id
accepts_nested_attributes_for :best_friend, :update_only => true
def comments=(new_comments)
raise RuntimeError
end
def best_friend_first_name=(new_name)
assign_attributes({ :best_friend_attributes => { :first_name => new_name } })
end
end
class Insure

View file

@ -1,2 +1,5 @@
class Task < ActiveRecord::Base
def updated_at
ending
end
end

View file

@ -26,6 +26,12 @@ class Topic < ActiveRecord::Base
end
}.new(self)
module NamedExtension
def two
2
end
end
has_many :replies, :dependent => :destroy, :foreign_key => "parent_id"
has_many :approved_replies, -> { approved }, class_name: 'Reply', foreign_key: "parent_id", counter_cache: 'replies_count'
has_many :replies_with_primary_key, :class_name => "Reply", :dependent => :destroy, :primary_key => "title", :foreign_key => "parent_title"
@ -102,6 +108,9 @@ class ImportantTopic < Topic
end
class BlankTopic < Topic
def blank?
true
end
end
module Web