Methods
Instance Public methods
actual_start_drip(content) Link
Use the start_drip if it exists, otherwise use the member start drip
Source: show
# File engines/member/app/actions/member/content_search/scope/functions.rb, line 7 def actual_start_drip(content) Arel::Nodes::NamedFunction.new( "coalesce", [content.arel_table[:drip_start], calculate_member_start_drip(content)] ) end
calculate_member_start_drip(content) Link
This is a postgres specific implementation
Source: show
# File engines/member/app/actions/member/content_search/scope/functions.rb, line 15 def calculate_member_start_drip(content) content_table = content.arel_table day_interval = Arel::Nodes::SqlLiteral.new("INTERVAL '1 day'") days_term = Arel::Nodes::Multiplication.new( content_table[:days_until_drip], day_interval ) Arel::Nodes::Grouping.new( Arel::Nodes::Addition.new( member_plannings_table[:created_at], days_term ) ) end
concat_function(nodes, delimiter) Link
Source: show
# File engines/member/app/actions/member/content_search/scope/functions.rb, line 31 def concat_function(nodes, delimiter) delimiter_node = Arel::Nodes::Quoted.new(delimiter) args = nodes.inject { |acc, node| Array(acc) << delimiter_node << node } Arel::Nodes::NamedFunction.new("concat", args) end