mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Merge pull request #2964 from msgehard/silence_warnings
Silence Ruby warnings about uninitialized instance variable.
This commit is contained in:
commit
5f28c22722
1 changed files with 2 additions and 9 deletions
|
@ -48,26 +48,19 @@ module Quiz
|
|||
end
|
||||
end
|
||||
|
||||
class Post < Struct.new(:title, :author_name, :body, :secret, :written_on, :cost)
|
||||
class Post < Struct.new(:title, :author_name, :body, :secret, :persisted, :written_on, :cost)
|
||||
extend ActiveModel::Naming
|
||||
include ActiveModel::Conversion
|
||||
extend ActiveModel::Translation
|
||||
|
||||
alias_method :secret?, :secret
|
||||
alias_method :persisted?, :persisted
|
||||
|
||||
def initialize(*args)
|
||||
super
|
||||
@persisted = false
|
||||
end
|
||||
|
||||
def persisted=(boolean)
|
||||
@persisted = boolean
|
||||
end
|
||||
|
||||
def persisted?
|
||||
@persisted
|
||||
end
|
||||
|
||||
attr_accessor :author
|
||||
def author_attributes=(attributes); end
|
||||
|
||||
|
|
Loading…
Reference in a new issue