Sha256: 83cf79eb955f3cd7ad3071653550289396857cdcef4c71c6e1e900d1b2d84bca

Contents?: true

Size: 464 Bytes

Versions: 2

Compression:

Stored size: 464 Bytes

Contents

# Common methods for single relations, like {Relation::Public} and {Relation::Reject}
#
# Unlike {Relation::Custom}, {SocialStream::Models::Subject subjects} have only one of
# these {Relation relations}.
#
class Relation::Single < Relation
  class << self
    def instance
      @instance ||=
        first || create!
    end
  end

  # The name of public relation
  def name
    I18n.t("relation_#{ self.class.name.split("::").last.underscore }.name")
  end
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
social_stream-0.25.2 base/app/models/relation/single.rb
social_stream-base-0.19.2 app/models/relation/single.rb