Sha256: 8a0a113fda341e3947934f79092b1ad1dfd132f964fc7192171ae5a15875f0f0

Contents?: true

Size: 399 Bytes

Versions: 12

Compression:

Stored size: 399 Bytes

Contents

module EgovUtils
  class Fullname < AzaharaSchema::Attribute

    def arel_field
      Arel::Nodes::NamedFunction.new 'CONCAT', [EgovUtils::Person.arel_table[:lastname], Arel::Nodes::SqlLiteral.new('\' \'') , EgovUtils::Person.arel_table[:firstname]]
    end

    def build_json_options!(options)
      options[:methods] ||= []
      options[:methods] << 'fullname'
      options
    end

  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
egov_utils-0.1.15 app/attributes/egov_utils/fullname.rb
egov_utils-0.1.14 app/attributes/egov_utils/fullname.rb
egov_utils-0.1.13 app/attributes/egov_utils/fullname.rb
egov_utils-0.1.12 app/attributes/egov_utils/fullname.rb
egov_utils-0.1.11 app/attributes/egov_utils/fullname.rb
egov_utils-0.1.10 app/attributes/egov_utils/fullname.rb
egov_utils-0.1.9 app/attributes/egov_utils/fullname.rb
egov_utils-0.1.8 app/attributes/egov_utils/fullname.rb
egov_utils-0.1.7 app/attributes/egov_utils/fullname.rb
egov_utils-0.1.6 app/attributes/egov_utils/fullname.rb
egov_utils-0.1.5 app/attributes/egov_utils/fullname.rb
egov_utils-0.1.4 app/attributes/egov_utils/fullname.rb