sunrise-cms 0.6.11 → 0.7.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- data/app/assets/javascripts/sunrise/application.js +5 -4
- data/app/assets/javascripts/sunrise/jquery.dialog.js.coffee +2 -2
- data/app/assets/stylesheets/sunrise/application.css +4 -1
- data/app/views/sunrise/manager/_header_show.html.erb +1 -1
- data/app/views/sunrise/manager/buttons/_delete.html.erb +2 -1
- data/app/views/sunrise/manager/structures/thumbs/_record.html.erb +2 -1
- data/app/views/sunrise/manager/structures/tree/_record.html.erb +1 -1
- data/app/views/sunrise/manager/table/_record.html.erb +1 -1
- data/app/views/sunrise/manager/thumbs/_record.html.erb +1 -1
- data/app/views/sunrise/shared/services.json.jbuilder +1 -1
- data/config/routes.rb +1 -1
- data/db/migrate/20120611095315_create_settings.rb +3 -3
- data/lib/generators/sunrise/install_generator.rb +2 -2
- data/lib/generators/sunrise/templates/models/active_record/asset.rb +1 -1
- data/lib/generators/sunrise/templates/models/active_record/settings.rb +9 -2
- data/lib/generators/sunrise/templates/models/active_record/structure.rb +1 -2
- data/lib/generators/sunrise/templates/models/active_record/user.rb +1 -3
- data/lib/generators/sunrise/templates/models/mongoid/settings.rb +0 -1
- data/lib/generators/sunrise/templates/models/mongoid/structure.rb +1 -1
- data/lib/generators/sunrise/templates/models/mongoid/user.rb +1 -2
- data/lib/sunrise/carrierwave/base_uploader.rb +2 -2
- data/lib/sunrise/config/model.rb +1 -1
- data/lib/sunrise/core_ext/string.rb +7 -25
- data/lib/sunrise/models/user.rb +3 -26
- data/lib/sunrise/version.rb +1 -1
- data/spec/dummy/log/test.log +22584 -0
- data/spec/dummy/public/uploads/avatar/content_rails.png +0 -0
- data/spec/dummy/public/uploads/avatar/rails.png +0 -0
- data/spec/dummy/public/uploads/avatar/thumb_rails.png +0 -0
- data/spec/dummy/public/uploads/tmp/1397814500-44499-6278/rails.png +0 -0
- data/spec/dummy/public/uploads/tmp/1397814500-44499-6278/small_rails.png +0 -0
- data/spec/dummy/public/uploads/tmp/1397814500-44499-6278/thumb_rails.png +0 -0
- data/spec/dummy/public/uploads/tmp/1397814501-44499-0716/rails.png +0 -0
- data/spec/dummy/public/uploads/tmp/1397814501-44499-0716/small_rails.png +0 -0
- data/spec/dummy/public/uploads/tmp/1397814501-44499-0716/thumb_rails.png +0 -0
- data/spec/dummy/public/uploads/tmp/1397814501-44499-6498/rails.png +0 -0
- data/spec/dummy/public/uploads/tmp/1397814501-44499-6498/small_rails.png +0 -0
- data/spec/dummy/public/uploads/tmp/1397814501-44499-6498/thumb_rails.png +0 -0
- data/spec/dummy/public/uploads/tmp/1397814502-44499-9048/silicon_valley.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1397814502-44499-9048/small_silicon_valley.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1397814502-44499-9048/thumb_silicon_valley.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1397814509-44499-4712/rails.png +0 -0
- data/spec/dummy/public/uploads/tmp/1397814511-44499-6511/rails.png +0 -0
- data/spec/dummy/public/uploads/tmp/1397814514-44499-0946/rails.png +0 -0
- data/spec/dummy/public/uploads/tmp/1397814515-44499-4275/rails.png +0 -0
- data/spec/dummy/public/uploads/tmp/1397814516-44499-7258/rails.png +0 -0
- data/spec/dummy/public/uploads/tmp/1397814743-45062-5613/rails.png +0 -0
- data/spec/dummy/public/uploads/tmp/1397814743-45062-5613/small_rails.png +0 -0
- data/spec/dummy/public/uploads/tmp/1397814743-45062-5613/thumb_rails.png +0 -0
- data/spec/dummy/public/uploads/tmp/1397814744-45062-2352/rails.png +0 -0
- data/spec/dummy/public/uploads/tmp/1397814744-45062-2352/small_rails.png +0 -0
- data/spec/dummy/public/uploads/tmp/1397814744-45062-2352/thumb_rails.png +0 -0
- data/spec/dummy/public/uploads/tmp/1397814744-45062-7990/rails.png +0 -0
- data/spec/dummy/public/uploads/tmp/1397814744-45062-7990/small_rails.png +0 -0
- data/spec/dummy/public/uploads/tmp/1397814744-45062-7990/thumb_rails.png +0 -0
- data/spec/dummy/public/uploads/tmp/1397814745-45062-4632/silicon_valley.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1397814745-45062-4632/small_silicon_valley.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1397814745-45062-4632/thumb_silicon_valley.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1397814752-45062-3620/rails.png +0 -0
- data/spec/dummy/public/uploads/tmp/1397814754-45062-7554/rails.png +0 -0
- data/spec/dummy/public/uploads/tmp/1397814757-45062-6575/rails.png +0 -0
- data/spec/dummy/public/uploads/tmp/1397814758-45062-2473/rails.png +0 -0
- data/spec/dummy/public/uploads/tmp/1397814758-45062-7698/rails.png +0 -0
- data/spec/dummy/public/uploads/tmp/1397815061-45673-4098/rails.png +0 -0
- data/spec/dummy/public/uploads/tmp/1397815061-45673-4098/small_rails.png +0 -0
- data/spec/dummy/public/uploads/tmp/1397815061-45673-4098/thumb_rails.png +0 -0
- data/spec/dummy/public/uploads/tmp/1397815062-45673-5873/rails.png +0 -0
- data/spec/dummy/public/uploads/tmp/1397815062-45673-5873/small_rails.png +0 -0
- data/spec/dummy/public/uploads/tmp/1397815062-45673-5873/thumb_rails.png +0 -0
- data/spec/dummy/public/uploads/tmp/1397815062-45673-9908/rails.png +0 -0
- data/spec/dummy/public/uploads/tmp/1397815062-45673-9908/small_rails.png +0 -0
- data/spec/dummy/public/uploads/tmp/1397815062-45673-9908/thumb_rails.png +0 -0
- data/spec/dummy/public/uploads/tmp/1397815063-45673-6362/silicon_valley.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1397815063-45673-6362/small_silicon_valley.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1397815063-45673-6362/thumb_silicon_valley.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1397815070-45673-9261/rails.png +0 -0
- data/spec/dummy/public/uploads/tmp/1397815072-45673-2350/rails.png +0 -0
- data/spec/dummy/public/uploads/tmp/1397815075-45673-3163/rails.png +0 -0
- data/spec/dummy/public/uploads/tmp/1397815076-45673-3745/rails.png +0 -0
- data/spec/dummy/public/uploads/tmp/1397815077-45673-2689/rails.png +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/025a845bfc99eb99aa9690545d024974 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/02ca6949ca99936393e2992467409faf +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/03bae0b322a9c8706915fdb4f8d50961 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/06632caa2dd14ba28b138446bd3d807a +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/06a86d61c2e57fad1cee30584df6f969 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/07d036bf808a7ace22ce3b32701a2867 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/0cc8e44f8b692c44ef509fd2d7f38941 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/0d7fd69f7cbd03f1617b280bfb33677e +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/0e7270936d642e566d747ab335c44ec2 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/0f382880a507fbcedb3a83727f118f84 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/0fab3bb8b5212da52c8b7e0ae428b22a +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/12bbe81ebeeacdf11820f57a821789ff +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/146ce2f3522fd98d4a8a1501f16c7092 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/172c139e25cc08516d5a8c72c777dd4d +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/18b64b11b8b00cc21a396da25a5ff156 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/197d8d604ec08a638b656e053944b734 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/1bdb903463fe67323dbadb0f78337c70 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/1beea1617441e02d76649f4b799aedac +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/20f8ac265bd1f0c57067c7a4b5c8f119 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/212fc15df4fd708ebdef5bd3be2191c1 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/256dcb01e7f35659d770584fd71a85d2 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/25a167c7563d6fe8ec6b13ec1ac09274 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/2a6ef2448bbff5c2c3c70c141f744cf5 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/2dedb8177c20286c4259c1d58c5646cc +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/33b9cc34fd627b9c81e63eb0faf06efb +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/33bd898bccf5b0821d1d3ffa02e9d1b6 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/350390c7e44df7d038254cff29468e2d +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/3633276e08728ac0cfea5659b4f8b516 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/37b103f4623089af1456b90830fe941c +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/392239d689265304b5fe68912a8f2383 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/3c396fbac68d9fb827a0f4c9d8cae3b6 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/43ad0cf2497efae7114ac03a314706c5 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/46e447bca92498433b2a3114106389a9 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/47395ef44102932b2b9fe17a46c16601 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/4c1c0c6c54ed879c4a5489eadd3a772c +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/4ca01587005a9b895bca383881bec87d +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/4cffdba2a7aac80c1765e060b152b382 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/54d68ac9b230a01a37ef415779a748da +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/55b923cfea92fd264597042a44303f0c +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/56d4d696f46e9a63d0a42e11556bce11 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/56e5bd2f3c94d7a9d0da7c4e05c7ad78 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/5807e61754ed8b16702f6ad7ba34d439 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/5a44970074ecbfeae2cc9798ed7da7aa +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/5ab8f53cba6a8bdf2c6d671491c397ce +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/5e27babe25470126fbc4635dc9fe9a6a +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/6056bd921f3a4b6e437dab030d7fef90 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/61533733f5f9ec09571d2d5c45d5ab47 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/68c52f388e9c2401252c0bedf6247c8c +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/6a1e72555b75237fffccb5de8937b4d4 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/6a8187f5c6f2e115d1a1c21ca2ec81a0 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/7041d544b28bff5f26dde49d77a2e87d +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/747d1d7298f227da4193f23f3932ac8e +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/749bd767d6654c80265f5ca0959dc8e1 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/75870e6b6fe8335a7912ca4ea859a76a +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/759bbbe7d51d98664d8072e51b24744b +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/7a1f4a9bcb1d7d1e515330c4f5c391ad +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/7ad564910e515e335bb008989a97efb7 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/7b55037b89f2debe558b43fe7542e409 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/7ff7dd624cb7a6db5ec99af129138020 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/80870efa2a2ddb1de325c224daff5712 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/856b05d9307e97e681bc5c7f3649f714 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/8766064af197b444eb1f06a6650ca9c3 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/894aeaae9cc8483fa9f7a5146ff6ff6f +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/8a559f967fac90d4ae5a84af92c111e1 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/8c5ee15b5860dcf2941abd00daf001eb +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/8c9393d7c6a1a2b6bb1fc9a9ccaba111 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/8d476275ed52a5aa897cb7eef648dbc4 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/906da6ff8c06db3e472a0a10985b668c +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/94826bb92d888d50a265392a81ce1286 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/956d7ea9ee52ec12759995ab47f1e780 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/974812817397ff6032b286a281d9a163 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/9ba0cab624f25b68f79447e62fbc6112 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/a1c0fa5689dff4e7edcc4f175f9d54bf +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/a43280845b1d41babd3f6714cd2d1337 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/a50e247ceb9e9af32260a73eadbb65cb +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/a668bf13b4df6854c8c1085b26daa63a +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/a78a33e8cea959257da93b3e67786300 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/aa4822def20c419f0e50e2a38e73a1df +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/aa94554c7d6f15d3f88e9710b043c2cc +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/abde9800d767ab39abc91703e5a83d70 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/b25e1f0b850e73d0e1ef154249ce8135 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/b4e0977feb24777fe3df7dd188b2b123 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/b4e12b8782fac2f3caaa4aea2f89087c +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/b8c47badf85ceedb2268ef3b0f074257 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/bafd6678f36ffd5fb29e4d9055df1f97 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/bc4b7beed5a786619d6c3855909cb077 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/bfc0fef30976427a03ddccb1ce78d6e7 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/c104157fd9dbe5edc61a1889af968e19 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/c37e2e0969ee5b3590335141a08ed884 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/c3dc3ada4560805584739bfe7c2b24d9 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/c4d36397803a4adf8ea86a8936b2d5f5 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/c8f8b0ae15c86cf8aae9e3601758435e +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/cbbe8f22213647e8549911f486aee9b3 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/cc04ce51d1e3d02a64f2781ea0876af3 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/cebb517859b2ed48276bf54e0ba6dcec +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/d311318a280b46ab076da5c419b210ab +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/d48c8e1ff1b6fcdbacf6ab08f8bde111 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/d7c40ebee2fb9471bab352337570ba40 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/d9390b9983c2dcadf2533a63d0f7a84c +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/da055188ac218679c8fe62932c379340 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/da4488b32bd6fb75c655a077956c9034 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/e0f1660d21c6375d8a36eac87ae8ccbc +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/e1639f86099d91eb2fede327d443906f +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/e25f607f69c16bc5ffb481f9606b457e +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/e2c4f946939f2d7d0b42d86383755cae +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/e4a2ab1f3bf2d0726dff720ae88e8abc +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/e4f46080338c0c52e3933999a7f8106d +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/e59a3c2ff941e0fdc7987168580bf4cc +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/e5ab921ab9e413144898d780049a5c88 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/e6cfe2e09e34ec2b24494a74eed5243a +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/e994cc6f07f643c4c230a9b740fd03f5 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/ec87c33887ff6c0258bd8469a77bdcb4 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/eccb73ad1563f9b070c4ffdf07ffff38 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/ee5a41236d43159aac87f9224a0bcfb8 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/f00fb03eca205b5e302d9ae7ed652817 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/f24a0e7771eab5bd17ee05c73c56649e +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/f2de4855fd4840abb2f6e80afee5f4ed +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/f475ab32c44efa173bf8ba75435d2570 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/f5165c4d7cee0e7cb99bc069fd4c09b9 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/f53b02f1d2cbab753c7931e700469bed +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/f5cf5c65e6bf2039363f3b1e09bcdc9c +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/f975cba8c490022ddfc45bab0b512879 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/fba4eeb0b33c40737a907a18ee0770a4 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/fbe8d6803f3e5a9ccb6eb7a285b95ee0 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/fd7e46e0b42a510b40f17d1f1bacf80e +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/fd9e24b6acf76f9d44cc8e26d3148e39 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/fe03e8232ec516da863efecd7bb2678b +0 -0
- data/spec/generators/install_generator_spec.rb +1 -1
- data/spec/models/user_spec.rb +0 -8
- data/spec/requests/manager/default/update_spec.rb +1 -1
- metadata +415 -42
- data/lib/sunrise/core_ext/array.rb +0 -22
- data/lib/sunrise/models/settings.rb +0 -144
- data/vendor/assets/stylesheets/smoothness/jquery-ui-1.8.16.custom.css +0 -568
@@ -1,22 +0,0 @@
|
|
1
|
-
require 'enumerator'
|
2
|
-
|
3
|
-
class Array
|
4
|
-
def chunk(pieces)
|
5
|
-
q, r = length.divmod(pieces)
|
6
|
-
(0..pieces).map { |i| i * q + [r, i].min }.enum_cons(2) \
|
7
|
-
.map { |a, b| slice(a...b) }
|
8
|
-
end
|
9
|
-
|
10
|
-
def shuffle
|
11
|
-
sort_by { rand }
|
12
|
-
end
|
13
|
-
|
14
|
-
def shuffle!
|
15
|
-
self.replace shuffle
|
16
|
-
end
|
17
|
-
|
18
|
-
def random
|
19
|
-
idx = Kernel.rand(size)
|
20
|
-
at(idx)
|
21
|
-
end
|
22
|
-
end
|
@@ -1,144 +0,0 @@
|
|
1
|
-
require "dalli"
|
2
|
-
require "active_support/cache/dalli_store"
|
3
|
-
|
4
|
-
module Sunrise
|
5
|
-
module Models
|
6
|
-
module Settings
|
7
|
-
extend ActiveSupport::Concern
|
8
|
-
|
9
|
-
class SettingNotFound < RuntimeError; end
|
10
|
-
|
11
|
-
included do
|
12
|
-
cattr_accessor :defaults
|
13
|
-
self.defaults = {}.with_indifferent_access
|
14
|
-
|
15
|
-
# cache must follow the contract of ActiveSupport::Cache. Defaults to no-op.
|
16
|
-
cattr_accessor :cache
|
17
|
-
self.cache = ::ActiveSupport::Cache::DalliStore.new
|
18
|
-
|
19
|
-
# options passed to cache.fetch() and cache.write(). example: {:expires_in => 5.minutes}
|
20
|
-
cattr_accessor :cache_options
|
21
|
-
self.cache_options = {:expires_in => 1.day}
|
22
|
-
end
|
23
|
-
|
24
|
-
module ClassMethods
|
25
|
-
def cache_key(var_name)
|
26
|
-
[target_id, target_type, var_name].compact.map(&:to_s).join("::")
|
27
|
-
end
|
28
|
-
|
29
|
-
#get or set a variable with the variable as the called method
|
30
|
-
def method_missing(method, *args)
|
31
|
-
if self.respond_to?(method)
|
32
|
-
super
|
33
|
-
else
|
34
|
-
method_name = method.to_s
|
35
|
-
|
36
|
-
#set a value for a variable
|
37
|
-
if method_name =~ /=$/
|
38
|
-
var_name = method_name.gsub('=', '')
|
39
|
-
value = args.first
|
40
|
-
self[var_name] = value
|
41
|
-
|
42
|
-
#retrieve a value
|
43
|
-
else
|
44
|
-
self[method_name]
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
49
|
-
#destroy the specified settings record
|
50
|
-
def destroy(var_name)
|
51
|
-
var_name = var_name.to_s
|
52
|
-
begin
|
53
|
-
target(var_name).destroy
|
54
|
-
cache.delete(cache_key(var_name))
|
55
|
-
true
|
56
|
-
rescue NoMethodError
|
57
|
-
raise SettingNotFound, "Setting variable \"#{var_name}\" not found"
|
58
|
-
end
|
59
|
-
end
|
60
|
-
|
61
|
-
def delete_all(conditions = nil)
|
62
|
-
cache.clear
|
63
|
-
super
|
64
|
-
end
|
65
|
-
|
66
|
-
#retrieve all settings as a hash (optionally starting with a given namespace)
|
67
|
-
def all(starting_with=nil)
|
68
|
-
query = target_scoped
|
69
|
-
query = query.where(["var LIKE ?", "#{starting_with}%"]) if starting_with
|
70
|
-
|
71
|
-
result = defaults.dup
|
72
|
-
|
73
|
-
query.all.each do |record|
|
74
|
-
result[record.var.to_sym] = record.value
|
75
|
-
end
|
76
|
-
|
77
|
-
result.with_indifferent_access
|
78
|
-
end
|
79
|
-
|
80
|
-
#get a setting value by [] notation
|
81
|
-
def [](var_name)
|
82
|
-
cache.fetch(cache_key(var_name), cache_options) do
|
83
|
-
if (var = target(var_name)).present?
|
84
|
-
var.value
|
85
|
-
else
|
86
|
-
defaults[var_name.to_sym]
|
87
|
-
end
|
88
|
-
end
|
89
|
-
end
|
90
|
-
|
91
|
-
#set a setting value by [] notation
|
92
|
-
def []=(var_name, value)
|
93
|
-
record = target_scoped.where(:var => var_name.to_s).first
|
94
|
-
record ||= new(:var => var_name.to_s)
|
95
|
-
|
96
|
-
record.value = value
|
97
|
-
record.save!
|
98
|
-
cache.write(cache_key(var_name), value, cache_options)
|
99
|
-
value
|
100
|
-
end
|
101
|
-
|
102
|
-
def merge!(var_name, hash_value)
|
103
|
-
raise ArgumentError unless hash_value.is_a?(Hash)
|
104
|
-
|
105
|
-
old_value = self[var_name] || {}
|
106
|
-
raise TypeError, "Existing value is not a hash, can't merge!" unless old_value.is_a?(Hash)
|
107
|
-
|
108
|
-
new_value = old_value.merge(hash_value)
|
109
|
-
self[var_name] = new_value if new_value != old_value
|
110
|
-
|
111
|
-
new_value
|
112
|
-
end
|
113
|
-
|
114
|
-
def target(var_name)
|
115
|
-
target_scoped.where(:var => var_name.to_s).first
|
116
|
-
end
|
117
|
-
|
118
|
-
def target_scoped
|
119
|
-
scoped.where(:target_id => target_id, :target_type => target_type)
|
120
|
-
end
|
121
|
-
|
122
|
-
def target_id
|
123
|
-
nil
|
124
|
-
end
|
125
|
-
|
126
|
-
def target_type
|
127
|
-
nil
|
128
|
-
end
|
129
|
-
|
130
|
-
def update_attributes(attrs)
|
131
|
-
attrs.each do |key, value|
|
132
|
-
self[key] = value
|
133
|
-
end
|
134
|
-
|
135
|
-
cache.clear
|
136
|
-
end
|
137
|
-
|
138
|
-
def to_key
|
139
|
-
['settings']
|
140
|
-
end
|
141
|
-
end
|
142
|
-
end
|
143
|
-
end
|
144
|
-
end
|