Class: Refinery::Activity

Inherits:
Object
  • Object
show all
Defined in:
vendor/plugins/refinery/lib/refinery/activity.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Activity

for nested_with, pass in the reverse order of ancestry e.g. [parent.parent_of_parent, parent]



7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'vendor/plugins/refinery/lib/refinery/activity.rb', line 7

def initialize(options={})
  {
    :class => nil,
    :conditions => nil,
    :created_image => "add.png",
    :limit => 10,
    :nested_with => [],
    :order => 'updated_at DESC',
    :title => nil,
    :updated_image => "edit.png",
    :url => nil,
    :url_prefix => ""
  }.merge(options).each { |key,value| self.instance_variable_set(:"@#{key}", value) }
end

Instance Attribute Details

#classObject

Returns the value of attribute class.



4
5
6
# File 'vendor/plugins/refinery/lib/refinery/activity.rb', line 4

def class
  @class
end

#conditionsObject

Returns the value of attribute conditions.



4
5
6
# File 'vendor/plugins/refinery/lib/refinery/activity.rb', line 4

def conditions
  @conditions
end

#created_imageObject

Returns the value of attribute created_image.



4
5
6
# File 'vendor/plugins/refinery/lib/refinery/activity.rb', line 4

def created_image
  @created_image
end

#limitObject

Returns the value of attribute limit.



4
5
6
# File 'vendor/plugins/refinery/lib/refinery/activity.rb', line 4

def limit
  @limit
end

#nested_withObject

Returns the value of attribute nested_with.



4
5
6
# File 'vendor/plugins/refinery/lib/refinery/activity.rb', line 4

def nested_with
  @nested_with
end

#orderObject

Returns the value of attribute order.



4
5
6
# File 'vendor/plugins/refinery/lib/refinery/activity.rb', line 4

def order
  @order
end

#titleObject

Returns the value of attribute title.



4
5
6
# File 'vendor/plugins/refinery/lib/refinery/activity.rb', line 4

def title
  @title
end

#updated_imageObject

Returns the value of attribute updated_image.



4
5
6
# File 'vendor/plugins/refinery/lib/refinery/activity.rb', line 4

def updated_image
  @updated_image
end

#urlObject

Returns the value of attribute url.



4
5
6
# File 'vendor/plugins/refinery/lib/refinery/activity.rb', line 4

def url
  @url
end

#url_prefixObject

Returns the value of attribute url_prefix.



4
5
6
# File 'vendor/plugins/refinery/lib/refinery/activity.rb', line 4

def url_prefix
  @url_prefix
end

Instance Method Details

#nesting(record_string = "record") ⇒ Object

to use in a URL like edit_admin_group_individuals_url(record.group, record) which will help you if you’re using nested routed.



24
25
26
# File 'vendor/plugins/refinery/lib/refinery/activity.rb', line 24

def nesting(record_string="record")
  self.nested_with.inject("") { |nest_chain, nesting| nest_chain << "#{record_string}.#{nesting}," }
end