Module: SolidusReviews::Spree::Api::ApiHelpersDecorator

Defined in:
app/decorators/helpers/solidus_reviews/spree/api/api_helpers_decorator.rb

Class Method Summary collapse

Class Method Details

.prepended(base) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'app/decorators/helpers/solidus_reviews/spree/api/api_helpers_decorator.rb', line 7

def self.prepended(base)
  base.module_eval do
    @@review_attributes = [
      :id, :product_id, :name, :location, :rating, :title, :review, :approved,
      :created_at, :updated_at, :user_id, :ip_address, :locale, :show_identifier,
      :verified_purchaser
    ]

    @@feedback_review_attributes = [
      :id, :user_id, :review_id, :rating, :comment, :created_at, :updated_at, :locale
    ]

    def review_attributes
      @@review_attributes
    end

    def feedback_review_attributes
      @@feedback_review_attributes
    end
  end
end