Module: Iord::Attriutes

Extended by:
ActiveSupport::Concern
Included in:
Controller
Defined in:
lib/iord/attributes.rb

Instance Method Summary collapse

Instance Method Details

#attrsObject



20
21
22
# File 'lib/iord/attributes.rb', line 20

def attrs
  @attrs ||= show_attrs - %i(_id created_at updated_at)
end

#edit_attrsObject



36
37
38
# File 'lib/iord/attributes.rb', line 36

def edit_attrs
  form_attrs
end

#form_attrsObject



28
29
30
# File 'lib/iord/attributes.rb', line 28

def form_attrs
  attrs
end

#index_attrsObject



24
25
26
# File 'lib/iord/attributes.rb', line 24

def index_attrs
  attrs
end

#new_attrsObject



32
33
34
# File 'lib/iord/attributes.rb', line 32

def new_attrs
  form_attrs
end

#show_attrsObject



16
17
18
# File 'lib/iord/attributes.rb', line 16

def show_attrs
  @show_attrs ||= resource_class.attribute_names.map{ |i| i.to_sym } - %i(deleted_at)
end