We were developing a Content Management System which is composed of different components, with each component having dependency on other components in the hierarchy.
Our CMS has the following structure :
- Site has_many pages
- Page has_many sections
- Section has_many embedded_modules
- EmbeddedModule has_many elements
For any component to be publishable, we need to ensure that not only a particular component, but also its descendants(children) should satisfy the criteria of publishability.
In our case a Page could be publishable, if all sections belonging to it were publishable. A section would be publishable if all embedded modules belonging to it were publishable. A EmbeddedModule would be publishable if all elements belonging to it were publishable.
If at any step of the hierarchy the criteria fails, not only that component should be marked as unpublishable but also upchain should be notified of unpublishablity.
If any EmbeddedModule gets unpublished then it must unpublish the upper hierarchy i.e its associated section, page and site.
To achieve this we identified that a shared module would be needed which can handle publishability of a component and should also be able to notify the publishability change to its parent.
Most online stores thrive on customer satisfaction and their loyalty towards their stores. In order to improve the long term relationship with the customers and earn their loyalty, stores come up with different ideas to keep customers engaged. One such idea is to award loyalty points to the customer based on their purchases. These awarded points can be used by customers as a discount in their future purchases.
Understanding the need, we recently published this new extension “Spree Loyalty Points” which adds the loyalty points functionality into the existing e-commerce system. With this extension a new payment method gets quickly added to Spree e-commerce stores. It also automates two features (a) awarding of the loyalty points to the customers on the basis of the configuration done by admin and (b) updating the points based on each transaction done on Spree Commerce platform. It also allow the users to redeem earned loyalty points while placing new orders. Continue reading
Recently we were working on a feature where we had to combine an image and audio to create a video on mobile devices. In iOS this can be done using AVAssetExportSessionthough – for detail see this link However, we could not find any native solution for this problem in Android.
FFmpeg is one such tool to tackle this problem but it is not available for Android officially. We tried few existing Android ports of FFmpeg but they were either outdated or didn’t work for us. So we planned to fold our sleeves and compile the library for Android.
Compiling libraries on Linux system is a fairly common task, download the source code of the library and run three commands:
As we wanted to use the FFmpeg library on Android devices, we can’t just use the executable generated on the Linux machine directly because Android devices have different CPU architecture, different instruction sets and modified Linux kernel (OS). So we needed to cross compile FFmpeg library for Android
Cross Compilation ?
The process of building executable binaries on one machine, and running them on another machine when the CPU architecture or the Operating System are different is called “cross compilation”.
We understand the preferences of shoppers have changed globally. Today, consumers prefer shopping in the most convenient ways: anywhere, anytime and on the move. This changing landscape has given birth to the world of mobile and applications. The statistics prove the increase in mobile internet usage is on the rise, now standing at 65% globally.
Around 32% of all online purchases have been done through mobile. Mobile commerce is looking promising, and expects the spending to be $200 billion USD by the end of 2014, reaching an approximate 50% growth from 2013. Predictions indicate that by 2020, smartphones and tablets will account for more than 75% of global online commercial transactions, and more than 50% of spend.
The e-commerce market, which is now enhanced by mobile, is comprised primarily of e-commerce companies that have long held a web presence, but have gained even more with the transition from web to mobile.
After we started using Spree for development of e-commerce stores for our clients, we often found the clients looking for different modes for achieving more conversion.
From statistics it was visible that end users need more convenience in their hands while shopping online, particularly in the developing nations where credit card penetration is relatively low. In such environment, Bank Transfer appears to be another practical way by which consumers shopping online can make payments for their order.
Vinsol is SpreeCommerce Premier Partner. View Vinsol’s Services
Bank Transfer or BT, is a payment method which gives user the freedom to do an offline/online transaction to the Merchant’s account directly. The user deposits the amount into Merchant’s bank account, which is specified on the checkout page. The end user, on the other hand, after transferring order amount into Merchant’s account, needs to login and provide the payment transaction details with the specific order. Continue reading
RubyOnRails provides us with many model callbacks around the object’s lifecycle when object is being created, updated or destroyed. For example: before_create, after_create, before_update, after_destroy etc. We use them to write & run our code around the object’s lifecycle by defining a method and associating them as one of the callbacks.
But then how can we make a piece of code execute as a callback for any another defined method except create, update, save and destroy? For example, let’s say we have a model Article and we want to execute something just before and after an article is being published without hooking into model’s before_save and after_save callbacks?
RubyOnRails or more precisely ActiveRecord provides us with a module ActiveModel::Callbacks, which allows us to define and register custom callbacks using
define_model_callbacks method. Lets have a look at the snippet below for the above scenario:
Don’t select your next e-commerce platform without reading about these 13 factors first.
Online business has become a dominant and growing force. Global sales through e-commerce topped $1 trillion in 2012, with North American and Asia-Pacific nations accounting for nearly 70% of it. Projections are that global e-commerce sales will reach $1.5 trillion in 2016.
“Conduct better due diligence of the platform”
Over 60% of medium to large e-commerce site owners claim they should have done better due diligence on the platform they selected for their store. Much too often do businesses face constrained growth or incur significant losses due to misguided platform selections.
If you are ready to sell online, choosing the best e-commerce system for your business can be a challenging and confusing process. Based on our deep expertise of rails e-commerce and Spree development, this blog will help make sense of 13 factors you should be considering for selecting an e-commerce platform for your store and how spree stacks up against the competition on those factors.
There is no “enterprise” edition of Spree – its all the same software. Enterprise clients, small and medium sized businesses can use Open Source Spree for commercial purpose without paying any license fee.
The new research identifies leading web & application developers that work extensively with Ruby on Rails.
WASHINGTON, Updated At: June 25, 2014 – Today SourcingLine (now Clutch) published new research on leading web and application developers with extensive Ruby on Rails experience.
The top firms inaugurated into the Ruby on Rails Developers Leaders Matrix are as follows:
Vinsol, Quick Left, Idyllic Software, philosophie, Burnside Digital, Perfectial, DevMynd Software, CognitiveClouds, and VeriQual.
Analysts reached out to firms with a demonstrated history of successful projects for both domestic international clients. Official findings are based on a firm’s proven experience, positive client reviews, and market presence. Companion directories were also published, which allow buyers to search for vendors that best fit their project needs and requirements.
“The flexibility and rapid deployment speed of Ruby on Rails make it ideal for many custom development projects,” explained Joshua Margolin, Senior Analyst at SourcingLine. “The vendors in our research have a proven record of using Rails to deliver viable, high-quality solutions to their clients.”
In one of our current project we had a requirement where we needed to allow the site admin to download raw DB data as CSV file for some offline analysis. So, according to the requirement, we allowed the admin to select a database table and a date range to download the generated CSV data.
Our initial approach was to send the CSV file asynchronously using delayed job. It worked like this:
Admin submits the request, system queues it and sends admin an email with the attached CSV file. The reason we did this asynchronously was to avoid timeout during CSV generation.
While testing & benchmarking this approach, we ecountered two issues when we had a large data to export.
Too much memory was used by the ruby process when generating the CSV
CSV size could be larger than the supported attachment size by the email service provider, hence could result in an undelivered email
Like most developers, who use paperclip gem with their RubyOnRails applications to support picture uploading and generation of distinct styles/thumbnails of pictures, for displaying them in various views, we also do the same in a lot of our apps.
After running one such web app in production for 2 years, the app needed to be redesigned. This required us to generate couple more styles/sizes for each uploaded image.
Paperclip provides a method ‘reprocess!(:style)’ to generate all/one style(s).
Now, when we planned to move this new version of the app to production, we had to generate those missing styles. There were a few thousand thumbnails to be generated, and our estimated time to generate these missing styles was around half an hour. Since we could not have the site available to users without the graphics, we had to put the site in maintenance mode until the new styles got generated. We also realized that as more images get uploaded and used in the system, this downtime if we ever needed to resize graphics again would go up. We could also not do this conversion without taking the site down as more images may get uploaded while we might be resizing using a script.