Sha256: 93c8eae29368c33ed4d2119d8d3cd88332f435535d4641db244bd1cbc8491965

Contents?: true

Size: 614 Bytes

Versions: 14

Compression:

Stored size: 614 Bytes

Contents

require 'action_view/helpers/auto_tag_helper/form_info'
require 'activerecord/mlang'
class OrgMemberText < ActiveRecord::Base
  include ActiveRecord::Mlang::Text
  include ActionView::Helpers::AutoTagHelper::FormInfo
  set_accessible_attrs :family_name, :given_name, :family_name_pron, :given_name_pron, :comment, :comment_format

  def name
    fn = self.family_name.to_s.presence
    gn = self.given_name.to_s.presence
    if fn && gn
      ( self.try(:parent).try(:lang).try(:east?) ) ? "#{fn} #{gn}" : "#{gn} #{fn}"
    else
      gn.presence || fn
    end
  end

   def __display__
     self.name
   end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
we_bridge_rails_engine_orgs-0.1.13 app/models/org_member_text.rb
we_bridge_rails_engine_orgs-0.1.12 app/models/org_member_text.rb
we_bridge_rails_engine_orgs-0.1.11 app/models/org_member_text.rb
we_bridge_rails_engine_orgs-0.1.10 app/models/org_member_text.rb
we_bridge_rails_engine_orgs-0.1.9 app/models/org_member_text.rb
we_bridge_rails_engine_orgs-0.1.8 app/models/org_member_text.rb
we_bridge_rails_engine_orgs-0.1.7 app/models/org_member_text.rb
we_bridge_rails_engine_orgs-0.1.6 app/models/org_member_text.rb
we_bridge_rails_engine_orgs-0.1.5 app/models/org_member_text.rb
we_bridge_rails_engine_orgs-0.1.4 app/models/org_member_text.rb
we_bridge_rails_engine_orgs-0.1.3 app/models/org_member_text.rb
we_bridge_rails_engine_orgs-0.1.2 app/models/org_member_text.rb
we_bridge_rails_engine_orgs-0.1.1 app/models/org_member_text.rb
we_bridge_rails_engine_orgs-0.1.0 app/models/org_member_text.rb