app/models/feature.rb in usman-0.3.15 vs app/models/feature.rb in usman-0.3.16

- old
+ new

@@ -38,10 +38,12 @@ scope :search, lambda {|query| where("LOWER(name) LIKE LOWER('%#{query}%')") } scope :status, lambda { |status| where("LOWER(status)='#{status}'") } + scope :categorisable, -> { where(categorisable: true) } + scope :unpublished, -> { where(status: UNPUBLISHED) } scope :published, -> { where(status: PUBLISHED) } scope :disabled, -> { where(status: DISABLED) } def self.save_row_data(hsh) @@ -159,9 +161,13 @@ # == Examples # >>> feature.display_name # => "Products" def display_name "#{name.to_s.demodulize.pluralize.titleize}" + end + + def display_categorisable + self.categorisable ? "Yes" : "No" end # Image Configuration # ------------------- def image_configuration \ No newline at end of file