Module: Actionstore

Defined in:
lib/actionstore/channel.rb,
lib/actionstore/railtie.rb,
lib/actionstore/version.rb,
lib/actionstore/actionstore.rb

Defined Under Namespace

Modules: ClassMethods, InstanceMethods Classes: Channel, Railtie

Constant Summary collapse

VERSION =
"0.3.2"

Class Method Summary collapse

Class Method Details

.store_id(subject) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/actionstore/actionstore.rb', line 3

def self.store_id subject
  if subject.nil?
    nil
  elsif subject.is_a? String
    subject
  elsif subject.respond_to? :to_store_id
    subject.to_store_id
  else
    ActionView::RecordIdentifier.dom_id subject
  end
end