adminable 0.0.4 → 0.0.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
  SHA1:
3
- metadata.gz: a219dbfca42335cddb071f1e9d2f24a08bb22992
4
- data.tar.gz: 4be60a789135b4f404aa268b440bdd88a1705bac
3
+ metadata.gz: 50dbc10813e44d6cbaafaf677198e95604541bd9
4
+ data.tar.gz: 1a583fe099f1a41a986ff8e61b2deb632dae6e9e
5
5
  SHA512:
6
- metadata.gz: c9fc788109f641c6c626af0e5e63d822a119b0a8ffca8e5e2359ff0907daea3bd830158174d7f12f4c502852f5b56ef6b98721806080bd08dcff5a0dd2159fb2
7
- data.tar.gz: ef331388d6bd326f84c82d9736001cce5f7af8c7f69093d297578f9b5f5d7f1e837dcfe5e11b27fd6849c7fa38471ec37b3853b6fa78947d32f3f929b86da174
6
+ metadata.gz: 1f46365f19a81adde1666e349976db7626b32a396db05ef6546e9e1a2681816ec4b66c7c02e782a4e8d687ffec705c873550311eb3efbf96cd76dec9fff1af2b
7
+ data.tar.gz: e735b3c8245ba04e89450b6bf444d9e628eeaa816498875a91fb3d0a6e3918431cc3993f8b6b08b531595b1a3ebb8316af1e022b15204fd2e061d2ccfe2feeeb
data/README.md CHANGED
@@ -149,6 +149,20 @@ You can use generator to copy original partial to your application.
149
149
  * `type` - `string`, `text` etc. See [Built-in Attributes](#built-in-attributes).
150
150
  * `resource` - Use controller name (e.g. `users`) to replace partial only for single controller or leave blank to replace partials for all controllers.
151
151
 
152
+ ## F.A.Q
153
+
154
+ ##### If model to_param method was overridden
155
+
156
+ ```ruby
157
+ class Adminable::Blog::PostsController < Adminable::ResourcesController
158
+ def set_entry
159
+ entry = @resource.model.find_by(slug: params[:id])
160
+
161
+ super
162
+ end
163
+ end
164
+ ```
165
+
152
166
  ## Contributing
153
167
 
154
168
  1. Fork it (https://github.com/droptheplot/adminable/fork)
@@ -103,9 +103,8 @@ module Adminable
103
103
  private
104
104
 
105
105
  def set_entry
106
- @entry = Adminable::Presenters::Entry.new(
107
- @resource.model.find(params[:id])
108
- )
106
+ entry ||= @resource.model.find(params[:id])
107
+ @entry = Adminable::Presenters::Entry.new(entry)
109
108
  end
110
109
 
111
110
  def resource_model_name
@@ -1,3 +1,3 @@
1
1
  module Adminable
2
- VERSION = '0.0.4'.freeze
2
+ VERSION = '0.0.5'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: adminable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sergey Novikov