Module: StatusFor::Status_For_Utils
- Defined in:
- lib/status_for/acts_as_statusable_for.rb
Instance Method Summary collapse
- #status_for_array_to_psql_array(group) ⇒ Object
-
#status_for_psql_array_to_array(psql_group) ⇒ Object
Some conversion is needed to save arrays into the postgresql database tables.
Instance Method Details
#status_for_array_to_psql_array(group) ⇒ Object
90 91 92 93 |
# File 'lib/status_for/acts_as_statusable_for.rb', line 90 def status_for_array_to_psql_array(group) mgroup = group.kind_of?(Array) ? group : [group] mgroup.to_s.gsub('[', '{').gsub(']', '}') end |
#status_for_psql_array_to_array(psql_group) ⇒ Object
Some conversion is needed to save arrays into the postgresql database tables.
82 83 84 85 86 87 88 |
# File 'lib/status_for/acts_as_statusable_for.rb', line 82 def status_for_psql_array_to_array(psql_group) if psql_group eval(psql_group.gsub('NULL', '').gsub('{', '[').gsub('}', ']')) else [] end end |