aboutsummaryrefslogtreecommitdiffstats
path: root/lib/active_text/attribute.rb
diff options
context:
space:
mode:
authorJavan Makhmali <javan@javan.us>2018-02-08 15:48:45 -0500
committerJavan Makhmali <javan@javan.us>2018-02-08 15:48:45 -0500
commit5012d645daa65ef776d27eb973b3278302c36cad (patch)
treebe85c13f8f2fef097f1547e039cb5459d4cf023c /lib/active_text/attribute.rb
parent38e1f12d79ec3313e42643e52f2d10cb5fbd5d5d (diff)
downloadrails-5012d645daa65ef776d27eb973b3278302c36cad.tar.gz
rails-5012d645daa65ef776d27eb973b3278302c36cad.tar.bz2
rails-5012d645daa65ef776d27eb973b3278302c36cad.zip
Add initial ActiveRecord extension: `active_text_attribute`
Diffstat (limited to 'lib/active_text/attribute.rb')
-rw-r--r--lib/active_text/attribute.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/active_text/attribute.rb b/lib/active_text/attribute.rb
new file mode 100644
index 0000000000..577adde83a
--- /dev/null
+++ b/lib/active_text/attribute.rb
@@ -0,0 +1,11 @@
+module ActiveText
+ module Attribute
+ extend ActiveSupport::Concern
+
+ class_methods do
+ def active_text_attribute(attribute_name)
+ serialize(attribute_name, ActiveText::Content)
+ end
+ end
+ end
+end