Module: PgTagsOn::ActiveRecord::Arel
- Included in:
- PredicateHandler::BaseHandler, Repositories::ArrayJsonb::Create, Repositories::ArrayJsonb::Delete, Repositories::ArrayJsonb::Update, Repositories::ArrayValue::Create, Repositories::ArrayValue::Delete, Repositories::ArrayValue::Update, Repositories::BaseRepository
- Defined in:
- lib/pg_tags_on/active_record/arel.rb
Overview
Arel extension
Instance Method Summary collapse
-
#arel_array_cat(attr, value) ⇒ Object
array_cat function.
-
#arel_array_remove(attr, value) ⇒ Object
array_remove function.
-
#arel_array_replace(attr, value1, value2) ⇒ Object
array_replace function.
- #arel_bind(query_attr) ⇒ Object
- #arel_build_quoted(expr) ⇒ Object
- #arel_cast(attr, type) ⇒ Object
-
#arel_distinct(node) ⇒ Object
distinct function.
- #arel_function(name, *args) ⇒ Object
- #arel_infix_operation(operator, left, right) ⇒ Object
- #arel_jsonb_extract_path(attr, *args) ⇒ Object
- #arel_query_attribute(attr, value, cast_type) ⇒ Object
- #arel_sql(expr) ⇒ Object
-
#arel_unnest(attr) ⇒ Object
unnest function
attrArel attribute.
Instance Method Details
#arel_array_cat(attr, value) ⇒ Object
array_cat function
23 24 25 |
# File 'lib/pg_tags_on/active_record/arel.rb', line 23 def arel_array_cat(attr, value) arel_function('array_cat', attr, value) end |
#arel_array_remove(attr, value) ⇒ Object
array_remove function
33 34 35 |
# File 'lib/pg_tags_on/active_record/arel.rb', line 33 def arel_array_remove(attr, value) arel_function('array_remove', attr, value) end |
#arel_array_replace(attr, value1, value2) ⇒ Object
array_replace function
28 29 30 |
# File 'lib/pg_tags_on/active_record/arel.rb', line 28 def arel_array_replace(attr, value1, value2) arel_function('array_replace', attr, value1, value2) end |
#arel_bind(query_attr) ⇒ Object
45 46 47 |
# File 'lib/pg_tags_on/active_record/arel.rb', line 45 def arel_bind(query_attr) ::Arel::Nodes::BindParam.new(query_attr) end |
#arel_build_quoted(expr) ⇒ Object
61 62 63 |
# File 'lib/pg_tags_on/active_record/arel.rb', line 61 def arel_build_quoted(expr) ::Arel::Nodes.build_quoted(expr) end |
#arel_cast(attr, type) ⇒ Object
53 54 55 |
# File 'lib/pg_tags_on/active_record/arel.rb', line 53 def arel_cast(attr, type) ::Arel::Nodes::InfixOperation.new('::', attr, arel_sql(type)) end |
#arel_distinct(node) ⇒ Object
distinct function
18 19 20 |
# File 'lib/pg_tags_on/active_record/arel.rb', line 18 def arel_distinct(node) arel_function('distinct', node) end |
#arel_function(name, *args) ⇒ Object
7 8 9 |
# File 'lib/pg_tags_on/active_record/arel.rb', line 7 def arel_function(name, *args) ::Arel::Nodes::NamedFunction.new(name, args) end |
#arel_infix_operation(operator, left, right) ⇒ Object
49 50 51 |
# File 'lib/pg_tags_on/active_record/arel.rb', line 49 def arel_infix_operation(operator, left, right) ::Arel::Nodes::InfixOperation.new(operator, left, right) end |
#arel_jsonb_extract_path(attr, *args) ⇒ Object
37 38 39 |
# File 'lib/pg_tags_on/active_record/arel.rb', line 37 def arel_jsonb_extract_path(attr, *args) arel_function('jsonb_extract_path', [attr, *args]) end |
#arel_query_attribute(attr, value, cast_type) ⇒ Object
41 42 43 |
# File 'lib/pg_tags_on/active_record/arel.rb', line 41 def arel_query_attribute(attr, value, cast_type) ::ActiveRecord::Relation::QueryAttribute.new(attr, value, cast_type) end |
#arel_sql(expr) ⇒ Object
57 58 59 |
# File 'lib/pg_tags_on/active_record/arel.rb', line 57 def arel_sql(expr) ::Arel.sql(expr) end |
#arel_unnest(attr) ⇒ Object
unnest function attr Arel attribute
13 14 15 |
# File 'lib/pg_tags_on/active_record/arel.rb', line 13 def arel_unnest(attr) arel_function('unnest', attr) end |