effective_classifieds 0.6.3 → 0.6.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9f50ce82294a1f8cacc7770a7ed0c016b9cfaf167e5503b77811909ac0f50e8b
4
- data.tar.gz: 388ea2f75b8dbedeaf6c5e2e647dcb7e89ac6557f7d4e577e69e68388c5199c6
3
+ metadata.gz: 513b026eaa5383f76e9245c493e80db4e046a1a27b066bdfd53dea5c569df640
4
+ data.tar.gz: fbbc24393ec5435358133a9c94c36de7123ac225660ad2325d5fb8aeae7123f0
5
5
  SHA512:
6
- metadata.gz: 5d4e9750e5f9283bc579338d05e302ef4f4aadbbb7fedcc3b0b2a7edc34b58056a7b57962d4384f4c9ffa31c7a82cd1f68a00b589328e7ddfaf34787c96af6f1
7
- data.tar.gz: f80d8138623f819eeb2ace8b51cc6f947ffde862263cdd459ef525227987ab3881e29f9bf114f0caafc3cab2d7b4503e6a85db933e31014e870fe8a9a825b409
6
+ metadata.gz: 98985dcaca1f4f735ef3a6fcb7308bd990b70c109a298d560ca33bb1d3ff186e7ad3e4e543906f9641d047a2e83e6a3481fd5f7ab3c39765bf5461b2a7faed3e
7
+ data.tar.gz: 4e17489e7d1d7e80dab1ccb823573bd58406c95bc808978478976dbfca52145cd5ab1e6038dee3e2de55f1aafa3008d5881cb8f0c3879f4472d256a91256dbea
@@ -31,7 +31,11 @@ module Effective
31
31
 
32
32
  respond_to do |format|
33
33
  format.html { }
34
- format.js { render('show', formats: :js) }
34
+
35
+ format.json {
36
+ url = effective_classifieds.classified_url(@classified, format: :json)
37
+ render(json: @classified.for_json.merge(url: url).to_json)
38
+ }
35
39
  end
36
40
 
37
41
  end
@@ -154,6 +154,10 @@ module Effective
154
154
  title.presence || model_name.human
155
155
  end
156
156
 
157
+ def for_json
158
+ { id: id, title: title, body: body.to_s, created_at: created_at, updated_at: updated_at }
159
+ end
160
+
157
161
  def purchasable_name
158
162
  "#{category} - #{title}"
159
163
  end
@@ -9,7 +9,7 @@ module EffectiveClassifieds
9
9
 
10
10
  # Include acts_as_addressable concern and allow any ActiveRecord object to call it
11
11
  initializer 'effective_classifieds.active_record' do |app|
12
- ActiveSupport.on_load :active_record do
12
+ app.config.to_prepare do
13
13
  ActiveRecord::Base.extend(EffectiveClassifiedsClassifiedWizard::Base)
14
14
  end
15
15
  end
@@ -1,3 +1,3 @@
1
1
  module EffectiveClassifieds
2
- VERSION = '0.6.3'.freeze
2
+ VERSION = '0.6.5'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_classifieds
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.3
4
+ version: 0.6.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-12-01 00:00:00.000000000 Z
11
+ date: 2023-12-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails