mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Lazy initialization of rich text model
This commit is contained in:
parent
aa42bf2027
commit
94a95db2f5
1 changed files with 1 additions and 1 deletions
|
@ -6,7 +6,7 @@ module ActionText
|
|||
def has_rich_text(name)
|
||||
class_eval <<-CODE, __FILE__, __LINE__ + 1
|
||||
def #{name}
|
||||
rich_text_#{name}
|
||||
self.rich_text_#{name} ||= ActionText::RichText.new(name: "#{name}", record: self)
|
||||
end
|
||||
|
||||
def #{name}=(body)
|
||||
|
|
Loading…
Reference in a new issue